From cfa8bc3c4f0849e0e2c947dffecb71f6b82afefa Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Wed, 30 Apr 2025 17:13:13 +0200 Subject: [PATCH] switch out inputs for npins where i can --- flake.lock | 282 ++++++++------------------------------ flake.nix | 11 +- infra/common/resource.nix | 9 +- 3 files changed, 71 insertions(+), 231 deletions(-) diff --git a/flake.lock b/flake.lock index 8ecb7bd0..266a4f1e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,26 +1,5 @@ { "nodes": { - "agenix": { - "inputs": { - "darwin": "darwin", - "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "systems": "systems" - }, - "locked": { - "lastModified": 1736955230, - "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", - "owner": "ryantm", - "repo": "agenix", - "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", - "type": "github" - }, - "original": { - "owner": "ryantm", - "repo": "agenix", - "type": "github" - } - }, "crane": { "flake": false, "locked": { @@ -38,46 +17,6 @@ "type": "github" } }, - "darwin": { - "inputs": { - "nixpkgs": [ - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", - "type": "github" - }, - "original": { - "owner": "lnl7", - "ref": "master", - "repo": "nix-darwin", - "type": "github" - } - }, - "disko": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1740485968, - "narHash": "sha256-WK+PZHbfDjLyveXAxpnrfagiFgZWaTJglewBWniTn2Y=", - "owner": "nix-community", - "repo": "disko", - "rev": "19c1140419c4f1cdf88ad4c1cfb6605597628940", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "disko", - "type": "github" - } - }, "dream2nix": { "inputs": { "nixpkgs": [ @@ -106,11 +45,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -172,11 +111,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -190,11 +129,11 @@ "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -246,7 +185,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems" }, "locked": { "lastModified": 1710146030, @@ -262,31 +201,11 @@ "type": "github" } }, - "git-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1737465171, - "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "git-hooks-nix": { "inputs": { "flake-compat": "flake-compat_2", - "gitignore": "gitignore_2", - "nixpkgs": "nixpkgs_4" + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1737465171, @@ -342,27 +261,6 @@ } }, "gitignore": { - "inputs": { - "nixpkgs": [ - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "gitignore_2": { "inputs": { "nixpkgs": [ "nixops4-nixos", @@ -384,27 +282,6 @@ "type": "github" } }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1703113217, - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "mk-naked-shell": { "flake": false, "locked": { @@ -423,10 +300,9 @@ }, "nix": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-parts": "flake-parts_4", - "git-hooks-nix": "git-hooks-nix_2", - "nixfmt": "nixfmt", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts_3", + "git-hooks-nix": "git-hooks-nix", "nixpkgs": [ "nixops4-nixos", "nixops4", @@ -436,16 +312,15 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1738382221, - "narHash": "sha256-3+qJBts5RTAtjCExo6bkqrttL+skpYZzPOVEzPSwVtc=", + "lastModified": 1745685971, + "narHash": "sha256-yzyW8CNxPjys+eqbnyxICi3W5zESTpWehBAmMKDU6Ws=", "owner": "NixOS", "repo": "nix", - "rev": "d949c8de7c7e84bb7537dc772609686c37033a3b", + "rev": "ee59af99f8619e17db4289843da62a24302d20b7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "master", "repo": "nix", "type": "github" } @@ -465,11 +340,11 @@ "treefmt": "treefmt" }, "locked": { - "lastModified": 1738390452, - "narHash": "sha256-o8kg4q1V2xV9ZlszAnizXJK2c+fbhAeLbGoTUa2u1Bw=", + "lastModified": 1745648139, + "narHash": "sha256-3K7u0SEmJTOzp1kKAngUIp9hgwafJCyjntFeXJQu6Pw=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "718d577808e3e31f445b6564d58b755294e72f42", + "rev": "3651a63811d1301e49b581cc0534f78319fcd0ca", "type": "github" }, "original": { @@ -501,15 +376,15 @@ "flake-parts": "flake-parts_3", "nix": "nix", "nix-cargo-integration": "nix-cargo-integration", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs", "nixpkgs-old": "nixpkgs-old" }, "locked": { - "lastModified": 1739444468, - "narHash": "sha256-brg21neEI7pUnSRksOx9IE8/Kcr8OmEg4NIxL0sSy+U=", + "lastModified": 1745687024, + "narHash": "sha256-8uZ5CfHn/3zsrP02k7+oRD9/FSLhOkHabuJwdiLUllI=", "owner": "nixops4", "repo": "nixops4", - "rev": "fb601ee79d8c9e3e7aca98dd2334ea91da3ea7e0", + "rev": "f244144017bd67afb597dd9ab946c598cfd77c2a", "type": "github" }, "original": { @@ -533,11 +408,11 @@ ] }, "locked": { - "lastModified": 1740082114, - "narHash": "sha256-xNUnup8loWAMlP2+EnGX7HaO2vJlFakjvU0gTYi3F48=", + "lastModified": 1744210136, + "narHash": "sha256-cnI378pamqbp3c6VmNWBadeuiWi92XsT7bVMI5iRBVk=", "owner": "nixops4", "repo": "nixops4-nixos", - "rev": "85ebdd8b4b182287e4c6ca0e888f2d3a4aa7453c", + "rev": "1cf497c17fac268a1a9ec31de15a18453c1aff81", "type": "github" }, "original": { @@ -548,11 +423,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703013332, - "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", + "lastModified": 1745526057, + "narHash": "sha256-ITSpPDwvLBZBnPRS2bUcHY3gZSwis/uTe255QgMtTLA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", + "rev": "f771eb401a46846c1aebd20552521b233dd7e18b", "type": "github" }, "original": { @@ -580,26 +455,32 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1738452942, - "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" } }, "nixpkgs-lib_2": { "locked": { - "lastModified": 1738452942, - "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" } }, "nixpkgs-lib_3": { @@ -648,11 +529,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1738136902, - "narHash": "sha256-pUvLijVGARw4u793APze3j6mU1Zwdtz7hGkGGkD87qw=", + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9a5db3142ce450045840cc8d832b13b8a2018e0c", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", "type": "github" }, "original": { @@ -663,38 +544,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1730768919, - "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1730768919, - "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { "locked": { "lastModified": 1738410390, "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", @@ -710,13 +559,13 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_4": { "locked": { - "lastModified": 1740463929, - "narHash": "sha256-4Xhu/3aUdCKeLfdteEHMegx5ooKQvwPHNkOgNCXQrvc=", + "lastModified": 1745921652, + "narHash": "sha256-hEAvEN+y/OQ7wA7+u3bFJwXSe8yoSf2QaOMH3hyTJTQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5d7db4668d7a0c6cc5fc8cf6ef33b008b2b1ed8b", + "rev": "b000159bba69b0106a42f65e52dbf27f77aca9d3", "type": "github" }, "original": { @@ -751,7 +600,7 @@ }, "purescript-overlay": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_2", "nixpkgs": [ "nixops4-nixos", "nixops4", @@ -794,8 +643,6 @@ }, "root": { "inputs": { - "agenix": "agenix", - "disko": "disko", "flake-parts": "flake-parts", "git-hooks": "git-hooks", "nixops4": [ @@ -869,21 +716,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 217b6108..c833bc93 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,13 @@ outputs = inputs@{ flake-parts, ... }: + let + sources = import ./npins; + inherit (sources) + agenix + git-hooks + ; + in flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" @@ -22,7 +29,7 @@ ]; imports = [ - inputs.git-hooks.flakeModule + (import "${git-hooks}/flake-module.nix") inputs.nixops4.modules.flake.default ./deployment/flake-part.nix @@ -58,7 +65,7 @@ devShells.default = pkgs.mkShell { packages = [ pkgs.nil - inputs'.agenix.packages.default + (pkgs.callPackage "${agenix}/pkgs/agenix.nix" { }) pkgs.openssh pkgs.httpie pkgs.jq diff --git a/infra/common/resource.nix b/infra/common/resource.nix index 4606ddf4..7e86467c 100644 --- a/infra/common/resource.nix +++ b/infra/common/resource.nix @@ -1,5 +1,4 @@ { - inputs, lib, config, ... @@ -9,6 +8,8 @@ let inherit (lib) attrValues elem mkDefault; inherit (lib.attrsets) concatMapAttrs optionalAttrs; inherit (lib.strings) removeSuffix; + sources = import ../../npins; + inherit (sources) nixpkgs agenix disko; secretsPrefix = ../../secrets; secrets = import (secretsPrefix + "/secrets.nix"); @@ -25,15 +26,15 @@ in hostPublicKey = config.fediversityVm.hostPublicKey; }; - nixpkgs = inputs.nixpkgs; + inherit nixpkgs; ## The configuration of the machine. We strive to keep in this file only the ## options that really need to be injected from the resource. Everything else ## should go into the `./nixos` subdirectory. nixos.module = { imports = [ - inputs.agenix.nixosModules.default - inputs.disko.nixosModules.default + (import "${agenix}/modules/age.nix") + (import "${disko}/module.nix") ./options.nix ./nixos ];