This commit is contained in:
Peder Bergebakken Sundt 2024-01-26 01:46:33 +01:00
parent 7b5e25ed46
commit 5346aa8da3
6 changed files with 46 additions and 11 deletions

View File

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

View File

@ -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";
});
});
/**/
});
}

View File

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

View File

@ -21,7 +21,19 @@
];
home.packages = with pkgs; [
#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

View File

@ -4,6 +4,7 @@
git
gh
hub
colordiff
];
#programs.git.gitui.enable = true;

View File

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