-
Notifications
You must be signed in to change notification settings - Fork 9
/
flake.nix
56 lines (50 loc) · 1.69 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
nix-std.url = "github:chessai/nix-std";
};
outputs = inputs@{ flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
flake = {
nixosModules = {
vfio = {
imports = [
(import ./modules/kvmfr { std = inputs.nix-std.lib; })
./modules/libvirtd
./modules/vfio
./modules/virtualisation
];
};
default = self.nixosModules.vfio;
};
};
perSystem = { system, pkgs, self', lib, ... }: let
mkModuleDoc = (pkgs.callPackage (import ./lib/mkModuleDoc.nix) {});
testParams = { inherit pkgs; imports = [ self.nixosModules.vfio ]; };
in {
checks = {
kvmfr = import ./tests/kvmfr testParams;
libvirtd = import ./tests/libvirtd testParams;
libvirtd-domain = import ./tests/libvirtd/domain.nix testParams;
libvirtd-network = import ./tests/libvirtd/network.nix testParams;
virtualisation = import ./tests/virtualisation testParams;
docs = self'.packages.docbook;
};
packages = rec {
options-doc = mkModuleDoc "vfio" self.nixosModules.vfio;
docbook = pkgs.callPackage ./docs/docbook.nix {
moduleDoc = options-doc;
};
};
formatter = inputs.nixpkgs.legacyPackages.${system}.nixfmt;
devShells.default = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
mdbook
nixfmt
];
};
};
};
}