From fcd9503664c01c1a3400ba93cf5b6add35fbca95 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 3 Aug 2024 16:47:08 +0800 Subject: [PATCH] wrapper-manager-fds/docs: update project overview and add design notes to modules --- .../website/content/en/project-overview.adoc | 16 ++++++++-------- .../modules/wrapper-manager/README.adoc | 12 ++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc index 5894249c..48f5c5e3 100644 --- a/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc +++ b/subprojects/wrapper-manager-fds/docs/website/content/en/project-overview.adoc @@ -38,7 +38,7 @@ nix-channel --add {remote-git-repo}/archive/master.tar.gz wrapper-manager-fds nix-channel --update ---- -Then in your environment configuration, you'll have to import it. +Then in your environment configuration, you'll have to import the user entrypoint. For more details, see <>. [#installation-pinning-tool] @@ -65,9 +65,9 @@ Though not recommended, you could manually pin the Nix library yourself like in { pkgs, ... }: let - wrapper-manager-fds = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; - wrapperManager = import wrapper-manager-fds { }; - wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } + wrapper-manager-fds-src = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; + wrapper-manager = import wrapper-manager-fds-src { }; + wrapperManagerLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; } in wrapperManagerLib.env.build { } ---- @@ -119,11 +119,11 @@ To use it, it only requires a nixpkgs instance like in the following code. { pkgs, ... }: let - wrapper-manager-fds = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; - wrapperManager = import wrapper-manager-fds { }; - wrapperManagerLib = import wrapperManagerLib.lib { inherit pkgs; } + wrapper-manager-fds-src = builtins.fetchTarball "{remote-git-repo}/archive/master.tar.gz"; + wrapper-manager = import wrapper-manager-fds-src { }; + wrapperManagerLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; } in -wmLib.env.build { } +wrapperManagerLib.env.build { } ---- diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc b/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc index 34ee3e44..aa1238c7 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/README.adoc @@ -3,3 +3,15 @@ This is the module set of the wrapper-manager module environment. Just take note that we're following the runtime shell of nixpkgs which is GNU Bash as of 2024-06-30. + +Also, take note of several design decisions when making the modules. + +* Typically, several options are designed around one option. +The most prominent example of this is `wrappers..makeWrapperArgs` where we basically create those `makeWrapper` arguments from other options. + +* Another common design here is most of the interaction happens around in individual wrappers so individual-wrapper-wide options are typically accompanied with a environment-wide version of that option. +An example of that is `environment.variables` and `environment.pathAdd` where it's basically a global set/list of variables and search paths to be put in each wrapper (that is, `wrappers..env` and `wrappers..pathAdd`). + +* When constructing modules with a `listOf ` that is going to be set some other options, typically it is better to have them set in the individual wrapper and nothing else. +An example of that can be seen in `xdg.dataDirs` and `wrappers..xdg.dataDirs` implementation. +This is designed like that so the user can override the entire thing if they choose.