Personal-NixOS-Configuration/modules/nixos/cspark-desktop-niri/home.nix

92 lines
2.9 KiB
Nix

{ lib, config, pkgs, modulesPath, inputs, ... }:
let
cfg = config.cspark-desktop-niri-config-1;
in
{
# imports =
# [
# inputs.niri.homeModules.niri
# ];
options.cspark-desktop-niri-config-1 = {
enable
= lib.mkEnableOption "Enable Custom Niri Desktop Setup 1";
};
config = lib.mkIf cfg.enable {
# Config Files (typically $HOME/.config)
xdg.configFile = {
"vesktop/themes".source = ./resources/home-manager/.config/vesktop/themes;
"waybar".source = ./resources/home-manager/.config/waybar;
"niri/config.kdl".source = ./resources/home-manager/.config/niri/config.kdl;
"mako/config".source = ./resources/home-manager/.config/mako/config;
"foot/foot.ini".source = ./resources/home-manager/.config/foot/foot.ini;
"networkmanager-dmenu/config.ini".source = ./resources/home-manager/.config/networkmanager-dmenu/config.ini;
};
services.udiskie.enable = true;
services.udiskie.tray = "never";
# Automatically executed on niri startup
home.packages = with pkgs; [
(writeShellScriptBin "niri-autostart"
''
waybar &
mako &
swaybg -i ${config.home.homeDirectory}/Pictures/Wallpapers/ourdream.png &
wlsunset -l 51.5 -L 0.1 &
'')
(writeShellScriptBin "fuzzel-pass"
''
shopt -s nullglob globstar
typeit=0
if [[ $1 == "--type" ]]; then
typeit=1
shift
fi
prefix=''${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/**/*.gpg )
password_files=( "''${password_files[@]#"$prefix"/}" )
password_files=( "''${password_files[@]%.gpg}" )
password=$(printf '%s\n' "''${password_files[@]}" | fuzzel --background=fbf1c7ff --border-color=d79921ff --text-color=3c3836ff --match-color=f9f5d7ff --selection-color=d79921ff --selection-text-color=fbf1c7ff --dmenu "$@")
[[ -n $password ]] || exit
if [[ $typeit -eq 0 ]]; then
pass_output=$(pass show -c "$password" 2>/dev/null)
notify-send "$pass_output"
else
pass_output=$(pass show "$password" | { IFS= read -r pass; printf %s "$pass"; })
notify-send "$pass_output"
fi
'')
];
home.sessionVariables = {
TERM = "foot";
QT_QPA_PLATFORM = "wayland";
QT_QPA_PLATFORMTHEME = "qt6ct";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SDL_VIDEODRIVER = "wayland,x11,windows";
_JAVA_AWT_WM_NONREPARENTING = "1";
SSH_ASKPASS_REQUIRE = "force";
SSH_ASKPASS = "/run/current-system/sw/bin/lxqt-openssh-askpass";
MOZ_ENABLE_WAYLAND = "1";
# Enable native wayland support for chromium and electron based applications
NIXOS_OZONE_WL = "1";
};
# Start sway after login if on TTY1 (Default Linux TTY upon boot/login)
#programs.bash.profileExtra = ''
# if [[ $(tty) == "/dev/tty1" ]]; then
# niri-session
# exit
# fi
# '';
};
}