Fix NixOS system building and add a flake check that it works

Problem caused by: https://gerrit.lix.systems/c/lix/+/993

But this is actually nixpkgs doing extremely silly feature detection of
Nix based on version which it should /absolutely not be doing/.
This commit is contained in:
jade 2024-05-03 17:13:57 -07:00
parent a792d328c4
commit f879988840
4 changed files with 36 additions and 12 deletions

View file

@ -36,11 +36,11 @@
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1714353561, "lastModified": 1714774053,
"narHash": "sha256-1OKjSB5kPw0Tnm/h4j1IZe6TfdX04QNbm1kn0q58Rls=", "narHash": "sha256-RaiwQCGFhC1WtieS2N3FotIlKSowq+R6ETyY6nZnPh8=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "c0733f3cec9e5edd7fa3a4bf156b6ee065762fea", "rev": "549d609a7bce2b4ac28808a76a72d7f3743b9c76",
"revCount": 15448, "revCount": 15471,
"type": "git", "type": "git",
"url": "ssh://git@git.lix.systems/lix-project/lix.git" "url": "ssh://git@git.lix.systems/lix-project/lix.git"
}, },
@ -51,11 +51,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1714253743, "lastModified": 1714635257,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "narHash": "sha256-4cPymbty65RvF1DWQfc+Bc8B233A1BWxJnNULJKQ1EY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "rev": "63c3a29ca82437c87573e4c6919b09a24ea61b0f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -28,5 +28,12 @@
}; };
packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; }; packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; };
nixosTests = pkgs.recurseIntoAttrs (pkgs.callPackage ./test-nixos.nix { lix-module = self.nixosModules.default; });
checks = {
inherit (self.nixosTests.${system}) it-builds;
inherit (self.packages.${system}) default nix-eval-jobs;
};
}); });
} }

View file

@ -15,15 +15,15 @@ let
}) })
); );
# This is kind of scary to not override the nix version to pretend to be
# 2.18 since nixpkgs can introduce new breakage in its Nix unstable CLI
# usage.
# https://github.com/nixos/nixpkgs/blob/6afb255d976f85f3359e4929abd6f5149c323a02/nixos/modules/config/nix.nix#L121
lixPkg = (final.callPackage (lix + "/package.nix") { lixPkg = (final.callPackage (lix + "/package.nix") {
build-release-notes = false; build-release-notes = false;
versionSuffix = "-lix${versionSuffix}"; versionSuffix = "-lix${versionSuffix}";
boehmgc-nix = boehmgc-patched; 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}";
};
inherit (prev) lib; inherit (prev) lib;
in in

17
test-nixos.nix Normal file
View file

@ -0,0 +1,17 @@
{ nixos, lix-module }:
let
configs = {
it-builds = nixos ({ ... }: {
documentation.enable = false;
fileSystems."/".device = "ignore-root-device";
boot.loader.grub.enable = false;
system.stateVersion = "24.05";
});
};
in
{
inherit configs;
it-builds = configs.it-builds.config.system.build.toplevel;
}