chore(lib): remove lib from labs

This commit is contained in:
Jake Hamilton 2025-03-30 04:24:37 -07:00
parent c30f94972c
commit 5bec48ef8a
Signed by: jakehamilton
GPG key ID: 9762169A1B35EA68
59 changed files with 208 additions and 8096 deletions

View file

@ -1,8 +1,10 @@
{
lib ? import ./../lib,
foundation ? import ./../foundation { system = "i686-linux"; },
}:
let
pins = import ./npins;
lib = import pins.lib;
modules = import ./src/modules.nix;
result = lib.modules.run {

34
tidepool/flake.lock generated
View file

@ -1,18 +1,12 @@
{
"nodes": {
"foundation": {
"inputs": {
"lib": [
"lib"
]
},
"locked": {
"dir": "foundation",
"lastModified": 1724190751,
"narHash": "sha256-e8sOmeXS9YWuQqjW6gvtS3PIueazkf4S1iiJ/94eXv4=",
"ref": "master",
"rev": "4b36a5a0133f5481840bdfaf693c971215a7ef1f",
"revCount": 84,
"dirtyRev": "c30f94972c84c5c758b705e4363f624e75560916-dirty",
"dirtyShortRev": "c30f949-dirty",
"lastModified": 1742785479,
"narHash": "sha256-jYjvytd4Ut1z3izUuGCfq2KKjHLgWYvhMtPtyRh4FR8=",
"type": "git",
"url": "file:../"
},
@ -22,27 +16,9 @@
"url": "file:../"
}
},
"lib": {
"locked": {
"dir": "lib",
"lastModified": 1724190751,
"narHash": "sha256-e8sOmeXS9YWuQqjW6gvtS3PIueazkf4S1iiJ/94eXv4=",
"ref": "master",
"rev": "4b36a5a0133f5481840bdfaf693c971215a7ef1f",
"revCount": 84,
"type": "git",
"url": "file:../"
},
"original": {
"dir": "lib",
"type": "git",
"url": "file:../"
}
},
"root": {
"inputs": {
"foundation": "foundation",
"lib": "lib"
"foundation": "foundation"
}
}
},

View file

@ -1,11 +1,7 @@
{
inputs = {
lib = {
url = "git+file:../?dir=lib";
};
foundation = {
url = "git+file:../?dir=foundation";
inputs.lib.follows = "lib";
};
};
@ -13,7 +9,6 @@
inputs:
let
exports = import ./default.nix {
lib = inputs.lib.lib;
foundation = inputs.foundation.packages.i686-linux;
};
in

View file

@ -0,0 +1,80 @@
# 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`"

View file

@ -0,0 +1,16 @@
{
"pins": {
"lib": {
"type": "Git",
"repository": {
"type": "Git",
"url": "git+ssh://forgejo@git.auxolotl.org/auxolotl/lib.git"
},
"branch": "main",
"revision": "7552ab48bb394d59d2bf1f7a558d28ce59da524d",
"url": null,
"hash": "0705fm00k9f95b6idf5qnfvqm4qf1a0cv966ghgd48kd1qy4il5c"
}
},
"version": 3
}