flakes: Migrate the config and miku to flakes
This commit is contained in:
@@ -30,54 +30,63 @@ let
|
||||
nwggridWrapper = mkWrapperScript "${pkgs.nwg-launchers}/bin/nwggrid-server" "";
|
||||
# TODO: Fuse this with kanshi
|
||||
swayIdleWrapper = mkWrapperScript "${pkgs.swayidle}/bin/swayidle" "-w before-sleep '${pkgs.swaylock}/bin/swaylock -f --image $(find ~/Data/Wallpaper/horizontal/ -maxdepth 1 -type f | shuf -n 1)'";
|
||||
|
||||
cfg = config.ptw.programs.sway;
|
||||
in {
|
||||
home-manager.users."${config.system.singleUser}" = {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
config = {
|
||||
bars = [ ];
|
||||
startup = [
|
||||
{ command = "${nwggridWrapper}"; always = true; }
|
||||
{ command = "${swayncWrapper}"; always = true; }
|
||||
{ command = "${waybarWrapper}"; always = true; }
|
||||
{ command = "${kanshiWrapper}"; always = true; }
|
||||
{ command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; always = true; }
|
||||
{ command = "${swayIdleWrapper}"; always = true; }
|
||||
];
|
||||
modifier = "${modifier}";
|
||||
gaps = {
|
||||
inner = 5;
|
||||
outer = 7;
|
||||
};
|
||||
input = {
|
||||
"*" = { xkb_layout = "de"; };
|
||||
"2:7:SynPS/2_Synaptics_TouchPad" = {
|
||||
tap = "enabled";
|
||||
natural_scroll = "disabled";
|
||||
dwt = "enabled";
|
||||
options.ptw.programs.sway = {
|
||||
enable = lib.mkEnableOption "Configure sway using HomeManager";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.sway.enable = true;
|
||||
home-manager.users."${config.ptw.system.singleUser}" = {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
config = {
|
||||
bars = [ ];
|
||||
startup = [
|
||||
{ command = "${nwggridWrapper}"; always = true; }
|
||||
{ command = "${swayncWrapper}"; always = true; }
|
||||
{ command = "${waybarWrapper}"; always = true; }
|
||||
{ command = "${kanshiWrapper}"; always = true; }
|
||||
{ command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; always = true; }
|
||||
{ command = "${swayIdleWrapper}"; always = true; }
|
||||
];
|
||||
modifier = "${modifier}";
|
||||
gaps = {
|
||||
inner = 5;
|
||||
outer = 7;
|
||||
};
|
||||
input = {
|
||||
"*" = { xkb_layout = "de"; };
|
||||
"2:7:SynPS/2_Synaptics_TouchPad" = {
|
||||
tap = "enabled";
|
||||
natural_scroll = "disabled";
|
||||
dwt = "enabled";
|
||||
};
|
||||
"2:10:TPPS/2_Elan_TrackPoint" = { dwt = "enabled"; };
|
||||
};
|
||||
output = {
|
||||
"*" = { adaptive_sync = "on"; };
|
||||
};
|
||||
keybindings = let
|
||||
speakers = "alsa_output.pci-0000_00_1f.3.analog-stereo";
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+Return" = "exec alacritty";
|
||||
"${modifier}+e" = "exec emacs";
|
||||
"${modifier}+Shift+q" = "kill";
|
||||
"${modifier}+f" = "exec firefox";
|
||||
"${modifier}+d" = "exec ${pkgs.nwg-launchers}/bin/nwggrid -client";
|
||||
"${modifier}+p" = "exec ${passwordDmenu}";
|
||||
"Mod4+s" = "exec systemctl suspend";
|
||||
# TODO: Screenlock
|
||||
#"Mod4+l" = "exec ..."
|
||||
"F1" = "exec pactl set-sink-volume ${speakers} toggle";
|
||||
"F2" = "exec pactl set-sink-volume ${speakers} -10%";
|
||||
"F3" = "exec pactl set-sink-volume ${speakers} +10%";
|
||||
"F5" = "exec brightnessctl --device=intel_backlight set 10%-";
|
||||
"F6" = "exec brightnessctl --device=intel_backlight set +10%";
|
||||
};
|
||||
"2:10:TPPS/2_Elan_TrackPoint" = { dwt = "enabled"; };
|
||||
};
|
||||
output = {
|
||||
"*" = { adaptive_sync = "on"; };
|
||||
};
|
||||
keybindings = let
|
||||
speakers = "alsa_output.pci-0000_00_1f.3.analog-stereo";
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+Return" = "exec alacritty";
|
||||
"${modifier}+e" = "exec emacs";
|
||||
"${modifier}+Shift+q" = "kill";
|
||||
"${modifier}+f" = "exec firefox";
|
||||
"${modifier}+d" = "exec ${pkgs.nwg-launchers}/bin/nwggrid -client";
|
||||
"${modifier}+p" = "exec ${passwordDmenu}";
|
||||
"Mod4+s" = "exec systemctl suspend";
|
||||
# TODO: Screenlock
|
||||
#"Mod4+l" = "exec ..."
|
||||
"F1" = "exec pactl set-sink-volume ${speakers} toggle";
|
||||
"F2" = "exec pactl set-sink-volume ${speakers} -10%";
|
||||
"F3" = "exec pactl set-sink-volume ${speakers} +10%";
|
||||
"F5" = "exec brightnessctl --device=intel_backlight set 10%-";
|
||||
"F6" = "exec brightnessctl --device=intel_backlight set +10%";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user