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 = [
|
imports = [
|
||||||
./sway.nix
|
./sway.nix
|
||||||
./term.nix
|
./term.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
config = lib.mkIf (cfg.enable) {
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
fira-code
|
# Fonts
|
||||||
];
|
fira-code
|
||||||
|
# GUI programs
|
||||||
|
pavucontrol
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
let mod = "Mod4";
|
let mod = "Mod4";
|
||||||
cfg = config.custom.gui.sway;
|
cfg = config.custom.gui;
|
||||||
|
|
||||||
# Generate the workspace keybinds
|
# Generate the workspace keybinds
|
||||||
genWorkspaces = { numbered, named }: with lib; (
|
genWorkspaces = { numbered, named }: with lib; (
|
||||||
|
@ -15,13 +15,12 @@ let mod = "Mod4";
|
||||||
);
|
);
|
||||||
|
|
||||||
sc = with pkgs; (writeScriptBin "sc" ''
|
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; {
|
in with lib; {
|
||||||
|
|
||||||
options.custom.gui.sway = with types; {
|
options.custom.gui.wm = with types; {
|
||||||
enable = mkEnableOption "sway window manager";
|
|
||||||
workspaces.named = mkOption {
|
workspaces.named = mkOption {
|
||||||
type = attrsOf str;
|
type = attrsOf str;
|
||||||
default = {};
|
default = {};
|
||||||
|
@ -75,7 +74,7 @@ in with lib; {
|
||||||
};
|
};
|
||||||
|
|
||||||
keybindings = mkMerge [
|
keybindings = mkMerge [
|
||||||
(genWorkspaces { inherit (cfg.workspaces) numbered named; })
|
(genWorkspaces { inherit (cfg.wm.workspaces) numbered named; })
|
||||||
{
|
{
|
||||||
"${mod}+h" = "focus left";
|
"${mod}+h" = "focus left";
|
||||||
"${mod}+j" = "focus down";
|
"${mod}+j" = "focus down";
|
||||||
|
@ -109,7 +108,7 @@ in with lib; {
|
||||||
Escape = "mode default";
|
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