-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdefault.nix
More file actions
50 lines (44 loc) · 1.31 KB
/
default.nix
File metadata and controls
50 lines (44 loc) · 1.31 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
{ config, lib, pkgs, ... }:
let
cfg = config.services.screendbtui;
meta = {
options = {
enable = lib.options.mkEnableOption "Enable the Rust application service";
settings = lib.options.mkOption {
type = lib.types.submodule {
options = {
# port = lib.options.mkOption {
# type = lib.types.int;
# default = 8080;
# description = "Port number to listen on";
# };
# debug-mode = lib.options.mkOption {
# type = lib.types.bool;
# default = false;
# description = "Enable debug mode";
# };
};
};
default = {};
description = "Application settings";
};
};
};
in {
options.services.screendbtui = meta.options;
config = lib.mkIf cfg.enable {
systemd.services.screendbtui = {
description = "Make Screen DB TUI available";
after = [ "network.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.rust}/bin/cargo run --release";
Environment = lib.optionalString cfg.settings.debug-mode "RUST_LOG=debug";
DynamicUser = true;
ProtectSystem = "strict";
ProtectHome = true;
PrivateTmp = true;
};
};
};
}