nixos/spacecookie: add package option
This allows to change the derivation to use for the spacecookie server binary. We probably should also use justStaticExecutables by default to reduce the runtime closure of the service.
This commit is contained in:
parent
8abd77c811
commit
58be28d7ce
1 changed files with 13 additions and 1 deletions
|
@ -15,6 +15,18 @@ in {
|
|||
|
||||
enable = mkEnableOption "spacecookie";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.haskellPackages.spacecookie;
|
||||
example = literalExample ''
|
||||
pkgs.haskell.lib.justStaticExecutables pkgs.haskellPackages.spacecookie
|
||||
'';
|
||||
description = ''
|
||||
The spacecookie derivation to use. This can be used to
|
||||
override the used package or to use another version.
|
||||
'';
|
||||
};
|
||||
|
||||
hostname = mkOption {
|
||||
type = types.str;
|
||||
default = "localhost";
|
||||
|
@ -62,7 +74,7 @@ in {
|
|||
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
ExecStart = "${pkgs.haskellPackages.spacecookie}/bin/spacecookie ${configFile}";
|
||||
ExecStart = "${lib.getBin cfg.package}/bin/spacecookie ${configFile}";
|
||||
FileDescriptorStoreMax = 1;
|
||||
|
||||
DynamicUser = true;
|
||||
|
|
Loading…
Reference in a new issue