diff --git a/flake.nix b/flake.nix index 3459b31..b446fd2 100644 --- a/flake.nix +++ b/flake.nix @@ -68,8 +68,7 @@ }; nixpkgsPatcher.inputs = inputs; modules = [ - ./hosts/desktop/configuration.nix - ./hosts/desktop/hardware-configuration.nix + ./hosts/desktop ./modules/sops.nix ./modules/common.nix ./modules/desktop/xremap.nix @@ -106,8 +105,7 @@ ; }; modules = [ - ./hosts/music-server/configuration.nix - ./hosts/music-server/hardware-configuration.nix + ./hosts/music-server ./modules/common.nix ./modules/sops.nix home-manager.nixosModules.home-manager @@ -126,8 +124,7 @@ ; }; modules = [ - ./hosts/pizzasucht/configuration.nix - ./hosts/pizzasucht/hardware-configuration.nix + ./hosts/pizzasucht ./modules/common.nix home-manager.nixosModules.home-manager { @@ -144,8 +141,7 @@ ; }; modules = [ - ./hosts/laptop/configuration.nix - ./hosts/laptop/hardware-configuration.nix + ./hosts/laptop ./modules/desktop/xremap.nix ./modules/common.nix home-manager.nixosModules.home-manager diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 48128d5..a974a08 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -4,10 +4,6 @@ }: { imports = [ - ./boot.nix - ./drives.nix - ./packages.nix - ./hardware-configuration.nix ../../modules/sops.nix ../../modules/desktop/vr.nix ../../modules/nixos/git.nix diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix new file mode 100644 index 0000000..fca0f61 --- /dev/null +++ b/hosts/desktop/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./boot.nix + ./drives.nix + ./packages.nix + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/hosts/laptop/boot.nix b/hosts/laptop/boot.nix new file mode 100644 index 0000000..747d1cf --- /dev/null +++ b/hosts/laptop/boot.nix @@ -0,0 +1,44 @@ +{ + boot.loader.grub = { + enable = true; + zfsSupport = true; + efiSupport = true; + efiInstallAsRemovable = true; + mirroredBoots = [ + { + devices = [ "nodev" ]; + path = "/boot"; + } + ]; + }; + + boot.kernelParams = [ + "i8042.reset" + "i8042.nomux" + ]; + + boot.zfs.forceImportRoot = false; + + fileSystems."/" = { + device = "zpool/root"; + fsType = "zfs"; + }; + fileSystems."/home" = { + device = "zpool/home"; + fsType = "zfs"; + }; + fileSystems."/var" = { + device = "zpool/var"; + fsType = "zfs"; + }; + fileSystems."/nix" = { + device = "zpool/nix"; + fsType = "zfs"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/7FFD-E943"; + fsType = "vfat"; + }; + + swapDevices = [ ]; +} diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 92ae44f..8f882e9 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -5,55 +5,13 @@ { imports = [ - ./hardware-configuration.nix + ./boot.nix ./packages.nix + ./hardware-configuration.nix ../../modules/nixos/git.nix ../../modules/nixos/remote-builder.nix ]; - boot.loader.grub = { - enable = true; - zfsSupport = true; - efiSupport = true; - efiInstallAsRemovable = true; - mirroredBoots = [ - { - devices = [ "nodev" ]; - path = "/boot"; - } - ]; - }; - - boot.kernelParams = [ - "i8042.reset" - "i8042.nomux" - ]; - - boot.zfs.forceImportRoot = false; - - fileSystems."/" = { - device = "zpool/root"; - fsType = "zfs"; - }; - fileSystems."/home" = { - device = "zpool/home"; - fsType = "zfs"; - }; - fileSystems."/var" = { - device = "zpool/var"; - fsType = "zfs"; - }; - fileSystems."/nix" = { - device = "zpool/nix"; - fsType = "zfs"; - }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/7FFD-E943"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - networking.hostId = "fefca888"; networking.hostName = "some_phone"; diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix new file mode 100644 index 0000000..fca3c49 --- /dev/null +++ b/hosts/laptop/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./boot.nix + ./packages.nix + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/modules/nixos/server/zfs.nix b/hosts/music-server/boot.nix similarity index 87% rename from modules/nixos/server/zfs.nix rename to hosts/music-server/boot.nix index 3686008..32f1f0b 100644 --- a/modules/nixos/server/zfs.nix +++ b/hosts/music-server/boot.nix @@ -32,12 +32,8 @@ device = "/dev/disk/by-uuid/FCFD-4472"; fsType = "vfat"; }; + boot.zfs.forceImportRoot = false; - services.zfs.autoScrub.enable = true; swapDevices = [ ]; - - services.zfs.autoSnapshot = { - enable = true; - }; } diff --git a/hosts/music-server/configuration.nix b/hosts/music-server/configuration.nix index 6195f5b..965a7b4 100644 --- a/hosts/music-server/configuration.nix +++ b/hosts/music-server/configuration.nix @@ -5,8 +5,6 @@ { imports = [ - ./hardware-configuration.nix - ./packages.nix ../../modules/nixos/server ../../modules/nixos/git.nix ../../modules/sops.nix @@ -27,6 +25,11 @@ fsType = "ext4"; }; + services.zfs = { + autoSnapshot.enable = true; + autoScrub.enable = true; + }; + networking.hostId = "6054e036"; networking.hostName = "nixos-music"; networking.networkmanager.enable = true; diff --git a/hosts/music-server/default.nix b/hosts/music-server/default.nix new file mode 100644 index 0000000..fca3c49 --- /dev/null +++ b/hosts/music-server/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./boot.nix + ./packages.nix + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/hosts/pizzasucht/boot.nix b/hosts/pizzasucht/boot.nix new file mode 100644 index 0000000..60f47f2 --- /dev/null +++ b/hosts/pizzasucht/boot.nix @@ -0,0 +1,51 @@ +{ + boot.supportedFilesystems = [ "zfs" ]; + boot.initrd.supportedFilesystems = [ "zfs" ]; + + boot.initrd.availableKernelModules = [ + "virtio_pci" + "virtio_blk" + "virtio_scsi" + ]; + + boot.zfs.forceImportRoot = false; + + boot.zfs.devNodes = "/dev/disk/by-path"; + + boot.kernelParams = [ "console=ttyS0" ]; + boot.loader.grub = { + enable = true; + zfsSupport = true; + efiSupport = true; + efiInstallAsRemovable = true; + mirroredBoots = [ + { + devices = [ "nodev" ]; + path = "/boot"; + } + ]; + }; + + fileSystems."/" = { + device = "zpool/root"; + fsType = "zfs"; + }; + fileSystems."/home" = { + device = "zpool/home"; + fsType = "zfs"; + }; + fileSystems."/var" = { + device = "zpool/var"; + fsType = "zfs"; + }; + fileSystems."/nix" = { + device = "zpool/nix"; + fsType = "zfs"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/8FA8-69C2"; + fsType = "vfat"; + }; + + swapDevices = [ ]; +} diff --git a/hosts/pizzasucht/configuration.nix b/hosts/pizzasucht/configuration.nix index c47f1fc..5498e23 100644 --- a/hosts/pizzasucht/configuration.nix +++ b/hosts/pizzasucht/configuration.nix @@ -5,60 +5,9 @@ { imports = [ - ./hardware-configuration.nix - ./packages.nix ../../modules/nixos/git.nix ]; networking.hostId = "798c7c92"; - boot.supportedFilesystems = [ "zfs" ]; - boot.initrd.supportedFilesystems = [ "zfs" ]; - - boot.initrd.availableKernelModules = [ - "virtio_pci" - "virtio_blk" - "virtio_scsi" - ]; - - boot.zfs.forceImportRoot = false; - - boot.zfs.devNodes = "/dev/disk/by-path"; - - boot.kernelParams = [ "console=ttyS0" ]; - boot.loader.grub = { - enable = true; - zfsSupport = true; - efiSupport = true; - efiInstallAsRemovable = true; - mirroredBoots = [ - { - devices = [ "nodev" ]; - path = "/boot"; - } - ]; - }; - - fileSystems."/" = { - device = "zpool/root"; - fsType = "zfs"; - }; - fileSystems."/home" = { - device = "zpool/home"; - fsType = "zfs"; - }; - fileSystems."/var" = { - device = "zpool/var"; - fsType = "zfs"; - }; - fileSystems."/nix" = { - device = "zpool/nix"; - fsType = "zfs"; - }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/8FA8-69C2"; - fsType = "vfat"; - }; - - swapDevices = [ ]; # networking.hostName = "nixos"; # Define your hostname. diff --git a/hosts/pizzasucht/default.nix b/hosts/pizzasucht/default.nix new file mode 100644 index 0000000..fca3c49 --- /dev/null +++ b/hosts/pizzasucht/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./boot.nix + ./packages.nix + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix index 67cec46..f3aa257 100644 --- a/modules/nixos/server/default.nix +++ b/modules/nixos/server/default.nix @@ -4,7 +4,6 @@ ./slskd.nix ./navidrome.nix ./services.nix - ./zfs.nix ./firewall.nix ./grafana.nix ../scripts.nix