mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 22:11:33 +01:00
15 lines
529 B
Nix
15 lines
529 B
Nix
lib: {
|
|
isTailscaleDomain = domain: domain |> lib.hasSuffix ".ts.net";
|
|
|
|
subdomainOf = domain: domain |> lib.splitString "." |> lib.head;
|
|
|
|
rootDomainOf = domain: domain |> lib.splitString "." |> lib.tail |> lib.concatStringsSep ".";
|
|
|
|
listNixFilesRecursively =
|
|
dir: dir |> lib.filesystem.listFilesRecursive |> lib.filter (lib.hasSuffix ".nix");
|
|
|
|
listDirectoryNames =
|
|
path: path |> builtins.readDir |> lib.filterAttrs (_: type: type == "directory") |> lib.attrNames;
|
|
|
|
genAttrs = f: names: lib.genAttrs names f;
|
|
}
|