Refactor to pass host vars as arguments
Remove per‑host imports across flake, modules, and profiles, exposing needed variables (system, printer settings, consoleKeyMap, etc.) as arguments. Drop unused printEnable flags from host variable files.
This commit is contained in:
@@ -2,11 +2,9 @@
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
host,
|
||||
profile,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../hosts/${host}/variables.nix) profile;
|
||||
in {
|
||||
}: {
|
||||
options.docker.enable = lib.mkEnableOption "Docker";
|
||||
|
||||
config.virtualisation.docker = lib.mkIf config.docker.enable {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
{
|
||||
host,
|
||||
hostId,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../hosts/${host}/variables.nix) hostId;
|
||||
in {
|
||||
}: {
|
||||
# Defensive assertion for hostname validity (clearer message at eval time)
|
||||
assertions = [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{host, ...}: let
|
||||
inherit (import ../../hosts/${host}/variables.nix) enableNFS;
|
||||
in {
|
||||
{enableNFS, ...}: {
|
||||
services = {
|
||||
rpcbind.enable = enableNFS;
|
||||
nfs.server.enable = enableNFS;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
host,
|
||||
printEnable,
|
||||
ensureDefaultPrinter,
|
||||
ensurePrinters,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../hosts/${host}/printers.nix) printEnable ensureDefaultPrinter ensurePrinters;
|
||||
in {
|
||||
}: {
|
||||
services = lib.mkIf printEnable {
|
||||
printing = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
{
|
||||
pkgs,
|
||||
host,
|
||||
stylixImage,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../hosts/${host}/variables.nix) stylixImage;
|
||||
in {
|
||||
}: {
|
||||
# Styling Options
|
||||
stylix = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
{
|
||||
host,
|
||||
consoleKeyMap,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../hosts/${host}/variables.nix) consoleKeyMap;
|
||||
in {
|
||||
}: {
|
||||
nix = {
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
settings = {
|
||||
|
||||
+13
-3
@@ -5,10 +5,14 @@
|
||||
host,
|
||||
profile,
|
||||
system,
|
||||
gitUsername,
|
||||
shell,
|
||||
extraMonitorSettings,
|
||||
keyboardLayout,
|
||||
gitEmail,
|
||||
location,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../hosts/${host}/variables.nix) gitUsername shell;
|
||||
in {
|
||||
}: {
|
||||
imports = [inputs.home-manager.nixosModules.home-manager];
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
@@ -21,6 +25,12 @@ in {
|
||||
host
|
||||
profile
|
||||
system
|
||||
extraMonitorSettings
|
||||
shell
|
||||
keyboardLayout
|
||||
gitEmail
|
||||
gitUsername
|
||||
location
|
||||
;
|
||||
};
|
||||
users.${username} = {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{host, ...}: let
|
||||
inherit (import ../../hosts/${host}/variables.nix) keyboardLayout;
|
||||
in {
|
||||
{keyboardLayout, ...}: {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb = {
|
||||
|
||||
Reference in New Issue
Block a user