-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (57 loc) · 1.82 KB
/
flake.nix
File metadata and controls
70 lines (57 loc) · 1.82 KB
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
{
description = "A simple Go package";
# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
outputs = inputs@{ self, nixpkgs, flake-parts, hercules-ci-effects }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
version = builtins.substring 0 8 lastModifiedDate;
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
hercules-ci-effects.flakeModule
];
systems = supportedSystems;
herculesCI.ciSystems = [ "x86_64-linux" ];
flake = {
overlays = {
default = final: prev: {
pingshutdown = prev.callPackage ./package.nix { inherit version; };
};
};
nixosModules = {
pingshutdown = {
imports = [
./module.nix
];
nixpkgs.overlays = [
self.overlays.default
];
};
};
};
perSystem = { pkgs, ... }: {
packages = rec {
pingshutdown = pkgs.callPackage ./package.nix { inherit version; };
default = pingshutdown;
};
devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [ go gopls gotools go-tools ];
PINGSHUTDOWN_DELAY = "15s";
PINGSHUTDOWN_TARGET = "192.0.2.100";
PINGSHUTDOWN_NOTIFICATION = "true";
PINGSHUTDOWN_DRYRUN = "true";
shellHook = ''
if [ -f ".env" ]; then
source .env
fi
'';
};
};
};
};
}