mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 12:51:34 +01:00
Replace lib' with self.lib
This commit is contained in:
parent
07c46beefb
commit
8ba17ac1ce
10 changed files with 25 additions and 31 deletions
|
|
@ -2,7 +2,6 @@
|
|||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -38,7 +37,7 @@ in
|
|||
{ file, value }:
|
||||
value
|
||||
|> lib.map (domain: {
|
||||
file = lib'.relativePath file;
|
||||
file = self.lib.relativePath file;
|
||||
inherit domain;
|
||||
})
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
config,
|
||||
options,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -31,7 +31,7 @@ in
|
|||
{ file, value }:
|
||||
value
|
||||
|> lib.map (port: {
|
||||
file = lib'.relativePath file;
|
||||
file = self.lib.relativePath file;
|
||||
inherit port;
|
||||
})
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -10,8 +10,8 @@ let
|
|||
|
||||
virtualHosts = cfg.virtualHosts |> lib.attrValues |> lib.filter (value: value.enable);
|
||||
|
||||
publicHostsExist = virtualHosts |> lib.any (value: (!lib'.isPrivateDomain value.domain));
|
||||
privateHostsExist = virtualHosts |> lib.any (value: lib'.isPrivateDomain value.domain);
|
||||
publicHostsExist = virtualHosts |> lib.any (value: (!self.lib.isPrivateDomain value.domain));
|
||||
privateHostsExist = virtualHosts |> lib.any (value: self.lib.isPrivateDomain value.domain);
|
||||
|
||||
webPorts = [
|
||||
80
|
||||
|
|
@ -29,7 +29,7 @@ let
|
|||
lib.nameValuePair domain {
|
||||
logFormat = "output file ${config.services.caddy.logDir}/${domain}.log { mode 640 }";
|
||||
extraConfig = lib.concatLines [
|
||||
(lib.optionalString (lib'.isPrivateDomain domain) (
|
||||
(lib.optionalString (self.lib.isPrivateDomain domain) (
|
||||
let
|
||||
certDir = config.security.acme.certs.${domain}.directory;
|
||||
in
|
||||
|
|
@ -138,7 +138,7 @@ in
|
|||
|
||||
certs =
|
||||
virtualHosts
|
||||
|> lib.filter (host: lib'.isPrivateDomain host.domain)
|
||||
|> lib.filter (host: self.lib.isPrivateDomain host.domain)
|
||||
|> lib.map (host: lib.nameValuePair host.domain { })
|
||||
|> lib.listToAttrs;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -41,7 +40,7 @@ in
|
|||
|> lib.concatMap (
|
||||
host:
|
||||
host.config.meta.domains.local
|
||||
|> lib.filter (domain: lib'.isPrivateDomain domain)
|
||||
|> lib.filter (domain: self.lib.isPrivateDomain domain)
|
||||
|> lib.map (domain: "\"${domain}. A ${host.config.custom.networking.overlay.address}\"")
|
||||
);
|
||||
in
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -56,8 +55,8 @@ in
|
|||
message = "Running syncthing on a server requires `gui.domain` to be set";
|
||||
}
|
||||
{
|
||||
assertion = (cfg.gui.domain != null) -> (lib'.isPrivateDomain cfg.gui.domain);
|
||||
message = lib'.mkUnprotectedMessage "Syncthing-GUI";
|
||||
assertion = (cfg.gui.domain != null) -> (self.lib.isPrivateDomain cfg.gui.domain);
|
||||
message = self.lib.mkUnprotectedMessage "Syncthing-GUI";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -113,7 +112,7 @@ in
|
|||
|
||||
folders =
|
||||
cfg.folders
|
||||
|> lib'.genAttrs (name: {
|
||||
|> self.lib.genAttrs (name: {
|
||||
path = "${dataDir}/${name}";
|
||||
devices = config.services.syncthing.settings.devices |> lib.attrNames;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
config,
|
||||
self,
|
||||
pkgs,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -31,7 +31,7 @@ in
|
|||
sops.secrets =
|
||||
cfg.networks
|
||||
|> lib.map (name: "iwd/${name}")
|
||||
|> lib'.genAttrs (_: {
|
||||
|> self.lib.genAttrs (_: {
|
||||
restartUnits = [ "iwd.service" ];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -25,8 +25,8 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = lib.singleton {
|
||||
assertion = lib'.isPrivateDomain cfg.domain;
|
||||
message = lib'.mkUnprotectedMessage "Filebrowser";
|
||||
assertion = self.lib.isPrivateDomain cfg.domain;
|
||||
message = self.lib.mkUnprotectedMessage "Filebrowser";
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -25,8 +25,8 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = lib.singleton {
|
||||
assertion = lib'.isPrivateDomain cfg.domain;
|
||||
message = lib'.mkUnprotectedMessage "FreshRSS";
|
||||
assertion = self.lib.isPrivateDomain cfg.domain;
|
||||
message = self.lib.mkUnprotectedMessage "FreshRSS";
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
config,
|
||||
self,
|
||||
lib,
|
||||
lib',
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -184,7 +183,7 @@ in
|
|||
|> lib.filter (domain: domain != cfg.domain)
|
||||
|> lib.map (
|
||||
domain:
|
||||
lib.nameValuePair (lib'.subdomainOf domain) {
|
||||
lib.nameValuePair (self.lib.subdomainOf domain) {
|
||||
inherit domain;
|
||||
group = hostName;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue