From 9e7a775e2578e126dddb1c6f7514874265e3d08e Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 28 Apr 2024 21:30:47 +0200 Subject: yeet the nix flakes this is, in the widest possible sense, a revert of e88fed18f499a3e8ac98c772bbb62f00d1f8d1d7, which was now a little over two years ago. Of course, lots of things have changed since then: - this uses npins instead of niv, which is both simpler and still maintained - i haven't brought back the old deploy lib; I still use deploy-rs (with some modifications) to deploy things - if you actually use my stuff downstream, you can now use packages/ & tests/ & modules/ as entry points directly, while still having some control over inputs - (since i also don't believe any downstream users actually exist, i've not bothered to have a shim flake.nix so your stuff probably just broke. well, it was an experimental feature, anyways) - in general there's a lot more of the old-fashioned structure back again, with default.nix files in subdirectories that form a structure, not like how almost everything was just imported in the one big flake.nix file For people who are interested in also having a non-flake config similar to this one, it's probably best to take a look at inputs.nix (and also at npins, of course) --- npins/default.nix | 64 +++++++++++++++ npins/sources.json | 234 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 298 insertions(+) create mode 100644 npins/default.nix create mode 100644 npins/sources.json (limited to 'npins') diff --git a/npins/default.nix b/npins/default.nix new file mode 100644 index 0000000..891db57 --- /dev/null +++ b/npins/default.nix @@ -0,0 +1,64 @@ +# Generated by npins. Do not modify; will be overwritten regularly +let + requireFile = { sha256, hashMode ? "recursive" }: + builtins.derivation { + name = "source"; + outputHashMode = hashMode; + outputHashAlgo = "sha256"; + outputHash = sha256; + preferLocalBuild = true; + allowSubstitutes = false; + builder = "builtins:fetchurl"; + system = "builtin"; # builtins.currentSystem; + }; + + 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, ... }: + 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 + cached = requireFile { sha256 = hash; }; + fetched = builtins.fetchGit { + url = repository.url; + rev = revision; + }; + in if builtins.pathExists (builtins.unsafeDiscardStringContext cached.outPath) + then cached.outPath + else builtins.trace "npins: re-fetching source ${repository.url}" fetched.outPath; + + 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 new file mode 100644 index 0000000..ee51261 --- /dev/null +++ b/npins/sources.json @@ -0,0 +1,234 @@ +{ + "pins": { + "almanac": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/forks/almanac" + }, + "branch": "master", + "revision": "cdd82b013777324f146c4961b866154a9287110b", + "url": null, + "hash": "0804k1zcnyhfdgjxmpgyg9l537j6p4ajrjgzz9svxka6acc1l85h" + }, + "bahnhof-name": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/bahnhof.name" + }, + "branch": "main", + "revision": "0c05c14574ed301c1f80ceeb5edabc34e47feffb", + "url": null, + "hash": "0vmvxypsxxlj2zxmssgpjfqmbs5lkc7vq1cfchc6pkszrywydg0g" + }, + "blog": { + "type": "Git", + "repository": { + "type": "Git", + "url": "ssh://cgit/~/blog" + }, + "branch": "main", + "revision": "58e380da3f6cc57bc8673067973d880c209c011c", + "url": null, + "hash": "129v5q9ayf63v616rjy88v07i2brl8s7hw6s2yxsxvknyrnykbj7" + }, + "deploy-rs": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/forks/deploy-rs" + }, + "branch": "nom-flag", + "revision": "9001480e03ab8c957716e2bf164bbde605472399", + "url": null, + "hash": "1iiplqa731ldha728xk2fi36n87p20hnzf35g21jli1dlknw388f" + }, + "flake-utils": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "numtide", + "repo": "flake-utils" + }, + "pre_releases": false, + "version_upper_bound": null, + "version": "v1.0.0", + "revision": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "url": "https://api.github.com/repos/numtide/flake-utils/tarball/v1.0.0", + "hash": "0hynd4rbkbplxzl2a8wb3r8z0h17z2alhhdsam78g3vgzpzg0d43" + }, + "gtfsBooks": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/forks/gtfs-books" + }, + "branch": "main", + "revision": "2a9d4fcf48b872aef1343f71dfddf44946fd8eb5", + "url": null, + "hash": "077xjxaisjqcnqwjpq8cfg34y27cv5aidvzwv4d5736rz9v96bak" + }, + "home-manager": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "home-manager" + }, + "branch": "release-23.11", + "revision": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", + "url": "https://github.com/nix-community/home-manager/archive/86853e31dc1b62c6eeed11c667e8cdd0285d4411.tar.gz", + "hash": "1hw53llinnqj61138bh0iwv31b73h9h6lvzrphq3prgxkg8anzay" + }, + "isabelle-utils": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/isabelle-utils" + }, + "branch": "master", + "revision": "e7427d5c67c0a90c369adecb4b0c65c043cb2e34", + "url": null, + "hash": "129pizyyvxg7lzgk9pqn48a7brhyh5fv7vwzrs7wnhkp30hrpjq2" + }, + "nixpkgs": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "NixOS", + "repo": "nixpkgs" + }, + "branch": "nixos-23.11", + "revision": "12430e43bd9b81a6b4e79e64f87c624ade701eaf", + "url": "https://github.com/NixOS/nixpkgs/archive/12430e43bd9b81a6b4e79e64f87c624ade701eaf.tar.gz", + "hash": "1ry06nhk8ayfb7wjmkacz8zqk0hwvp9phyachbkxsyxgc0hj3y6z" + }, + "nixpkgs-unstable": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "NixOS", + "repo": "nixpkgs" + }, + "branch": "nixpkgs-unstable", + "revision": "2b1f64b358f2cab62617f26b3870fd0ee375d848", + "url": "https://github.com/NixOS/nixpkgs/archive/2b1f64b358f2cab62617f26b3870fd0ee375d848.tar.gz", + "hash": "1iy5vigbw2dx7rhzmsszc7d87sw545f0vw4kcwxk3mazxg9qrzgl" + }, + "ntfy-matrix-bot": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/ntfy-matrix-bot" + }, + "branch": "main", + "revision": "c4bedb1756c96db3f7d01feedc6587f7b0c3dc0f", + "url": null, + "hash": "1kq34zk7k6rg9k8frvx51hl1ldqqbfgvhm9f827b5a4c0rx28dah" + }, + "playground": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/playground" + }, + "branch": "master", + "revision": "19144f12772063b1c6f00ad186dabbf53ea25985", + "url": null, + "hash": "1ss0n237f0dmw0akw2q0qp8nvnijcg35f9qgy3i27m4ib3gl4ybk" + }, + "rust-overlay": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "oxalica", + "repo": "rust-overlay" + }, + "branch": "master", + "revision": "44f8738f4b9805f7c60118c48f85da835839311a", + "url": "https://github.com/oxalica/rust-overlay/archive/44f8738f4b9805f7c60118c48f85da835839311a.tar.gz", + "hash": "10nm617bmlw9ialhhc9qix3fij6s5ggpwgcq8sldqqx99dhg9bxj" + }, + "showrt": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/showrt" + }, + "branch": "main", + "revision": "7de36af3c6ffcc25832a6ff2303ba6c4c1101de5", + "url": null, + "hash": "09shk9b3969gmbmh8mavgss6f90zb51rsfby5n1d924agxzl93d6" + }, + "simple-nixos-mailserver": { + "type": "Git", + "repository": { + "type": "GitLab", + "repo_path": "simple-nixos-mailserver/nixos-mailserver", + "server": "https://gitlab.com/" + }, + "branch": "nixos-23.11", + "revision": "e47f3719f1db3e0961a4358d4cb234a0acaa7baf", + "url": "https://gitlab.com/api/v4/projects/simple-nixos-mailserver%2Fnixos-mailserver/repository/archive.tar.gz?sha=e47f3719f1db3e0961a4358d4cb234a0acaa7baf", + "hash": "122vm4n3gkvlkqmlskiq749bhwfd0r71v6vcmg1bbyg4998brvx8" + }, + "sops-nix": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "Mic92", + "repo": "sops-nix" + }, + "branch": "master", + "revision": "f1b0adc27265274e3b0c9b872a8f476a098679bd", + "url": "https://github.com/Mic92/sops-nix/archive/f1b0adc27265274e3b0c9b872a8f476a098679bd.tar.gz", + "hash": "048rwfxmmrx5z5kika5d7lamdwg1jraighj42kampqvadh1sd0dq" + }, + "tracktrain": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/tracktrain" + }, + "branch": "main", + "revision": "d4f4208fe66d3813b65312dac0bf895c4cdc53d6", + "url": null, + "hash": "0wf5x8pcls7w08kwl24l70bjyp1dmqzbkab71dvmkazs4vxvanvm" + }, + "traveltext": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/traveltext" + }, + "branch": "main", + "revision": "b6080abc5661f9323593944f5701d7dd7597afb9", + "url": null, + "hash": "0rwfkkq46j7yjbkv3ylpsifzlhq7qlc2svzpbwjyqm65d53dyalm" + }, + "uplcg": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/forks/uplcg" + }, + "branch": "main", + "revision": "b61c0b191578d6ed39a6038cca7b436764a1f9f1", + "url": null, + "hash": "0675z5gvw0chx3hrr7bpiqxiwcykxhgw8qws17yazi071i8jgl29" + }, + "walint": { + "type": "Git", + "repository": { + "type": "Git", + "url": "https://stuebinm.eu/git/walint" + }, + "branch": "playground", + "revision": "6b71528e72458bcb5e0a0089033b9367c887967f", + "url": null, + "hash": "1lx92iw228x3m35nk11zp3v1jc03rd8yqcymxidk09s8lrrsyynz" + } + }, + "version": 3 +} \ No newline at end of file -- cgit v1.2.3