From 378533c2d338a8fc209c50f5f070ecc22137e41b Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 4 Dec 2023 10:05:25 -0500 Subject: [PATCH] refactor: split up some packages and unify into hyprland module --- devices/binto/default.nix | 1 - devices/binto/home/packages.nix | 81 +--------------------------- devices/binto/modules/gpu-replay.nix | 23 ++++++++ devices/wim/default.nix | 1 - devices/wim/home/packages.nix | 62 +-------------------- home/obs.nix | 12 +++++ modules/dolphin.nix | 27 ++++++++++ modules/hyprland/default.nix | 68 ++++++++++++++--------- 8 files changed, 106 insertions(+), 169 deletions(-) create mode 100644 home/obs.nix create mode 100644 modules/dolphin.nix diff --git a/devices/binto/default.nix b/devices/binto/default.nix index 5bb39581..48534de3 100644 --- a/devices/binto/default.nix +++ b/devices/binto/default.nix @@ -36,7 +36,6 @@ }; home-manager.users.${config.vars.user} = { imports = [ - ../../home/dconf.nix ../../home/firefox ./home/packages.nix diff --git a/devices/binto/home/packages.nix b/devices/binto/home/packages.nix index 43dbeeb3..cddf0af5 100644 --- a/devices/binto/home/packages.nix +++ b/devices/binto/home/packages.nix @@ -1,83 +1,4 @@ -{ - pkgs, - nixpkgs-wayland, - ... -}: let - waypkgs = nixpkgs-wayland.packages.x86_64-linux; -in { - programs = { - obs-studio = { - enable = true; - plugins = with waypkgs; [ - obs-wlrobs - ]; - }; - - btop.enable = true; - }; - home.packages = - (with pkgs; [ - # FIXME: vlc stutters - mpv - nextcloud-client - libreoffice-fresh - photoqt - hunspell - hunspellDicts.en_CA - jellyfin-media-player - spotifywm - thunderbird - prismlauncher-qt5 - (pkgs.discord.override { - withOpenASAR = true; - withVencord = true; - }) - - # School - virt-manager - bluej - xournalpp - ]) - ++ (with pkgs.plasma5Packages; [ - ark - kcharselect - kdenlive - okular - - # Dolphin & co - dolphin - dolphin-plugins - kdegraphics-thumbnailers - ffmpegthumbs - kio - kio-admin # needs to be both here and in system pkgs - kio-extras - kmime - ]) - ++ (with pkgs.gnome; [ - gnome-calculator - ]); - - # TODO: add mic sound - xdg.configFile."gsr.sh" = { - executable = true; - text = '' - export WINDOW=DP-5 - export CONTAINER=mkv - export QUALITY=very_high - export CODEC=auto - export AUDIO_CODEC=aac - export FRAMERATE=60 - export REPLAYDURATION=1200 - export OUTPUTDIR=/home/matt/Videos/Replay - export MAKEFOLDERS=yes - # export ADDITIONAL_ARGS= - - # Disable compositor in X11 for best performance - exec /bin/sh -c 'AUDIO="''${AUDIO_DEVICE:-$(pactl get-default-sink).monitor}"; gpu-screen-recorder -v no -w $WINDOW -c $CONTAINER -q $QUALITY -k $CODEC -ac $AUDIO_CODEC -a "$AUDIO" -f $FRAMERATE -r $REPLAYDURATION -o "$OUTPUTDIR" -mf $MAKEFOLDERS $ADDITIONAL_ARGS' - ''; - }; - +{...}: { xdg.desktopEntries."com.github.iwalton3.jellyfin-media-player" = { name = "Jellyfin Media Player"; comment = "Desktop client for Jellyfin"; diff --git a/devices/binto/modules/gpu-replay.nix b/devices/binto/modules/gpu-replay.nix index 6aa97a0a..1bda140d 100644 --- a/devices/binto/modules/gpu-replay.nix +++ b/devices/binto/modules/gpu-replay.nix @@ -1,5 +1,6 @@ { pkgs, + config, lib, ... }: let @@ -50,4 +51,26 @@ in { source = "${gsr}/bin/gsr-kms-server"; }; }; + + home-manager.users.${config.vars.user} = { + # TODO: add mic sound + xdg.configFile."gsr.sh" = { + executable = true; + text = '' + export WINDOW=DP-5 + export CONTAINER=mkv + export QUALITY=very_high + export CODEC=auto + export AUDIO_CODEC=aac + export FRAMERATE=60 + export REPLAYDURATION=1200 + export OUTPUTDIR=/home/matt/Videos/Replay + export MAKEFOLDERS=yes + # export ADDITIONAL_ARGS= + + # Disable compositor in X11 for best performance + exec /bin/sh -c 'AUDIO="''${AUDIO_DEVICE:-$(pactl get-default-sink).monitor}"; gpu-screen-recorder -v no -w $WINDOW -c $CONTAINER -q $QUALITY -k $CODEC -ac $AUDIO_CODEC -a "$AUDIO" -f $FRAMERATE -r $REPLAYDURATION -o "$OUTPUTDIR" -mf $MAKEFOLDERS $ADDITIONAL_ARGS' + ''; + }; + }; } diff --git a/devices/wim/default.nix b/devices/wim/default.nix index 762ce3f2..0cb87fb6 100644 --- a/devices/wim/default.nix +++ b/devices/wim/default.nix @@ -33,7 +33,6 @@ }; home-manager.users .${config.vars.user} = { imports = [ - ../../home/dconf.nix ../../home/firefox ./home/dotfiles.nix diff --git a/devices/wim/home/packages.nix b/devices/wim/home/packages.nix index 42441c74..08f0fb4c 100644 --- a/devices/wim/home/packages.nix +++ b/devices/wim/home/packages.nix @@ -1,72 +1,12 @@ -{ - pkgs, - nixpkgs-wayland, - ... -}: let - waypkgs = nixpkgs-wayland.packages.x86_64-linux; -in { - programs = { - obs-studio = { - enable = true; - plugins = with waypkgs; [ - obs-wlrobs - ]; - }; - - btop.enable = true; - }; - +{pkgs, ...}: { home.packages = (with pkgs.python311Packages; [ python pyclip ]) - ++ (with pkgs.plasma5Packages; [ - ark - kcharselect - kdenlive - okular - - # Dolphin & co - dolphin - dolphin-plugins - kdegraphics-thumbnailers - ffmpegthumbs - kio - kio-admin # needs to be both here and in system pkgs - kio-extras - kmime - ]) - ++ (with pkgs.gnome; [ - gnome-calculator - ]) ++ (with pkgs; [ - # School - virt-manager - bluej - camunda-modeler - - # Misc Apps - thunderbird # TODO: use programs.thunderbird - spotifywm - zeal - libreoffice-fresh # TODO: add spelling stuff and declarative conf? - photoqt - gimp-with-plugins # TODO: set plugins using nix - vlc - nextcloud-client - jellyfin-media-player - xournalpp - (pkgs.discord.override { - withOpenASAR = true; - withVencord = true; - }) - prismlauncher-qt5 - # Misc CLI acpi - alsa-utils - fontfor (writeShellScriptBin "Gparted" '' ( diff --git a/home/obs.nix b/home/obs.nix new file mode 100644 index 00000000..96578fe9 --- /dev/null +++ b/home/obs.nix @@ -0,0 +1,12 @@ +{nixpkgs-wayland, ...}: let + waypkgs = nixpkgs-wayland.packages.x86_64-linux; +in { + programs = { + obs-studio = { + enable = true; + plugins = with waypkgs; [ + obs-wlrobs + ]; + }; + }; +} diff --git a/modules/dolphin.nix b/modules/dolphin.nix new file mode 100644 index 00000000..369a9362 --- /dev/null +++ b/modules/dolphin.nix @@ -0,0 +1,27 @@ +{config, pkgs, ...}: { + environment.systemPackages = with pkgs; [ + plasma5Packages.kio-admin + ]; + + home-manager.users.${config.vars.user}.home.packages = + with pkgs; [] + ++ (with pkgs.plasma5Packages; [ + ark + kcharselect + kdenlive + okular + + # Dolphin & co + dolphin + dolphin-plugins + kdegraphics-thumbnailers + ffmpegthumbs + kio + kio-admin # needs to be both here and in system pkgs + kio-extras + kmime + ]) + ++ (with pkgs.gnome; [ + gnome-calculator + ]); +} diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index c35c095a..37bf6561 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -12,16 +12,12 @@ # Config stuff isNvidia = config.hardware.nvidia.modesetting.enable; isTouchscreen = config.hardware.sensor.iio.enable; - confPath = "${config.vars.configDir}/hypr/main.conf"; - kdeconnect = config.programs.kdeconnect; - gnomekey = config.services.gnome.gnome-keyring; - xserver = config.services.xserver; - - gset = pkgs.gsettings-desktop-schemas; - polkit = pkgs.plasma5Packages.polkit-kde-agent; in { # SYSTEM CONFIG - imports = [../greetd]; + imports = [ + ../greetd + ../dolphin.nix + ]; programs = { kdeconnect.enable = true; @@ -29,6 +25,7 @@ in { }; services = { + gnome.gnome-keyring.enable = true; dbus.enable = true; gvfs.enable = true; }; @@ -41,15 +38,13 @@ in { ]; }; - environment.systemPackages = with pkgs; [ - plasma5Packages.kio-admin - ]; - # HOME-MANAGER CONFIG home-manager.users.${config.vars.user} = { imports = [ - ../../home/theme.nix ../../home/alacritty.nix + ../../home/dconf.nix + ../../home/obs.nix + ../../home/theme.nix ../../home/wofi ]; @@ -64,8 +59,9 @@ in { ]); settings = { - env = - [ + env = let + gset = pkgs.gsettings-desktop-schemas; + in [ "XCURSOR_SIZE, 24" "XDG_DATA_DIRS, ${builtins.concatStringsSep ":" [ "${gset}/share/gsettings-schemas/${gset.name}" @@ -105,7 +101,9 @@ in { ]) ]; - input = { + input = let + xserver = config.services.xserver; + in { kb_layout = xserver.layout; kb_variant = xserver.xkbVariant; follow_mouse = true; @@ -116,17 +114,13 @@ in { exec-once = [ "hyprctl setcursor Dracula-cursors 24" - "${polkit}/libexec/polkit-kde-authentication-agent-1" + "${pkgs.plasma5Packages.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1" "swww init --no-cache && swww img -t none ${pkgs.dracula-theme}/wallpapers/waves.png" "wl-paste --watch cliphist store" - ] - ++ (optionals (kdeconnect.enable) [ - "${kdeconnect.package}/libexec/kdeconnectd" + "${config.programs.kdeconnect.package}/libexec/kdeconnectd" "kdeconnect-indicator" - ]) - ++ (optionals (gnomekey.enable) [ "gnome-keyring-daemon --start --components=secrets" - ]); + ]; windowrule = [ "noborder,^(wofi)$" @@ -209,13 +203,37 @@ in { special_scale_factor = 0.8; }; - source = [confPath]; + source = ["${config.vars.configDir}/hypr/main.conf"]; }; }; home.packages = with pkgs; [ + # School + virt-manager + bluej + camunda-modeler + libreoffice-fresh # TODO: declarative conf? + hunspell + hunspellDicts.en_CA + + # Apps + thunderbird # TODO: use programs.thunderbird + spotifywm + photoqt + mpv + nextcloud-client + jellyfin-media-player + xournalpp + (pkgs.discord.override { + withOpenASAR = true; + withVencord = true; + }) + prismlauncher-qt5 + # tools wl-color-picker + wl-clipboard + cliphist grim slurp swappy @@ -240,8 +258,6 @@ in { xorg.xrandr libinput xclip - wl-clipboard - cliphist libnotify ]; };