Compare commits

...

11 commits

5 changed files with 98 additions and 33 deletions

View file

@ -51,11 +51,11 @@
"lix": {
"flake": false,
"locked": {
"lastModified": 1712180067,
"narHash": "sha256-XU32CuKt0wXB8Ws5P3pZFMlYIMVx9om1GycYpITAwZ0=",
"lastModified": 1713222580,
"narHash": "sha256-wWUZtNf1mSaO8B9mYWSR0AoYVQhryTZIW+b1yIYkAcs=",
"ref": "refs/heads/main",
"rev": "89c31953c58d8089c85ae7ab43a5c59bb0f9f69b",
"revCount": 15311,
"rev": "866c76c7f93442993eb84b4268811bc101b4d447",
"revCount": 15403,
"type": "git",
"url": "ssh://git@git.lix.systems/lix-project/lix.git"
},

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/lix-project/nix-eval-jobs"
},
"branch": "main",
"revision": "793841a9b7b689e37c9a7902710aab2bd6a833d5",
"url": null,
"hash": "1pkb7glscd6dkfjf7x1cj51l21k09wjw5mzm32j37yrln5f20il5"
}
},
"version": 3
}

View file

@ -15,45 +15,45 @@ let
})
);
# Internal nix-doc used by Lix.
lix-doc = final.callPackage (lix + "/nix-doc/package.nix") { };
lixPkg = (final.callPackage (lix + "/package.nix") {
build-release-notes = false;
versionSuffix = "-lix${versionSuffix}";
boehmgc-nix = boehmgc-patched;
}).overrideAttrs {
# Note: load-bearing version override. Nixpkgs does version detection to determine
# what commands and whatnot we support, so tell Nixpkgs that we're 2.18 (ish).
version = "2.18.3-lix${versionSuffix}";
};
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: {
src = lix;
# FIXME: fake version so that nixpkgs will not try to use nix config >_>
version = "2.18.3-lix${versionSuffix}";
VERSION_SUFFIX = "-lix${versionSuffix}";
# We only include CMake so that Meson can locate toml11, which only ships CMake dependency metadata.
dontUseCmakeConfigure = true;
patches = [ ];
buildInputs = old.buildInputs or [ ] ++ [
final.toml11
lix-doc
];
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [
final.buildPackages.cmake
# FIXME: we don't know why this was not being picked up properly when
# included in nativeCheckInputs.
final.buildPackages.git
final.buildPackages.python3
];
});
nix_2_18 = lixPkg;
stable = 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
prefetch-yarn-deps = prev.prefetch-yarn-deps.override {
nix = final.nixVersions.nix_2_18_upstream;
};
prefetch-npm-deps = prev.prefetch-npm-deps.override {
nix = final.nixVersions.nix_2_18_upstream;
};
nix-prefetch-git = prev.nix-prefetch-git.override {
nix = final.nixVersions.nix_2_18_upstream;
};