forked from lix-project/nixos-module
Merge pull request 'nix-eval-jobs: use lix' (#15) from jade/nix-eval-jobs-lix into main
Reviewed-on: lix-project/nixos-module#15
This commit is contained in:
commit
262c2b479d
|
@ -23,8 +23,10 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
packages.default = pkgs.nixVersions.nix_2_18;
|
packages = {
|
||||||
packages.nix-doc = pkgs.nix-doc;
|
default = pkgs.nixVersions.nix_2_18;
|
||||||
|
inherit (pkgs) nix-doc nix-eval-jobs;
|
||||||
|
};
|
||||||
|
|
||||||
packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; };
|
packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; };
|
||||||
});
|
});
|
||||||
|
|
47
npins/default.nix
Normal file
47
npins/default.nix
Normal 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
16
npins/sources.json
Normal 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
|
||||||
|
}
|
17
overlay.nix
17
overlay.nix
|
@ -19,6 +19,11 @@ let
|
||||||
lix-doc = final.callPackage (lix + "/lix-doc/package.nix") { };
|
lix-doc = final.callPackage (lix + "/lix-doc/package.nix") { };
|
||||||
in
|
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 {
|
nixVersions = prev.nixVersions // rec {
|
||||||
# FIXME: do something less scuffed
|
# FIXME: do something less scuffed
|
||||||
nix_2_18 = (prev.nixVersions.nix_2_18.override { boehmgc = boehmgc-patched; }).overrideAttrs (old: {
|
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_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
|
# force these onto upstream so we are not regularly rebuilding electron
|
||||||
prefetch-yarn-deps = prev.prefetch-yarn-deps.override {
|
prefetch-yarn-deps = prev.prefetch-yarn-deps.override {
|
||||||
nix = final.nixVersions.nix_2_18_upstream;
|
nix = final.nixVersions.nix_2_18_upstream;
|
||||||
|
|
Loading…
Reference in a new issue