Remove prefetch-npm-deps override #18

Closed
k900 wants to merge 45 commits from k900/nixos-module:prefetch-npm-fix into main
4 changed files with 84 additions and 2 deletions
Showing only changes of commit 9babd8172a - Show all commits

View file

@ -23,8 +23,10 @@
in
{
inherit pkgs;
packages.default = pkgs.nixVersions.nix_2_18;
packages.nix-doc = pkgs.nix-doc;
packages = {
default = pkgs.nixVersions.nix_2_18;
inherit (pkgs) nix-doc nix-eval-jobs;
};
packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; };
});

47
npins/default.nix Normal file
View file

@ -0,0 +1,47 @@
# 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, ... }:
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"; builtins.fetchGit {
url = repository.url;
rev = revision;
# 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`"

16
npins/sources.json Normal file
View file

@ -0,0 +1,16 @@
{
"pins": {
"nix-eval-jobs": {
"type": "Git",
"repository": {
"type": "Git",
"url": "git+ssh://git@git.lix.systems/lheckemann/nix-eval-jobs"
},
"branch": "main",
"revision": "c3d8ca19b39f4cc5a2df1061baf649d1fe20517e",
"url": null,
"hash": "1bww5ymy9klysm5z5hi1i8604b4dfrkrvikhslwv0vkrbwvfk5p0"
}
},
"version": 3
}

View file

@ -19,6 +19,11 @@ let
lix-doc = final.callPackage (lix + "/lix-doc/package.nix") { };
in
{
# used for things that one wouldn't necessarily want to update, but we
# nevertheless shove it in the overlay and fixed-point it in case one *does*
# want to do that.
lix-sources = import ./npins;
nixVersions = prev.nixVersions // rec {
# FIXME: do something less scuffed
nix_2_18 = (prev.nixVersions.nix_2_18.override { boehmgc = boehmgc-patched; }).overrideAttrs (old: {
@ -47,6 +52,18 @@ in
nix_2_18_upstream = prev.nixVersions.nix_2_18;
};
nix-eval-jobs = (prev.nix-eval-jobs.override {
# lix
nix = final.nixVersions.nix_2_18;
}).overrideAttrs (old: {
# FIXME: should this be patches instead?
src = final.lix-sources.nix-eval-jobs;
mesonBuildType = "debugoptimized";
ninjaFlags = old.ninjaFlags or [ ] ++ [ "-v" ];
});
# force these onto upstream so we are not regularly rebuilding electron
prefetch-yarn-deps = prev.prefetch-yarn-deps.override {
nix = final.nixVersions.nix_2_18_upstream;