Re-organize custom.gui
namespace
This commit is contained in:
parent
f25e2d197e
commit
df7cd2714f
3 changed files with 23 additions and 14 deletions
|
@ -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
|
||||
];
|
||||
|
||||
config = lib.mkIf (cfg.enable) {
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# Fonts
|
||||
fira-code
|
||||
# GUI programs
|
||||
pavucontrol
|
||||
];
|
||||
};
|
||||
|
||||
}
|
|
@ -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; (
|
||||
|
@ -20,8 +20,7 @@ let mod = "Mod4";
|
|||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
custom.gui.sway.enable = true;
|
||||
custom.gui.enable = true;
|
||||
}
|
Loading…
Reference in a new issue