treewide: replaceChars -> replaceStrings
This commit is contained in:
parent
6ad13152c4
commit
537fa18f76
@ -5,6 +5,6 @@
|
|||||||
unifiAddress = "https://unifi.shack:8443/";
|
unifiAddress = "https://unifi.shack:8443/";
|
||||||
unifiInsecure = true;
|
unifiInsecure = true;
|
||||||
unifiUsername = "prometheus"; # needed manual login after setup to confirm the password
|
unifiUsername = "prometheus"; # needed manual login after setup to confirm the password
|
||||||
unifiPassword = lib.replaceChars ["\n"] [""] (builtins.readFile <secrets/shack/unifi-prometheus-pw>);
|
unifiPassword = lib.replaceStrings ["\n"] [""] (builtins.readFile <secrets/shack/unifi-prometheus-pw>);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ in {
|
|||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
systemd.services = lib.mapAttrs' (path: rules: lib.nameValuePair "acl-${lib.replaceChars ["/"] ["_"] path}" {
|
systemd.services = lib.mapAttrs' (path: rules: lib.nameValuePair "acl-${lib.replaceStrings ["/"] ["_"] path}" {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = [
|
path = [
|
||||||
pkgs.acl
|
pkgs.acl
|
||||||
|
@ -3,7 +3,7 @@ with stockholm.lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
readJSON = path: fromJSON (readFile path);
|
readJSON = path: fromJSON (readFile path);
|
||||||
sed.escape = replaceChars ["/"] ["\\/"]; # close enough
|
sed.escape = replaceStrings ["/"] ["\\/"]; # close enough
|
||||||
PATH = makeBinPath [
|
PATH = makeBinPath [
|
||||||
coreutils
|
coreutils
|
||||||
curl
|
curl
|
||||||
|
@ -26,7 +26,7 @@ let
|
|||||||
krops = import ../submodules/krops/lib;
|
krops = import ../submodules/krops/lib;
|
||||||
shell = import ./shell.nix { inherit (stockholm) lib; };
|
shell = import ./shell.nix { inherit (stockholm) lib; };
|
||||||
systemd = {
|
systemd = {
|
||||||
encodeName = replaceChars ["/"] ["\\x2f"];
|
encodeName = replaceStrings ["/"] ["\\x2f"];
|
||||||
};
|
};
|
||||||
types = nixpkgs-lib.types // import ./types.nix { lib = stockholm.lib; };
|
types = nixpkgs-lib.types // import ./types.nix { lib = stockholm.lib; };
|
||||||
uri = import ./uri.nix { inherit (stockholm) lib; };
|
uri = import ./uri.nix { inherit (stockholm) lib; };
|
||||||
@ -79,7 +79,7 @@ let
|
|||||||
string = toJSON x; # close enough
|
string = toJSON x; # close enough
|
||||||
}.${type} or reject;
|
}.${type} or reject;
|
||||||
|
|
||||||
indent = replaceChars ["\n"] ["\n "];
|
indent = replaceStrings ["\n"] ["\n "];
|
||||||
|
|
||||||
stripAttr = converge (filterAttrsRecursive (n: v: v != {} && v != null));
|
stripAttr = converge (filterAttrsRecursive (n: v: v != {} && v != null));
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ with import <stockholm/lib>;
|
|||||||
|
|
||||||
let
|
let
|
||||||
# returns dirname without / , used as disk name
|
# returns dirname without / , used as disk name
|
||||||
dname = dir: replaceChars ["/"] [""] (head (reverseList (splitString "/" dir)));
|
dname = dir: replaceStrings ["/"] [""] (head (reverseList (splitString "/" dir)));
|
||||||
snapraid-conf = ''
|
snapraid-conf = ''
|
||||||
# Disks
|
# Disks
|
||||||
${concatMapStringsSep "\n" (d: "disk ${dname d} ${d}") cfg.disks}
|
${concatMapStringsSep "\n" (d: "disk ${dname d} ${d}") cfg.disks}
|
||||||
|
Loading…
Reference in New Issue
Block a user