wrapper-manager-fds/docs: update menu and user guide

This commit is contained in:
Gabriel Arazas 2024-10-24 08:03:18 +08:00
parent e53cb12836
commit 1bfcf256d5
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 44 additions and 2 deletions

View File

@ -1,8 +1,14 @@
[[main]]
identifier = "user-guide"
name = "User guide"
url = "user-guide"
weight = 1
[[main]] [[main]]
identifier = "nix-module-options" identifier = "nix-module-options"
name = "Module options" name = "Module options"
url = "wrapper-manager-env-options/" url = "wrapper-manager-env-options/"
weight = 1 weight = 2
[[main]] [[main]]
identifier = "source-code" identifier = "source-code"

View File

@ -18,6 +18,37 @@ It is comparable to NixOS and home-manager in a way that it compiles into an ope
Speaking of which, wrapper-manager is meant to be composed in larger-scoped environments such as NixOS and home-manager, mainly by including wrapper-manager packages in `environment.systemPackages` and `home.packages` but you could also make them as a standalone package. Speaking of which, wrapper-manager is meant to be composed in larger-scoped environments such as NixOS and home-manager, mainly by including wrapper-manager packages in `environment.systemPackages` and `home.packages` but you could also make them as a standalone package.
[#getting-started]
== Getting started
But first, we'll have to have wrapper-manager in our configuration.
There are multiple ways to do so as already shown from the link:../project-overview#installation[Project overview] so we'll go ahead with what should you do after it.
There are multiple ways to build a wrapper-manager package:
* You can manually build one with `wrapperManagerLib.env.build`.
It needs a nixpkgs instance (`pkgs`) and a list of additional modules (`modules`) with an optional attrset of static of module arguments (`specialArgs`).
+
--
Here's an example of using the function.
[source, nix]
----
{ pkgs ? import <nixpkgs> { } }:
let
wrapper-manager = import <wrapper-manager-fds> { };
wrapperManagerLib = import wrapper-manager.wrapperManagerLib { inherit pkgs; };
in
wrapperManagerLib.env.build {
inherit pkgs;
modules = [ ./config/wrapper.nix ];
specialArgs = { hello = "WORLD"; };
}
----
--
[#using-wrapper-manager] [#using-wrapper-manager]
== Using wrapper-manager == Using wrapper-manager
@ -324,7 +355,7 @@ Here's an example of importing it into a NixOS and home-manager config with flak
]; ];
}; };
homeConfigurations.user = homeConfigurations { homeConfigurations.user = homeManagerConfiguration {
modules = [ modules = [
inputs.wrapper-manager.homeModules.wrapper-manager inputs.wrapper-manager.homeModules.wrapper-manager
]; ];
@ -336,6 +367,11 @@ Here's an example of importing it into a NixOS and home-manager config with flak
For the most part, the integration modules are mostly the same. For the most part, the integration modules are mostly the same.
As an example, you can create wrappers through `wrapper-manager.packages` where it is expected to be an attribute set of wrapper-manager configurations. As an example, you can create wrappers through `wrapper-manager.packages` where it is expected to be an attribute set of wrapper-manager configurations.
[NOTE]
====
Any wrapper-manager packages declared through it are automatically added as part of their respective list of packages (e.g., `home.packages` for home-manager, `environment.systemPackages` for NixOS).
====
[source, nix] [source, nix]
---- ----
{ lib, config, ... }: { lib, config, ... }: