From e3fee206a1cd8f16a0711dde55dfb197c9458d06 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 23 Jan 2025 20:20:08 -0500 Subject: [PATCH] Don't install kanshi on non-graphical installs. --- nix/configuration/roles/kanshi/default.nix | 51 +++++++++++++++------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/nix/configuration/roles/kanshi/default.nix b/nix/configuration/roles/kanshi/default.nix index 140833a..b1fdbb9 100644 --- a/nix/configuration/roles/kanshi/default.nix +++ b/nix/configuration/roles/kanshi/default.nix @@ -17,21 +17,40 @@ in { imports = [ ]; - environment.systemPackages = with pkgs; [ - kanshi - ]; - - me.swayIncludes = [ - exec_kanshi - ]; - - home-manager.users.talexander = - { pkgs, ... }: - { - home.file = { - ".config/kanshi/config" = { - source = ./files/config_kanshi; - }; - }; + options.me = { + kanshi.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install kanshi."; }; + }; + + config = lib.mkIf config.me.kanshi.enable ( + lib.mkMerge [ + { + environment.systemPackages = with pkgs; [ + ]; + } + (lib.mkIf config.me.graphical { + environment.systemPackages = with pkgs; [ + kanshi + ]; + + me.swayIncludes = [ + exec_kanshi + ]; + + home-manager.users.talexander = + { pkgs, ... }: + { + home.file = { + ".config/kanshi/config" = { + source = ./files/config_kanshi; + }; + }; + }; + }) + ] + ); }