aboutsummaryrefslogtreecommitdiff
path: root/modules/desktop/sway/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/desktop/sway/default.nix')
-rw-r--r--modules/desktop/sway/default.nix117
1 files changed, 117 insertions, 0 deletions
diff --git a/modules/desktop/sway/default.nix b/modules/desktop/sway/default.nix
new file mode 100644
index 0000000..7de94a6
--- /dev/null
+++ b/modules/desktop/sway/default.nix
@@ -0,0 +1,117 @@
+{
+ config,
+ username,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ mod = config.home-manager.users.${username}.wayland.windowManager.sway.config.modifier;
+in
+{
+ imports = [
+ ./swayidle.nix
+ ./swaylock.nix
+ ];
+
+ options.nx.desktop.sway.enable = lib.mkEnableOption "Enable sway and setup";
+ config = lib.mkIf config.nx.desktop.sway.enable {
+ home-manager.users.${username} = {
+ home.packages = with pkgs; [
+ wmenu
+ swaybg
+ sway-contrib.grimshot
+ wl-clipboard
+ xdg-utils
+ ];
+
+ wayland.windowManager.sway = {
+ enable = true;
+ systemd = {
+ enable = true;
+ xdgAutostart = true;
+ };
+ config = {
+ input = {
+ "*" = {
+ xkb_layout = "de";
+ };
+ };
+
+ output = {
+ DP-1 = {
+ resolution = "1920x1080@240Hz";
+ bg = "/etc/nixos/images/pond.jpg fill";
+ };
+ };
+
+ gaps = {
+ inner = 15;
+ };
+
+ window = {
+ titlebar = false;
+ border = 0;
+ };
+
+ modifier = "Mod4";
+
+ keybindings = lib.mkOptionDefault {
+ "${mod}+q" = "kill";
+ "${mod}+Shift+s" = "exec grimshot savecopy area";
+ "XF86AudioPlay" = "exec playerctl play-pause";
+ "XF86AudioPrev" = "exec playerctl previous";
+ "XF86AudioNext" = "exec playerctl next";
+ "XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_DEVICE@ +5%";
+ "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_DEVICE@ -5%";
+ "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_DEVICE@ toggle";
+ };
+
+ menu = "${pkgs.wmenu}/bin/wmenu-run -b -N 000000E6";
+ terminal = "${pkgs.foot}/bin/foot";
+ defaultWorkspace = "workspace number 1";
+
+ bars = [
+ {
+ "command" = "${pkgs.waybar}/bin/waybar";
+ }
+ ];
+ };
+ checkConfig = false;
+ wrapperFeatures.base = true;
+ wrapperFeatures.gtk = true;
+ };
+
+ home.sessionVariables = {
+ XDG_CURRENT_DESKTOP = "sway";
+ XDG_SCREENSHOTS_DIR = "~/Pictures/Screenshots/";
+ };
+
+ gtk = {
+ enable = true;
+ theme = {
+ name = "Adwaita-dark";
+ package = pkgs.gnome-themes-extra;
+ };
+ gtk3.extraConfig = {
+ Settings = ''
+ gtk-application-prefer-dark-theme=1
+ '';
+ };
+ gtk4.extraConfig = {
+ Settings = ''
+ gtk-application-prefer-dark-theme=1
+ '';
+ };
+ };
+
+ home.pointerCursor = {
+ gtk.enable = true;
+ name = "Adwaita";
+ package = pkgs.adwaita-icon-theme;
+ size = 24;
+ };
+ };
+ };
+}