@@ -23,10 +23,10 @@ This library provides two main components:
2323``` nix
2424{
2525 inputs.wrappers.url = "github:lassulus/wrappers";
26-
26+
2727 outputs = { self, nixpkgs, wrappers }: {
28- packages.x86_64-linux.default =
29- wrappers.wrapperModules.mpv.apply {
28+ packages.x86_64-linux.default =
29+ ( wrappers.wrapperModules.mpv.apply {
3030 pkgs = nixpkgs.legacyPackages.x86_64-linux;
3131 scripts = [ pkgs.mpvScripts.mpris ];
3232 "mpv.conf".content = ''
@@ -37,7 +37,7 @@ This library provides two main components:
3737 WHEEL_UP seek 10
3838 WHEEL_DOWN seek -10
3939 '';
40- };
40+ }).wrapper ;
4141 };
4242}
4343```
@@ -132,7 +132,8 @@ The function:
132132Creates a reusable wrapper module with:
133133- Type-safe configuration options via the module system
134134- ` options ` : Exposed options for documentation generation
135- - ` apply ` : Function to instantiate the wrapper with settings
135+ - ` apply ` : Function to instantiate the wrapper with settings, returning a config object
136+ - Access the wrapped package via the ` wrapper ` attribute of the returned config
136137
137138Built-in options (always available):
138139- ` pkgs ` : nixpkgs instance (required)
@@ -144,6 +145,8 @@ Built-in options (always available):
144145- ` env ` : Environment variables
145146- ` passthru ` : Additional passthru attributes
146147- ` filesToPatch ` : List of file paths (glob patterns) to patch for self-references (default: ` ["share/applications/*.desktop"] ` )
148+ - ` filesToExclude ` : List of file paths (glob patterns) to exclude from the wrapped package (default: ` [] ` )
149+ - ` wrapper ` : The resulting wrapped package (read-only, auto-generated from other options)
147150
148151Custom types:
149152- ` wlib.types.file ` : File type with ` content ` and ` path ` options
@@ -165,7 +168,7 @@ The wrapper module system integrates with NixOS module evaluation:
165168Wraps mpv with configuration file support and script management:
166169
167170``` nix
168- wrappers.wrapperModules.mpv.apply {
171+ ( wrappers.wrapperModules.mpv.apply {
169172 pkgs = pkgs;
170173 scripts = [ pkgs.mpvScripts.mpris pkgs.mpvScripts.thumbnail ];
171174 "mpv.conf".content = ''
@@ -179,15 +182,15 @@ wrappers.wrapperModules.mpv.apply {
179182 extraFlags = {
180183 "--save-position-on-quit" = {};
181184 };
182- }
185+ }).wrapper
183186```
184187
185188### notmuch Module
186189
187190Wraps notmuch with INI-based configuration:
188191
189192``` nix
190- wrappers.wrapperModules.notmuch.apply {
193+ ( wrappers.wrapperModules.notmuch.apply {
191194 pkgs = pkgs;
192195 config = {
193196 database = {
@@ -199,7 +202,7 @@ wrappers.wrapperModules.notmuch.apply {
199202 primary_email = "john@example.com";
200203 };
201204 };
202- }
205+ }).wrapper
203206```
204207
205208## Long-term Goals
0 commit comments