nix: what do you mean baseNameOf is not in lib
This commit is contained in:
parent
b53d7a1401
commit
d0edbdf5bb
1 changed files with 8 additions and 7 deletions
|
|
@ -5,6 +5,7 @@ self: {
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (builtins) toJSON baseNameOf toString;
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) package str port int listOf enum bool attrsOf path;
|
inherit (lib.types) package str port int listOf enum bool attrsOf path;
|
||||||
|
|
@ -13,7 +14,7 @@ self: {
|
||||||
cfg = config.services.eris;
|
cfg = config.services.eris;
|
||||||
|
|
||||||
# Generate the config.json content
|
# Generate the config.json content
|
||||||
erisConfigFile = pkgs.writeText "eris-config.json" (builtins.toJSON {
|
erisConfigFile = pkgs.writeText "eris-config.json" (toJSON {
|
||||||
listen_addr = cfg.listenAddress;
|
listen_addr = cfg.listenAddress;
|
||||||
metrics_port = cfg.metricsPort;
|
metrics_port = cfg.metricsPort;
|
||||||
backend_addr = cfg.backendAddress;
|
backend_addr = cfg.backendAddress;
|
||||||
|
|
@ -326,8 +327,8 @@ in {
|
||||||
RestrictSUIDSGID = true; # Ignore SUID/SGID bits on execution
|
RestrictSUIDSGID = true; # Ignore SUID/SGID bits on execution
|
||||||
|
|
||||||
# Directories managed by systemd
|
# Directories managed by systemd
|
||||||
StateDirectory = lib.baseNameOf cfg.stateDir; # e.g., "eris"
|
StateDirectory = baseNameOf cfg.stateDir; # e.g., "eris"
|
||||||
CacheDirectory = lib.baseNameOf cfg.cacheDir; # e.g., "eris"
|
CacheDirectory = baseNameOf cfg.cacheDir; # e.g., "eris"
|
||||||
StateDirectoryMode = "0750";
|
StateDirectoryMode = "0750";
|
||||||
CacheDirectoryMode = "0750";
|
CacheDirectoryMode = "0750";
|
||||||
|
|
||||||
|
|
@ -362,15 +363,15 @@ in {
|
||||||
mkdir -p ${cfg.stateDir}/conf ${cfg.dataDir} ${corporaDir} ${scriptsDir}
|
mkdir -p ${cfg.stateDir}/conf ${cfg.dataDir} ${corporaDir} ${scriptsDir}
|
||||||
|
|
||||||
# Ensure ownership is correct for all relevant dirs managed by systemd or created here
|
# Ensure ownership is correct for all relevant dirs managed by systemd or created here
|
||||||
${chownCmd} /var/lib/${lib.baseNameOf cfg.stateDir} \
|
${chownCmd} /var/lib/${baseNameOf cfg.stateDir} \
|
||||||
/var/cache/${lib.baseNameOf cfg.cacheDir} \
|
/var/cache/${baseNameOf cfg.cacheDir} \
|
||||||
${cfg.stateDir}/conf \
|
${cfg.stateDir}/conf \
|
||||||
${cfg.dataDir} \
|
${cfg.dataDir} \
|
||||||
${corporaDir} \
|
${corporaDir} \
|
||||||
${scriptsDir}
|
${scriptsDir}
|
||||||
# Copy declarative files
|
# Copy declarative files
|
||||||
${lib.toString copyCorporaCmds}
|
${toString copyCorporaCmds}
|
||||||
${lib.toString copyLuaScriptCmds}
|
${toString copyLuaScriptCmds}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue