diff --git a/deployment/check/common/deployerNode.nix b/deployment/check/common/deployerNode.nix index 94cf491c..15f1d171 100644 --- a/deployment/check/common/deployerNode.nix +++ b/deployment/check/common/deployerNode.nix @@ -76,7 +76,6 @@ in machine = (pkgs.nixos [ ./targetNode.nix - # ../../../infra/common/nixos/repart.nix "${modulesPath}/../lib/testing/nixos-test-base.nix" config.system.extraDependenciesFromModule { diff --git a/deployment/check/data-model-tf-proxmox/setups/shared.nix b/deployment/check/data-model-tf-proxmox/setups/shared.nix index e7b8e9f9..3ea6b94e 100644 --- a/deployment/check/data-model-tf-proxmox/setups/shared.nix +++ b/deployment/check/data-model-tf-proxmox/setups/shared.nix @@ -5,9 +5,6 @@ }: { imports = [ - # systemd-repart - # ../../../../infra/common/nixos/repart.nix - # disko "${sources.disko}/module.nix" ../../../../infra/common/proxmox-qemu-vm.nix ]; diff --git a/deployment/data-model.nix b/deployment/data-model.nix index 5a7ddd87..5a93459f 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -328,43 +328,15 @@ let inherit (ssh) host ; - # machine = import nixos_conf; machine = import ./nixos.nix { inherit sources system; configuration = tf-host.config.nixos-configuration; - # configuration = { ... }: { - # imports = [ - # tf-host.config.nixos-configuration - # ../infra/common/nixos/repart.nix - # ]; - # }; }; - # inherit (machine.config.boot.uki) name; name = "monkey"; - # # systemd-repart - # better for cross-compilation, worse for pre-/post-processing, doesn't support MBR: https://github.com/nix-community/disko/issues/550#issuecomment-2503736973 - # raw = "${machine.config.system.build.image}/${name}.raw"; - - # disko # worse for cross-compilation, better for pre-/post-processing, needs manual `imageSize`, random failures: https://github.com/nix-community/disko/issues/550#issuecomment-2503736973 raw = "${machine.config.system.build.diskoImages}/main.raw"; - # # nixos-generators: note it can straight-up do qcow2 as well, if we settle for nixos-generators - # # `mount: /run/nixos-etc-metadata.J3iARWBtna: failed to setup loop device for /nix/store/14ka2bmx6lcnyr8ah2yl787sqcgxz5ni-etc-metadata.erofs.` - # # [`Error: Failed to parse os-release`](https://github.com/NixOS/nixpkgs/blob/5b1861820a3bc4ef2f60b0afcffb71ea43f5d000/pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs#L151) - # raw = let - # # TODO parameterize things to let this flow into the terraform - # # btw qcow can be made by nixos-generators (qcow, qcow-efi) or by `image.repart` - # # wait, so i generate an image for the nixos config from the data model? how would i then propagate that to deploy? - # gen = import "${pkgs.nixos-generators}/share/nixos-generator/nixos-generate.nix" { - # inherit system formatConfig; - # inherit (sources) nixpkgs; - # configuration = tf-host.config.nixos-configuration; - # }; - # in - # "${gen.config.system.build.${formatAttr}}/nixos${fileExtension}"; - environment = { inherit host @@ -384,8 +356,6 @@ let (withPackages [ pkgs.jq pkgs.qemu - pkgs.nixos-generators - pkgs.httpie (pkgs.callPackage ./run/tf-proxmox-vm/tf.nix { }) ]) '' @@ -573,8 +543,6 @@ let (withPackages [ pkgs.jq pkgs.qemu - pkgs.nixos-generators - pkgs.httpie (pkgs.callPackage ./run/tf-proxmox-vm/tf.nix { }) ]) '' diff --git a/infra/common/nixos/default.nix b/infra/common/nixos/default.nix index 5ce1221b..71b08426 100644 --- a/infra/common/nixos/default.nix +++ b/infra/common/nixos/default.nix @@ -10,7 +10,6 @@ in imports = [ ./networking.nix ./users.nix - # ./repart.nix ]; time.timeZone = "Europe/Amsterdam"; diff --git a/infra/common/nixos/repart.nix b/infra/common/nixos/repart.nix deleted file mode 100644 index 72596bf1..00000000 --- a/infra/common/nixos/repart.nix +++ /dev/null @@ -1,192 +0,0 @@ -{ - config, - pkgs, - lib, - modulesPath, - ... -}: -{ - - imports = [ - "${modulesPath}/image/repart.nix" - ]; - - fileSystems = { - # "/" = { - # fsType = "tmpfs"; - # options = [ - # "size=20%" - # ]; - # }; - "/" = - let - partConf = config.image.repart.partitions."root".repartConfig; - in - { - device = "/dev/disk/by-partuuid/${partConf.UUID}"; - fsType = partConf.Format; - }; - - # "/var" = - # let - # partConf = config.image.repart.partitions."var".repartConfig; - # in - # { - # device = "/dev/disk/by-partuuid/${partConf.UUID}"; - # fsType = partConf.Format; - # }; - - "/boot" = - let - partConf = config.image.repart.partitions."esp".repartConfig; - in - { - device = "/dev/disk/by-partuuid/${partConf.UUID}"; - fsType = partConf.Format; - }; - - # "/nix/store" = - # let - # partConf = config.image.repart.partitions."store".repartConfig; - # in - # { - # device = "/dev/disk/by-partlabel/${partConf.Label}"; - # fsType = partConf.Format; - # }; - }; - - boot.uki.name = "monkey"; - # fileSystems."/".device = "/dev/disk/by-label/nixos"; - # https://nixos.org/manual/nixos/stable/#sec-image-repart - # https://x86.lol/generic/2024/08/28/systemd-sysupdate.html - image.repart = - let - efiArch = pkgs.stdenv.hostPlatform.efiArch; - in - { - name = config.boot.uki.name; - # name = "image"; - # split = true; - partitions = { - "esp" = { - # The contents to end up in the filesystem image. - contents = { - # "/EFI/BOOT/BOOTX64.EFI".source = "${pkgs.systemd}/lib/systemd/boot/efi/systemd-bootx64.efi"; - "/EFI/BOOT/BOOT${lib.toUpper efiArch}.EFI".source = - "${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi"; - - "/EFI/Linux/${config.system.boot.loader.ukiFile}".source = - "${config.system.build.uki}/${config.system.boot.loader.ukiFile}"; - - # https://man.archlinux.org/man/loader.conf.5 - "/loader/entries/loader.conf".source = pkgs.writeText "loader.conf" '' - timeout 0 - editor yes - default * - logLevel=debug - ''; - # "/loader/loader.conf".source = pkgs.writeText "loader.conf" '' - # timeout 0 - # editor yes - # default * - # logLevel=debug - # ''; - # nixos-*.conf - # "/loader/entries/nixos.conf".source = pkgs.writeText "nixos.conf" '' - # title NixOS - # linux /EFI/nixos/kernel.efi - # initrd /EFI/nixos/initrd.efi - # options init=/nix/store/.../init root=LABEL=nixos - # ''; - - # systemd-boot configuration - "/loader/loader.conf".source = ( - pkgs.writeText "$out" '' - timeout 3 - '' - ); - }; - # https://www.man7.org/linux//man-pages/man5/repart.d.5.html - repartConfig = { - Priority = 1; - Type = "esp"; - MountPoint = "/boot"; - Format = "vfat"; - UUID = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"; - SizeMinBytes = "500M"; - SizeMaxBytes = "500M"; - }; - # repartConfig = { - # Type = "esp"; - # UUID = "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"; # Well known - # Format = "vfat"; - # SizeMinBytes = "256M"; - # SplitName = "-"; - # }; - }; - "root" = { - storePaths = [ config.system.build.toplevel ]; - repartConfig = { - Priority = 2; - Type = "root"; - Label = "nixos"; - MountPoint = "/"; - Format = "ext4"; - UUID = "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"; - # populates the fs twice - Minimize = "guess"; - # Minimize = "off"; - # SizeMinBytes = "1G"; - # SizeMaxBytes = "20G"; - }; - - # "store" = { - # storePaths = [ config.system.build.toplevel ]; - # stripNixStorePrefix = true; - # repartConfig = { - # Type = "linux-generic"; - # Label = "store_${config.system.image.version}"; - # Format = "squashfs"; - # Minimize = "off"; - # ReadOnly = "yes"; - - # SizeMinBytes = "1G"; - # SizeMaxBytes = "1G"; - # SplitName = "store"; - # }; - # }; - - # # Placeholder for the second installed Nix store. - # "store-empty" = { - # repartConfig = { - # Type = "linux-generic"; - # Label = "_empty"; - # Minimize = "off"; - # SizeMinBytes = "1G"; - # SizeMaxBytes = "1G"; - # SplitName = "-"; - # }; - # }; - - # # Persistent storage - # "var" = { - # repartConfig = { - # Type = "var"; - # UUID = "4d21b016-b534-45c2-a9fb-5c16e091fd2d"; # Well known - # Format = "xfs"; - # Label = "nixos-persistent"; - # Minimize = "off"; - - # # Has to be large enough to hold update files. - # SizeMinBytes = "2G"; - # SizeMaxBytes = "2G"; - # SplitName = "-"; - - # # Wiping this gives us a clean state. - # FactoryReset = "yes"; - # }; - # }; - }; - }; - }; -}