summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/nixos/personal/nix.nix9
-rw-r--r--pkgs/lib/default.nix21
2 files changed, 16 insertions, 14 deletions
diff --git a/modules/nixos/personal/nix.nix b/modules/nixos/personal/nix.nix
index 24b5012..156f045 100644
--- a/modules/nixos/personal/nix.nix
+++ b/modules/nixos/personal/nix.nix
@@ -1,4 +1,4 @@
-{ config, lib, ... }:
+{ config, lib, pkgs, ... }:
let cfg = config.personal.nix;
in {
@@ -30,11 +30,8 @@ in {
flake = cfg.flake;
flags = if (cfg.flake == null) then
[ "--upgrade-all" ]
- else [
- "--update-input"
- "nixpkgs"
- "--commit-lock-file"
- ];
+ else
+ [ "--commit-lock-file" ] ++ pkgs.personal.lib.updateInputFlag "nixpkgs";
};
systemd.services = {
nix-gc.after =
diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix
index 964d099..6ba56ef 100644
--- a/pkgs/lib/default.nix
+++ b/pkgs/lib/default.nix
@@ -1,10 +1,15 @@
{ lib }:
-{
- homeManager = import ./home-manager { };
- toUserJS = prefs: ''
- ${lib.concatStrings (lib.mapAttrsToList (name: value: ''
- user_pref("${name}", ${builtins.toJSON value});
- '') prefs)}
- '';
-}
+let
+ self = {
+ homeManager = import ./home-manager { };
+ toUserJS = prefs: ''
+ ${lib.concatStrings (lib.mapAttrsToList (name: value: ''
+ user_pref("${name}", ${builtins.toJSON value});
+ '') prefs)}
+ '';
+ updateInputFlag = input: [ "--update-input" input ];
+ updateInputFlags = inputs:
+ builtins.concatLists (builtins.map self.updateInputFlag inputs);
+ };
+in self