-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
44 lines (44 loc) · 1.33 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
{
description = "nixos-router";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
git-hooks.url = "github:cachix/git-hooks.nix";
};
outputs =
inputs:
let
forAllSystems =
f:
inputs.nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
] (system: f (import inputs.nixpkgs { inherit system; }));
in
{
checks = forAllSystems (pkgs: {
default = pkgs.callPackage ./test.nix { module = inputs.self.nixosModules.default; };
lib = pkgs.callPackage ./lib-tests.nix { };
});
nixosModules.default = ./module.nix;
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
(writeShellScriptBin "get-bogon-networks" ''
${curl}/bin/curl --silent https://ipgeolocation.io/resources/bogon.html |
${htmlq}/bin/htmlq "td:first-child" --text
'')
];
inherit
(inputs.git-hooks.lib.${pkgs.stdenv.hostPlatform.system}.run {
src = ./.;
hooks.deadnix.enable = true;
hooks.nixfmt-rfc-style.enable = true;
})
shellHook
;
};
});
};
}