2025-02-24 22:47:32 -05:00
|
|
|
# Return a list of all hosts
|
|
|
|
|
|
|
|
nixpkgs:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
# darwin-hosts = import ./darwin;
|
|
|
|
aarch64-darwin-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./aarch64-darwin) [
|
|
|
|
# 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)
|
|
|
|
];
|
|
|
|
aarch64-linux-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./aarch64-linux) [
|
|
|
|
# Get only files ending in default.nix
|
|
|
|
(builtins.filter (name: lib.hasSuffix "default.nix" name))
|
2025-03-08 12:58:37 -05:00
|
|
|
# Remove the first file
|
|
|
|
(builtins.filter (name: name != ./aarch64-linux/default.nix))
|
2025-02-24 22:47:32 -05:00
|
|
|
# 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)
|
|
|
|
];
|
|
|
|
x86_64-linux-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./x86_64-linux) [
|
|
|
|
# Get only files ending in default.nix
|
2025-03-09 17:09:33 +00:00
|
|
|
(builtins.filter (name: lib.hasSuffix "default.nix" name))
|
2025-02-24 22:47:32 -05:00
|
|
|
# Import each host function
|
|
|
|
(map (file: {
|
2025-03-09 22:29:41 +00:00
|
|
|
# name = lib.removeSuffix ".nix" (builtins.baseNameOf file);
|
|
|
|
name = builtins.baseNameOf (builtins.dirOf file);
|
2025-02-24 22:47:32 -05:00
|
|
|
value = import file;
|
|
|
|
}))
|
|
|
|
# Convert to an attrset of hostname -> host function
|
|
|
|
(builtins.listToAttrs)
|
|
|
|
];
|
|
|
|
}
|