Split xorg and wayland configuration into respective nix files

This commit is contained in:
Thai Noodles 2024-01-08 07:36:26 -08:00
parent 9e9165cb4e
commit 80b40728b7
8 changed files with 130 additions and 77 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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
];
};

View File

@ -66,6 +66,7 @@
alsa.support32Bit = true;
pulse.enable = true;
#jack.enable = true;
wireplumber.enable = true;
};
users.users.${user.name}.packages = with pkgs; [
btfs

View File

@ -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
];
}

55
nixos/wayland.nix Normal file
View File

@ -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
];
}

58
nixos/xorg.nix Normal file
View File

@ -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
];
}