Add arch to hosts, share host config with flake.

This commit is contained in:
2021-09-24 11:31:56 -07:00
parent aaf5391557
commit c02318ca00
22 changed files with 121 additions and 13 deletions
-1
View File
@@ -149,7 +149,6 @@ let
arch = mkOption {
type = str;
description = "System architecture of the system.";
default = "x86_64-linux";
};
android-dev = mkEnableOption "Enable ADB on the host.";
+16
View File
@@ -0,0 +1,16 @@
{ lib, ... }:
with lib;
{
base-host-config = host-path: let
hostname-from-file = filename: builtins.replaceStrings [".nix"] [""] filename;
is-nix-file = filename: type: (builtins.match ".+\.nix$" filename) != null;
is-regular-file = filename: type: type == "regular" || type == "link";
host-files = attrNames (filterAttrs is-nix-file (filterAttrs is-regular-file (builtins.readDir host-path)));
hosts = map hostname-from-file host-files;
load-host-file = hostname: import (./. + "/hosts/${hostname}.nix");
in genAttrs hosts (hostname: load-host-file hostname);
}
+1 -1
View File
@@ -1,4 +1,4 @@
{ config, lib, ... }:
{ lib, ... }:
with lib;
let