diff options
-rw-r--r-- | flake.lock | 18 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/filesystems.nix | 41 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/hardware.nix | 15 | ||||
-rw-r--r-- | system/boot/boot.nix (renamed from hosts/IDOHVE/hardware/boot.nix) | 4 | ||||
-rwxr-xr-x | system/boot/boot_pictures/gnu.png (renamed from hosts/IDOHVE/hardware/boot_pictures/gnu.png) | bin | 327518 -> 327518 bytes | |||
-rwxr-xr-x | system/boot/boot_pictures/gnulin_emb_1.png (renamed from hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_1.png) | bin | 207444 -> 207444 bytes | |||
-rwxr-xr-x | system/boot/boot_pictures/gnulin_emb_2.png (renamed from hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_2.png) | bin | 208347 -> 208347 bytes | |||
-rw-r--r-- | system/filesystemLayouts/filesystemLayouts.nix | 62 | ||||
-rw-r--r-- | system/system.nix | 6 |
9 files changed, 88 insertions, 58 deletions
diff --git a/flake.lock b/flake.lock index 1bfa3e99..9b757473 100644 --- a/flake.lock +++ b/flake.lock @@ -6,11 +6,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1675247113, - "narHash": "sha256-+YcXjfCP4hNu8A68b/UoXFCTDwKLuLV+x/7dQnM5U/o=", + "lastModified": 1675462931, + "narHash": "sha256-JiOUSERBtA1lN/s9YTKGZoZ3XUicHDwr+C8swaPSh3M=", "owner": "nix-community", "repo": "home-manager", - "rev": "782cb855b2f23c485011a196c593e2d7e4fce746", + "rev": "e2c1756e3ae001ca8696912016dd31cb1503ccf3", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1674211260, - "narHash": "sha256-xU6Rv9sgnwaWK7tgCPadV6HhI2Y/fl4lKxJoG2+m9qs=", + "lastModified": 1675115703, + "narHash": "sha256-4zetAPSyY0D77x+Ww9QBe8RHn1akvIvHJ/kgg8kGDbk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5ed481943351e9fd354aeb557679624224de38d5", + "rev": "2caf4ef5005ecc68141ecb4aac271079f7371c44", "type": "github" }, "original": { @@ -38,11 +38,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1675183161, - "narHash": "sha256-Zq8sNgAxDckpn7tJo7V1afRSk2eoVbu3OjI1QklGLNg=", + "lastModified": 1675362331, + "narHash": "sha256-VmcnKPj5gJLxWK7Bxlhg2LoQvhKRss7Ax+uoFjd3qKY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e1e1b192c1a5aab2960bf0a0bd53a2e8124fa18e", + "rev": "a100acd7bbf105915b0004427802286c37738fef", "type": "github" }, "original": { diff --git a/hosts/IDOHVE/hardware/filesystems.nix b/hosts/IDOHVE/hardware/filesystems.nix deleted file mode 100644 index a188df18..00000000 --- a/hosts/IDOHVE/hardware/filesystems.nix +++ /dev/null @@ -1,41 +0,0 @@ -{config, ...}: let - main_disk = "/dev/disk/by-uuid/<uuid>"; -in { - fileSystems = { - "/" = { - device = "none"; - fsType = "tmpfs"; - options = ["defaults" "size=2G" "mode=755"]; - }; - "/nix" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nix" "compress-force=zstd:9"]; - }; - "/boot" = { - device = "/dev/disk/by-uuid/<uuid>"; - fsType = "vfat"; - }; - - "/srv/home" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@home" "compress-force=zstd:9"]; - }; - "/srv/nixos-config" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nixos-config" "compress-force=zstd:9"]; - }; - - "/etc/nixos" = { - device = "/srv/nix-config"; - options = ["bind"]; - }; - "/home" = { - device = "/srv/home"; - options = ["bind"]; - }; - }; - swapDevices = []; -} diff --git a/hosts/IDOHVE/hardware/hardware.nix b/hosts/IDOHVE/hardware/hardware.nix index 2d21ce8a..c36b7062 100644 --- a/hosts/IDOHVE/hardware/hardware.nix +++ b/hosts/IDOHVE/hardware/hardware.nix @@ -9,9 +9,20 @@ (modulesPath + "/installer/scan/not-detected.nix") # TODO is this necessary? ./cpu.nix ./gpu.nix - ./boot.nix - ./filesystems.nix ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + system.filesystemLayouts = { + enable = true; + mainDisk = "/dev/disk/by-uuid/<uuid>"; + efiDisk = "/dev/disk/by-uuid/<uuid>"; + }; + + boot = { + kernelModules = ["kvm-amd"]; + + # TODO check this: + initrd.availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; + }; } diff --git a/hosts/IDOHVE/hardware/boot.nix b/system/boot/boot.nix index 4cd94191..629e63ae 100644 --- a/hosts/IDOHVE/hardware/boot.nix +++ b/system/boot/boot.nix @@ -7,12 +7,8 @@ initrd = { compressor = "lz4"; compressorArgs = ["-9"]; - - # TODO check this: - availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; }; - kernelModules = ["kvm-amd"]; kernelPackages = pkgs.linuxPackages_latest; loader = { grub = { diff --git a/hosts/IDOHVE/hardware/boot_pictures/gnu.png b/system/boot/boot_pictures/gnu.png index d07dee3e..d07dee3e 100755 --- a/hosts/IDOHVE/hardware/boot_pictures/gnu.png +++ b/system/boot/boot_pictures/gnu.png Binary files differdiff --git a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_1.png b/system/boot/boot_pictures/gnulin_emb_1.png index 483f2681..483f2681 100755 --- a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_1.png +++ b/system/boot/boot_pictures/gnulin_emb_1.png Binary files differdiff --git a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_2.png b/system/boot/boot_pictures/gnulin_emb_2.png index 48cd6ad7..48cd6ad7 100755 --- a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_2.png +++ b/system/boot/boot_pictures/gnulin_emb_2.png Binary files differdiff --git a/system/filesystemLayouts/filesystemLayouts.nix b/system/filesystemLayouts/filesystemLayouts.nix new file mode 100644 index 00000000..2f7c8fc2 --- /dev/null +++ b/system/filesystemLayouts/filesystemLayouts.nix @@ -0,0 +1,62 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.system.filesystemLayout; +in { + options = { + cfg.enable = mkEnableOption (mdDoc "filesysetemLayout"); + cfg.mainDisk = mkOption { + type = lib.types.path; + example = literalExpression "/dev/disk/by-uuid/0442cb6d-f13a-4635-b487-fa76189774c5"; + description = lib.mdDoc "Path to the main disk"; + }; + cfg.efiDisk = mkOption { + type = lib.types.path; + example = literalExpression "/dev/disk/by-uuid/5143-6136"; + description = lib.mdDoc "Path to the main disk"; + }; + }; + + config = mkif cfg.enabled { + fileSystems = { + "/" = { + device = "none"; + fsType = "tmpfs"; + options = ["defaults" "size=2G" "mode=755"]; + }; + "/nix" = { + device = cfg.mainDisk; + fsType = "btrfs"; + options = ["subvol=@nix" "compress-force=zstd:9"]; + }; + "/boot" = { + device = cfg.efiDisk; + fsType = "vfat"; + }; + + "/srv/home" = { + device = cfg.mainDisk; + fsType = "btrfs"; + options = ["subvol=@home" "compress-force=zstd:9"]; + }; + "/srv/nixos-config" = { + device = cfg.mainDisk; + fsType = "btrfs"; + options = ["subvol=@nixos-config" "compress-force=zstd:9"]; + }; + + "/etc/nixos" = { + device = "/srv/nix-config"; + options = ["bind"]; + }; + "/home" = { + device = "/srv/home"; + options = ["bind"]; + }; + }; + swapDevices = []; + }; +} diff --git a/system/system.nix b/system/system.nix index 3a034742..17e78968 100644 --- a/system/system.nix +++ b/system/system.nix @@ -1,8 +1,10 @@ {config, ...}: { imports = [ + ./boot/boot.nix + ./filesystemLayouts/filesystemLayouts.nix ./locale/locale.nix - ./users/users.nix - ./sound/sound.nix ./packages/packages.nix + ./sound/sound.nix + ./users/users.nix ]; } |