mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
refactor: normalize usage of lib and builtins namespaces
This commit is contained in:
parent
043a996319
commit
062fd5de0b
17 changed files with 24 additions and 24 deletions
|
|
@ -33,12 +33,12 @@ in
|
|||
|> lib.concatLists
|
||||
|> lib.concatMap (
|
||||
entry:
|
||||
map (domain: {
|
||||
lib.map (domain: {
|
||||
file = entry.file;
|
||||
inherit domain;
|
||||
}) entry.value
|
||||
)
|
||||
|> lib.groupBy (entry: toString entry.domain)
|
||||
|> lib.groupBy (entry: builtins.toString entry.domain)
|
||||
|> lib.filterAttrs (domain: entries: lib.length entries > 1);
|
||||
|
||||
errorMessage =
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ in
|
|||
options.meta.ports.list.definitionsWithLocations
|
||||
|> lib.concatMap (
|
||||
entry:
|
||||
map (port: {
|
||||
lib.map (port: {
|
||||
inherit (entry) file;
|
||||
inherit port;
|
||||
}) entry.value
|
||||
)
|
||||
|> lib.groupBy (entry: toString entry.port)
|
||||
|> lib.groupBy (entry: builtins.toString entry.port)
|
||||
|> lib.filterAttrs (port: entries: lib.length entries > 1);
|
||||
|
||||
errorMessage =
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ let
|
|||
logFormat = "output file ${config.services.caddy.logDir}/access-${domain}.log { mode 640 }";
|
||||
extraConfig = ''
|
||||
${lib.optionalString (isTailscaleDomain domain) "bind tailscale/${getSubdomain domain}"}
|
||||
reverse_proxy localhost:${toString port}
|
||||
reverse_proxy localhost:${builtins.toString port}
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ in
|
|||
package = inputs.crowdsec.packages.${pkgs.system}.crowdsec;
|
||||
enrollKeyFile = config.sops.secrets."crowdsec/enrollment-key".path;
|
||||
settings = {
|
||||
api.server.listen_uri = "127.0.0.1:${toString cfg.apiPort}";
|
||||
cscli.prometheus_uri = "http://127.0.0.1:${toString cfg.prometheusPort}";
|
||||
api.server.listen_uri = "127.0.0.1:${builtins.toString cfg.apiPort}";
|
||||
cscli.prometheus_uri = "http://127.0.0.1:${builtins.toString cfg.prometheusPort}";
|
||||
};
|
||||
|
||||
allowLocalJournalAccess = true;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ in
|
|||
package = inputs.crowdsec.packages.${pkgs.system}.crowdsec-firewall-bouncer;
|
||||
settings = {
|
||||
api_key = "cs-firewall-bouncer";
|
||||
api_url = "http://127.0.0.1:${toString cfg.apiPort}";
|
||||
api_url = "http://127.0.0.1:${builtins.toString cfg.apiPort}";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ in
|
|||
database.SQLITE_JOURNAL_MODE = "WAL";
|
||||
cache = {
|
||||
ADAPTER = "twoqueue";
|
||||
HOST = builtins.toJSON {
|
||||
HOST = lib.strings.toJSON {
|
||||
size = 100;
|
||||
recent_ratio = 0.25;
|
||||
ghost_ratio = 0.5;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ in
|
|||
|
||||
services.static-web-server = {
|
||||
enable = true;
|
||||
listen = "[::]:${toString cfg.port}";
|
||||
listen = "[::]:${builtins.toString cfg.port}";
|
||||
root = "${pkgs.it-tools}/lib";
|
||||
configuration.general.health = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ in
|
|||
enable = true;
|
||||
settings = {
|
||||
base-url = "https://${cfg.domain}";
|
||||
listen-http = ":${toString cfg.port}";
|
||||
listen-http = ":${builtins.toString cfg.port}";
|
||||
behind-proxy = true;
|
||||
web-root = "disable";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ in
|
|||
group = lib.mkIf (!cfg.isServer) "users";
|
||||
dataDir = lib.mkIf (!cfg.isServer) "/home/seb";
|
||||
|
||||
guiAddress = lib.mkIf cfg.isServer "127.0.0.1:${toString cfg.gui.port}";
|
||||
guiAddress = lib.mkIf cfg.isServer "127.0.0.1:${builtins.toString cfg.gui.port}";
|
||||
|
||||
cert = lib.mkIf useStaticTls config.sops.secrets."syncthing/cert".path;
|
||||
key = lib.mkIf useStaticTls config.sops.secrets."syncthing/key".path;
|
||||
|
|
@ -81,7 +81,7 @@ in
|
|||
|> lib.mapAttrs (
|
||||
name: value: {
|
||||
id = value.config.custom.services.syncthing.deviceId;
|
||||
addresses = [ "tcp://${name}.${tailscaleCfg.domain}:${toString cfg.syncPort}" ];
|
||||
addresses = [ "tcp://${name}.${tailscaleCfg.domain}:${builtins.toString cfg.syncPort}" ];
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ in
|
|||
];
|
||||
|
||||
options = {
|
||||
listenAddress = "tcp://0.0.0.0:${toString cfg.syncPort}";
|
||||
listenAddress = "tcp://0.0.0.0:${builtins.toString cfg.syncPort}";
|
||||
globalAnnounceEnabled = false;
|
||||
localAnnounceEnabled = false;
|
||||
relaysEnabled = false;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ in
|
|||
};
|
||||
secrets = lib.mkOption {
|
||||
type = lib.types.anything;
|
||||
default = absoluteSecretsPath |> builtins.readFile |> builtins.fromJSON;
|
||||
default = absoluteSecretsPath |> lib.readFile |> lib.strings.fromJSON;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue