diff --git a/shared/home/gui/default.nix b/shared/home/gui/default.nix index 7d921d7..5e5be86 100644 --- a/shared/home/gui/default.nix +++ b/shared/home/gui/default.nix @@ -1,16 +1,26 @@ -{ pkgs, ... }: +{ pkgs, lib, config, ... }: -{ +let cfg = config.custom.gui; +in { + + options.custom.gui = { + enable = lib.mkEnableOption "Nix-managed GUI"; + }; imports = [ ./sway.nix ./term.nix ]; - fonts.fontconfig.enable = true; + config = lib.mkIf (cfg.enable) { + fonts.fontconfig.enable = true; - home.packages = with pkgs; [ - fira-code - ]; + home.packages = with pkgs; [ + # Fonts + fira-code + # GUI programs + pavucontrol + ]; + }; } \ No newline at end of file diff --git a/shared/home/gui/sway.nix b/shared/home/gui/sway.nix index 63346a1..4fed54e 100644 --- a/shared/home/gui/sway.nix +++ b/shared/home/gui/sway.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, ... }: let mod = "Mod4"; - cfg = config.custom.gui.sway; + cfg = config.custom.gui; # Generate the workspace keybinds genWorkspaces = { numbered, named }: with lib; ( @@ -15,13 +15,12 @@ let mod = "Mod4"; ); sc = with pkgs; (writeScriptBin "sc" '' - ${slurp}/bin/slurp | ${grim}/bin/grim -g - - | ${wl-clipboard}/bin/wl-copy -t image/png - ''); + ${slurp}/bin/slurp | ${grim}/bin/grim -g - - | ${wl-clipboard}/bin/wl-copy -t image/png + ''); in with lib; { - options.custom.gui.sway = with types; { - enable = mkEnableOption "sway window manager"; + options.custom.gui.wm = with types; { workspaces.named = mkOption { type = attrsOf str; default = {}; @@ -75,7 +74,7 @@ in with lib; { }; keybindings = mkMerge [ - (genWorkspaces { inherit (cfg.workspaces) numbered named; }) + (genWorkspaces { inherit (cfg.wm.workspaces) numbered named; }) { "${mod}+h" = "focus left"; "${mod}+j" = "focus down"; @@ -109,7 +108,7 @@ in with lib; { Escape = "mode default"; }; - window.titlebar = true; + window.titlebar = false; }; }; diff --git a/system/strawberry/home.nix b/system/strawberry/home.nix index 4b1a3bb..86261ed 100644 --- a/system/strawberry/home.nix +++ b/system/strawberry/home.nix @@ -1,5 +1,5 @@ { ... }: { - custom.gui.sway.enable = true; + custom.gui.enable = true; } \ No newline at end of file