From ee44e4f9529ae13d39303dee3c9fdc0803bdb79c Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 8 Jun 2024 12:22:23 +0200 Subject: [PATCH] home-manager: fix injection of machineVars --- flake.nix | 9 +++------ home/config/gtk.nix | 4 ++-- home/home.nix | 5 +---- home/packages.nix | 5 ++--- home/programs/xmobar/default.nix | 6 +++--- home/services/polybar.nix | 3 +-- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index 36b8dae..970ef3f 100644 --- a/flake.nix +++ b/flake.nix @@ -195,15 +195,12 @@ extraSpecialArgs = { inherit inputs; inherit (self) extendedLib; + inherit (config) machineVars; secrets = secrets.outputs.settings; }; - users.h7x4 = import ./home/home.nix { - inherit pkgs; - inherit inputs; - inherit (pkgs) lib; - inherit (config) machineVars; - inherit (self) extendedLib; + users.h7x4 = { + imports = [ ./home/home.nix ]; }; }; }) diff --git a/home/config/gtk.nix b/home/config/gtk.nix index 775d692..5d8ec45 100644 --- a/home/config/gtk.nix +++ b/home/config/gtk.nix @@ -1,6 +1,6 @@ -{ pkgs, config, ... }: +{ pkgs, config, machineVars, ... }: { - gtk = pkgs.lib.mkIf (!config.machineVars.headless) { + gtk = pkgs.lib.mkIf (!machineVars.headless) { enable = true; font = { name = "Droid Sans"; diff --git a/home/home.nix b/home/home.nix index 3b16b8b..a8dfda5 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,9 +1,7 @@ -{ pkgs, lib, extendedLib, inputs, machineVars, ... } @ args: let +{ config, pkgs, lib, extendedLib, inputs, machineVars, ... } @ args: let inherit (lib) mkForce mkIf optionals; graphics = !machineVars.headless; in { - inherit machineVars; - imports = [ ./shell.nix ./packages.nix @@ -26,7 +24,6 @@ in { ./programs/tmux.nix ./programs/zsh - ../modules/machineVars.nix ./modules/colors.nix ./modules/shellAliases.nix ] ++ optionals graphics [ diff --git a/home/packages.nix b/home/packages.nix index 4309552..8172d34 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -1,6 +1,5 @@ -{ pkgs, config, ... }: let - inherit (config) machineVars; -in { +{ pkgs, config, machineVars, ... }: +{ home.packages = with pkgs; [ beets cloc diff --git a/home/programs/xmobar/default.nix b/home/programs/xmobar/default.nix index 075db33..e3c46e9 100644 --- a/home/programs/xmobar/default.nix +++ b/home/programs/xmobar/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: let +{ config, pkgs, machineVars, ... }: let inherit (pkgs) lib; in { programs.xmobar = let @@ -7,8 +7,8 @@ in { # TODO: loop over dataDrives disks = [ "/" - "${config.machineVars.dataDrives.default}" - "${config.machineVars.dataDrives.default}/disks/data2" + "${machineVars.dataDrives.default}" + "${machineVars.dataDrives.default}/disks/data2" ]; mpd_status_script = pkgs.writeShellScript "mpd-status" '' diff --git a/home/services/polybar.nix b/home/services/polybar.nix index 36fbbd9..4fa7ae7 100644 --- a/home/services/polybar.nix +++ b/home/services/polybar.nix @@ -1,6 +1,5 @@ -{ pkgs, config, ... }: let +{ pkgs, config, machineVars, ... }: let colors = config.colors.defaultColorSet; - inherit (config) machineVars; in { services.polybar = { enable = true;