diff --git a/hardware/asrock.nix b/hardware/asrock.nix new file mode 100644 index 0000000..af564e5 --- /dev/null +++ b/hardware/asrock.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, modulesPath, ... }: { + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; +} diff --git a/host/lindberg/default.nix b/host/lindberg/default.nix new file mode 100644 index 0000000..5499c7c --- /dev/null +++ b/host/lindberg/default.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./networking.nix + ./filesystems.nix + + ../../hardware/asrock.nix + + ../../defaults/base + ]; + + # 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.09"; # Did you read the comment? + +} + diff --git a/host/lindberg/filesystems.nix b/host/lindberg/filesystems.nix new file mode 100644 index 0000000..063e63c --- /dev/null +++ b/host/lindberg/filesystems.nix @@ -0,0 +1,49 @@ +{ config, pkgs, ... }: { + + + boot.initrd.luks.devices = { + "system".device = "/dev/disk/by-uuid/ba646016-2618-4d9b-acf2-41986ab76f7e"; + "data".device = "/dev/disk/by-uuid/6cfe504d-992f-4b11-be3e-31d00c3e108d"; + "backup".device = "/dev/disk/by-uuid/772017c5-f176-4473-9db6-4aa3769cf056"; + "swap".device = "/dev/disk/by-uuid/c2f2bf21-51a8-4404-944c-ba83a9d7cf21"; + }; + + fileSystems = { + "/" = { + device = "/dev/mapper/system"; + fsType = "btrfs"; + }; + "/mnt/data" = { + device = "/dev/mapper/data"; + fsType = "btrfs"; + }; + "/mnt/backup" = { + device = "/dev/mapper/backup"; + fsType = "btrfs"; + }; + "/boot-primary" = { + device = "/dev/disk/by-uuid/7D11-F31D"; + fsType = "vfat"; + }; + "/boot-secondary" = { + device = "/dev/disk/by-uuid/ED1A-59BF"; + fsType = "vfat"; + }; + }; + + swapDevices = [{ device = "/dev/mapper/swap"; }]; + + # TODO: RAID Monitoring + # TODO: Set spin-down time of physical disks + + # Use the systemd-boot EFI boot loader. + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub = { + enable = true; + efiSupport = true; + mirroredBoots = [ + { devices = [ "nodev" ]; path = "/boot-primary"; efiBootloaderId = "NixOS primary"; } + { devices = [ "nodev" ]; path = "/boot-secondary"; efiBootloaderId = "NixOS secondary";} + ]; + }; +} diff --git a/host/lindberg/networking.nix b/host/lindberg/networking.nix new file mode 100644 index 0000000..97c5659 --- /dev/null +++ b/host/lindberg/networking.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +let + meta = import ../../meta; +in { + networking.hostName = "lindberg"; # TODO: Extract into meta + + networking.useDHCP = false; + networking.interfaces.enp5s0.useDHCP = true; +}