From 3f4317383846c76f5584b3466685706959ce3a15 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Mon, 10 Mar 2025 20:25:56 +0300 Subject: [PATCH] fix: use lib.recursiveUpdate where it is necessary --- hosts/redshift/backups.nix | 3 ++- modules/home/persist/default.nix | 15 ++++++++++----- modules/nixos/persist/default.nix | 9 +++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/hosts/redshift/backups.nix b/hosts/redshift/backups.nix index 2464167..2e9adc4 100644 --- a/hosts/redshift/backups.nix +++ b/hosts/redshift/backups.nix @@ -1,5 +1,6 @@ { config, + lib, inputs, secretsDir, ... @@ -65,7 +66,7 @@ }; }; }; - vps-prune = cfg.vps-backup // { + vps-prune = lib.recursiveUpdate cfg.vps-backup { backup = false; prune = true; createWrapper = false; diff --git a/modules/home/persist/default.nix b/modules/home/persist/default.nix index f29a347..b0182d7 100644 --- a/modules/home/persist/default.nix +++ b/modules/home/persist/default.nix @@ -4,7 +4,12 @@ ... }: let - inherit (lib) mkOption mkEnableOption mkIf; + inherit (lib) + mkEnableOption + mkIf + mkOption + recursiveUpdate + ; inherit (lib.types) listOf path str; cfg = config.persist; in @@ -31,11 +36,11 @@ in }; # Stuff that matters # TODO backups - state = { + state = recursiveUpdate { # backup = {...}; - } // common; + } common; # Stuff that's just there to speed up the system - cache = { + cache = recursiveUpdate { clean = { enable = mkEnableOption "cleaning the cache files and directories"; dates = mkOption { @@ -44,7 +49,7 @@ in description = "A systemd.time calendar description of when to clean the cache files"; }; }; - } // common; + } common; }; }; diff --git a/modules/nixos/persist/default.nix b/modules/nixos/persist/default.nix index aed2727..dd76cbb 100644 --- a/modules/nixos/persist/default.nix +++ b/modules/nixos/persist/default.nix @@ -16,6 +16,7 @@ let mkOption nameValuePair optionalAttrs + recursiveUpdate ; inherit (lib.types) listOf path str; inherit (builtins) concatMap; @@ -46,11 +47,11 @@ in }; # Stuff that matters # TODO backups - state = { + state = recursiveUpdate { # backup = {...}; - } // common; + } common; # Stuff that's just there to speed up the system - cache = { + cache = recursiveUpdate { clean = { enable = mkEnableOption "cleaning the cache files and directories"; dates = mkOption { @@ -59,7 +60,7 @@ in description = "A systemd.time calendar description of when to clean the cache files"; }; }; - } // common; + } common; }; };