2021-12-14 03:44:38 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2021-12-14 05:24:26 +00:00
|
|
|
let
|
2021-12-16 01:58:52 +00:00
|
|
|
cfg = config.this.application.sway;
|
2021-12-15 05:27:39 +00:00
|
|
|
graphical = config.this.graphical;
|
2022-03-10 15:08:58 +00:00
|
|
|
wallpaper = pkgs.fetchurl {
|
|
|
|
url =
|
|
|
|
"https://raw.githubusercontent.com/catppuccin/wallpapers/main/landscapes/evening-sky.png";
|
|
|
|
sha256 = "sha256-fYMzoY3un4qGOSR4DMqVUAFmGGil+wUze31rLLrjcAc=";
|
|
|
|
};
|
2021-12-14 03:44:38 +00:00
|
|
|
in with lib; {
|
|
|
|
options = {
|
2021-12-16 01:58:52 +00:00
|
|
|
this.application.sway = {
|
2021-12-14 03:44:38 +00:00
|
|
|
enable = mkOption {
|
2021-12-14 05:24:26 +00:00
|
|
|
default = graphical.enable;
|
2021-12-14 03:44:38 +00:00
|
|
|
type = with types; bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home-manager.users.james = {
|
2022-03-10 15:08:58 +00:00
|
|
|
home.sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; };
|
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
|
|
|
wrapperFeatures.gtk = true;
|
|
|
|
config = {
|
|
|
|
bars = [ ];
|
|
|
|
colors = {
|
|
|
|
focusedInactive = {
|
|
|
|
background = "#1E1E2E";
|
|
|
|
border = "#1E1E2E";
|
|
|
|
childBorder = "#1E1E2E";
|
|
|
|
indicator = "#1E1E2E";
|
|
|
|
text = "#C9CBFF";
|
|
|
|
};
|
|
|
|
unfocused = {
|
|
|
|
background = "#1E1E2E";
|
|
|
|
border = "#1E1E2E";
|
|
|
|
childBorder = "#1E1E2E";
|
|
|
|
indicator = "#1E1E2E";
|
|
|
|
text = "#C9CBFF";
|
|
|
|
};
|
|
|
|
focused = {
|
|
|
|
background = "#131020";
|
|
|
|
border = "#131020";
|
|
|
|
childBorder = "#131020";
|
|
|
|
indicator = "#131020";
|
|
|
|
text = "#ABE9B3";
|
|
|
|
};
|
|
|
|
urgent = {
|
|
|
|
background = "#F28FAD";
|
|
|
|
border = "#F28FAD";
|
|
|
|
childBorder = "#F28FAD";
|
|
|
|
indicator = "#F28FAD";
|
|
|
|
text = "#ABE9B3";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
fonts = {
|
|
|
|
names = [ "Alegreya" "FontAwesome" ];
|
|
|
|
size = 9.0;
|
|
|
|
};
|
|
|
|
input = {
|
|
|
|
"1133:45079:MX_Master_Mouse" = {
|
|
|
|
natural_scroll = "enable";
|
|
|
|
accel_profile = "adaptive";
|
|
|
|
pointer_accel = "-0.3";
|
|
|
|
};
|
|
|
|
"1:1:AT_Translated_Set_2_keyboard" = {
|
|
|
|
xkb_options = "ctrl:nocaps";
|
|
|
|
};
|
|
|
|
"2:7:SynPS/2_Synaptics_TouchPad" = {
|
|
|
|
dwt = "enabled";
|
|
|
|
click_method = "clickfinger";
|
|
|
|
natural_scroll = "enabled";
|
|
|
|
middle_emulation = "enabled";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
gaps = {
|
|
|
|
inner = 5;
|
|
|
|
outer = 2;
|
|
|
|
};
|
|
|
|
# And import and scripts as scene here would be good.
|
|
|
|
# https://github.com/gytis-ivaskevicius/nixfiles/blob/master/home-manager/i3-sway.nix
|
|
|
|
keybindings = mkOptionDefault { "Mod4+d" = ""; };
|
|
|
|
modifier = "Mod4";
|
|
|
|
output = { "eDP-1" = { bg = "${wallpaper} fill"; }; };
|
|
|
|
terminal = "${pkgs.kitty}/bin/kitty";
|
|
|
|
# https://rycee.gitlab.io/home-manager/options.html#opt-wayland.windowManager.sway.config.window.commands
|
|
|
|
window = { };
|
|
|
|
};
|
2021-12-14 03:44:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
autotiling
|
|
|
|
dmenu
|
2022-03-08 05:16:54 +00:00
|
|
|
grim
|
|
|
|
imagemagick
|
|
|
|
slurp
|
|
|
|
gammastep
|
2021-12-14 03:44:38 +00:00
|
|
|
swayidle
|
|
|
|
swaylock
|
2022-03-08 05:16:54 +00:00
|
|
|
playerctl
|
2021-12-14 03:44:38 +00:00
|
|
|
wl-clipboard
|
|
|
|
wofi
|
|
|
|
(writeTextFile {
|
|
|
|
name = "sway-entry";
|
|
|
|
destination = "/bin/sway-entry";
|
|
|
|
executable = true;
|
|
|
|
text = ''
|
|
|
|
#! ${pkgs.bash}/bin/bash
|
|
|
|
|
|
|
|
# first import environment variables from the login manager
|
|
|
|
# function is currently deprecated. It should be rolled back in the future
|
|
|
|
systemctl --user import-environment
|
|
|
|
|
|
|
|
# then start the service
|
|
|
|
exec systemctl --user start sway.service
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2022-03-08 05:16:54 +00:00
|
|
|
programs.light.enable = true;
|
|
|
|
|
2021-12-14 03:44:38 +00:00
|
|
|
systemd.user.targets.sway-session = {
|
|
|
|
description = "Sway compositor session";
|
|
|
|
documentation = [ "man:systemd.special(7)" ];
|
|
|
|
bindsTo = [ "graphical-session.target" ];
|
|
|
|
wants = [ "graphical-session-pre.target" ];
|
|
|
|
after = [ "graphical-session-pre.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services.sway = {
|
2022-03-08 04:35:07 +00:00
|
|
|
enable = true;
|
2021-12-14 03:44:38 +00:00
|
|
|
description = "Sway - Wayland window manager";
|
|
|
|
documentation = [ "man:sway(5)" ];
|
2022-03-08 04:35:07 +00:00
|
|
|
bindsTo = [ "default.target" ];
|
2021-12-14 03:44:38 +00:00
|
|
|
wants = [ "graphical-session-pre.target" ];
|
|
|
|
after = [ "graphical-session-pre.target" ];
|
|
|
|
# We explicitly unset PATH here, as we want it to be set by
|
|
|
|
# systemctl --user import-environment in startsway
|
|
|
|
environment.PATH = lib.mkForce null;
|
|
|
|
serviceConfig = {
|
2022-02-10 04:13:06 +00:00
|
|
|
Type = "simple";
|
2021-12-14 03:44:38 +00:00
|
|
|
ExecStart =
|
|
|
|
"${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug";
|
|
|
|
ExecStopPost =
|
2022-02-10 04:13:06 +00:00
|
|
|
"/usr/bin/env systemctl --user unset-environment SWAYSOCK DISPLAY I3SOCK WAYLAND_DISPLAY";
|
2021-12-14 03:44:38 +00:00
|
|
|
NotifyAccess = "all";
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = 1;
|
|
|
|
TimeoutStopSec = 10;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.james.extraGroups = [ "video" "audio" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|