diff --git a/README.md b/README.md index 0d757b2..403c70d 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,11 @@ nhmu enableShell = true; _1password = true; docker = true; - graphical = true; - steam = true; + # graphical = true; + graphical = { + steam = true; + vscode = true; + }; extraImports = [ ./home-manager/john.nix ./home-manager/gnome.nix diff --git a/flake.nix b/flake.nix index 4a09fa2..b05b545 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,6 @@ _1password = config._1password; docker = config.docker; graphical = config.graphical; - steam = config.steam; } ] ++ config.extraImports; diff --git a/homeManagerModules/default.nix b/homeManagerModules/default.nix index da8c644..31670b7 100644 --- a/homeManagerModules/default.nix +++ b/homeManagerModules/default.nix @@ -62,15 +62,8 @@ # # parentheses. Maybe you want to install Nerd Fonts with a limited number of # # fonts? # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) - ] ++ lib.optionals config.graphical [ - discord - spotify - sublime4 - joplin-desktop - ] ++ lib.optionals config._1password [ - _1password-cli - gh # GitHub CLI with 1Password integration - ]; + ] + ++ lib.optionals config.graphical.discord [ discord ]; # Home Manager can also manage your environment variables through # 'home.sessionVariables'. These will be explicitly sourced when using a diff --git a/homeManagerModules/ghostty.nix b/homeManagerModules/ghostty.nix index 1ac4a9e..bd5b615 100644 --- a/homeManagerModules/ghostty.nix +++ b/homeManagerModules/ghostty.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, nixgl, ... }: { - home.sessionVariables = lib.mkIf (config.enableShell && config.graphical) { + home.sessionVariables = lib.mkIf (config.enableShell && config.graphical.ghostty) { TERMINAL = "ghostty"; }; @@ -9,7 +9,7 @@ nixGL.defaultWrapper = "mesa"; nixGL.installScripts = [ "mesa" ]; - programs.ghostty = lib.mkIf (config.enableShell && config.graphical) { + programs.ghostty = lib.mkIf (config.enableShell && config.graphical.ghostty) { enable = true; enableZshIntegration = true; package = config.lib.nixGL.wrap pkgs.ghostty; @@ -52,7 +52,7 @@ }; # https://github.com/ghostty-org/ghostty/discussions/3763#discussioncomment-11699970 - xdg.desktopEntries."com.mitchellh.ghostty" = lib.mkIf (config.enableShell && config.graphical) { + xdg.desktopEntries."com.mitchellh.ghostty" = lib.mkIf (config.enableShell && config.graphical.ghostty) { name = "Ghostty"; type = "Application"; comment = "A terminal emulator"; diff --git a/homeManagerModules/vscode.nix b/homeManagerModules/vscode.nix index e5eca5b..ab6c9cd 100644 --- a/homeManagerModules/vscode.nix +++ b/homeManagerModules/vscode.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: { - programs.vscode = lib.mkIf config.graphical { + programs.vscode = lib.mkIf config.graphical.vscode { enable = true; package = pkgs.vscode; profiles.default.extensions = with pkgs.vscode-extensions; [ diff --git a/nixosModules/options.nix b/nixosModules/options.nix index 1ddf022..ec7706e 100644 --- a/nixosModules/options.nix +++ b/nixosModules/options.nix @@ -60,15 +60,24 @@ description = "Whether to enable docker stuff"; }; - options.graphical = lib.mkOption { + options.graphical.discord = lib.mkOption { type = lib.types.bool; default = false; - description = "Whether this system has a graphical environment"; }; - options.steam = lib.mkOption { + options.graphical.ghostty = lib.mkOption { + type = lib.types.bool; + default = false; + }; + + options.graphical.steam = lib.mkOption { type = lib.types.bool; default = false; description = "Whether this system has Steam installed"; }; + + options.graphical.vscode = lib.mkOption { + type = lib.types.bool; + default = false; + }; } diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix index 3f9ef49..bd5c38f 100644 --- a/nixosModules/steam.nix +++ b/nixosModules/steam.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, ... }: { - programs.steam = lib.mkIf config.steam { + programs.steam = lib.mkIf config.graphical.steam { enable = true; gamescopeSession.enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play