Ostara rework - extend domainMerge

This commit is contained in:
kat witch 2021-08-11 21:15:35 +01:00
parent a9b7332d3c
commit 2c512aeb7b
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
10 changed files with 34 additions and 22 deletions

View file

@ -7,7 +7,7 @@
type = "resource";
connection = {
port = 62954;
host = "192.168.1.245";
host = "192.168.1.171";
};
};
};

View file

@ -7,7 +7,6 @@ with lib;
imports = with meta; [
profiles.hardware.eeepc-1015pem
profiles.laptop
services.kattv
];
@ -39,10 +38,8 @@ with lib;
networking = {
hostId = "9f89b327";
useDHCP = false;
wireless.interfaces = [ "wlp2s0" ];
interfaces = {
enp1s0.useDHCP = true;
wlp2s0.useDHCP = true;
};
};
@ -50,7 +47,7 @@ with lib;
kw.fw = {
public = {
interfaces = singleton "wlp2s0";
interfaces = singleton "enp1s0";
tcp.ports = [ 9981 9982 ];
};
};

View file

@ -8,7 +8,6 @@ with lib;
imports = with meta; [
profiles.hardware.v330-14arr
profiles.gui
profiles.laptop
users.kat.guiFull
services.netdata
services.nginx

View file

@ -6,7 +6,6 @@ with lib;
options = {
deploy.profile = {
gui = mkEnableOption "Graphical System";
laptop = mkEnableOption "Laptop (Implies WiFi)";
vfio = mkEnableOption "VFIO";
trusted = mkEnableOption "Trusted Submodule";
hardware = {
@ -14,6 +13,8 @@ with lib;
amdgpu = mkEnableOption "AMD GPU";
hcloud-imperative = mkEnableOption "Imperative Hetzner Cloud Setup";
intel = mkEnableOption "Intel CPU";
laptop = mkEnableOption "Laptop";
wifi = mkEnableOption "WiFi, home network";
ryzen = mkEnableOption "AMD Ryzen CPU";
ms-7b86 = mkEnableOption "MSI B450-A Pro Max";
rm-310 = mkEnableOption "Intel DQ67OW";
@ -27,7 +28,6 @@ with lib;
({ superConfig, ... }: {
options.deploy.profile = {
gui = mkEnableOption "Graphical System";
laptop = mkEnableOption "Laptop (Implies WiFi)";
vfio = mkEnableOption "VFIO";
trusted = mkEnableOption "Trusted Submodule";
hardware = {
@ -35,6 +35,8 @@ with lib;
amdgpu = mkEnableOption "AMD GPU";
hcloud-imperative = mkEnableOption "Imperative Hetzner Cloud Setup";
intel = mkEnableOption "Intel CPU";
laptop = mkEnableOption "Laptop";
wifi = mkEnableOption "WiFi, home network";
ryzen = mkEnableOption "AMD Ryzen CPU";
ms-7b86 = mkEnableOption "MSI B450-A Pro Max";
rm-310 = mkEnableOption "Intel DQ67OW";

View file

@ -1,6 +1,10 @@
let hardwareProfiles = { lib }:
let profiles = with profiles; lib.modList {
modulesDir = ./.;
let profiles = with profiles; lib.domainMerge {
folder = ""; # not used in this usage
folderPaths = [
./.
../../trusted/profiles/hardware
];
} // {
ms-7b86 = {
imports = [
@ -20,12 +24,15 @@ let profiles = with profiles; lib.modList {
v330-14arr-base
ryzen
amdgpu
laptop
wifi
];
};
eeepc-1015pem = {
imports = [
eeepc-1015pem-base
intel
laptop
];
};
}; in profiles;

View file

@ -0,0 +1,9 @@
{ config, ... }:
{
deploy.profile.hardware.laptop = true;
imports = [
./light.nix
];
}

View file

@ -0,0 +1,6 @@
{ config, ... }:
{
deploy.profile.hardware.wifi = true;
networking.wireless.enable = true;
}

View file

@ -1,7 +0,0 @@
{ ... }:
{
imports = [ ./light.nix ];
deploy.profile.laptop = true;
}

View file

@ -1,10 +1,9 @@
{ lib }: { folder, defaultFile ? "default.nix" }: with lib; let
folderNames = [ (../../depot + "/${folder}") (../../depot/trusted + "/${folder}") ];
{ lib }: { folder, defaultFile ? "default.nix", folderPaths ? [ (../../depot + "/${folder}") (../../depot/trusted + "/${folder}") ] }: with lib; let
defaultFileFinal = if (defaultFile == "default.nix" && folder == "hosts") then
"meta.nix"
else defaultFile;
folderModLists = map (folderName: modList {
modulesDir = folderName;
folderModLists = map (folderPath: modList {
modulesDir = folderPath;
defaultFile = defaultFileFinal;
}) (filter builtins.pathExists folderNames);
}) (filter builtins.pathExists folderPaths);
in foldl modListMerge { } folderModLists