ops/nixos: refactoring for sway

This commit is contained in:
Luke Granger-Brown 2021-05-06 03:56:20 +01:00
parent 1c571d965a
commit b7cd20c769
4 changed files with 127 additions and 94 deletions

View file

@ -13,5 +13,11 @@ in
config = { config = {
my.home-manager.imports = lib.mkAfter [ ./home-manager/graphical-client-wayland.nix ]; my.home-manager.imports = lib.mkAfter [ ./home-manager/graphical-client-wayland.nix ];
xdg.portal = {
enable = true;
gtkUsePortal = true;
extraPortals = with depot.pkgs; [ xdg-desktop-portal-wlr ];
};
}; };
} }

View file

@ -9,24 +9,43 @@
waybar waybar
mako mako
kanshi kanshi
qt5.qtwayland
]); ]);
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export XDG_CURRENT_DESKTOP=sway
export MOZ_ENABLE_WAYLAND=1
export MOZ_USE_XINPUT2=1
'';
config = { config = {
modifier = "Mod4"; modifier = "Mod4";
keybindings = let keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier; modifier = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault { in lib.mkOptionDefault {
"${modifier}+l" = "exec loginctl lock-session"; "${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock";
"${modifier}+p" = "exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui"; "${modifier}+p" = "exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui";
"${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty"; "${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty";
}; };
startup = [ startup = [
{ command = "xss-lock --transfer-sleep-lock -- ${pkgs.swaylock}/bin/swaylock"; }
{ command = "${pkgs.gnome3.networkmanagerapplet}/bin/nm-applet"; }
]; ];
output."*".bg = "${depot.pkgs.lukegb-wallpapers}/lunik1-gruvbox-dark-rainbow.png fill";
# howl: tap-to-click
input."1739:24385:Synaptics_TM2438-005" = {
tap = "enabled";
tap_button_map = "lrm";
middle_emulation = "enabled";
};
}; };
}; };
my.alacritty.fontSize = 12;
} }

View file

@ -19,4 +19,10 @@
]; ];
}; };
}; };
services.random-background = {
enable = true;
imageDirectory = "${depot.nix.pkgs.lukegb-wallpapers}";
interval = null;
};
} }

View file

@ -2,100 +2,102 @@
{ {
imports = [ ./client.nix ]; imports = [ ./client.nix ];
gtk = { options.my.alacritty = with lib; {
enable = true; fontSize = mkOption {
gtk3.extraConfig = { default = 6;
gtk-application-prefer-dark-theme = 1; type = types.int;
};
};
qt = {
enable = true;
platformTheme = "gtk";
};
home.packages = lib.mkAfter (with pkgs; [
google-chrome-beta
firefox
mpv
dino
lutris
pavucontrol
pngquant
rxvt_unicode
teamspeak_client
virtmanager
xclip
xss-lock
yubioath-desktop
depot.nix.pkgs.flameshot
]);
programs.alacritty = {
enable = true;
settings.font = let
iosevka = style: { family = "Iosevka"; inherit style; };
in {
normal = iosevka "Regular";
bold = iosevka "Bold";
italic = iosevka "Italic";
bold_italic = iosevka "Bold Italic";
size = 6;
};
settings.colors = {
# Ayu Dark, from https://github.com/alacritty/alacritty/wiki/Color-schemes
primary = {
background = "#0A0E14";
foreground = "#B3B1AD";
};
# Normal colors
normal = {
black = "#01060E";
red = "#EA6C73";
green = "#91B362";
yellow = "#F9AF4F";
blue = "#53BDFA";
magenta = "#FAE994";
cyan = "#90E1C6";
white = "#C7C7C7";
};
# Bright colors
bright = {
black = "#686868";
red = "#F07178";
green = "#C2D94C";
yellow = "#FFB454";
blue = "#59C2FF";
magenta = "#FFEE99";
cyan = "#95E6CB";
white = "#FFFFFF";
};
}; };
}; };
home.file."bin/screencap" = { config = {
executable = true; gtk = {
text = '' enable = true;
#!/usr/bin/env bash gtk3.extraConfig = {
exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui gtk-application-prefer-dark-theme = 1;
};
};
qt = {
enable = true;
platformTheme = "gtk";
};
home.packages = lib.mkAfter (with pkgs; [
google-chrome-beta
firefox
mpv
dino
lutris
pavucontrol
pngquant
rxvt_unicode
teamspeak_client
virtmanager
xclip
xss-lock
yubioath-desktop
depot.nix.pkgs.flameshot
]);
programs.alacritty = {
enable = true;
settings.font = let
iosevka = style: { family = "Iosevka"; inherit style; };
in {
normal = iosevka "Regular";
bold = iosevka "Bold";
italic = iosevka "Italic";
bold_italic = iosevka "Bold Italic";
size = config.my.alacritty.fontSize;
};
settings.colors = {
# Ayu Dark, from https://github.com/alacritty/alacritty/wiki/Color-schemes
primary = {
background = "#0A0E14";
foreground = "#B3B1AD";
};
# Normal colors
normal = {
black = "#01060E";
red = "#EA6C73";
green = "#91B362";
yellow = "#F9AF4F";
blue = "#53BDFA";
magenta = "#FAE994";
cyan = "#90E1C6";
white = "#C7C7C7";
};
# Bright colors
bright = {
black = "#686868";
red = "#F07178";
green = "#C2D94C";
yellow = "#FFB454";
blue = "#59C2FF";
magenta = "#FFEE99";
cyan = "#95E6CB";
white = "#FFFFFF";
};
};
};
home.file."bin/screencap" = {
executable = true;
text = ''
#!/usr/bin/env bash
exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui
'';
};
home.file.".xprofile".text = ''
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
if [ -e "$HOME/.profile" ]; then
. "$HOME/.profile"
fi
systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID
systemctl --user restart ssh-agent
''; '';
}; };
home.file.".xprofile".text = ''
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
if [ -e "$HOME/.profile" ]; then
. "$HOME/.profile"
fi
systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID
systemctl --user restart ssh-agent
'';
services.random-background = {
enable = true;
imageDirectory = "${depot.nix.pkgs.lukegb-wallpapers}";
interval = null;
};
} }