sway: Make package configurable

This commit is contained in:
Erwin Boskma 2024-03-26 15:06:20 +01:00
parent 05986bc2a6
commit c2744ea1eb
Signed by: erwin
SSH key fingerprint: SHA256:/Wk1WZdLg+vQHs3in9qq7PsIp8SMzwGSk/RLZ5zPuZk
6 changed files with 60 additions and 27 deletions

View file

@ -19,6 +19,7 @@ in
options.eboskma.programs.sway = { options.eboskma.programs.sway = {
enable = mkEnableOption "sway"; enable = mkEnableOption "sway";
wayvnc = mkEnableOption "wayvnc"; wayvnc = mkEnableOption "wayvnc";
package = mkPackageOption pkgs "sway" { };
lock-wallpaper = mkOption { lock-wallpaper = mkOption {
description = "Wallpaper to use for the lockscreen"; description = "Wallpaper to use for the lockscreen";
@ -85,6 +86,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
package = cfg.package;
config = { config = {
modifier = mod; modifier = mod;
@ -160,7 +163,7 @@ in
gaps = { gaps = {
inner = 10; inner = 10;
outer = 5; # outer = 5;
smartBorders = "on"; smartBorders = "on";
}; };
@ -244,8 +247,8 @@ in
"${mod}+c" = mkIf config.eboskma.programs.emacs.enable "exec ${config.programs.emacs.package}/bin/emacsclient -c"; "${mod}+c" = mkIf config.eboskma.programs.emacs.enable "exec ${config.programs.emacs.package}/bin/emacsclient -c";
"${mod}+Print" = "exec ${pkgs.grim}/bin/grim -o $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name')"; "${mod}+Print" = "exec ${pkgs.grim}/bin/grim -o $(${cfg.package}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name')";
"${mod}+Shift+Print" = ''exec ${pkgs.grim}/bin/grim -o $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name') - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f''; "${mod}+Shift+Print" = ''exec ${pkgs.grim}/bin/grim -o $(${cfg.package}/bin/swaymsg -t get_outputs | ${pkgs.jaq}/bin/jaq -r '.[] | select(.focused) | .name') - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f'';
"${mod}+Shift+Ctrl+Print" = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f''; "${mod}+Shift+Ctrl+Print" = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t "image/png" -f'';
"${mod}+Shift+Alt+Print" = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)"''; "${mod}+Shift+Alt+Print" = ''exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)"'';
@ -288,6 +291,16 @@ in
for_window [shell="xwayland"] title_format "%title [XWayland]" for_window [shell="xwayland"] title_format "%title [XWayland]"
for_window [app_id="^.*iwgtk$"] floating enable for_window [app_id="^.*iwgtk$"] floating enable
blur enable
blur_xray disable
shadows enable
default_dim_inactive 0.2
corner_radius 10
include /etc/sway/config.d/* include /etc/sway/config.d/*
''; '';
# exec --no-startup-id ${pkgs.swaynotificationcenter}/bin/swaync # exec --no-startup-id ${pkgs.swaynotificationcenter}/bin/swaync
@ -345,8 +358,8 @@ in
} }
{ {
timeout = 1200; timeout = 1200;
command = "${pkgs.sway}/bin/swaymsg 'output * power off'"; command = "${cfg.package}/bin/swaymsg 'output * power off'";
resumeCommand = "${pkgs.sway}/bin/swaymsg '${resumeMessages}'"; resumeCommand = "${cfg.package}/bin/swaymsg '${resumeMessages}'";
} }
]; ];
}; };

View file

@ -121,7 +121,7 @@
kernelParams = [ "amd_pstate.shared_mem=1" ]; kernelParams = [ "amd_pstate.shared_mem=1" ];
extraModulePackages = with config.boot.kernelPackages; [ extraModulePackages = with config.boot.kernelPackages; [
cpupower cpupower
rtl88x2bu # rtl88x2bu
zenpower zenpower
]; ];
@ -226,6 +226,14 @@
enable = true; enable = true;
}; };
sudo.enable = false; sudo.enable = false;
pam.services.swaylock = {
unixAuth = true;
setLoginUid = true;
enableGnomeKeyring = true;
allowNullPassword = true;
updateWtmp = true;
startSession = true;
};
}; };
systemd = { systemd = {
@ -384,6 +392,18 @@
}; };
programs = { programs = {
sway = {
enable = true;
package = pkgs.swayfx;
wrapperFeatures = {
gtk = true;
base = true;
};
extraPackages = with pkgs; [
swaylock
swayidle
];
};
gnome-disks.enable = true; gnome-disks.enable = true;
# ssh.startAgent = true; # ssh.startAgent = true;

View file

@ -230,6 +230,14 @@
apparmor = { apparmor = {
enable = true; enable = true;
}; };
pam.services.swaylock = {
unixAuth = true;
setLoginUid = true;
enableGnomeKeyring = true;
allowNullPassword = true;
updateWtmp = true;
startSession = true;
};
}; };
systemd.network = { systemd.network = {
@ -308,6 +316,17 @@
# programs.ssh.startAgent = true; # programs.ssh.startAgent = true;
programs = { programs = {
sway = {
enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
extraPackages = with pkgs; [
swaylock
swayidle
];
};
gnome-disks.enable = true; gnome-disks.enable = true;
nix-ld = { nix-ld = {
enable = true; enable = true;

View file

@ -25,18 +25,6 @@ in
fuse.userAllowOther = true; fuse.userAllowOther = true;
seahorse.enable = true; seahorse.enable = true;
sway = mkIf cfg.wayland {
enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
extraPackages = with pkgs; [
swaylock
swayidle
];
};
}; };
xdg = { xdg = {
@ -61,14 +49,6 @@ in
}; };
security = { security = {
pam.services.swaylock = {
unixAuth = true;
setLoginUid = true;
enableGnomeKeyring = true;
allowNullPassword = true;
updateWtmp = true;
startSession = true;
};
pki.certificates = [ (builtins.readFile ./horus-ca.pem) ]; pki.certificates = [ (builtins.readFile ./horus-ca.pem) ];
wrappers = { wrappers = {
fusermount.source = "${pkgs.fuse}/bin/fusermount"; fusermount.source = "${pkgs.fuse}/bin/fusermount";

View file

@ -12,7 +12,7 @@ let
style = builtins.readFile ./greetd.css; style = builtins.readFile ./greetd.css;
swaySession = pkgs.writeShellScript "sway-session" '' swaySession = pkgs.writeShellScript "sway-session" ''
${pkgs.sway}/bin/sway --unsupported-gpu ${config.programs.sway.package}/bin/sway --unsupported-gpu
''; '';
steam-gamescope = steam-gamescope =

View file

@ -118,6 +118,7 @@ in
starship.enable = true; starship.enable = true;
sway = { sway = {
enable = true; enable = true;
package = pkgs.swayfx;
lock-wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-2560.png"; lock-wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-2560.png";
output = { output = {
"DP-2" = { "DP-2" = {