tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/homepage-dashboard: init
Jon Seager
2 years ago
3de6be09
b1cf2cb3
+56
2 changed files
expand all
collapse all
unified
split
nixos
modules
module-list.nix
services
misc
homepage-dashboard.nix
+1
nixos/modules/module-list.nix
···
646
646
./services/misc/greenclip.nix
647
647
./services/misc/headphones.nix
648
648
./services/misc/heisenbridge.nix
649
649
+
./services/misc/homepage-dashboard.nix
649
650
./services/misc/ihaskell.nix
650
651
./services/misc/input-remapper.nix
651
652
./services/misc/irkerd.nix
+55
nixos/modules/services/misc/homepage-dashboard.nix
···
1
1
+
{ config
2
2
+
, pkgs
3
3
+
, lib
4
4
+
, ...
5
5
+
}:
6
6
+
7
7
+
let
8
8
+
cfg = config.services.homepage-dashboard;
9
9
+
in
10
10
+
{
11
11
+
options = {
12
12
+
services.homepage-dashboard = {
13
13
+
enable = lib.mkEnableOption (lib.mdDoc "Homepage Dashboard");
14
14
+
15
15
+
package = lib.mkPackageOptionMD pkgs "homepage-dashboard" { };
16
16
+
17
17
+
openFirewall = lib.mkOption {
18
18
+
type = lib.types.bool;
19
19
+
default = false;
20
20
+
description = lib.mdDoc "Open ports in the firewall for Homepage.";
21
21
+
};
22
22
+
23
23
+
listenPort = lib.mkOption {
24
24
+
type = lib.types.int;
25
25
+
default = 8082;
26
26
+
description = lib.mdDoc "Port for Homepage to bind to.";
27
27
+
};
28
28
+
};
29
29
+
};
30
30
+
31
31
+
config = lib.mkIf cfg.enable {
32
32
+
systemd.services.homepage-dashboard = {
33
33
+
description = "Homepage Dashboard";
34
34
+
after = [ "network.target" ];
35
35
+
wantedBy = [ "multi-user.target" ];
36
36
+
37
37
+
environment = {
38
38
+
HOMEPAGE_CONFIG_DIR = "/var/lib/homepage-dashboard";
39
39
+
PORT = "${toString cfg.listenPort}";
40
40
+
};
41
41
+
42
42
+
serviceConfig = {
43
43
+
Type = "simple";
44
44
+
DynamicUser = true;
45
45
+
StateDirectory = "homepage-dashboard";
46
46
+
ExecStart = "${lib.getExe cfg.package}";
47
47
+
Restart = "on-failure";
48
48
+
};
49
49
+
};
50
50
+
51
51
+
networking.firewall = lib.mkIf cfg.openFirewall {
52
52
+
allowedTCPPorts = [ cfg.listenPort ];
53
53
+
};
54
54
+
};
55
55
+
}