diff --git a/base/services/auto-upgrade.nix b/base/services/auto-upgrade.nix index acd77a4..098d744 100644 --- a/base/services/auto-upgrade.nix +++ b/base/services/auto-upgrade.nix @@ -1,16 +1,27 @@ { inputs, pkgs, lib, ... }: + +let + inputUrls = lib.mapAttrs (input: value: value.url) (import "${inputs.self}/flake.nix").inputs; +in + { system.autoUpgrade = { enable = true; flake = "git+https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git"; flags = [ - # --update-input is deprecated since nix 2.22, and removed in lix 2.90 - # https://git.lix.systems/lix-project/lix/issues/400 "--refresh" - "--override-input" "nixpkgs" "github:nixos/nixpkgs/nixos-24.11-small" - "--override-input" "nixpkgs-unstable" "github:nixos/nixpkgs/nixos-unstable-small" "--no-write-lock-file" - ]; + # --update-input is deprecated since nix 2.22, and removed in lix 2.90 + # as such we instead use --override-input combined with --refresh + # https://git.lix.systems/lix-project/lix/issues/400 + ] ++ (lib.pipe inputUrls [ + (lib.intersectAttrs { + nixpkgs = { }; + nixpkgs-unstable = { }; + }) + (lib.mapAttrsToList (input: url: ["--override-input" input url])) + lib.concatLists + ]); }; # workaround for https://github.com/NixOS/nix/issues/6895 diff --git a/flake.nix b/flake.nix index b385dcd..fe2aa4c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "PVV System flake"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small"; # remember to also update the url in base/services/auto-upgrade.nix + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small"; sops-nix.url = "github:Mic92/sops-nix";