2024-03-07 19:27:15 +00:00
|
|
|
{
|
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2024-03-07 19:31:59 +00:00
|
|
|
inputs.lix = {
|
2024-06-19 06:32:31 +00:00
|
|
|
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
2024-03-07 19:31:59 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
2024-03-07 19:27:15 +00:00
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
2024-03-25 00:17:53 +00:00
|
|
|
inputs.flakey-profile.url = "github:lf-/flakey-profile";
|
2024-03-07 19:27:15 +00:00
|
|
|
|
2024-03-25 20:44:56 +00:00
|
|
|
outputs = inputs@{ self, nixpkgs, lix, flake-utils, flakey-profile, ... }:
|
2024-08-13 00:57:09 +00:00
|
|
|
let
|
|
|
|
lixVersionJson = builtins.fromJSON (builtins.readFile (lix + "/version.json"));
|
|
|
|
versionSuffix = nixpkgs.lib.optionalString (!lixVersionJson.official_release)
|
|
|
|
"-pre${builtins.substring 0 8 lix.lastModifiedDate}-${lix.shortRev or lix.dirtyShortRev}";
|
|
|
|
in
|
|
|
|
{
|
2024-03-25 20:44:56 +00:00
|
|
|
inherit inputs;
|
2024-07-30 22:11:02 +00:00
|
|
|
nixosModules = {
|
|
|
|
# Use a locally built Lix
|
|
|
|
default = import ./module.nix { inherit lix versionSuffix; };
|
|
|
|
|
|
|
|
# Use Lix from nixpkgs
|
|
|
|
lixFromNixpkgs = import ./module.nix { lix = null; };
|
|
|
|
};
|
|
|
|
|
|
|
|
overlays = {
|
|
|
|
# Use a locally built Lix
|
|
|
|
default = import ./overlay.nix { inherit lix versionSuffix; };
|
|
|
|
|
|
|
|
# Use Lix from nixpkgs
|
|
|
|
lixFromNixpkgs = import ./overlay.nix { lix = null; };
|
|
|
|
};
|
2024-03-25 20:44:56 +00:00
|
|
|
} // flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlays.default ];
|
|
|
|
};
|
2024-05-04 00:18:19 +00:00
|
|
|
|
|
|
|
linux64BitSystems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
|
|
|
|
inherit (pkgs) lib;
|
2024-03-25 20:44:56 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit pkgs;
|
2024-04-16 03:06:52 +00:00
|
|
|
packages = {
|
|
|
|
default = pkgs.nixVersions.nix_2_18;
|
|
|
|
inherit (pkgs) nix-doc nix-eval-jobs;
|
|
|
|
};
|
2024-03-25 00:14:18 +00:00
|
|
|
|
2024-03-25 20:44:56 +00:00
|
|
|
packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; };
|
2024-05-04 00:13:57 +00:00
|
|
|
|
2024-07-30 21:38:08 +00:00
|
|
|
nixosTests = pkgs.recurseIntoAttrs (pkgs.callPackage ./test-nixos.nix { inherit pkgs; lix-module = self.nixosModules.default; });
|
2024-05-04 00:13:57 +00:00
|
|
|
|
|
|
|
checks = {
|
|
|
|
inherit (self.packages.${system}) default nix-eval-jobs;
|
2024-05-04 00:18:19 +00:00
|
|
|
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
2024-07-30 21:38:08 +00:00
|
|
|
# wrongMajor intentionally not included here since it is expected to fail
|
2024-05-04 00:18:19 +00:00
|
|
|
inherit (self.nixosTests.${system}) it-builds;
|
2024-05-04 00:13:57 +00:00
|
|
|
};
|
2024-03-25 20:44:56 +00:00
|
|
|
});
|
2024-03-07 19:27:15 +00:00
|
|
|
}
|