diff --git a/base.nix b/base.nix index d7ecb54..3e38d40 100644 --- a/base.nix +++ b/base.nix @@ -50,6 +50,7 @@ nix.settings.allowed-users = [ "*" ]; # default #nix.settings.allowed-users = [ "@nixbld" "@builders" ]; # TODO: this nix.settings.trusted-users = [ "root" "@wheel" ]; + nix.settings.keep-derivations = true; # great with nix-diff nix.settings.auto-optimise-store = true; # deduplicate with hardlinks, expensive. Alternative: nix-store --optimise #nix.optimize.automatic = true; # periodic optimization nix.gc.automatic = true; diff --git a/hardware/gpu/cuda.nix b/hardware/gpu/cuda.nix index ca8e0b1..f9483c9 100644 --- a/hardware/gpu/cuda.nix +++ b/hardware/gpu/cuda.nix @@ -64,9 +64,9 @@ #'') ]); - # nvidia bad nixpkgs.config.packageOverrides = (pkgs: { + /** / teams = pkgs.teams.overrideAttrs (old: rec { postInstall = (old.postInstall or "") + '' substituteInPlace $out/share/applications/teams.desktop \ @@ -74,6 +74,7 @@ ''; # --replace 'Exec=teams' 'Exec=teams --disable-gpu' }); + /**/ discord = pkgs.discord.overrideAttrs (old: rec { desktopItem = old.desktopItem.override (old: { #exec = "env NIXOS_OZONE_WL=1 ${old.exec}"; @@ -83,6 +84,7 @@ ln -sf "${desktopItem}/share/applications" $out/share/ '' + old.postInstall; }); + /** / slack = pkgs.slack.overrideAttrs (old: { postInstall = old.postInstall or "" + '' substituteInPlace $out/share/applications/slack.desktop \ @@ -97,6 +99,6 @@ exec = "element-desktop --use-gl=desktop %u"; }); }); + /**/ }); - } diff --git a/users/pbsds/home/default.nix b/users/pbsds/home/default.nix index 2d19ece..9ec30be 100644 --- a/users/pbsds/home/default.nix +++ b/users/pbsds/home/default.nix @@ -2,7 +2,7 @@ { pkgs, config, ... }: { #nixpkgs.config.allowUnfree = true; - home.stateVersion = "22.11"; # TODO: what uses this? + home.stateVersion = "23.05"; imports = [ ./profiles/sops.nix diff --git a/users/pbsds/home/profiles/desktop.nix b/users/pbsds/home/profiles/desktop.nix index 6a13d6d..e26f6fb 100644 --- a/users/pbsds/home/profiles/desktop.nix +++ b/users/pbsds/home/profiles/desktop.nix @@ -21,7 +21,19 @@ ]; home.packages = with pkgs; [ - wl-clipboard + #wl-clipboard # https://github.com/bugaevc/wl-clipboard/issues/185 + (symlinkJoin { + inherit (wl-clipboard) name; + paths = [ + (writeShellScriptBin "wl-copy" '' + timeout 0.25s ${lib.getExe' wl-clipboard "wl-copy"} "$@" + '') + (writeShellScriptBin "wl-paste" '' + timeout 0.25s ${lib.getExe' wl-clipboard "wl-paste"} "$@" + '') + wl-clipboard + ]; + }) discord element-desktop @@ -30,6 +42,8 @@ slack telegram-desktop + (pkgs.zxtune or null) + f3d firefox zotero diff --git a/users/pbsds/home/profiles/git.nix b/users/pbsds/home/profiles/git.nix index ba350a1..0d06b0a 100644 --- a/users/pbsds/home/profiles/git.nix +++ b/users/pbsds/home/profiles/git.nix @@ -4,6 +4,7 @@ git gh hub + colordiff ]; #programs.git.gitui.enable = true; diff --git a/users/pbsds/home/profiles/mpv.nix b/users/pbsds/home/profiles/mpv.nix index d83b2f9..c4a27f2 100644 --- a/users/pbsds/home/profiles/mpv.nix +++ b/users/pbsds/home/profiles/mpv.nix @@ -1,17 +1,34 @@ -{ pkgs, flakes, ... }: +{ lib, pkgs, flakes, ... }: + +let + m = pkgs.mpvScripts; + a4k = lib.mkIf (m ? anime4k); +in + { #home.packages = with pkgs; [ mpv ]; programs.mpv.enable = true; programs.mpv.bindings."n" = "sub-seek 1"; programs.mpv.bindings."SHIFT+n" = "sub-seek -1"; - programs.mpv.bindings."b" = ''cycle-values audio-channels 2 "auto"''; + programs.mpv.bindings."b" = ''cycle-values audio-channels 2 5 7 "auto"''; - programs.mpv.scripts = with pkgs.mpvScripts; [ - #thumbnail # TOO SLOW - thumbfast - mpris - (pkgs.mpvScripts.mpv-webm or flakes.self.pkgs.mpv-webm) # activate with SHIFT+W + # m.anime4k - from https://github.com/NixOS/nixpkgs/pull/273830 + # TODO: add to home-manager? + programs.mpv.bindings."CTRL+0" = a4k ''no-osd change-list glsl-shaders clr ""; show-text "GLSL shaders cleared"''; + programs.mpv.bindings."CTRL+1" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A (HQ)"''; + programs.mpv.bindings."CTRL+2" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_Soft_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B (HQ)"''; + programs.mpv.bindings."CTRL+3" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C (HQ)"''; + programs.mpv.bindings."CTRL+4" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_Restore_CNN_M.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A+A (HQ)"''; + programs.mpv.bindings."CTRL+5" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_Soft_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Restore_CNN_Soft_M.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B+B (HQ)"''; + programs.mpv.bindings."CTRL+6" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Restore_CNN_M.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C+A (HQ)"''; + /**/ + + programs.mpv.scripts = [ + #m.thumbnail # TOO SLOW + m.thumbfast + m.mpris + (m.mpv-webm or flakes.self.pkgs.mpv-webm) # activate with SHIFT+W # from https://github.com/mpv-player/mpv/issues/9767#issuecomment-1024831645 ({ scriptName = "dynamic-subs.lua"; } // (pkgs.writeTextDir "share/mpv/scripts/dynamic-subs.lua" '' mp.add_hook('on_load', 10, function()