Files
nix/lib/hosts.nix
T
hektor 6fa74fead8
check / lint (push) Successful in 15s
refactor: rename utils to lib'
2026-11-06 14:35:01 +01:00

24 lines
494 B
Nix

{ lib }:
let
fs = import ./fs.nix { inherit lib; };
hostsPath = ../hosts;
hostMeta =
host:
let
metaPath = hostsPath + "/${host}/meta.nix";
in
if builtins.pathExists metaPath then
import metaPath
else
throw "meta.nix required in ${toString metaPath}";
hostNames = fs.dirNames hostsPath;
in
{
inherit hostsPath hostMeta hostNames;
adminHosts = builtins.filter (host: (hostMeta host).host.admin or false) hostNames;
nixosHosts = hostNames;
}