couchpotato module: init

wip/yesman
Tristan Helmich 7 years ago committed by Robin Gloster
parent ef0f4e7092
commit e5f353d5cd
  1. 2
      nixos/modules/misc/ids.nix
  2. 1
      nixos/modules/module-list.nix
  3. 50
      nixos/modules/services/misc/couchpotato.nix

@ -282,6 +282,7 @@
infinoted = 264;
keystone = 265;
glance = 266;
couchpotato = 267;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -534,6 +535,7 @@
infinoted = 264;
keystone = 265;
glance = 266;
couchpotato = 267;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal

@ -242,6 +242,7 @@
./services/misc/cpuminer-cryptonight.nix
./services/misc/cgminer.nix
./services/misc/confd.nix
./services/misc/couchpotato.nix
./services/misc/devmon.nix
./services/misc/dictd.nix
./services/misc/dysnomia.nix

@ -0,0 +1,50 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.services.couchpotato;
in
{
options = {
services.couchpotato = {
enable = mkEnableOption "CouchPotato Server";
};
};
config = mkIf cfg.enable {
systemd.services.couchpotato = {
description = "CouchPotato Server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
mkdir -p /var/lib/couchpotato
chown -R couchpotato:couchpotato /var/lib/couchpotato
'';
serviceConfig = {
Type = "simple";
User = "couchpotato";
Group = "couchpotato";
PermissionsStartOnly = "true";
ExecStart = "${pkgs.couchpotato}/bin/couchpotato";
Restart = "on-failure";
};
};
users.extraUsers = singleton
{ name = "couchpotato";
group = "couchpotato";
home = "/var/lib/couchpotato/";
description = "CouchPotato daemon user";
uid = config.ids.uids.couchpotato;
};
users.extraGroups = singleton
{ name = "couchpotato";
gid = config.ids.gids.couchpotato;
};
};
}
Loading…
Cancel
Save