From d71afad094d1badf987f54df5eea579a24910407 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Wed, 25 Aug 2021 12:06:38 +0200 Subject: [PATCH] mpv: Make the primary screen configurable --- hosts/miku.nix | 6 ++++++ modules/programs/mpv/default.nix | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/hosts/miku.nix b/hosts/miku.nix index 976e493..29cd262 100644 --- a/hosts/miku.nix +++ b/hosts/miku.nix @@ -50,6 +50,10 @@ # Enable notification sounds propagatedBuildInputs = old.propagatedBuildInputs ++ [ prev.gsound ]; }); + + animedl = prev.animedl.overrideAttrs (old: { + extraPkgs = pkgs: with pkgs; [ mpv ]; + }); }) # Unstable, NUR, ... @@ -95,6 +99,8 @@ }; }; + programs.mpv.primaryScreen = "C27F398"; + networking = { interfaces.enp6s0.useDHCP = false; hostName = "miku"; diff --git a/modules/programs/mpv/default.nix b/modules/programs/mpv/default.nix index fc6d200..3ab727b 100644 --- a/modules/programs/mpv/default.nix +++ b/modules/programs/mpv/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: let makeMpvProfile = { shader, additional ? {} }: { @@ -12,11 +12,20 @@ let video-sync = "display-resample"; interpolation = ""; tscale = "oversample"; - # TODO: Make those two configurable - screen-name = "C27F398"; - fs-screen-name = "C27F398"; # Make mpv pop up on the primary screen - } // additional; + } // additional // (if config.programs.mpv != "" then { + # Make mpv pop up on the primary screen + screen-name = config.programs.mpv.primaryScreen; + fs-screen-name = config.programs.mpv.primaryScreen; + } else {}); in { + options.programs.mpv = { + primaryScreen = lib.mkOption { + type = lib.types.str; + default = ""; + description = "The name of the screen to use for fullscreen"; + }; + }; + config = { environment.systemPackages = with pkgs; [ mpv ];