This repository has no description
1.9 kB
76 lines
1{ self, lib, ... }:
2{
3 imports = [
4 ./mpv/default.nix
5 ];
6 flake.wrapLib.mkWrapper =
7 argsFun: settings:
8 let
9 args = argsFun wrapperLib;
10 pkgs = args.pkgs;
11 module = args.module;
12
13 wrapperLib = {
14 types = {
15 inherit file;
16 };
17 };
18 file = lib.types.submodule (
19 { name, config, ... }:
20 {
21 options = {
22 content = lib.mkOption {
23 type = lib.types.lines;
24 description = ''
25 content of file
26 '';
27 };
28 path = lib.mkOption {
29 type = lib.types.path;
30 description = ''
31 the path to the file
32 '';
33 default = pkgs.writeText name config.content;
34 };
35 };
36 }
37 );
38 eval = lib.evalModules {
39 modules = [
40 module
41 {
42 options = {
43 package = lib.mkOption {
44 type = lib.types.package;
45 description = "The base package to use.";
46 };
47 extraPackages = lib.mkOption {
48 type = lib.types.listOf lib.types.package;
49 default = [ ];
50 };
51 flags = lib.mkOption {
52 type = lib.types.attrsOf lib.types.unspecified; # TODO add list handling
53 default = { };
54 };
55 passthru = lib.mkOption {
56 type = lib.types.attrs;
57 default = { };
58 };
59 };
60 config = settings;
61 }
62 ];
63 };
64 config = eval.config;
65 options = eval.options;
66 in
67 self.libWithPkgs.${pkgs.system}.makeWrapper config.package {
68 runtimeInputs = config.extraPackages;
69 flagSeparator = "=";
70 flags = config.flags;
71 passthru = {
72 inherit options config settings;
73 }
74 // config.passthru;
75 };
76}