alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
wrapperModules: init 0.alpha
author
lassulus
date
1 year ago
(Jul 29, 2025, 8:10 PM CEST)
commit
07b8c859
07b8c85933a3bc52dd9fb47cbd98326398b031a8
parent
4d53d1dd
4d53d1dd0d25e77e44403d1f6b30959c25ee9fbe
+134
2 changed files
Expand all
Collapse all
Unified
Split
wrapperModules
flake-module.nix
mpv
default.nix
+6
wrapperModules/flake-module.nix
View file
Reviewed
···
1
1
+
{ ... }:
2
2
+
{
3
3
+
imports = [
4
4
+
./mpv/default.nix
5
5
+
];
6
6
+
}
+128
wrapperModules/mpv/default.nix
View file
Reviewed
···
1
1
+
{
2
2
+
self,
3
3
+
lib,
4
4
+
...
5
5
+
}:
6
6
+
{
7
7
+
perSystem =
8
8
+
{ pkgs, self', ... }:
9
9
+
{
10
10
+
legacyPackages.wrappers.mpv = self.wrapLib.mkWrapper (wlib: {
11
11
+
inherit pkgs;
12
12
+
module =
13
13
+
{ config, ... }:
14
14
+
{
15
15
+
options = {
16
16
+
scripts = lib.mkOption {
17
17
+
type = lib.types.listOf lib.types.package;
18
18
+
default = [ ];
19
19
+
description = "Scripts to add to mpv via override.";
20
20
+
};
21
21
+
"mpv.input" = lib.mkOption {
22
22
+
type = wlib.types.file;
23
23
+
default.content = "";
24
24
+
};
25
25
+
"mpv.conf" = lib.mkOption {
26
26
+
type = wlib.types.file;
27
27
+
default.content = ''
28
28
+
osd-font-size=20
29
29
+
'';
30
30
+
};
31
31
+
};
32
32
+
config.flags = {
33
33
+
"--no-config" = { };
34
34
+
"--input-conf" = config."mpv.input".path;
35
35
+
"--include" = config."mpv.conf".path;
36
36
+
"--ytdl-format" = "best[height<1081]";
37
37
+
"--script-opts" = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
38
38
+
"--script-opts-append" = "sponsorblock-local_database=no";
39
39
+
"--audio-channels" = "2";
40
40
+
"--script" = config.scripts;
41
41
+
};
42
42
+
};
43
43
+
});
44
44
+
packages.mpv_test = self'.legacyPackages.wrappers.mpv {
45
45
+
};
46
46
+
};
47
47
+
flake.wrapLib.mkWrapper =
48
48
+
argsFun: settings:
49
49
+
let
50
50
+
args = argsFun wrapperLib;
51
51
+
pkgs = args.pkgs;
52
52
+
module = args.module;
53
53
+
54
54
+
wrapperLib = {
55
55
+
types = {
56
56
+
inherit file;
57
57
+
};
58
58
+
};
59
59
+
file = lib.types.submodule (
60
60
+
{ name, config, ... }:
61
61
+
{
62
62
+
options = {
63
63
+
content = lib.mkOption {
64
64
+
type = lib.types.lines;
65
65
+
description = ''
66
66
+
content of file
67
67
+
'';
68
68
+
};
69
69
+
path = lib.mkOption {
70
70
+
type = lib.types.path;
71
71
+
description = ''
72
72
+
the path to the file
73
73
+
'';
74
74
+
default = pkgs.writeText name config.content;
75
75
+
};
76
76
+
};
77
77
+
}
78
78
+
);
79
79
+
eval = lib.evalModules {
80
80
+
modules = [
81
81
+
module
82
82
+
{
83
83
+
options = {
84
84
+
package = lib.mkOption {
85
85
+
type = lib.types.package;
86
86
+
default = pkgs.mpv;
87
87
+
description = "The base mpv package to use.";
88
88
+
};
89
89
+
extraPackages = lib.mkOption {
90
90
+
type = lib.types.listOf lib.types.package;
91
91
+
default = [ ];
92
92
+
};
93
93
+
flags = lib.mkOption {
94
94
+
type = lib.types.attrsOf lib.types.unspecified; # TODO add list handling
95
95
+
default = { };
96
96
+
};
97
97
+
# scripts = lib.mkOption {
98
98
+
# type = lib.types.listOf lib.types.package;
99
99
+
# default = [ ];
100
100
+
# description = "Scripts to add to mpv via override.";
101
101
+
# };
102
102
+
# "mpv.input" = lib.mkOption {
103
103
+
# type = file;
104
104
+
# default.content = "";
105
105
+
# };
106
106
+
# "mpv.conf" = lib.mkOption {
107
107
+
# type = file;
108
108
+
# default.content = ''
109
109
+
# osd-font-size=20
110
110
+
# '';
111
111
+
# };
112
112
+
};
113
113
+
config = settings;
114
114
+
}
115
115
+
];
116
116
+
};
117
117
+
config = eval.config;
118
118
+
options = eval.options;
119
119
+
in
120
120
+
self.libWithPkgs.${pkgs.system}.makeWrapper config.package {
121
121
+
runtimeInputs = config.extraPackages;
122
122
+
flagSeparator = "=";
123
123
+
flags = config.flags;
124
124
+
passthru = {
125
125
+
inherit options config settings;
126
126
+
};
127
127
+
};
128
128
+
}