Commit 5925d70e authored by Samuel Laurén's avatar Samuel Laurén
Browse files

glances server

parent 60456c7c
......@@ -3,6 +3,7 @@
{
imports = [
./services/coffeecam.nix
./services/glances.nix
];
nix = {
......@@ -79,5 +80,10 @@
uploadAddress = "http://baka-ett.utu.fi/kahviimg.php";
};
services.glances = {
enable = true;
user = "coffeecam";
};
system.stateVersion = "17.09";
}
......@@ -46,7 +46,6 @@ in {
};
};
# Are these options in any way sensible
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.ffmpeg pkgs.curl ];
......@@ -55,6 +54,7 @@ in {
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
# Are these options in any way sensible
serviceConfig = {
User = "${cfg.user}";
ExecStart = lib.replaceStrings ["\n"] [" "] ''
......
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.glances;
in {
options = {
services.glances = {
enable = mkEnableOption "glances";
user = mkOption {
description = "Username";
type = types.str;
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.python36Packages.glances ];
systemd.services.glances = {
description = "Glances server";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = {
User = "${cfg.user}";
ExecStart = "${pkgs.python36Packages.glances}/bin/glances -w";
Restart = "on-abort";
};
};
};
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment