added factorio

This commit is contained in:
Ranomier 2024-10-26 21:26:39 +02:00
parent 37b08d943b
commit 70ebb4de20
8 changed files with 138 additions and 19 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
./nixos-switch.log
nixos-switch.log

6
hosts/crocoite/boot.nix Normal file
View file

@ -0,0 +1,6 @@
{...}: {
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.configurationLimit = 20;
boot.loader.efi.canTouchEfiVariables = true;
}

View file

@ -41,6 +41,7 @@
allowUnfree = true;
};
};
networking.hostName = "crocoite"; # Define your hostname.
nix.settings.experimental-features = ["nix-command" "flakes"];
@ -53,8 +54,9 @@
#nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
./hardware-configuration.nix
./boot.nix
../../modules/basic_system_config.nix
../../modules/locale.nix
../../modules/networking.nix
../../modules/boot_theming.nix

6
hosts/factorio/boot.nix Normal file
View file

@ -0,0 +1,6 @@
{...}: {
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
}

View file

@ -0,0 +1,50 @@
{pkgs, ...}: {
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
nixpkgs = {
# You can add overlays here
#overlays = with inputs.self.overlays; [
# Add overlays your own flake exports (from overlays and pkgs dir):
#additions
#modifications
#unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
#];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix.settings.experimental-features = ["nix-command" "flakes"];
# https://lix.systems/ Lix is a modern, delicious implementation of the Nix package manager,
# focused on correctness, usability, and growth
# and committed to doing right by its community.
nix.package = pkgs.lix;
imports = [
#nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
#./hardware-configuration.nix
./boot.nix
./hardware-configuration.nix
../../modules/locale.nix
../../modules/game/server/factorio.nix
];
}

View file

@ -0,0 +1,34 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a6c22dab-a82a-4109-a8d0-b7ed99d56bc7";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/ca4eedce-6e52-4593-a188-a48e54074d14"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,31 @@
{pkgs, ...}: {
# Also enable non-free packages or else the factorio download will fail:
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
factorio-headless
];
services.factorio = {
enable = true;
openFirewall = true;
#mods =
# let
# inherit (pkgs) lib;
# modDir = /opt/factorio-mods;
# modList = lib.pipe modDir [
# builtins.readDir
# (lib.filterAttrs (k: v: v == "regular"))
# (lib.mapAttrsToList (k: v: k))
# (builtins.filter (lib.hasSuffix ".zip"))
# ];
# modToDrv = modFileName:
# pkgs.runCommand "copy-factorio-mods" {} ''
# mkdir $out
# cp ${modDir + "/${modFileName}"} $out/${modFileName}
# ''
# // { deps = []; };
# in
# builtins.map modToDrv modList;
};
}

View file

@ -1,26 +1,16 @@
{
config,
pkgs,
...
}: {
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.configurationLimit = 20;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "crocoite"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
{...}: {
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
#i18n.supportedLocales = [
# "en_GB.UTF-8"
# "en_US.UTF-8"
# "de_DE.UTF-8"
#];
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";