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

@ -9,7 +9,7 @@ userConfigs = rec {
email = "bryan@ramos.codes";
shell = pkgs.bash;
# Image name from ~Pictures/wallpapers directory
# From wallpapers directory
wallpaper = "mountains.jpg";
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;
{

View file

@ -3,7 +3,11 @@
with lib;
let
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
{ options.modules.user.bash = { enable = mkEnableOption "user.bash"; };
@ -22,7 +26,7 @@ in
eza = {
enable = true;
enableAliases = true;
} // optionalAttrs gui.enable {
} // optionalAttrs wm.enable {
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 = [
./desktopEnvironments
./modules
];
}

View file

@ -3,10 +3,15 @@
with lib;
let
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
{ options.modules.user.gui.alacritty = { enable = mkEnableOption "user.gui.alacritty"; };
config = mkIf cfg.enable {
config = mkIf (cfg.enable && wm.enable) {
programs.alacritty = {
enable = true;
settings = import ./config/alacritty.nix;

View file

@ -6,5 +6,6 @@
./fun
./utils
./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
modifier = config.wayland.windowManager.sway.config.modifier;
wallpapers = builtins.path {
path = ./wallpapers;
name = "wallpapers";
};
in
{ enable = true;
@ -17,13 +21,13 @@ in
HDMI-A-1 = {
resolution = "1920x1080";
position = "0,0";
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill";
bg = "${wallpapers}/${config.user.wallpaper} fill";
};
DP-1 = {
resolution = "1080x1920";
position = "1920,0";
transform = "90";
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill";
bg = "${wallpapers}/${config.user.wallpaper} fill";
};
};
modifier = "Mod1";

View file

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

View file

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