2022-12-02 06:01:36 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
2022-12-12 21:53:10 +00:00
|
|
|
my-flake.url = "github:Jaculabilis/my-flake";
|
2022-12-10 20:48:00 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs?ref=refs/tags/22.11";
|
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-12-02 06:01:36 +00:00
|
|
|
};
|
|
|
|
|
2022-12-12 21:53:10 +00:00
|
|
|
outputs = { self, my-flake, nixpkgs, flake-compat }:
|
2022-12-10 20:48:00 +00:00
|
|
|
let
|
2022-12-12 21:53:10 +00:00
|
|
|
systems = [ "aarch64-linux" "x86_64-linux" ];
|
|
|
|
each = system:
|
|
|
|
let
|
2022-12-28 20:23:25 +00:00
|
|
|
pkgs = (import nixpkgs {
|
2022-12-12 21:53:10 +00:00
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlays.default ];
|
2022-12-28 20:23:25 +00:00
|
|
|
});
|
|
|
|
in {
|
2022-12-28 20:24:15 +00:00
|
|
|
packages.${system} = {
|
|
|
|
default = self.packages.${system}.inquisitor;
|
|
|
|
inquisitor = pkgs.inquisitor;
|
|
|
|
env = pkgs.inquisitor.dependencyEnv;
|
|
|
|
};
|
2022-12-12 21:53:10 +00:00
|
|
|
|
2022-12-28 20:25:20 +00:00
|
|
|
devShells.${system} = {
|
|
|
|
default = self.devShells.${system}.inquisitor;
|
|
|
|
inquisitor = pkgs.mkShell {
|
|
|
|
buildInputs = [ (pkgs.python3.withPackages (p: [p.poetry])) ];
|
|
|
|
shellHook = ''
|
|
|
|
PS1="(inquisitor) $PS1"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
sources = pkgs.mkShell {
|
|
|
|
buildInputs = [ self.packages.${system}.env ];
|
|
|
|
shellHook = ''
|
|
|
|
PS1="(sources) $PS1"
|
|
|
|
'';
|
|
|
|
};
|
2022-12-12 21:53:10 +00:00
|
|
|
};
|
2022-12-28 23:43:15 +00:00
|
|
|
|
|
|
|
checks.${system}.test-module = let
|
|
|
|
test-lib = import "${nixpkgs}/nixos/lib/testing-python.nix" {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
test-lib.makeTest {
|
|
|
|
name = "inquisitor-test-module";
|
|
|
|
nodes = {
|
|
|
|
host = { ... }: {
|
|
|
|
imports = [ self.nixosModules.default ];
|
|
|
|
services.inquisitor.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
testScript = ''
|
|
|
|
start_all()
|
|
|
|
host.wait_for_unit("multi-user.target")
|
|
|
|
# Check that the setup script ran
|
|
|
|
host.succeed("[ -e /var/lib/inquisitor ]")
|
|
|
|
# Check that the service came up
|
|
|
|
host.succeed("systemctl is-enabled inquisitor")
|
|
|
|
host.succeed("systemctl is-active inquisitor")
|
|
|
|
'';
|
|
|
|
};
|
2022-12-12 21:53:10 +00:00
|
|
|
};
|
2022-12-28 20:25:20 +00:00
|
|
|
in (my-flake.outputs-for each systems) // {
|
2022-12-12 21:53:10 +00:00
|
|
|
overlays.default = final: prev: {
|
2022-12-28 20:24:15 +00:00
|
|
|
inquisitor = final.poetry2nix.mkPoetryApplication {
|
2022-12-10 20:48:00 +00:00
|
|
|
projectDir = ./.;
|
2022-12-28 20:24:15 +00:00
|
|
|
};
|
2022-12-10 20:48:00 +00:00
|
|
|
};
|
2022-12-14 04:03:28 +00:00
|
|
|
nixosModules.default = import ./module.nix self;
|
2022-12-02 06:01:36 +00:00
|
|
|
};
|
|
|
|
}
|