about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJared Baur <jaredbaur@fastmail.com>2024-01-31 09:12:28 -0800
committerJared Baur <jaredbaur@fastmail.com>2024-01-31 09:12:28 -0800
commit50866dc20fb85063f1d4e103b11530092c490d03 (patch)
tree7b4586995808fd1ac1420bdf39a7d608f38792c6 /nixos
parentb37344b7a0d537be2bb408cefdf364bee178a6cc (diff)
downloadnixlib-50866dc20fb85063f1d4e103b11530092c490d03.tar
nixlib-50866dc20fb85063f1d4e103b11530092c490d03.tar.gz
nixlib-50866dc20fb85063f1d4e103b11530092c490d03.tar.bz2
nixlib-50866dc20fb85063f1d4e103b11530092c490d03.tar.lz
nixlib-50866dc20fb85063f1d4e103b11530092c490d03.tar.xz
nixlib-50866dc20fb85063f1d4e103b11530092c490d03.tar.zst
nixlib-50866dc20fb85063f1d4e103b11530092c490d03.zip
nixos/sysupdate: allow lists in sysupdate config
Lists are convenient to have in sysupdate configuration when using
multiple `MatchPattern` under `Target` when the target can have multiple
filenames. This use-case is helpful for BootLoaderSpec bootcounting where the target file on
disk can have multiple filenames, and in order for sysupdate to properly
ensure only N number of instances of this target exist at one time, we
need to have multiple match patterns.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/systemd/sysupdate.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/systemd/sysupdate.nix b/nixos/modules/system/boot/systemd/sysupdate.nix
index cab35ddf270c..1f4088ddf825 100644
--- a/nixos/modules/system/boot/systemd/sysupdate.nix
+++ b/nixos/modules/system/boot/systemd/sysupdate.nix
@@ -3,7 +3,7 @@
 let
   cfg = config.systemd.sysupdate;
 
-  format = pkgs.formats.ini { };
+  format = pkgs.formats.ini { listToValue = toString; };
 
   definitionsDirectory = utils.systemdUtils.lib.definitions
     "sysupdate.d"
@@ -79,7 +79,7 @@ in
           Source = {
             Type = "url-file";
             Path = "https://download.example.com/";
-            MatchPattern = "nixos_@v.efi.xz";
+            MatchPattern = [ "nixos_@v+@l-@d.efi" "nixos_@v+@l.efi" "nixos_@v.efi" ];
           };
 
           Target = {