From e387656be88a4ac498de93ffe39ea3c150c3ef22 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 30 May 2025 19:02:34 +0200 Subject: [PATCH 1/3] base/auto-upgrade: fetch input urls from flake --- base/services/auto-upgrade.nix | 21 ++++++++++++++++----- flake.nix | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) 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"; From c8d29c363ff69fc44ce54a0f61e40d62a8c81baa Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 30 May 2025 19:03:26 +0200 Subject: [PATCH 2/3] flake: switch to nixos.org nixpkgs tarballs no rate limiting and supports ipv6 --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index fe2aa4c..540967f 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ description = "PVV System flake"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small"; + nixpkgs.url = "https://nixos.org/channels/nixos-24.11-small/nixexprs.tar.xz"; + nixpkgs-unstable.url = "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz"; sops-nix.url = "github:Mic92/sops-nix"; sops-nix.inputs.nixpkgs.follows = "nixpkgs"; From ca9ac0e0fc3b5ba660ed9c7d91a04c3714279134 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 30 May 2025 19:05:01 +0200 Subject: [PATCH 3/3] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/9204750b34cae1a8347ab4b5588115edfeebc6d7' (2025-04-24) → 'https://releases.nixos.org/nixos/24.11-small/nixos-24.11.718472.97d3ce1ceb66/nixexprs.tar.xz?narHash=sha256-8sjG4sNIonQPK2olCGvq3/j1qtjwPaTOFU5nkz1gj2Q%3D&rev=97d3ce1ceb663a24184aac92b7e9e8f5452111c1' (2025-05-30) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/6a2957c7978b189202e03721aab901c0a9dc1e1a' (2025-04-26) → 'https://releases.nixos.org/nixos/unstable-small/nixos-25.11pre807945.b8af95f4cf51/nixexprs.tar.xz?narHash=sha256-YCnUqO9k39p0oMIBndxYTbu8m0fOA/KVcq3IekXPy9c%3D&rev=b8af95f4cf511c5f056b463c3a45d2b63c7cfb03' (2025-05-30) --- flake.lock | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/flake.lock b/flake.lock index 6e5828d..fadda13 100644 --- a/flake.lock +++ b/flake.lock @@ -139,34 +139,28 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745526780, - "narHash": "sha256-LXXYBmFPMQU2lTb6alKWfjgQs08BKn+txMNcgbu00hI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9204750b34cae1a8347ab4b5588115edfeebc6d7", - "type": "github" + "lastModified": 1748615477, + "narHash": "sha256-8sjG4sNIonQPK2olCGvq3/j1qtjwPaTOFU5nkz1gj2Q=", + "rev": "97d3ce1ceb663a24184aac92b7e9e8f5452111c1", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/24.11-small/nixos-24.11.718472.97d3ce1ceb66/nixexprs.tar.xz?rev=97d3ce1ceb663a24184aac92b7e9e8f5452111c1" }, "original": { - "owner": "NixOS", - "ref": "nixos-24.11-small", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://nixos.org/channels/nixos-24.11-small/nixexprs.tar.xz" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1745688173, - "narHash": "sha256-fgvG1O5JvSSjeQx+ea0DJ3GfMbLPVhAQta/DqQ2y6jc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6a2957c7978b189202e03721aab901c0a9dc1e1a", - "type": "github" + "lastModified": 1748588304, + "narHash": "sha256-YCnUqO9k39p0oMIBndxYTbu8m0fOA/KVcq3IekXPy9c=", + "rev": "b8af95f4cf511c5f056b463c3a45d2b63c7cfb03", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable-small/nixos-25.11pre807945.b8af95f4cf51/nixexprs.tar.xz?rev=b8af95f4cf511c5f056b463c3a45d2b63c7cfb03" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable-small", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz" } }, "pvv-calendar-bot": {