From 2959cfe6dcfc6cd5c77386184dc561181ed8671c Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Thu, 8 Jul 2021 01:43:45 +0000 Subject: [PATCH] User native home-manager module for mpv --- externals/home-manager | 2 +- home/default.nix | 5 ++--- home/mpv.nix | 30 ++++++++++++++++++++++++++++++ system/starlight/default.nix | 6 +++--- 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 home/mpv.nix diff --git a/externals/home-manager b/externals/home-manager index 2376999..06ee8ec 160000 --- a/externals/home-manager +++ b/externals/home-manager @@ -1 +1 @@ -Subproject commit 23769994e8f7b212d9a257799173b120ed87736b +Subproject commit 06ee8ec8dfc4554c374052cd7b7083765748af99 diff --git a/home/default.nix b/home/default.nix index 97d4d20..4a033a6 100644 --- a/home/default.nix +++ b/home/default.nix @@ -8,17 +8,16 @@ useUserPackages = true; useGlobalPkgs = true; }; - home-manager.users.artemis = { pkgs, ... }: { + home-manager.users.artemis = { imports = [ ./git.nix + ./mpv.nix ./neovim ]; xdg.enable = true; xdg.configFile = { "alacritty/alacritty.yml".source = ./files/alacritty.yml; - "mpv/mpv.conf".source = ./files/mpv/mpv.conf; - "mpv/input.conf".source = ./files/mpv/input.conf; "mimeapps.list".source = ./files/mimeapps.list; "swaylock/config".text = '' daemonize diff --git a/home/mpv.nix b/home/mpv.nix new file mode 100644 index 0000000..380e347 --- /dev/null +++ b/home/mpv.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: +{ + programs.mpv = { + enable = true; + config = { + slang = "eng,en"; + alang = "eng,en"; + hwdec = "vaapi"; + vo = "gpu"; + + no-audio-display = ""; + audio-normalize-downmix = ""; + replaygain = "track"; + }; + # Don't make this profile default since not all machines can handle it + profiles.gpu-hq = { + scale = "ewa_lanczossharp"; + cscale = "ewa_lanczossharp"; + }; + + bindings = { + WHEEL_UP = "ignore"; + WHEEL_DOWN = "ignore"; + WHEEL_LEFT = "ignore"; + WHEEL_RIGHT = "ignore"; + k = "add sub-scale -0.1"; + K = "add sub-scale +0.1"; + }; + }; +} diff --git a/system/starlight/default.nix b/system/starlight/default.nix index a5ecb86..de0e9b4 100644 --- a/system/starlight/default.nix +++ b/system/starlight/default.nix @@ -77,9 +77,9 @@ hardware.opengl.extraPackages = with pkgs; [ vulkan-validation-layers ]; - # Scanning - hardware.sane.enable = true; - users.users.artemis.extraGroups = [ "scanner" ]; + # Home + home-manager.users.artemis.programs.mpv.defaultProfiles = [ "gpu-hq" ]; + # NixOS system.stateVersion = "19.09"; }