aboutsummaryrefslogtreecommitdiff
path: root/modules/home
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home')
-rw-r--r--modules/home/media/jellyfin-mpv-shim/default.nix59
-rw-r--r--modules/home/media/mpv/default.nix67
-rw-r--r--modules/home/shells/zsh/default.nix34
3 files changed, 146 insertions, 14 deletions
diff --git a/modules/home/media/jellyfin-mpv-shim/default.nix b/modules/home/media/jellyfin-mpv-shim/default.nix
new file mode 100644
index 0000000..53826f6
--- /dev/null
+++ b/modules/home/media/jellyfin-mpv-shim/default.nix
@@ -0,0 +1,59 @@
+{ config, lib, ... }:
+let
+ cfg = config.nx.media.jellyfin-mpv-shim;
+ # Reference your custom mpv options
+ mpvOpt = config.nx.media.mpv;
+ inherit (lib)
+ mkEnableOption
+ mkIf
+ mkOption
+ types
+ optionalAttrs
+ ;
+in
+{
+ options.nx.media.jellyfin-mpv-shim = {
+ enable = mkEnableOption "Jellyfin MPV Shim";
+ name = mkOption {
+ description = "Name of player";
+ type = types.str;
+ default = "mpv-shim";
+ };
+ hdrExpansion = mkOption {
+ type = types.bool;
+ default = mpvOpt.hdrExpansion;
+ };
+ targetPeak = mkOption {
+ type = types.int;
+ default = mpvOpt.targetPeak;
+ };
+ };
+
+ config = mkIf cfg.enable {
+ systemd.user.services.jellyfin-mpv-shim.Service.Environment = [
+ "ENABLE_HDR_WSI=1"
+ ];
+
+ services.jellyfin-mpv-shim = {
+ enable = true;
+ settings = {
+ player_name = cfg.name;
+ allow_transcode_to_h256 = true;
+ };
+ mpvConfig = {
+ vo = "gpu-next";
+ gpu-api = "vulkan";
+ target-colorspace-hint = "yes";
+ target-peak = cfg.targetPeak;
+ }
+ // (optionalAttrs cfg.hdrExpansion {
+ target-trc = "pq";
+ target-prim = "bt.2020";
+ #target-peak = 406;
+ #tone-mapping = "spline";
+ #tone-mapping-mode = "rgb";
+ inverse-tone-mapping = "yes";
+ });
+ };
+ };
+}
diff --git a/modules/home/media/mpv/default.nix b/modules/home/media/mpv/default.nix
new file mode 100644
index 0000000..f6ac360
--- /dev/null
+++ b/modules/home/media/mpv/default.nix
@@ -0,0 +1,67 @@
+{ config, lib, ... }:
+let
+ cfg = config.nx.media.mpv;
+ inherit (lib)
+ mkEnableOption
+ types
+ optional
+ mkIf
+ mkOption
+ ;
+in
+{
+ options.nx.media.mpv = {
+ enable = mkEnableOption "a free, open source, and cross-platform media player";
+ hdrExpansion = mkEnableOption "SDR to HDR inverse tone mapping";
+ targetPeak = mkOption {
+ description = "Peak brightness of the display";
+ type = types.int;
+ default = 500; # For MO27Q28G
+ };
+ };
+ config = mkIf cfg.enable {
+ programs.mpv = {
+ enable = true;
+ config = {
+ vo = "gpu-next";
+ gpu-api = "vulkan";
+ target-peak = cfg.targetPeak;
+ target-colorspace-hint = "yes";
+ };
+ profiles = {
+ # Dolby Vision profile
+ "DOVI" = {
+ profile-restore = "copy";
+ profile-cond = "p[\"video-dec-params/gamma\"] == \"auto\"";
+ target-trc = "pq";
+ target-prim = "bt.2020";
+ target-peak = cfg.targetPeak;
+ tone-mapping-mode = "auto";
+ };
+
+ # SDR look while in HDR
+ "SDR" = {
+ profile-restore = "copy";
+ target-trc = "pq";
+ target-prim = "bt.2020";
+ target-peak = 207;
+ tone-mapping = "bt.2390";
+ tone-mapping-mode = "rgb";
+ inverse-tone-mapping = "yes";
+ };
+
+ # SDR to HDR inverse tone mapping
+ "SDR_HDR_EFFECT" = {
+ profile-restore = "copy";
+ target-trc = "pq";
+ target-prim = "bt.2020";
+ target-peak = 406;
+ tone-mapping = "spline";
+ tone-mapping-mode = "rgb";
+ inverse-tone-mapping = "yes";
+ };
+ };
+ defaultProfiles = optional cfg.hdrExpansion "HDR_MODE:SDR_HDR_EFFECT";
+ };
+ };
+}
diff --git a/modules/home/shells/zsh/default.nix b/modules/home/shells/zsh/default.nix
index 72d3f9a..5da67c9 100644
--- a/modules/home/shells/zsh/default.nix
+++ b/modules/home/shells/zsh/default.nix
@@ -25,23 +25,29 @@ in
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initContent = ''
- # view man pages with nvim
- export MANPAGER="nvim +Man!"
+ # view man pages with nvim
+ export MANPAGER="nvim +Man!"
- # Directory completion with trailing slash
- zstyle ':completion:*' list-dirs-first true
- zstyle ':completion:*' special-dirs true
- zstyle ':completion:*' squeeze-slashes true
- zstyle ':completion:*' add-space false
+ # Directory completion with trailing slash
+ zstyle ':completion:*' list-dirs-first true
+ zstyle ':completion:*' special-dirs true
+ zstyle ':completion:*' squeeze-slashes true
+ zstyle ':completion:*' add-space false
- # Case-insensitive completion
- zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
- # vim keybindings
- bindkey -v
+ # Case-insensitive completion
+ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
+ # vim keybindings
+ bindkey -v
- # zoxide smarter cmd command
- eval "$(zoxide init zsh)"
- '';
+ # Auto cd - type directory name to cd into it
+ setopt AUTO_CD
+
+ # Complete .. to ../ for directory navigation
+ setopt AUTO_PARAM_SLASH
+
+ # zoxide smarter cmd command
+ eval "$(zoxide init zsh)"
+ '';
shellAliases = {
ls = "ls --color=auto";
};