diff --git a/hardware/apu1.nix b/hardware/apu1.nix new file mode 100644 index 0000000..ae4de21 --- /dev/null +++ b/hardware/apu1.nix @@ -0,0 +1,30 @@ +# 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, ... }: + +{ + imports = [ ]; + + boot.loader.grub.extraConfig = + "\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n "; + boot.initrd.availableKernelModules = [ + "ahci" + "ohci_pci" + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" "virtio" "tun" ]; + boot.extraModulePackages = [ ]; + boot.kernelParams = [ "console=ttyS0,115200n8" ]; + + hardware.cpu.amd.updateMicrocode = true; + + nix.maxJobs = lib.mkDefault 2; +} diff --git a/host/etzel.nix b/host/etzel.nix new file mode 100644 index 0000000..42c09db --- /dev/null +++ b/host/etzel.nix @@ -0,0 +1,73 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = [ + ../hardware/apu1.nix + ../role/base + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + + + boot.initrd.luks.devices = { + "root" = {device = "/dev/disk/by-uuid/196202a2-ecb2-4c43-9a62-9e58f4d5de95"; keyFile = "/etc/luks.keyfile";}; + "swap" = {device = "/dev/disk/by-uuid/a268e9e6-8636-42b1-84bc-0a432e493d0d"; keyFile = "/etc/luks.keyfile";}; + }; + boot.initrd.secrets."/etc/luks.keyfile" = /boot/luks.keyfile; + + fileSystems = { + "/" = { + device = "/dev/mapper/root"; + fsType = "btrfs"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/14a4d9dc-2d3b-44e1-938e-1429f1639507"; + fsType = "ext4"; + }; + }; + + swapDevices = [{ device = "/dev/mapper/swap"; }]; + + + networking.hostName = "etzel"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.enp1s0.useDHCP = true; + networking.interfaces.enp2s0.useDHCP = true; + networking.interfaces.enp3s0.useDHCP = true; + networking.interfaces.wlp4s0.useDHCP = true; + networking.interfaces.wlp6s0.useDHCP = true; + + # 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/Amsterdam"; + + + # 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. It‘s 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 = "20.03"; # Did you read the comment? + +} +