From 32588d707410f9ad78b2e900de8de34ca33db2c2 Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sun, 27 Jul 2025 22:13:26 -0700 Subject: [PATCH] feat: waybar nvidia --- flake.lock | 24 --- flake.nix | 7 - home/environments/niri/autostart.nix | 2 +- home/environments/niri/niri.nix | 1 + home/environments/niri/waybar.nix | 7 +- home/profiles/common/stylix.nix | 3 + home/profiles/graphical/bitwarden.nix | 3 + home/profiles/graphical/discord.nix | 18 ++- home/profiles/graphical/packages.nix | 3 - home/profiles/graphical/thunderbird.nix | 36 +++++ home/profiles/graphical/thunderbird.yaml | 0 home/profiles/shell/chawan.nix | 14 ++ nixos/common/stylix.nix | 3 + packages/dorion.nix | 190 ----------------------- systems/goliath.nix | 13 ++ tree.nix | 1 - 16 files changed, 89 insertions(+), 236 deletions(-) create mode 100644 home/profiles/graphical/bitwarden.nix create mode 100644 home/profiles/graphical/thunderbird.nix create mode 100644 home/profiles/graphical/thunderbird.yaml create mode 100644 home/profiles/shell/chawan.nix delete mode 100644 packages/dorion.nix diff --git a/flake.lock b/flake.lock index b9ec560c..b7b8e97c 100644 --- a/flake.lock +++ b/flake.lock @@ -825,29 +825,6 @@ "type": "github" } }, - "moonlight": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1752617499, - "narHash": "sha256-LVXO+V182R2KmNfTJjpYx/yYk97+Kvzul7gzSM72JJM=", - "owner": "moonlight-mod", - "repo": "moonlight", - "rev": "694b353a772ee2d0be218b2158a28bf71dbdaddd", - "type": "github" - }, - "original": { - "owner": "moonlight-mod", - "repo": "moonlight", - "type": "github" - } - }, "naersk": { "inputs": { "fenix": "fenix", @@ -1421,7 +1398,6 @@ "lanzaboote": "lanzaboote", "lix-module": "lix-module", "minecraft": "minecraft", - "moonlight": "moonlight", "naersk": "naersk", "neorg-overlay": "neorg-overlay", "nh": "nh", diff --git a/flake.nix b/flake.nix index de3aee97..ed74741a 100644 --- a/flake.nix +++ b/flake.nix @@ -171,13 +171,6 @@ xwayland-satellite-stable.follows = "empty"; }; }; - moonlight = { - url = "github:moonlight-mod/moonlight"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; lanzaboote = { url = "github:nix-community/lanzaboote/v0.4.2"; diff --git a/home/environments/niri/autostart.nix b/home/environments/niri/autostart.nix index 0f0544d9..0c2f53ac 100644 --- a/home/environments/niri/autostart.nix +++ b/home/environments/niri/autostart.nix @@ -67,7 +67,7 @@ in { } { command = [ - "discord" + "${getExe' config.programs.vesktop.package "vesktop"}" "--enable-features=WaylandLinuxDrmSyncobj,UseOzonePlatform" "--ozone-platform=wayland" ]; diff --git a/home/environments/niri/niri.nix b/home/environments/niri/niri.nix index 19389c9c..e563165c 100644 --- a/home/environments/niri/niri.nix +++ b/home/environments/niri/niri.nix @@ -75,6 +75,7 @@ in { }; workspaces = { browser = {}; + mail = {}; chat = {}; vidya = {}; media = {}; diff --git a/home/environments/niri/waybar.nix b/home/environments/niri/waybar.nix index ceee409e..5d5283fe 100644 --- a/home/environments/niri/waybar.nix +++ b/home/environments/niri/waybar.nix @@ -81,7 +81,7 @@ _: { margin: 0px; } - #mode, #custom-notification, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris { + #mode, #custom-notification, #custom-nvidia-vram, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris { padding: 0 5px; margin: 0 5px; } @@ -94,6 +94,9 @@ _: { font-size: 150%; } + #custom-nvidia-vram { + } + #mpris.playing { background-color: @base0B; } @@ -164,7 +167,7 @@ _: { "backlight" "battery" "tray" - #"custom/notification" + "custom/notification" ]; idle_inhibitor = { diff --git a/home/profiles/common/stylix.nix b/home/profiles/common/stylix.nix index a96e425d..22f5b3e4 100644 --- a/home/profiles/common/stylix.nix +++ b/home/profiles/common/stylix.nix @@ -1,4 +1,7 @@ { pkgs, ... }: { + home.packages = [ + pkgs.adwaita-icon-theme + ]; stylix = { enable = true; cursor = { diff --git a/home/profiles/graphical/bitwarden.nix b/home/profiles/graphical/bitwarden.nix new file mode 100644 index 00000000..4705568e --- /dev/null +++ b/home/profiles/graphical/bitwarden.nix @@ -0,0 +1,3 @@ +{ pkgs, ... }: { + home.packages = [ pkgs.bitwarden-desktop ]; +} diff --git a/home/profiles/graphical/discord.nix b/home/profiles/graphical/discord.nix index 8f322024..28a07a5d 100644 --- a/home/profiles/graphical/discord.nix +++ b/home/profiles/graphical/discord.nix @@ -1,12 +1,14 @@ {pkgs, ...}: { - home.packages = with pkgs; [ - (discord-krisp.override { - withOpenASAR = true; - withMoonlight = true; - }) - ]; - - programs.moonlight = { + stylix.targets.vesktop.enable = false; + programs.vesktop = { enable = true; + settings = { + autoUpdate = false; + autoUpdateNotification = false; + notifyAboutUpdates = false; + disableMinSize = true; + plugins = { + }; + }; }; } diff --git a/home/profiles/graphical/packages.nix b/home/profiles/graphical/packages.nix index a81f5af4..3243e3ed 100644 --- a/home/profiles/graphical/packages.nix +++ b/home/profiles/graphical/packages.nix @@ -7,9 +7,6 @@ btop htop - # Mail - thunderbird - aseprite # Chat tdesktop # Telegram diff --git a/home/profiles/graphical/thunderbird.nix b/home/profiles/graphical/thunderbird.nix new file mode 100644 index 00000000..03f3a3db --- /dev/null +++ b/home/profiles/graphical/thunderbird.nix @@ -0,0 +1,36 @@ +_: { + programs.thunderbird = { + enable = true; + profiles.main = { + isDefault = true; + withExternalGnupg = true; + }; + }; + accounts.email.accounts = let + katIdentity = { + realName = "Kat Inskip"; + }; + dorkIdentity = { + realName = "Kat Dork"; + }; + mainEnable.thunderbird = { + enable = true; + profiles = [ "main" ]; + }; + gmailAccount = mainEnable // { + flavor = "gmail.com"; + }; + in { + primary = gmailAccount // katIdentity // { + primary = true; + address = "kat@inskip.me"; + }; + home = gmailAccount // katIdentity // { + address = "kat.inskip@gmail.com"; + }; + dork = gmailAccount // dorkIdentity // { + address = "dorkdev99@gmail.com"; + }; + }; + +} diff --git a/home/profiles/graphical/thunderbird.yaml b/home/profiles/graphical/thunderbird.yaml new file mode 100644 index 00000000..e69de29b diff --git a/home/profiles/shell/chawan.nix b/home/profiles/shell/chawan.nix new file mode 100644 index 00000000..009c755c --- /dev/null +++ b/home/profiles/shell/chawan.nix @@ -0,0 +1,14 @@ +_: { + programs.chawan = { + enable = true; + settings = { + buffer = { + images = true; + autofocus = true; + }; + pager."C-k" = "() => pager.load('https://duckduckgo.com/?=')"; + pager."C-l" = "() => pager.load('https://github.com/?=')"; + pager."C-m" = "() => pager.load('https://news.ycombinator.com/?=')"; + }; + }; +} diff --git a/nixos/common/stylix.nix b/nixos/common/stylix.nix index 24ff097d..a847f993 100644 --- a/nixos/common/stylix.nix +++ b/nixos/common/stylix.nix @@ -1,4 +1,7 @@ { pkgs, ... }: { + environment.systemPackages = [ + pkgs.adwaita-icon-theme + ]; stylix = { enable = true; targets = { diff --git a/packages/dorion.nix b/packages/dorion.nix deleted file mode 100644 index 7ba142e3..00000000 --- a/packages/dorion.nix +++ /dev/null @@ -1,190 +0,0 @@ -{ - lib, - fetchFromGitHub, - fetchurl, - rustPlatform, - cmake, - ninja, - wrapGAppsHook4, - glib-networking, - gst_all_1, - libsysprof-capture, - libayatana-appindicator, - nodejs, - openssl, - pkg-config, - yq-go, - pnpm_9, - webkitgtk_4_1, - cargo-tauri, - desktop-file-utils, -}: let - webkitgtk_4_1' = webkitgtk_4_1.override { - enableExperimental = true; - }; - - shelter = fetchurl { - url = "https://raw.githubusercontent.com/uwu/shelter-builds/fab6f100bd0ab8583d67f792f66722a7d2a14bd1/shelter.js"; - hash = "sha256-d9vaKLrl8RYNcHnE1iGN49ov6U/Y+9XpEsio+c1Sguc="; - meta = { - homepage = "https://github.com/uwu/shelter"; - sourceProvenance = [lib.sourceTypes.binaryBytecode]; # actually, minified JS - license = lib.licenses.cc0; - }; - }; -in - rustPlatform.buildRustPackage (finalAttrs: { - pname = "dorion"; - version = "6.7.1"; - - src = fetchFromGitHub { - owner = "SpikeHD"; - repo = "Dorion"; - tag = "v${finalAttrs.version}"; - hash = "sha256-d4G3royqhz+te5wPWVLNqqG/w0qOvTd7dKcWSzxUMUo="; - }; - - cargoPatches = [ - ./no-cargo-patch.patch - ]; - - cargoRoot = "src-tauri"; - buildAndTestSubdir = finalAttrs.cargoRoot; - - useFetchCargoVendor = true; - cargoHash = "sha256-1xpAJkS31DjrZCY5WJ4/Z1t1ALED5gz7xYLhVR1Qzww="; - - pnpmDeps = pnpm_9.fetchDeps { - inherit (finalAttrs) pname version src; - hash = "sha256-xBonUzA4+1zbViEsKap6CaG6ZRldW1LjNYIB+FmVRFs="; - }; - - # CMake (webkit extension) - cmakeDir = "."; - cmakeBuildDir = "src-tauri/extension_webkit"; - dontUseCmakeConfigure = true; - dontUseNinjaBuild = true; - dontUseNinjaCheck = true; - dontUseNinjaInstall = true; - # cmake's supposed to set this automatically - # ... but the detection is based on the presence of ninja build hook - cmakeFlags = [ - "-GNinja" - ]; - - nativeBuildInputs = [ - pnpm_9.configHook - cargo-tauri.hook - nodejs - pkg-config - wrapGAppsHook4 - yq-go - desktop-file-utils - cmake - ninja - ]; - - buildInputs = [ - openssl - webkitgtk_4_1' - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-good - gst_all_1.gst-plugins-rs - glib-networking - libsysprof-capture - libayatana-appindicator - ]; - - postPatch = '' - # remove updater - rm -rf updater - - # patch cargo-deps - pushd $cargoDepsCopy/tauri-plugin-shell-* - patch -p1 < /build/source/src-tauri/patches/tauri-plugin-shell+*.patch - popd - - substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \ - --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" - - # disable pre-build script and disable auto-updater - yq -iPo=json ' - .bundle.resources = (.bundle.resources | map(select(. != "updater*"))) - ' src-tauri/tauri.conf.json - - # link shelter injection - ln -s ${shelter} src-tauri/injection/shelter.js - - # link html/frontend data - ln -s /build/source/src /build/source/src-tauri/html - ''; - - configurePhase = '' - cmakeConfigurePhase - pnpmConfigHook - ''; - - buildPhase = '' - ninjaBuildPhase - cd /build/source - tauriBuildHook - ''; - - postInstall = '' - # Set up the resource directories - mkdir -p $out/lib/Dorion - ln -s $out/lib/Dorion $out/lib/dorion - rm -rf $out/lib/Dorion/injection - cp -r src-tauri/injection $out/lib/Dorion - cp -r src $out/lib/Dorion - - # Modify the desktop file - desktop-file-edit \ - --set-comment "Tiny alternative Discord client" \ - --set-key="Exec" --set-value="Dorion %U" \ - --set-key="TryExec" --set-value="Dorion" \ - --set-key="StartupWMClass" --set-value="Dorion" \ - --set-key="StartupNotify" --set-value="true" \ - --set-key="Categories" --set-value="Network;InstantMessaging;Chat;" \ - --set-key="Keywords" --set-value="dorion;discord;vencord;chat;im;vc;ds;dc;dsc;tauri;" \ - --set-key="Terminal" --set-value="false" \ - --set-key="MimeType" --set-value="x-scheme-handler/discord" \ - $out/share/applications/Dorion.desktop - ''; - - # error: failed to run custom build command for `Dorion v6.5.3 (/build/source/src-tauri)` - # Permission denied (os error 13) - doCheck = false; - - env = { - TAURI_RESOURCE_DIR = "${placeholder "out"}/lib"; - }; - - meta = { - homepage = "https://spikehd.github.io/projects/dorion/"; - description = "Tiny alternative Discord client"; - longDescription = '' - Dorion is an alternative Discord client aimed towards lower-spec or - storage-sensitive PCs that supports themes, plugins, and more! - ''; - changelog = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}"; - downloadPage = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}"; - license = with lib.licenses; [ - gpl3Only - cc0 # Shelter - ]; - mainProgram = "Dorion"; - maintainers = with lib.maintainers; [ - nyabinary - aleksana - griffi-gh - getchoo - ]; - platforms = lib.platforms.linux; - sourceProvenance = [ - lib.sourceTypes.binaryBytecode # actually, minified JS - lib.sourceTypes.fromSource - ]; - }; - }) diff --git a/systems/goliath.nix b/systems/goliath.nix index 57ae509b..0f50296f 100644 --- a/systems/goliath.nix +++ b/systems/goliath.nix @@ -8,6 +8,7 @@ _: let ... }: let inherit (lib.attrsets) nameValuePair listToAttrs; + inherit (lib.meta) getExe'; datasets = [ "root" "nix" @@ -96,6 +97,18 @@ _: let "-model_sheet" ]; }; + programs.waybar.settings.main = { + modules-center = [ + "custom/nvidia-vram" + ]; + "custom/nvidia-vram" = { + tooltip = false; + format = "nvidia {}"; + interval = 1; + exec = "${getExe' pkgs.nvidia-smi "nvidia-smi"} --query-gpu=memory.used,memory.total,pstate --format=csv,noheader,nounits"; + return-type = ""; + }; + }; niri.settings = { outputs = { "LG Electronics LG Ultra HD 0x0001AC91" = { diff --git a/tree.nix b/tree.nix index 7359d9a2..e3b9387a 100644 --- a/tree.nix +++ b/tree.nix @@ -112,7 +112,6 @@ sops-nix.homeManagerModules.sops chaotic.homeManagerModules.default spicetify-nix.homeManagerModules.spicetify - moonlight.homeModules.default nix-flatpak.homeManagerModules.nix-flatpak zen-browser.homeModules.default stylix.homeModules.stylix