mirror of
https://github.com/nmasur/dotfiles
synced 2025-02-23 01:32:04 +00:00
19 lines
493 B
Nix
19 lines
493 B
Nix
# Return a list of all nix-darwin hosts
|
|
|
|
{ lib, ... }:
|
|
|
|
lib.pipe (lib.filesystem.listFilesRecursive ./.) [
|
|
# Get only files ending in default.nix
|
|
(builtins.filter (name: lib.hasSuffix "default.nix" name))
|
|
# Remove this file
|
|
(builtins.filter (name: name != ./default.nix))
|
|
# 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)
|
|
]
|