fixing hosts

This commit is contained in:
Noah Masur
2025-02-16 16:33:32 -05:00
parent 1062369a78
commit 7de88ba2b6
4 changed files with 31 additions and 40 deletions

View File

@ -1,20 +0,0 @@
# Return a list of all NixOS hosts
{ nixpkgs, ... }:
let
inherit (nixpkgs) lib;
in
lib.pipe (lib.filesystem.listFilesRecursive ./.) [
# Get only files ending in default.nix
(builtins.filter (name: lib.hasSuffix "default.nix" name))
# Import each host function
map
(file: {
name = builtins.baseNameOf (builtins.dirOf file);
value = import file;
})
# Convert to an attrset of hostname -> host function
(builtins.listToAttrs)
]