about summary refs log tree commit diff stats
path: root/npins
diff options
context:
space:
mode:
authorAlan Pearce2024-11-16 13:11:06 +0100
committerAlan Pearce2024-11-16 13:11:06 +0100
commit72018b5585e945aa51a3a557a641cce17cabaf26 (patch)
tree5dfaa8c99fba0cb233192097273931d7d148f7d7 /npins
parentcd04ffd199e989f233797d18013fe35380b0376d (diff)
downloadwebsite-72018b5585e945aa51a3a557a641cce17cabaf26.tar.lz
website-72018b5585e945aa51a3a557a641cce17cabaf26.tar.zst
website-72018b5585e945aa51a3a557a641cce17cabaf26.zip
Switch back to flakes
Diffstat (limited to 'npins')
-rw-r--r--npins/default.nix80
-rw-r--r--npins/sources.json29
2 files changed, 0 insertions, 109 deletions
diff --git a/npins/default.nix b/npins/default.nix
deleted file mode 100644
index 5e7d086..0000000
--- a/npins/default.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-# Generated by npins. Do not modify; will be overwritten regularly
-let
-  data = builtins.fromJSON (builtins.readFile ./sources.json);
-  version = data.version;
-
-  mkSource =
-    spec:
-    assert spec ? type;
-    let
-      path =
-        if spec.type == "Git" then
-          mkGitSource spec
-        else if spec.type == "GitRelease" then
-          mkGitSource spec
-        else if spec.type == "PyPi" then
-          mkPyPiSource spec
-        else if spec.type == "Channel" then
-          mkChannelSource spec
-        else
-          builtins.throw "Unknown source type ${spec.type}";
-    in
-    spec // { outPath = path; };
-
-  mkGitSource =
-    {
-      repository,
-      revision,
-      url ? null,
-      hash,
-      branch ? null,
-      ...
-    }:
-    assert repository ? type;
-    # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
-    # In the latter case, there we will always be an url to the tarball
-    if url != null then
-      (builtins.fetchTarball {
-        inherit url;
-        sha256 = hash; # FIXME: check nix version & use SRI hashes
-      })
-    else
-      assert repository.type == "Git";
-      let
-        urlToName =
-          url: rev:
-          let
-            matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url;
-
-            short = builtins.substring 0 7 rev;
-
-            appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else "";
-          in
-          "${if matched == null then "source" else builtins.head matched}${appendShort}";
-        name = urlToName repository.url revision;
-      in
-      builtins.fetchGit {
-        url = repository.url;
-        rev = revision;
-        inherit name;
-        # hash = hash;
-      };
-
-  mkPyPiSource =
-    { url, hash, ... }:
-    builtins.fetchurl {
-      inherit url;
-      sha256 = hash;
-    };
-
-  mkChannelSource =
-    { url, hash, ... }:
-    builtins.fetchTarball {
-      inherit url;
-      sha256 = hash;
-    };
-in
-if version == 3 then
-  builtins.mapAttrs (_: mkSource) 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
deleted file mode 100644
index 7c490a4..0000000
--- a/npins/sources.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "pins": {
-    "nixpkgs": {
-      "type": "Git",
-      "repository": {
-        "type": "GitHub",
-        "owner": "NixOS",
-        "repo": "nixpkgs"
-      },
-      "branch": "nixpkgs-unstable",
-      "revision": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a",
-      "url": "https://github.com/NixOS/nixpkgs/archive/dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a.tar.gz",
-      "hash": "0rp3nkvfwzbsn2rmc8kw0yh1gn0sfw03kzr3ks4smgpal813w67m"
-    },
-    "pre-commit-hooks": {
-      "type": "Git",
-      "repository": {
-        "type": "GitHub",
-        "owner": "cachix",
-        "repo": "pre-commit-hooks.nix"
-      },
-      "branch": "master",
-      "revision": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
-      "url": "https://github.com/cachix/pre-commit-hooks.nix/archive/3c3e88f0f544d6bb54329832616af7eb971b6be6.tar.gz",
-      "hash": "04pwjz423iq2nkazkys905gvsm5j39722ngavrnx42b8msr5k555"
-    }
-  },
-  "version": 3
-}
\ No newline at end of file