From 108f9b70285de181d4d9585a9c7362b985f54ae1 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 13 Jun 2024 14:36:34 +0100 Subject: [PATCH] dwm --- home/semita.nix | 1 - home/users/sam/default.nix | 23 ++++++++++++++++- hosts/common/optional/dwm.nix | 25 +++++++++++++++++++ .../optional/{displayManager => }/sddm.nix | 0 hosts/semita/default.nix | 5 ++-- 5 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 hosts/common/optional/dwm.nix rename hosts/common/optional/{displayManager => }/sddm.nix (100%) diff --git a/home/semita.nix b/home/semita.nix index c610e9b..2186de1 100644 --- a/home/semita.nix +++ b/home/semita.nix @@ -11,7 +11,6 @@ ./common/optional/git.nix ./common/optional/sops.nix ./common/optional/syncthing.nix - ./common/optional/desktop/hyprland ]; diff --git a/home/users/sam/default.nix b/home/users/sam/default.nix index beeb764..d611c12 100644 --- a/home/users/sam/default.nix +++ b/home/users/sam/default.nix @@ -1,4 +1,4 @@ -{ pkgs, outputs, ... }: +{ pkgs, outputs, config, ... }: { home.username = "sam"; @@ -54,6 +54,27 @@ qt.style.name = "adwaita-dark"; qt.style.package = pkgs.adwaita-qt; + # TODO configure x11 to look in .config/x11 + #home.file."${config.xdg.configHome}/x11/xinitrc" = { + home.file.".xinitrc" = { + recursive = true; + text = '' + if test -z "$DBUS_SESSION_BUS_ADDRESS"; then + eval $(dbus-launch --exit-with-session --sh-syntax) + fi + systemctl --user import-environment DISPLAY XAUTHORITY + + if command -v dbus-update-activation-environment >/dev/null 2>&1; then + dbus-update-activation-environment DISPLAY XAUTHORITY + fi + + export XSESSION_PID="$$" + exec dwm + + ''; + }; + + home.sessionVariables = { EDITOR = "nvim"; TERMINAL = "alacritty"; diff --git a/hosts/common/optional/dwm.nix b/hosts/common/optional/dwm.nix new file mode 100644 index 0000000..171438c --- /dev/null +++ b/hosts/common/optional/dwm.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: +{ + + services = { + libinput.enable = true; + xserver = { + enable = true; + xkb.layout = "gb"; + displayManager.startx.enable = true; + autorun = false; + windowManager.dwm = { + enable = true; + package = pkgs.dwm.overrideAttrs { + src = pkgs.fetchFromGitea { + domain = "git.bitlab21.com"; + owner = "sam"; + repo = "dwm"; + rev = "011c32e72e45b124ad6ab5c8185945cd2e637270"; + sha256 = "sha256-rFiGTynYPEDav7ydokkRAHpT2zPFtz+Hn9lZbufEOEg="; + }; + }; + }; + }; + }; +} diff --git a/hosts/common/optional/displayManager/sddm.nix b/hosts/common/optional/sddm.nix similarity index 100% rename from hosts/common/optional/displayManager/sddm.nix rename to hosts/common/optional/sddm.nix diff --git a/hosts/semita/default.nix b/hosts/semita/default.nix index 1a5e1f9..95759b4 100644 --- a/hosts/semita/default.nix +++ b/hosts/semita/default.nix @@ -1,4 +1,4 @@ -{ inputs, config, lib, pkgs, outputs,... }: +{ inputs, config, lib, pkgs, outputs, ... }: let # Disko setup fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence @@ -28,9 +28,8 @@ in # Import optional options ../common/optional/persistence.nix ../common/optional/pipewire.nix - ../common/optional/hyprland.nix - ../common/optional/displayManager/sddm.nix ../common/optional/openssh.nix + ../common/optional/dwm.nix ];