mirror of
https://github.com/9001/copyparty.git
synced 2025-08-20 02:12:20 -06:00
formatting clean-up with alejandra.
This commit is contained in:
parent
68e7000275
commit
15e200caa2
|
@ -1,27 +1,29 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
with lib;
|
pkgs,
|
||||||
|
lib,
|
||||||
let
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
mkKeyValue = key: value:
|
mkKeyValue = key: value:
|
||||||
if value == true then
|
if value == true
|
||||||
|
then
|
||||||
# sets with a true boolean value are coerced to just the key name
|
# sets with a true boolean value are coerced to just the key name
|
||||||
key
|
key
|
||||||
else if value == false then
|
else if value == false
|
||||||
|
then
|
||||||
# or omitted completely when false
|
# or omitted completely when false
|
||||||
""
|
""
|
||||||
else
|
else (generators.mkKeyValueDefault {inherit mkValueString;} ": " key value);
|
||||||
(generators.mkKeyValueDefault { inherit mkValueString; } ": " key value);
|
|
||||||
|
|
||||||
mkAttrsString = value: (generators.toKeyValue {inherit mkKeyValue;} value);
|
mkAttrsString = value: (generators.toKeyValue {inherit mkKeyValue;} value);
|
||||||
|
|
||||||
mkValueString = value:
|
mkValueString = value:
|
||||||
if isList value then
|
if isList value
|
||||||
(concatStringsSep ", " (map mkValueString value))
|
then (concatStringsSep ", " (map mkValueString value))
|
||||||
else if isAttrs value then
|
else if isAttrs value
|
||||||
"\n" + (mkAttrsString value)
|
then "\n" + (mkAttrsString value)
|
||||||
else
|
else (generators.mkValueStringDefault {} value);
|
||||||
(generators.mkValueStringDefault { } value);
|
|
||||||
|
|
||||||
mkSectionName = value: "[" + (escape ["[" "]"] value) + "]";
|
mkSectionName = value: "[" + (escape ["[" "]"] value) + "]";
|
||||||
|
|
||||||
|
@ -215,8 +217,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
preStart = let
|
preStart = let
|
||||||
replaceSecretCommand = name: attrs:
|
replaceSecretCommand = name: attrs: "${getExe pkgs.replace-secret} '${
|
||||||
"${getExe pkgs.replace-secret} '${
|
|
||||||
passwordPlaceholder name
|
passwordPlaceholder name
|
||||||
}' '${attrs.passwordFile}' ${runtimeConfigPath}";
|
}' '${attrs.passwordFile}' ${runtimeConfigPath}";
|
||||||
in ''
|
in ''
|
||||||
|
@ -239,13 +240,15 @@ in {
|
||||||
StateDirectoryMode = "0700";
|
StateDirectoryMode = "0700";
|
||||||
WorkingDirectory = home;
|
WorkingDirectory = home;
|
||||||
TemporaryFileSystem = "/:ro";
|
TemporaryFileSystem = "/:ro";
|
||||||
BindReadOnlyPaths = [
|
BindReadOnlyPaths =
|
||||||
|
[
|
||||||
"/nix/store"
|
"/nix/store"
|
||||||
"-/etc/resolv.conf"
|
"-/etc/resolv.conf"
|
||||||
"-/etc/nsswitch.conf"
|
"-/etc/nsswitch.conf"
|
||||||
"-/etc/hosts"
|
"-/etc/hosts"
|
||||||
"-/etc/localtime"
|
"-/etc/localtime"
|
||||||
] ++ (mapAttrsToList (k: v: "-${v.passwordFile}") cfg.accounts);
|
]
|
||||||
|
++ (mapAttrsToList (k: v: "-${v.passwordFile}") cfg.accounts);
|
||||||
BindPaths = [home] ++ (mapAttrsToList (k: v: v.path) cfg.volumes);
|
BindPaths = [home] ++ (mapAttrsToList (k: v: v.path) cfg.volumes);
|
||||||
# Would re-mount paths ignored by temporary root
|
# Would re-mount paths ignored by temporary root
|
||||||
#ProtectSystem = "strict";
|
#ProtectSystem = "strict";
|
||||||
|
|
Loading…
Reference in a new issue