forked from space-wizards/SS14.Watchdog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
67 lines (59 loc) · 2.16 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
{
description =
"Flake providing a package and NixOS module for the Space Station 14 Watchdog.";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.05";
outputs = { self, nixpkgs }:
let
nixos-lib = import (nixpkgs + "/nixos/lib") { };
forAllSystems = function:
nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]
(system: function (import nixpkgs { inherit system; }));
in
{
packages = forAllSystems (pkgs: {
default = self.packages.${pkgs.system}.space-station-14-watchdog;
space-station-14-watchdog =
pkgs.callPackage ./nix/package.nix { flake = self; };
vm-test = nixos-lib.runTest {
name = "space-station-14-watchdog";
imports = [ ./nix/test.nix ];
hostPkgs = pkgs;
extraBaseModules = { imports = [ self.nixosModules.space-station-14-watchdog ]; };
};
});
overlays = {
default = self.overlays.space-station-14-watchdog;
space-station-14-watchdog = final: prev: {
space-station-14-watchdog =
self.packages.${prev.system}.space-station-14-watchdog;
};
};
apps = forAllSystems (pkgs: {
default = self.apps.${pkgs.system}.space-station-14-watchdog;
space-station-14-watchdog = {
type = "app";
program = "${
self.packages.${pkgs.system}.space-station-14-watchdog
}/bin/SS14.Watchdog";
};
fetch-deps = {
type = "app";
program = toString
self.packages.${pkgs.system}.space-station-14-watchdog.passthru.fetch-deps;
};
vm-test = {
type = "app";
program = "${self.packages.${pkgs.system}.vm-test.driver}/bin/nixos-test-driver";
};
vm-test-interactive = {
type = "app";
program = "${self.packages.${pkgs.system}.vm-test.driverInteractive}/bin/nixos-test-driver";
};
});
nixosModules = {
default = self.nixosModules.space-station-14-watchdog;
space-station-14-watchdog = import ./nix/module.nix self;
};
formatter = forAllSystems (pkgs: pkgs.nixpkgs-fmt);
};
}