Replace lib' with self.lib

This commit is contained in:
SebastianStork 2026-01-16 14:09:34 +01:00
parent 07c46beefb
commit 8ba17ac1ce
Signed by: SebastianStork
SSH key fingerprint: SHA256:iEM011ogNMG1q8+U500adGu/9rpPuZ2KnFtbdLeqTiI
10 changed files with 25 additions and 31 deletions

View file

@ -5,12 +5,10 @@
... ...
}: }:
let let
lib' = self.lib;
mkHost = mkHost =
hostName: hostName:
inputs.nixpkgs.lib.nixosSystem { inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs self lib'; }; specialArgs = { inherit inputs self; };
modules = [ modules = [
{ networking = { inherit hostName; }; } { networking = { inherit hostName; }; }
"${self}/hosts/common.nix" "${self}/hosts/common.nix"
@ -31,13 +29,13 @@ let
self.nixosConfigurations.${hostname}; self.nixosConfigurations.${hostname};
}; };
hostNames = "${self}/hosts" |> lib'.listDirectoryNames; hostNames = "${self}/hosts" |> self.lib.listDirectoryNames;
in in
{ {
flake = { flake = {
nixosConfigurations = hostNames |> lib'.genAttrs mkHost; nixosConfigurations = hostNames |> self.lib.genAttrs mkHost;
deploy.nodes = hostNames |> lib'.genAttrs mkDeployNode; deploy.nodes = hostNames |> self.lib.genAttrs mkDeployNode;
checks = inputs.deploy-rs.lib |> lib.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy); checks = inputs.deploy-rs.lib |> lib.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy);
}; };

View file

@ -2,7 +2,6 @@
config, config,
self, self,
lib, lib,
lib',
... ...
}: }:
let let
@ -38,7 +37,7 @@ in
{ file, value }: { file, value }:
value value
|> lib.map (domain: { |> lib.map (domain: {
file = lib'.relativePath file; file = self.lib.relativePath file;
inherit domain; inherit domain;
}) })
) )

View file

@ -1,8 +1,8 @@
{ {
config, config,
options, options,
self,
lib, lib,
lib',
... ...
}: }:
let let
@ -31,7 +31,7 @@ in
{ file, value }: { file, value }:
value value
|> lib.map (port: { |> lib.map (port: {
file = lib'.relativePath file; file = self.lib.relativePath file;
inherit port; inherit port;
}) })
) )

View file

@ -1,7 +1,7 @@
{ {
config, config,
self,
lib, lib,
lib',
... ...
}: }:
let let
@ -10,8 +10,8 @@ let
virtualHosts = cfg.virtualHosts |> lib.attrValues |> lib.filter (value: value.enable); virtualHosts = cfg.virtualHosts |> lib.attrValues |> lib.filter (value: value.enable);
publicHostsExist = virtualHosts |> lib.any (value: (!lib'.isPrivateDomain value.domain)); publicHostsExist = virtualHosts |> lib.any (value: (!self.lib.isPrivateDomain value.domain));
privateHostsExist = virtualHosts |> lib.any (value: lib'.isPrivateDomain value.domain); privateHostsExist = virtualHosts |> lib.any (value: self.lib.isPrivateDomain value.domain);
webPorts = [ webPorts = [
80 80
@ -29,7 +29,7 @@ let
lib.nameValuePair domain { lib.nameValuePair domain {
logFormat = "output file ${config.services.caddy.logDir}/${domain}.log { mode 640 }"; logFormat = "output file ${config.services.caddy.logDir}/${domain}.log { mode 640 }";
extraConfig = lib.concatLines [ extraConfig = lib.concatLines [
(lib.optionalString (lib'.isPrivateDomain domain) ( (lib.optionalString (self.lib.isPrivateDomain domain) (
let let
certDir = config.security.acme.certs.${domain}.directory; certDir = config.security.acme.certs.${domain}.directory;
in in
@ -138,7 +138,7 @@ in
certs = certs =
virtualHosts virtualHosts
|> lib.filter (host: lib'.isPrivateDomain host.domain) |> lib.filter (host: self.lib.isPrivateDomain host.domain)
|> lib.map (host: lib.nameValuePair host.domain { }) |> lib.map (host: lib.nameValuePair host.domain { })
|> lib.listToAttrs; |> lib.listToAttrs;
}; };

View file

@ -2,7 +2,6 @@
config, config,
self, self,
lib, lib,
lib',
... ...
}: }:
let let
@ -41,7 +40,7 @@ in
|> lib.concatMap ( |> lib.concatMap (
host: host:
host.config.meta.domains.local 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}\"") |> lib.map (domain: "\"${domain}. A ${host.config.custom.networking.overlay.address}\"")
); );
in in

View file

@ -2,7 +2,6 @@
config, config,
self, self,
lib, lib,
lib',
... ...
}: }:
let let
@ -56,8 +55,8 @@ in
message = "Running syncthing on a server requires `gui.domain` to be set"; message = "Running syncthing on a server requires `gui.domain` to be set";
} }
{ {
assertion = (cfg.gui.domain != null) -> (lib'.isPrivateDomain cfg.gui.domain); assertion = (cfg.gui.domain != null) -> (self.lib.isPrivateDomain cfg.gui.domain);
message = lib'.mkUnprotectedMessage "Syncthing-GUI"; message = self.lib.mkUnprotectedMessage "Syncthing-GUI";
} }
]; ];
@ -113,7 +112,7 @@ in
folders = folders =
cfg.folders cfg.folders
|> lib'.genAttrs (name: { |> self.lib.genAttrs (name: {
path = "${dataDir}/${name}"; path = "${dataDir}/${name}";
devices = config.services.syncthing.settings.devices |> lib.attrNames; devices = config.services.syncthing.settings.devices |> lib.attrNames;
}); });

View file

@ -1,8 +1,8 @@
{ {
config, config,
self,
pkgs, pkgs,
lib, lib,
lib',
... ...
}: }:
let let
@ -31,7 +31,7 @@ in
sops.secrets = sops.secrets =
cfg.networks cfg.networks
|> lib.map (name: "iwd/${name}") |> lib.map (name: "iwd/${name}")
|> lib'.genAttrs (_: { |> self.lib.genAttrs (_: {
restartUnits = [ "iwd.service" ]; restartUnits = [ "iwd.service" ];
}); });

View file

@ -1,7 +1,7 @@
{ {
config, config,
self,
lib, lib,
lib',
... ...
}: }:
let let
@ -25,8 +25,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = lib.singleton { assertions = lib.singleton {
assertion = lib'.isPrivateDomain cfg.domain; assertion = self.lib.isPrivateDomain cfg.domain;
message = lib'.mkUnprotectedMessage "Filebrowser"; message = self.lib.mkUnprotectedMessage "Filebrowser";
}; };
meta = { meta = {

View file

@ -1,7 +1,7 @@
{ {
config, config,
self,
lib, lib,
lib',
... ...
}: }:
let let
@ -25,8 +25,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = lib.singleton { assertions = lib.singleton {
assertion = lib'.isPrivateDomain cfg.domain; assertion = self.lib.isPrivateDomain cfg.domain;
message = lib'.mkUnprotectedMessage "FreshRSS"; message = self.lib.mkUnprotectedMessage "FreshRSS";
}; };
meta = { meta = {

View file

@ -2,7 +2,6 @@
config, config,
self, self,
lib, lib,
lib',
... ...
}: }:
let let
@ -184,7 +183,7 @@ in
|> lib.filter (domain: domain != cfg.domain) |> lib.filter (domain: domain != cfg.domain)
|> lib.map ( |> lib.map (
domain: domain:
lib.nameValuePair (lib'.subdomainOf domain) { lib.nameValuePair (self.lib.subdomainOf domain) {
inherit domain; inherit domain;
group = hostName; group = hostName;
} }