wm.sway module

This commit is contained in:
Bryan Ramos 2024-05-15 21:00:37 -04:00
parent 35cf3c5d4a
commit 00b46789d6
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
17 changed files with 34 additions and 29 deletions

View file

@ -32,7 +32,7 @@
}; };
gui = { gui = {
sway.enable = true; wm.sway.enable = true;
alacritty.enable = true; alacritty.enable = true;
browsers.enable = true; browsers.enable = true;
corn.enable = true; corn.enable = true;

View file

@ -34,7 +34,7 @@
}; };
gui = { gui = {
sway.enable = true; wm.sway.enable = true;
alacritty.enable = true; alacritty.enable = true;
browsers.enable = true; browsers.enable = true;
neovim.enable = true; neovim.enable = true;

View file

@ -9,7 +9,7 @@ userConfigs = rec {
email = "bryan@ramos.codes"; email = "bryan@ramos.codes";
shell = pkgs.bash; shell = pkgs.bash;
# Image name from ~Pictures/wallpapers directory # From wallpapers directory
wallpaper = "mountains.jpg"; wallpaper = "mountains.jpg";
groups = [ "wheel" "networkmanager" "home-manager" "input" ]; groups = [ "wheel" "networkmanager" "home-manager" "input" ];

1
src/user/configs/wallpapers Symbolic link
View file

@ -0,0 +1 @@
../modules/gui/modules/wm/sway/config/wallpapers/

View file

@ -1,4 +1,4 @@
{ lib }: { lib, ... }:
with lib; with lib;
{ {

View file

@ -3,7 +3,11 @@
with lib; with lib;
let let
cfg = config.modules.user.bash; cfg = config.modules.user.bash;
gui = config.modules.user.gui.sway; gui = config.modules.user.gui.wm;
wm = {
enable = builtins.any (mod: mod.enable or false) (builtins.attrValues gui);
};
in in
{ options.modules.user.bash = { enable = mkEnableOption "user.bash"; }; { options.modules.user.bash = { enable = mkEnableOption "user.bash"; };
@ -22,7 +26,7 @@ in
eza = { eza = {
enable = true; enable = true;
enableAliases = true; enableAliases = true;
} // optionalAttrs gui.enable { } // optionalAttrs wm.enable {
icons = true; icons = true;
}; };
}; };

View file

@ -1,14 +1,9 @@
{ lib, ... }:
with lib;
let
mkModules = dir: recursiveUpdate
(attrsets.mapAttrs (_: moduleDir: {
inherit (moduleDir) default;
}) (filterAttrs (n: v: isAttrs v) (attrsets.mapAttrs (_: v: builtins.readDir v) dir)))
{ inherit (dir) default; };
in
{ {
imports = mkModules ./.; imports = [
./bash
./git
./gui
./security
./utils
];
} }

View file

@ -1,6 +1,5 @@
{ {
imports = [ imports = [
./desktopEnvironments
./modules ./modules
]; ];
} }

View file

@ -3,10 +3,15 @@
with lib; with lib;
let let
cfg = config.modules.user.gui.alacritty; cfg = config.modules.user.gui.alacritty;
gui = config.modules.user.gui.wm;
wm = {
enable = builtins.any (mod: mod.enable or false) (builtins.attrValues gui);
};
in in
{ options.modules.user.gui.alacritty = { enable = mkEnableOption "user.gui.alacritty"; }; { options.modules.user.gui.alacritty = { enable = mkEnableOption "user.gui.alacritty"; };
config = mkIf cfg.enable { config = mkIf (cfg.enable && wm.enable) {
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;
settings = import ./config/alacritty.nix; settings = import ./config/alacritty.nix;

View file

@ -6,5 +6,6 @@
./fun ./fun
./utils ./utils
./writing ./writing
./wm
]; ];
} }

View file

Before

Width:  |  Height:  |  Size: 609 KiB

After

Width:  |  Height:  |  Size: 609 KiB

Before After
Before After

View file

@ -2,6 +2,10 @@
let let
modifier = config.wayland.windowManager.sway.config.modifier; modifier = config.wayland.windowManager.sway.config.modifier;
wallpapers = builtins.path {
path = ./wallpapers;
name = "wallpapers";
};
in in
{ enable = true; { enable = true;
@ -17,13 +21,13 @@ in
HDMI-A-1 = { HDMI-A-1 = {
resolution = "1920x1080"; resolution = "1920x1080";
position = "0,0"; position = "0,0";
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill"; bg = "${wallpapers}/${config.user.wallpaper} fill";
}; };
DP-1 = { DP-1 = {
resolution = "1080x1920"; resolution = "1080x1920";
position = "1920,0"; position = "1920,0";
transform = "90"; transform = "90";
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill"; bg = "${wallpapers}/${config.user.wallpaper} fill";
}; };
}; };
modifier = "Mod1"; modifier = "Mod1";

View file

@ -0,0 +1 @@
../../../wallpapers/

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.user.gui.sway; cfg = config.modules.user.gui.wm.sway;
in in
{ options.modules.user.gui.sway = { enable = mkEnableOption "user.gui.sway"; }; { options.modules.user.gui.wm.sway = { enable = mkEnableOption "user.gui.wm.sway"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; }; wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; };
programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; }; programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; };
@ -55,10 +55,5 @@ in
}; };
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home.file."Pictures/wallpapers" = {
source = ../../wallpapers;
recursive = true;
};
}; };
} }