mirror of
https://github.com/nmasur/dotfiles
synced 2025-02-12 21:42:03 +00:00
17 lines
411 B
Nix
17 lines
411 B
Nix
# Return a list of all hosts
|
|
|
|
{ lib, ... }:
|
|
|
|
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)
|
|
]
|