mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 19:51:17 +00:00
couchpotato module: init
This commit is contained in:
parent
ef0f4e7092
commit
e5f353d5cd
|
@ -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
|
||||
|
|
50
nixos/modules/services/misc/couchpotato.nix
Normal file
50
nixos/modules/services/misc/couchpotato.nix
Normal file
|
@ -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…
Reference in a new issue