-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathflake.nix
89 lines (81 loc) · 2.22 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
description = "Manage system config using nix on any distro";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
systems = [
"aarch64-linux"
"x86_64-linux"
];
eachSystem =
f:
nixpkgs.lib.genAttrs systems (
system:
f {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
}
);
nix-vm-test-lib =
let
rev = "f01e096295c8ace5f367985e323e3263eb7f9434";
sha256 = "sha256:11gqxnhdrpb025wybbb0wmpy2xzjaa6ncs55zbw8i2nzchkzrfvh";
in
"${
builtins.fetchTarball {
url = "https://github.com/numtide/nix-vm-test/archive/${rev}.tar.gz";
inherit sha256;
}
}/lib.nix";
in
{
lib = import ./nix/lib.nix { inherit nixpkgs; };
packages = eachSystem (
{ pkgs, system }:
import ./packages.nix { inherit pkgs; }
// {
default = self.packages.${system}.system-manager;
}
);
overlays = {
packages = final: _prev: import ./packages.nix { pkgs = final; };
default = self.overlays.packages;
};
# Only useful for quick tests
systemConfigs.default = self.lib.makeSystemConfig {
modules = [ ./examples/example.nix ];
};
formatter = eachSystem ({ pkgs, ... }: pkgs.treefmt);
devShells = eachSystem (
{ pkgs, ... }:
{
default = import ./shell.nix { inherit pkgs; };
}
);
checks = (
nixpkgs.lib.recursiveUpdate
(eachSystem (
{ system, ... }:
{
system-manager = self.packages.${system}.system-manager;
}
))
{
x86_64-linux =
let
system = "x86_64-linux";
in
(import ./test/nix/modules {
inherit system;
inherit (nixpkgs) lib;
nix-vm-test = import nix-vm-test-lib {
inherit nixpkgs;
inherit system;
};
system-manager = self;
});
}
);
};
}