Add arch to hosts, share host config with flake.
This commit is contained in:
+2
-10
@@ -1,16 +1,8 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
is-nix-file = filename: type: (builtins.match ".+\.nix$" filename) != null;
|
||||
is-regular-file = filename: type: type == "regular" || type == "link";
|
||||
hostname-from-file = filename: builtins.replaceStrings [".nix"] [""] filename;
|
||||
|
||||
host-files = attrNames (filterAttrs is-nix-file (filterAttrs is-regular-file (builtins.readDir ./hosts)));
|
||||
hosts = map hostname-from-file host-files;
|
||||
syslib = pkgs.callPackage ../lib/hosts.nix {};
|
||||
|
||||
load-host-file = hostname: import (./. + "/hosts/${hostname}.nix");
|
||||
|
||||
in {
|
||||
config.fudo.hosts = genAttrs hosts (hostname: load-host-file hostname);
|
||||
config.fudo.hosts = syslib.base-host-config ./hosts;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user