From 84722633b786ceb3aef8be3959b072c901b75dc9 Mon Sep 17 00:00:00 2001 From: nikstur Date: Tue, 31 Oct 2023 11:18:46 +0100 Subject: [PATCH 1/3] nixos/image: move docs into manual --- .../building-images-via-systemd-repart.chapter.md} | 0 nixos/doc/manual/installation/installation.md | 1 + nixos/modules/image/repart.nix | 5 +---- 3 files changed, 2 insertions(+), 4 deletions(-) rename nixos/{modules/image/repart.md => doc/manual/installation/building-images-via-systemd-repart.chapter.md} (100%) diff --git a/nixos/modules/image/repart.md b/nixos/doc/manual/installation/building-images-via-systemd-repart.chapter.md similarity index 100% rename from nixos/modules/image/repart.md rename to nixos/doc/manual/installation/building-images-via-systemd-repart.chapter.md diff --git a/nixos/doc/manual/installation/installation.md b/nixos/doc/manual/installation/installation.md index 140594256609..f3b1773d865c 100644 --- a/nixos/doc/manual/installation/installation.md +++ b/nixos/doc/manual/installation/installation.md @@ -8,4 +8,5 @@ installing.chapter.md changing-config.chapter.md upgrading.chapter.md building-nixos.chapter.md +building-images-via-systemd-repart.chapter.md ``` diff --git a/nixos/modules/image/repart.nix b/nixos/modules/image/repart.nix index 926791d85701..e006ce83ce77 100644 --- a/nixos/modules/image/repart.nix +++ b/nixos/modules/image/repart.nix @@ -206,10 +206,7 @@ in | tee repart-output.json ''; - meta = { - maintainers = with lib.maintainers; [ nikstur ]; - doc = ./repart.md; - }; + meta.maintainers = with lib.maintainers; [ nikstur ]; }; } From 151fa7c39c4b0c765d1ad076afdf042b1517a0ed Mon Sep 17 00:00:00 2001 From: nikstur Date: Tue, 31 Oct 2023 11:25:04 +0100 Subject: [PATCH 2/3] nixos/image: include module options in manual --- nixos/modules/module-list.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 4949eb6f298e..95615c8db544 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1531,5 +1531,9 @@ ./virtualisation/waydroid.nix ./virtualisation/xe-guest-utilities.nix ./virtualisation/xen-dom0.nix - { documentation.nixos.extraModules = [ ./virtualisation/qemu-vm.nix ]; } + { documentation.nixos.extraModules = [ + ./virtualisation/qemu-vm.nix + ./image/repart.nix + ]; + } ] From 14152f80bbe39216755fc6c09bd995be4833dea8 Mon Sep 17 00:00:00 2001 From: nikstur Date: Tue, 31 Oct 2023 10:49:56 +0100 Subject: [PATCH 3/3] nixos/image: fix layout of option examples in repart builder --- nixos/modules/image/repart.nix | 48 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/nixos/modules/image/repart.nix b/nixos/modules/image/repart.nix index e006ce83ce77..41e6110885b8 100644 --- a/nixos/modules/image/repart.nix +++ b/nixos/modules/image/repart.nix @@ -34,12 +34,13 @@ let }; }); default = { }; - example = lib.literalExpression '' { - "/EFI/BOOT/BOOTX64.EFI".source = - "''${pkgs.systemd}/lib/systemd/boot/efi/systemd-bootx64.efi"; + example = lib.literalExpression '' + { + "/EFI/BOOT/BOOTX64.EFI".source = + "''${pkgs.systemd}/lib/systemd/boot/efi/systemd-bootx64.efi"; - "/loader/entries/nixos.conf".source = systemdBootEntry; - } + "/loader/entries/nixos.conf".source = systemdBootEntry; + } ''; description = lib.mdDoc "The contents to end up in the filesystem image."; }; @@ -96,26 +97,27 @@ in partitions = lib.mkOption { type = with lib.types; attrsOf (submodule partitionOptions); default = { }; - example = lib.literalExpression '' { - "10-esp" = { - contents = { - "/EFI/BOOT/BOOTX64.EFI".source = - "''${pkgs.systemd}/lib/systemd/boot/efi/systemd-bootx64.efi"; - } - repartConfig = { - Type = "esp"; - Format = "fat"; + example = lib.literalExpression '' + { + "10-esp" = { + contents = { + "/EFI/BOOT/BOOTX64.EFI".source = + "''${pkgs.systemd}/lib/systemd/boot/efi/systemd-bootx64.efi"; + } + repartConfig = { + Type = "esp"; + Format = "fat"; + }; + }; + "20-root" = { + storePaths = [ config.system.build.toplevel ]; + repartConfig = { + Type = "root"; + Format = "ext4"; + Minimize = "guess"; + }; }; }; - "20-root" = { - storePaths = [ config.system.build.toplevel ]; - repartConfig = { - Type = "root"; - Format = "ext4"; - Minimize = "guess"; - }; - }; - }; ''; description = lib.mdDoc '' Specify partitions as a set of the names of the partitions with their