diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 22:13:02 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 22:13:02 +0200 |
| commit | 8345d17df4a353c62acb999805f1b7b1cc02d9ab (patch) | |
| tree | 74ff60b3784b7e08aaa9eaa053a82c1c9f14dd69 /npins | |
| parent | scripts/unflake.sh: Work around unflake not supporting npins v8 (diff) | |
| download | nixos-config-8345d17df4a353c62acb999805f1b7b1cc02d9ab.zip | |
treewide: Update
Diffstat (limited to 'npins')
| -rw-r--r-- | npins/default.nix | 45 | ||||
| -rw-r--r-- | npins/sources.json | 80 |
2 files changed, 68 insertions, 57 deletions
diff --git a/npins/default.nix b/npins/default.nix index 884fc8cc..8ec5eca6 100644 --- a/npins/default.nix +++ b/npins/default.nix @@ -65,7 +65,9 @@ let if pkgs == null then { inherit (builtins) fetchTarball fetchurl; - # For some fucking reason, fetchGit has a different signature than the other builtin fetchers … + # Frustratingly, due to flakes and `fetchTree`, `fetchGit` + # has a different signature than the other builtin + # fetchers fetchGit = args: (builtins.fetchGit args).outPath; } else @@ -95,7 +97,6 @@ let }; }; - # Dispatch to the correct code path based on the type path = if spec.type == "Git" then mkGitSource fetchers spec @@ -105,8 +106,8 @@ let mkPyPiSource fetchers spec else if spec.type == "Channel" then mkChannelSource fetchers spec - else if spec.type == "Tarball" then - mkTarballSource fetchers spec + else if spec.type == "Url" || spec.type == "MutableUrl" then + mkUrlSource fetchers spec else if spec.type == "Container" then mkContainerSource pkgs spec else @@ -192,16 +193,20 @@ let sha256 = hash; }; - mkTarballSource = - { fetchTarball, ... }: + mkUrlSource = + { + fetchTarball, + fetchurl, + ... + }: { url, - locked_url ? url, hash, + unpack, ... }: - fetchTarball { - url = locked_url; + (if unpack then fetchTarball else fetchurl) { + inherit url; sha256 = hash; }; @@ -211,16 +216,22 @@ let image_name, image_tag, image_digest, + hash, ... - }: + }@args: if pkgs == null then builtins.throw "container sources require passing in a Nixpkgs value: https://github.com/andir/npins/blob/master/README.md#using-the-nixpkgs-fetchers" else - pkgs.dockerTools.pullImage { - imageName = image_name; - imageDigest = image_digest; - finalImageTag = image_tag; - }; + pkgs.dockerTools.pullImage ( + { + imageName = image_name; + imageDigest = image_digest; + finalImageTag = image_tag; + hash = hash; + } + // (if args.arch or null != null then { arch = args.arch; } else { }) + ); + in mkFunctor ( { @@ -231,7 +242,7 @@ mkFunctor ( if builtins.isPath input then # while `readFile` will throw an error anyways if the path doesn't exist, # we still need to check beforehand because *our* error can be caught but not the one from the builtin - # *piegames sighs* + # See: <https://git.lix.systems/lix-project/lix/issues/1098> if builtins.pathExists input then builtins.fromJSON (builtins.readFile input) else @@ -242,7 +253,7 @@ mkFunctor ( throw "Unsupported input type ${builtins.typeOf input}, must be a path or an attrset"; version = data.version; in - if version == 7 then + if version == 8 then builtins.mapAttrs (name: spec: mkFunctor (mkSource name spec)) data.pins else throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/npins/sources.json b/npins/sources.json index 51c061a0..85928737 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -112,9 +112,9 @@ }, "branch": "master", "submodules": false, - "revision": "0532eb17955225173906d671fb36306bdeb1e2dc", - "url": "https://github.com/ipetkov/crane/archive/0532eb17955225173906d671fb36306bdeb1e2dc.tar.gz", - "hash": "sha256-EVZd2RsbpreRUDSi9rBwPY+ZxoyMaiEBbZxxhljbaS4=" + "revision": "59a82a1222dd3b2080b5cc52a1a2e8d5f1b77f37", + "url": "https://github.com/ipetkov/crane/archive/59a82a1222dd3b2080b5cc52a1a2e8d5f1b77f37.tar.gz", + "hash": "sha256-D+BsdpxmtUwtqGoY0IXPhHgTlmqgcZKCEo1oMyn7ep0=" }, "unflake_github_lnl7_nix-darwin_ref_master": { "type": "Git", @@ -125,9 +125,9 @@ }, "branch": "master", "submodules": false, - "revision": "56c666e108467d87d13508936aade6d567f2a501", - "url": "https://github.com/lnl7/nix-darwin/archive/56c666e108467d87d13508936aade6d567f2a501.tar.gz", - "hash": "sha256-zXcwYQGCT6pzinK+1dBB2ekTVtfxGZAapb3Evdcu4fY=" + "revision": "aabb2037edfc0f210723b72cd5f528aab5dd3f0b", + "url": "https://github.com/lnl7/nix-darwin/archive/aabb2037edfc0f210723b72cd5f528aab5dd3f0b.tar.gz", + "hash": "sha256-bchLZZ3sRn740zyvD2icZSnNoTaanN0nw7l6fjVXO+E=" }, "unflake_github_nix-community_disko_ref_master": { "type": "Git", @@ -138,9 +138,9 @@ }, "branch": "master", "submodules": false, - "revision": "115e5211780054d8a890b41f0b7734cafad54dfe", - "url": "https://github.com/nix-community/disko/archive/115e5211780054d8a890b41f0b7734cafad54dfe.tar.gz", - "hash": "sha256-eTAlX0CwgB84Ts3GaBd944A3DRXVMzgA0EqroZBISUo=" + "revision": "ff8702b4de27f72b4c78573dfb89ec74e36abdf1", + "url": "https://github.com/nix-community/disko/archive/ff8702b4de27f72b4c78573dfb89ec74e36abdf1.tar.gz", + "hash": "sha256-RxWs5ND31KzTG7wvMM+PMfUjyNpmIEr999lqNARaM5o=" }, "unflake_github_nix-community_home-manager": { "type": "Git", @@ -151,9 +151,9 @@ }, "branch": "master", "submodules": false, - "revision": "f384af1bec6423a0d4ba1855917ab948f64e5808", - "url": "https://github.com/nix-community/home-manager/archive/f384af1bec6423a0d4ba1855917ab948f64e5808.tar.gz", - "hash": "sha256-s7Tv6FUQThRAvW8En8XVC6HMb0uiikzVccCcCo9u/Bg=" + "revision": "5b6f5733726a1b2ccafb5dec6ac4ca7299fad66c", + "url": "https://github.com/nix-community/home-manager/archive/5b6f5733726a1b2ccafb5dec6ac4ca7299fad66c.tar.gz", + "hash": "sha256-zqDBhXMzfbdlO7F2bGHe7MOtB3xngd/+4ieMHDC+ZXo=" }, "unflake_github_nix-community_home-manager_ref_master": { "type": "Git", @@ -164,9 +164,9 @@ }, "branch": "master", "submodules": false, - "revision": "f384af1bec6423a0d4ba1855917ab948f64e5808", - "url": "https://github.com/nix-community/home-manager/archive/f384af1bec6423a0d4ba1855917ab948f64e5808.tar.gz", - "hash": "sha256-s7Tv6FUQThRAvW8En8XVC6HMb0uiikzVccCcCo9u/Bg=" + "revision": "5b6f5733726a1b2ccafb5dec6ac4ca7299fad66c", + "url": "https://github.com/nix-community/home-manager/archive/5b6f5733726a1b2ccafb5dec6ac4ca7299fad66c.tar.gz", + "hash": "sha256-zqDBhXMzfbdlO7F2bGHe7MOtB3xngd/+4ieMHDC+ZXo=" }, "unflake_github_nix-community_impermanence_ref_master": { "type": "Git", @@ -206,9 +206,9 @@ }, "branch": "main", "submodules": false, - "revision": "97df9dc0b7c924344b793a15c1e8e4522ebb854e", - "url": "https://github.com/nix-community/nix-index-database/archive/97df9dc0b7c924344b793a15c1e8e4522ebb854e.tar.gz", - "hash": "sha256-4axz3OBPTKa6LIkXV8n0lc63MQU+et2CB5DGobEAi6k=" + "revision": "1a2ea89c917781e88508d9fd2b507f2d2a0e173c", + "url": "https://github.com/nix-community/nix-index-database/archive/1a2ea89c917781e88508d9fd2b507f2d2a0e173c.tar.gz", + "hash": "sha256-0BYqs8yKWkOz2Q7+SP18N5E5gmDKSo6LSxIVIa0wWes=" }, "unflake_github_nix-community_nixos-generators_ref_master": { "type": "Git", @@ -232,9 +232,9 @@ }, "branch": "master", "submodules": false, - "revision": "49d924421d7c3175edc499fdc738bd70d69d97d5", - "url": "https://github.com/nix-community/nixpkgs.lib/archive/49d924421d7c3175edc499fdc738bd70d69d97d5.tar.gz", - "hash": "sha256-/LAL+E75c0ioCHxyVFGwzXorfuHzToKgqPUCRq4RTIY=" + "revision": "78afa8e310f34cba09443a5ef2fb47bfd21d294f", + "url": "https://github.com/nix-community/nixpkgs.lib/archive/78afa8e310f34cba09443a5ef2fb47bfd21d294f.tar.gz", + "hash": "sha256-eVQuIiDIy24NIAW+yEirKosWHFYAml6dghmevWgruBE=" }, "unflake_github_nix-community_nixvim_ref_main": { "type": "Git", @@ -245,9 +245,9 @@ }, "branch": "main", "submodules": false, - "revision": "b7521616f15ad73c6bec458d64ed7f06f4095edb", - "url": "https://github.com/nix-community/nixvim/archive/b7521616f15ad73c6bec458d64ed7f06f4095edb.tar.gz", - "hash": "sha256-ZRAMRXQE1UKBtpnPwwOqV8teaPDD/fdABvUXMjcyhow=" + "revision": "19a4e5efa14d15aaeb947db6e700591e4acdb295", + "url": "https://github.com/nix-community/nixvim/archive/19a4e5efa14d15aaeb947db6e700591e4acdb295.tar.gz", + "hash": "sha256-h8eBVfQ+UZRc52vqGHrtD0gT4cSw41G4PW+iK06Y3nc=" }, "unflake_github_nix-systems_default": { "type": "Git", @@ -323,9 +323,9 @@ }, "branch": "nixos-26.05", "submodules": false, - "revision": "b51242d7d43689db2f3be91bd05d5b24fbb469c4", - "url": "https://github.com/nixos/nixpkgs/archive/b51242d7d43689db2f3be91bd05d5b24fbb469c4.tar.gz", - "hash": "sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1+N6cArVE=" + "revision": "a0374025a863d007d98e3297f6aa46cc3141c2f0", + "url": "https://github.com/nixos/nixpkgs/archive/a0374025a863d007d98e3297f6aa46cc3141c2f0.tar.gz", + "hash": "sha256-9mUW6gNwoN2SWc/l0fW4svPNOulXLl8ijqKyeSOGgJE=" }, "unflake_github_nixos_nixpkgs_ref_nixos-unstable": { "type": "Git", @@ -336,9 +336,9 @@ }, "branch": "nixos-unstable", "submodules": false, - "revision": "331800de5053fcebacf6813adb5db9c9dca22a0c", - "url": "https://github.com/nixos/nixpkgs/archive/331800de5053fcebacf6813adb5db9c9dca22a0c.tar.gz", - "hash": "sha256-x5UQuRsH3MqI0U9afaXSNqzTPSeZlRLvFAav2Ux1pNw=" + "revision": "9ae611a455b90cf061d8f332b977e387bda8e1ca", + "url": "https://github.com/nixos/nixpkgs/archive/9ae611a455b90cf061d8f332b977e387bda8e1ca.tar.gz", + "hash": "sha256-md8WlXOlfnIeHeOScMTTHFyf2d6iaTwPl2apR5EQ3P4=" }, "unflake_github_nixos_nixpkgs_ref_nixos-unstable-small": { "type": "Git", @@ -349,9 +349,9 @@ }, "branch": "nixos-unstable-small", "submodules": false, - "revision": "c8560a2e8ad260841c482fe30731087b92f2223e", - "url": "https://github.com/nixos/nixpkgs/archive/c8560a2e8ad260841c482fe30731087b92f2223e.tar.gz", - "hash": "sha256-JsufhU/MyfEEJMNmtmW0DY6LbOVIjjPS0zGQpHvgrBY=" + "revision": "51effaf9783e0226281ad10e95a4af6c8a145316", + "url": "https://github.com/nixos/nixpkgs/archive/51effaf9783e0226281ad10e95a4af6c8a145316.tar.gz", + "hash": "sha256-tyh5yzbIN2ftH+uilyTWR6WCMZQeh3m5iOowTLNodyk=" }, "unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable": { "type": "Git", @@ -362,9 +362,9 @@ }, "branch": "nixpkgs-unstable", "submodules": false, - "revision": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f", - "url": "https://github.com/nixos/nixpkgs/archive/4df1b885d76a54e1aa1a318f8d16fd6005b6401f.tar.gz", - "hash": "sha256-vhVhuXzFrIOfcssC/9hDHx7MHzDKjF3keHuREOQqQiQ=" + "revision": "49a4bd0573c376468dd7996ddb6f9fa31d8c4d97", + "url": "https://github.com/nixos/nixpkgs/archive/49a4bd0573c376468dd7996ddb6f9fa31d8c4d97.tar.gz", + "hash": "sha256-Zn5KTggEmUB3lXn/ccERNcBdddE6IaOFber9dWViWDg=" }, "unflake_github_numtide_flake-utils": { "type": "Git", @@ -414,9 +414,9 @@ }, "branch": "master", "submodules": false, - "revision": "7cc96a6a3fd6613cafd633250a3934483479b9a1", - "url": "https://github.com/oxalica/rust-overlay/archive/7cc96a6a3fd6613cafd633250a3934483479b9a1.tar.gz", - "hash": "sha256-CvRZn3Ut0scqLJ1xwQFkZwKGVBUUNBPrFVXRTMZpbfU=" + "revision": "5b929d8c854149d926d05ea0cd6469bf4e54db27", + "url": "https://github.com/oxalica/rust-overlay/archive/5b929d8c854149d926d05ea0cd6469bf4e54db27.tar.gz", + "hash": "sha256-mjJ/VxJaIkgcUvKANgKOaaN5M1X1X+6NjCP0C5hw0WI=" }, "unflake_github_ryantm_agenix_ref_main": { "type": "Git", @@ -432,5 +432,5 @@ "hash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=" } }, - "version": 7 + "version": 8 } |
