diff --git a/config/home-manager/darkkirb.nix b/config/home-manager/darkkirb.nix index 50727d1b..5bc63e80 100644 --- a/config/home-manager/darkkirb.nix +++ b/config/home-manager/darkkirb.nix @@ -1,7 +1,5 @@ desktop: { pkgs, ... }: { imports = [ ./base.nix - ] ++ (if desktop then [ - ../programs/sway.nix - ] else []); + ] ++ (if desktop then [] else []); } diff --git a/config/nutty-noon.nix b/config/nutty-noon.nix index 6971ec7d..994d891b 100644 --- a/config/nutty-noon.nix +++ b/config/nutty-noon.nix @@ -5,6 +5,7 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ./systemd-boot.nix + ./services/sway.nix ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ "amdgpu" ]; @@ -119,6 +120,5 @@ home-manager.users.darkkirb = import ./home-manager/darkkirb.nix true; networking.nameservers = ["192.168.2.1"]; - services.xserver.enable = true; services.xserver.videoDrivers = [ "amdgpu" ]; } \ No newline at end of file diff --git a/config/programs/sway.nix b/config/programs/sway.nix deleted file mode 100644 index 74742c1e..00000000 --- a/config/programs/sway.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: { - wayland.windowManager.sway = { - enable = true; - wrapperFeatures.gtk = true ; - }; - home.packages = with pkgs; [ - swaylock - swayidle - wl-clipboard - mako # notification daemon - alacritty # Alacritty is the default terminal in the config - dmenu # Dmenu is the default in the config but i recommend wofi since its wayland native - ]; -} \ No newline at end of file diff --git a/config/services/sway.nix b/config/services/sway.nix new file mode 100644 index 00000000..41e0addd --- /dev/null +++ b/config/services/sway.nix @@ -0,0 +1,54 @@ +{ config, pkgs, lib, ... }: +{ + 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" ]; + }; + programs.sway = { + enable = true; + extraPackages = with pkgs; [ + dmenu + swaylock + swayidle + xwayland + mako + kanshi + grim + slurp + wl-clipboard + wf-recorder + (python38.withPackages(ps: with ps; [ i3pystatus keyring ])) + ]; + extraSessionCommands = '' + export SDL_VIDEODRIVER=wayland + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + export _JAVA_AWT_WM_NONREPARENTING=1 + export MOZ_ENABLE_WAYLAND=1 + ''; + }; + # configuring kanshi + systemd.user.services.kanshi = { + description = "Kanshi output autoconfig "; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + environment = { XDG_CONFIG_HOME="/home/mschwaig/.config"; }; + serviceConfig = { + # kanshi doesn't have an option to specifiy config file yet, so it looks + # at .config/kanshi/config + ExecStart = '' + ${pkgs.kanshi}/bin/kanshi + ''; + RestartSec = 5; + Restart = "always"; + }; + }; + + services.xserver.enable = true; + services.xserver.displayManager.defaultSession = "sway"; + services.xserver.displayManager.sddm.enable = true; + services.xserver.libinput.enable = true; +} \ No newline at end of file