zaphyra's git: nixfiles

zaphyra's nixfiles

commit 2235b769c7e33035bf6ad66e6752a3745f47ef77
parent 772e780dc553a26b03810b95e54f1121afd3d46c
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Fri, 19 Jun 2026 15:08:21 +0200

npins: update deps
2 files changed, 48 insertions(+), 37 deletions(-)
M
npins/default.nix
|
45
++++++++++++++++++++++++++++-----------------
M
npins/sources.json
|
40
++++++++++++++++++++--------------------
diff --git 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
@@ -101,15 +101,15 @@
       "type": "Git",
       "repository": {
         "type": "Forgejo",
-        "server": "https://codeberg.org",
+        "server": "https://codeberg.org/",
         "owner": "BANanaD3V",
         "repo": "niri-nix"
       },
       "branch": "main",
       "submodules": false,
-      "revision": "06ecf24d15ec95ef9c8bc2a08d366b0fc68adbec",
-      "url": "https://codeberg.org/BANanaD3V/niri-nix/archive/06ecf24d15ec95ef9c8bc2a08d366b0fc68adbec.tar.gz",
-      "hash": "sha256-I/sw4t/ZiAkErPzrEHoN3Gi4oh5o/omD50Qu4mQXuN0="
+      "revision": "897c1b79cd2f5a70f8189de09793f74ca0fe3890",
+      "url": "https://codeberg.org/BANanaD3V/niri-nix/archive/897c1b79cd2f5a70f8189de09793f74ca0fe3890.tar.gz",
+      "hash": "sha256-4LQ/onKqgOKkKbcripfGpegtV9rWsPooLCtErtnBj6k="
     },
     "nixMaid": {
       "type": "Git",

@@ -146,9 +146,9 @@
       },
       "branch": "master",
       "submodules": false,
-      "revision": "ef4efb84766a166c906bd55759574676bf91267c",
-      "url": "https://github.com/NixOS/nixos-hardware/archive/ef4efb84766a166c906bd55759574676bf91267c.tar.gz",
-      "hash": "sha256-3sRzgLX86qV5NlhWUAufLmHwkyP03tmL3VdZIM13dEo="
+      "revision": "08018c72174a4df5657f8d94178ac69fb9c243e5",
+      "url": "https://github.com/NixOS/nixos-hardware/archive/08018c72174a4df5657f8d94178ac69fb9c243e5.tar.gz",
+      "hash": "sha256-JrPh4M6S7aPsEE9tOENuZrxC6o2szSLlK+t4+nLke9s="
     },
     "nixpkgs": {
       "type": "Git",

@@ -159,9 +159,9 @@
       },
       "branch": "nixos-26.05",
       "submodules": false,
-      "revision": "705e9929918b43bd7b715dc0a878ac870449bb03",
-      "url": "https://github.com/NixOS/nixpkgs/archive/705e9929918b43bd7b715dc0a878ac870449bb03.tar.gz",
-      "hash": "sha256-ViA62qtL5za7V3d5I8OA9q9JcFhsVAiL5jVHwEclWqk="
+      "revision": "a0374025a863d007d98e3297f6aa46cc3141c2f0",
+      "url": "https://github.com/NixOS/nixpkgs/archive/a0374025a863d007d98e3297f6aa46cc3141c2f0.tar.gz",
+      "hash": "sha256-9mUW6gNwoN2SWc/l0fW4svPNOulXLl8ijqKyeSOGgJE="
     },
     "nixpkgsUnstable": {
       "type": "Git",

@@ -172,9 +172,9 @@
       },
       "branch": "master",
       "submodules": false,
-      "revision": "e7c036921ff981ff19094e8cc01c985d8d3e4213",
-      "url": "https://github.com/NixOS/nixpkgs/archive/e7c036921ff981ff19094e8cc01c985d8d3e4213.tar.gz",
-      "hash": "sha256-I3E/0eEHfgelhJvUOmTec9oIZS1VPSoHQHUcbnhujUQ="
+      "revision": "049f45f5f8ee8b28047bbbccd313d580bc0cada8",
+      "url": "https://github.com/NixOS/nixpkgs/archive/049f45f5f8ee8b28047bbbccd313d580bc0cada8.tar.gz",
+      "hash": "sha256-ApTWk0Y8zNrC3DzDCConiSkqZtprQL6e0w6cYfpNlRE="
     },
     "oeffisearch": {
       "type": "Git",

@@ -210,9 +210,9 @@
       },
       "branch": "nixos-26.05",
       "submodules": false,
-      "revision": "6c11ff592ef0dce8f1cc2fd870a6d61bd9133afa",
-      "url": "https://gitlab.com/api/v4/projects/simple-nixos-mailserver%2Fnixos-mailserver/repository/archive.tar.gz?sha=6c11ff592ef0dce8f1cc2fd870a6d61bd9133afa",
-      "hash": "sha256-lUmq8sXQzihreq9UMqAkSBy9z9ueZbRnFyltzYVfQ2I="
+      "revision": "661ec59a97ccee13a63f79280b282eb6f7d3f817",
+      "url": "https://gitlab.com/api/v4/projects/simple-nixos-mailserver%2Fnixos-mailserver/repository/archive.tar.gz?sha=661ec59a97ccee13a63f79280b282eb6f7d3f817",
+      "hash": "sha256-rq6WOopxq3U2AGEWO80o9LIJDYcYIdgw6jyl+y+19w8="
     },
     "sopsNix": {
       "type": "Git",

@@ -223,9 +223,9 @@
       },
       "branch": "master",
       "submodules": false,
-      "revision": "c591bf665727040c6cc5cb409079acb22dcce33c",
-      "url": "https://github.com/Mic92/sops-nix/archive/c591bf665727040c6cc5cb409079acb22dcce33c.tar.gz",
-      "hash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8="
+      "revision": "9ed65852b6257fbeae4355bc24ecfea307ca759a",
+      "url": "https://github.com/Mic92/sops-nix/archive/9ed65852b6257fbeae4355bc24ecfea307ca759a.tar.gz",
+      "hash": "sha256-Gq8KNx5A7hBB3uGJaj6eQfLDIz5YdLu92gqBcvHvoUo="
     },
     "stagit": {
       "type": "Git",

@@ -264,5 +264,5 @@
       "hash": "sha256-81zdkclz9/h0df1bL81gFwWep1TFJSn+wYVSm6LFcoM="
     }
   },
-  "version": 7
+  "version": 8
 }