From 631bed6ed93e8bf638299b570fb0c1ed902ee255 Mon Sep 17 00:00:00 2001 From: Florent Charpentier Date: Fri, 14 Mar 2025 14:18:15 +0100 Subject: [PATCH] nixos/systemd-repart: add support for repeating settings fix https://github.com/NixOS/nixpkgs/issues/389478 --- nixos/modules/image/repart.nix | 4 ++-- nixos/modules/system/boot/systemd/repart.nix | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nixos/modules/image/repart.nix b/nixos/modules/image/repart.nix index c2963c816533..d6120da6524a 100644 --- a/nixos/modules/image/repart.nix +++ b/nixos/modules/image/repart.nix @@ -48,7 +48,7 @@ let }; repartConfig = lib.mkOption { - type = with lib.types; attrsOf (oneOf [ str int bool ]); + type = with lib.types; attrsOf (oneOf [ str int bool (listOf str) ]); example = { Type = "home"; SizeMinBytes = "512M"; @@ -311,7 +311,7 @@ in (lib.mapAttrsToList (_n: v: v.repartConfig.Format or null) cfg.partitions); - format = pkgs.formats.ini { }; + format = pkgs.formats.ini { listsAsDuplicateKeys = true; }; definitionsDirectory = utils.systemdUtils.lib.definitions "repart.d" diff --git a/nixos/modules/system/boot/systemd/repart.nix b/nixos/modules/system/boot/systemd/repart.nix index 869172ceca6e..a8dc4745c26b 100644 --- a/nixos/modules/system/boot/systemd/repart.nix +++ b/nixos/modules/system/boot/systemd/repart.nix @@ -10,7 +10,7 @@ let cfg = config.systemd.repart; initrdCfg = config.boot.initrd.systemd.repart; - format = pkgs.formats.ini { }; + format = pkgs.formats.ini { listsAsDuplicateKeys = true; }; definitionsDirectory = utils.systemdUtils.lib.definitions "repart.d" format ( lib.mapAttrs (_n: v: { Partition = v; }) cfg.partitions @@ -93,6 +93,7 @@ in str int bool + (listOf str) ]) ); default = { };