From 80b40728b7e0294aefc28830e502d37f177a8fb9 Mon Sep 17 00:00:00 2001 From: iiogama Date: Mon, 8 Jan 2024 07:36:26 -0800 Subject: [PATCH] Split xorg and wayland configuration into respective nix files --- home-manager/dots/bash_login | 6 +-- home-manager/dots/bashrc | 9 ---- home-manager/dots/hypr/hyprland.conf | 3 +- hosts/default.nix | 8 ++-- nixos/cli.nix | 1 + nixos/gui.nix | 67 +++------------------------- nixos/wayland.nix | 55 +++++++++++++++++++++++ nixos/xorg.nix | 58 ++++++++++++++++++++++++ 8 files changed, 130 insertions(+), 77 deletions(-) create mode 100644 nixos/wayland.nix create mode 100644 nixos/xorg.nix diff --git a/home-manager/dots/bash_login b/home-manager/dots/bash_login index b016874..27393c2 100644 --- a/home-manager/dots/bash_login +++ b/home-manager/dots/bash_login @@ -3,6 +3,6 @@ tmux has-session -t scratch 2>/dev/null || tmux new-session -d -s scratch tmux has-session -t music 2>/dev/null || tmux new-session -d -s music tmux has-session -t chat 2>/dev/null || tmux new-session -d -s chat tmux has-session -t dev 2>/dev/null || tmux new-session -d -s dev -if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then - exec Hyprland -fi +#if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then +# exec Hyprland +#fi diff --git a/home-manager/dots/bashrc b/home-manager/dots/bashrc index b3b0220..f08f827 100644 --- a/home-manager/dots/bashrc +++ b/home-manager/dots/bashrc @@ -18,15 +18,6 @@ function mkcd { cd $1 } -function mkplatypus() { - cd $(mktemp -d) - touch "platypus.sh" - printf '#!/usr/bin/env sh' >> "platypus.sh" - printf "\n\n\n" >> "platypus.sh" - chmod +x "platypus.sh" - vim "+normal GA" "platypus.sh" -} - # fe [FUZZY PATTERN] - Open the selected file with the default editor # - Bypass fuzzy finder if there's only one match (--select-1) # - Exit if there's no match (--exit-0) diff --git a/home-manager/dots/hypr/hyprland.conf b/home-manager/dots/hypr/hyprland.conf index d20fbbd..b26e9a9 100644 --- a/home-manager/dots/hypr/hyprland.conf +++ b/home-manager/dots/hypr/hyprland.conf @@ -10,7 +10,8 @@ env = XCURSOR_SIZE,24 # exec-once = waybar & hyprpaper & firefox exec-once = nm-applet exec-once = mullvad-gui -exec-once = wl-paste --watch cliphist store +exec-once = wl-paste --type text --watch cliphist store +exec-once = wl-paste --type image --watch cliphist store exec-once = dunst exec-once = swww init exec-once = swww img $HOME/Pictures/wallpapers/bliss-night.png --transition-type simple diff --git a/hosts/default.nix b/hosts/default.nix index ac33754..2da66af 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -8,7 +8,7 @@ ../nixos/all.nix ../nixos/cli.nix ../nixos/chat.nix - ../nixos/gui.nix + ../nixos/wayland.nix ../nixos/gaming.nix ../nixos/office.nix ./buckwheat/configuration.nix @@ -21,7 +21,7 @@ ../home-manager/all.nix ../home-manager/cli.nix ../home-manager/chat.nix - ../home-manager/gui.nix + ../home-manager/wayland.nix ./buckwheat/home.nix ]; }; @@ -34,7 +34,7 @@ modules = [ ../nixos/all.nix ../nixos/cli.nix - ../nixos/gui.nix + ../nixos/xorg.nix ../nixos/office.nix ../nixos/pentest.nix ./fireweed/configuration.nix @@ -46,7 +46,7 @@ imports = [ ../home-manager/all.nix ../home-manager/cli.nix - ../home-manager/gui.nix + ../home-manager/xorg.nix ./fireweed/home.nix ]; }; diff --git a/nixos/cli.nix b/nixos/cli.nix index 181ce8a..731e2d8 100644 --- a/nixos/cli.nix +++ b/nixos/cli.nix @@ -66,6 +66,7 @@ alsa.support32Bit = true; pulse.enable = true; #jack.enable = true; + wireplumber.enable = true; }; users.users.${user.name}.packages = with pkgs; [ btfs diff --git a/nixos/gui.nix b/nixos/gui.nix index 0eb3b7b..c5c277c 100644 --- a/nixos/gui.nix +++ b/nixos/gui.nix @@ -5,8 +5,6 @@ variables = { VISUAL = "$EDITOR"; BROWSER = "mullvad-browser"; - SXHKD_SHELL = "/bin/sh"; - TERMINAL = "st"; }; }; xdg.mime = { @@ -15,32 +13,15 @@ "image/*" = [ "feh.desktop" ]; - }; - }; - xdg = { - autostart.enable = true; - portal = { - enable = true; - xdgOpenUsePortal = true; - extraPortals = [ - pkgs.xdg-desktop-portal-gtk + "text/*" = [ + "mullvad-browser.desktop" ]; - configPackages = [ - pkgs.gnome.gnome-session + "video/*" = [ + "mpv.desktop" ]; }; }; services = { - xserver = { - enable = true; - displayManager.startx.enable = true; - windowManager.bspwm.enable = true; - layout = "us"; - xkbVariant = ""; - }; - picom = { - enable = true; - }; # To add the Flathub repo, run: # $ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak.enable = true; @@ -57,11 +38,6 @@ ]; programs = { dconf.enable = true; - slock.enable = true; - hyprland = { - enable = true; - xwayland.enable = true; - }; }; users.users.${user.name}.packages = with pkgs; [ ani-cli @@ -75,43 +51,14 @@ mullvad-browser mupdf #onionshare-gui - scrot tor-browser-bundle-bin #urlview ]; environment.systemPackages = with pkgs; [ - # Packages for X - (dmenu.overrideAttrs (oldAttrs: rec { - configFile = writeText "config.def.h" (builtins.readFile ./patches/dmenu/config.h); - postPatch = "${oldAttrs.postPatch}\n cp ${configFile} config.def.h"; - })) - (st.overrideAttrs (oldAttrs: rec { - configFile = writeText "config.def.h" (builtins.readFile ./patches/st/config.h); - postPatch = "${oldAttrs.postPatch}\n cp ${configFile} config.def.h"; - })) - clipmenu dunst - hsetroot - networkmanagerapplet - notify-desktop - sxhkd - trayer - xbanish - xdg-utils - xdo - xdragon - xsel - - # Packages for Wayland - bemenu - bemoji - cliphist - foot - grimblast libnotify - swww - tessen - wl-clipboard - wtype + networkmanagerapplet + xdg-utils + xdragon ]; } diff --git a/nixos/wayland.nix b/nixos/wayland.nix new file mode 100644 index 0000000..bf32526 --- /dev/null +++ b/nixos/wayland.nix @@ -0,0 +1,55 @@ +# Wayland configuration.nix +{ config, lib, pkgs, inputs, user, ... }: +{ + imports = [ + ./gui.nix + ]; + environment = { + variables = { + TERMINAL = "foot"; + }; + }; + xdg = { + autostart.enable = true; + portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = [ + pkgs.xdg-desktop-portal-hyprland + ]; + configPackages = [ + pkgs.xdg-desktop-portal-hyprland + ]; + }; + }; + fonts.packages = with pkgs; [ + comic-mono + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + fira-code + fira-code-symbols + dina-font + ]; + programs = { + hyprland = { + enable = true; + xwayland.enable = true; + }; + }; + security.pam.services.swaylock = { + }; + environment.systemPackages = with pkgs; [ + bemenu + bemoji + cliphist + foot + grimblast + hyprpicker + swaylock + swww + tessen + wl-clipboard + wtype + ]; +} diff --git a/nixos/xorg.nix b/nixos/xorg.nix new file mode 100644 index 0000000..b11eadb --- /dev/null +++ b/nixos/xorg.nix @@ -0,0 +1,58 @@ +# Xorg configuration.nix +{ config, lib, pkgs, inputs, user, ... }: +{ + imports = [ + ./gui.nix + ]; + environment = { + variables = { + SXHKD_SHELL = "/bin/sh"; + TERMINAL = "st"; + }; + }; + xdg = { + autostart.enable = true; + portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + configPackages = [ + pkgs.gnome.gnome-session + ]; + }; + }; + services = { + xserver = { + enable = true; + displayManager.startx.enable = true; + windowManager.bspwm.enable = true; + layout = "us"; + xkbVariant = ""; + }; + picom = { + enable = true; + }; + }; + programs = { + slock.enable = true; + }; + environment.systemPackages = with pkgs; [ + (dmenu.overrideAttrs (oldAttrs: rec { + configFile = writeText "config.def.h" (builtins.readFile ./patches/dmenu/config.h); + postPatch = "${oldAttrs.postPatch}\n cp ${configFile} config.def.h"; + })) + (st.overrideAttrs (oldAttrs: rec { + configFile = writeText "config.def.h" (builtins.readFile ./patches/st/config.h); + postPatch = "${oldAttrs.postPatch}\n cp ${configFile} config.def.h"; + })) + clipmenu + hsetroot + scrot + sxhkd + trayer + xbanish + xsel + ]; +}