Commit Graph

162 Commits

Author SHA1 Message Date
Robert Hensing 26e72d85e6
home-manager: set module class to "homeManager"
This enables a module system feature documented here:
https://nixos.org/manual/nixpkgs/stable/index.html#module-system-lib-evalModules-param-class

For example, it allows a mistake to be caught, which is loading a
NixOS module into home-manager. This only works when the offending
module declares what it's for with a `_class` attribute.

It is not expected that users declare the `_type`, because the payoff
is small. It is only expected to be set by generic code, such as
functions or libraries that help with the "publishing" of modules
(e.g. flake-parts, flake-utils).

The class feature has been available in the module system since
https://github.com/NixOS/nixpkgs/pull/197547, merged May 6, 2023. It
has been part of all releases since 23.05-beta. The last NixOS release
that did _not_ support it has been end-of-life for close to a year
now.

Example:

    (lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
      modules = [{ _class = "nixos"; imports = [ ./foo.nix ]; }];
    }).activation-script

Corresponding error:

    error: The module <unknown-file> was imported into homeManager instead of nixos.

(`<unknown-file>` can be improved by also setting `_file`, if known; a
much older feature)

PR #5339
2024-04-27 09:28:21 +02:00
a-kenji f46814ec7c
treewide: prefer the official wiki 2024-04-17 23:58:16 +02:00
Robert Helgesson 7b3fca5adc
docs: minor fixes of guidelines 2024-03-17 23:35:57 +01:00
nbelakovski 35536fc6d6
docs: update beets and description of overriding packages
The beets package no longer has the "enableCheck" option so this was
confusing. Also the word override was used to mean two different
things so I modified the FAQ to use the word "change" and linked to
documentation regarding package overrides.
2024-03-14 21:20:04 +01:00
Scott Stevenson b319781e30
home-manager: Check VISUAL before EDITOR for editor
Check VISUAL for a visual editor before EDITOR, as per Unix convention
and as followed by Git, crontab, mutt, and other tools.
2024-02-05 23:22:43 +01:00
Robert Helgesson 2db6a2a429
docs: add style sheets and `scrubDerivations`
This adds style sheets and `scrubDerivations` from nmd, thereby
removing the need to download them separately.
2024-02-01 01:10:58 +01:00
Robert Helgesson e84811035d
treewide: deprecate `VERBOSE_ECHO`
The shell function `verboseEcho` can be used in its stead.
2024-01-24 13:36:05 +01:00
Robert Helgesson 4256729006
treewide: deprecate `DRY_RUN_CMD` and `DRY_RUN_NULL`
As a replacement, this adds the `run` helper function.
2024-01-24 13:36:05 +01:00
Robert Helgesson d6185e83d8
docs, tests: revert to fetchTarball for nmd and nmt
Turns out pulling nmt and nmd from Nixpkgs causes an IFD, even when
the packages are fixed-output derivations.

Thus, since Sourcehut is up and well, we can revert to simply fetching
nmd and nmt directly.

See discussion in <https://github.com/nix-community/home-manager/pull/4884>.
2024-01-18 23:29:40 +01:00
Robert Helgesson 846200eb57
docs: use nmd from Nixpkgs 2024-01-14 22:57:58 +01:00
Robert Helgesson 7403ed4980
home-manager: internalize uninstall
This adds a Boolean option `uninstall`. When enabled this option will
reset side-effecting configurations to their "empty" state. The intent
is that this will cause the activation script to remove all managed
files and packages.

Doing it this way should hopefully be more robust than the previous
solution. It also allows a somewhat more convenient uninstall process
when using Flakes; put `uninstall = true` in your existing
configuration and then do a switch.

Also add simple uninstall test in CI test job.
2024-01-13 00:32:31 +01:00
Robert Helgesson 93e804e7f8
docs: use alternative source of nmd 2024-01-11 14:46:44 +01:00
katelyn martin ebeeef94ab
docs: fix typo in nix-flakes.md 2023-12-19 12:51:08 -05:00
Robert Helgesson e4dba0bd01
docs: set the manual version to "24.05 (unstable)" 2023-12-17 12:58:55 +01:00
Viktor Kronvall c22b41f006 docs: fix broken link text 2023-12-17 01:03:30 +09:00
Viktor Kronvall 59c15ebe3d docs: fix link texts in release notes 2023-12-17 00:55:46 +09:00
Viktor Kronvall 07754e935a docs: add considerate as maintainer 2023-12-16 15:49:45 +09:00
Viktor Kronvall 6c82b1c9ce docs: use .xhtml for appendices 2023-12-16 15:46:42 +09:00
Viktor Kronvall 6fc71dc563 docs: add release-notes as appendix
The release notes used to be an appendix in the manual. After
converting to markdown that appendix got lost. This commit
reintroduces the release notes into the manual.
2023-12-16 15:46:00 +09:00
Phil Simpson 0e7cd64674
docs: fix nix-darwin module configuration example
The example is missing a `;` which causes this error when you attempt
a `darwin-rebuild switch`.

```
       error: syntax error, unexpected '=', expecting ';'

       at /Users/968713/.nixpkgs/darwin-configuration.nix:17:30:

           16|   }
           17|   home-manager.users.eve = { pkgs, ... }: {
             |                              ^
           18|     home.packages = [
```
2023-12-13 00:01:02 +01:00
Robert Helgesson fa91c109b0
docs: use relative paths to static resources
Fixes #4753
2023-12-09 13:20:54 +01:00
Robert Helgesson f10eb1b3ee
docs: apply nixfmt 2023-12-09 09:05:16 +01:00
Viktor Kronvall 613dbb35db docs: rename generated manual to `index.xhtml`
The `nixos-render-docs` tool outputs XHTML formatted content. In
order to convince browsers like `firefox` to treat the data as XHTML
the extension must be `.xhtml` and not `.html`.

Using the XHTML-formatted content as HTML is mainly an issue with
self-closing `<a />` tags.
2023-12-07 21:40:31 +09:00
Viktor Kronvall 0a71046493 docs: fix syntax highlighting
`document-highlighter` now outputs a `<code>` block inside the
pre-formatted `<pre>` tag. This changes the required CSS for
rendering code snippets. Moreover, this commit uses the highlightjs
as provided by the `document-highlighter` package instead of the
version packaged in `nmd`.
2023-12-07 21:31:50 +09:00
Viktor Kronvall b006bf1d74 docs: render DESCRIPTION and OPTIONS headings 2023-12-07 21:28:18 +09:00
Viktor Kronvall eff22a27e2 docs: replace `console` language with `shell` 2023-12-07 21:28:18 +09:00
Viktor Kronvall 67b797a377 docs: update nmd version
This update fixes the custom CSS to make the `$` character
non-selectable in highlighted code blocks.
2023-12-07 21:28:18 +09:00
Viktor Kronvall 5c2ef5243d docs: extend home-configuration.nix header
The previous version had a longer header before the options,
including a DESCRIPTION section and an header for the OPTIONS.
2023-12-07 21:28:18 +09:00
Viktor Kronvall be80122731 docs: include 3rd-party part 2023-12-07 21:28:18 +09:00
Viktor Kronvall b5a47bd700 docs: this is the `home-manager` manual 2023-12-07 21:28:18 +09:00
Viktor Kronvall 32063973cc docs: fix note blocks 2023-12-07 21:28:18 +09:00
Viktor Kronvall 2098c6fe91 docs: no justification in home-manager manpage
The `man home-configuration.nix` is configured to left
align the text similar to `man configuration.nix`. This
commit updates the `man home-manager` page to be consitent
with the two manpages mentioned above.
2023-12-07 21:28:18 +09:00
Viktor Kronvall 8dae2041ef docs: use nixos-render-docs
This commit removes the `home-manager-render-docs` package in favor
of upstream `nixos-render-docs` where the manpage generator has been
updated to take a `--header` and a `--footer` flag specifying static
content around the content derived from the options.json file.
2023-12-07 21:28:16 +09:00
Viktor Kronvall e4d290396c docs: update manual to refer to 23.11 2023-12-07 21:27:38 +09:00
Viktor Kronvall f48a0062df docs: update paths to make manual tests pass 2023-12-07 21:27:38 +09:00
Viktor Kronvall 0dcb767676 docs: add htmlOpenTool to manual
This commit extracts the htmlOpenTool from `nmd` into a module
in the home-manager docs directory. This is done to provide feature
parity with the documentation generated using the docbook .xml files.
2023-12-07 21:27:38 +09:00
Viktor Kronvall 728423e6f4 docs: add home-manager manpage 2023-12-07 21:27:38 +09:00
Viktor Kronvall 80ac72bf03 docs: render without deprecated optionsDocBook
The `optionsDocBook` function is deprecated in nixpkgs since
nixos-23.11. This commit updates the manual and manpages to
use commonmark formatted documentation instead of the deprecated
docbook format.
2023-12-07 21:27:38 +09:00
Robert Helgesson e1f3b36ab0
home-manager: set unstable release to 24.05 2023-11-24 09:25:42 +01:00
Robert Helgesson aeb2232d7a
home-manager: set stable release to 23.11 2023-11-24 09:23:25 +01:00
Robert Helgesson ae631b0b20
docs: fix option name
Fixes #4589
2023-10-20 23:56:29 +02:00
Artturin f6bb5c2973
docs: add stateVersion to the NixOS/nix-darwin example
This is necessary, without this a new user gets

```
error: The option `home-manager.users.X.home.stateVersion' is used but not defined.
```
2023-10-17 07:58:51 +02:00
pacien 6bba64781e
password-store-sync: remove module
The module `services.git-sync` (introduced two years after) provides
the same functionality, but in a more general and reliable way.
2023-10-10 14:28:09 +02:00
Emily c707d4f552 docs: hide `_module.*` from NixOS/nix-darwin docs
These are already documented in the system-level manuals and have no
particular relevance to the `home-manager.*` options.
2023-07-19 21:44:06 +01:00
Emily 8c350c2069 docs: update for Markdown migration 2023-07-17 18:49:09 +01:00
Emily 7398af11b8 docs: clean up after Markdown migration 2023-07-17 18:49:09 +01:00
Emily 59b933653a docs: use `nixosOptionsDoc`
Output is mostly unchanged aside from some minor typographical and
formatting changes, along with better source links.

We temporarily export `options.docBookForMigration` to allow
`nix-doc-munge` to check its conversions.
2023-07-17 16:49:35 +01:00
Emily 23ad3d2b53 version: add `isReleaseBranch` 2023-07-17 16:49:32 +01:00
Norbert Melzer 47c2adc6b3
docs: update link to allowed users setting (#4176)
1. The option has been renamed in NixOS about a year ago.
2. The link into the manual describing that option has been
   fixed.
2023-06-28 11:41:08 +02:00
Robert Helgesson 172d46d4b2
docs: bump nmd
Removes the need to apply `fix-man-options-duplication.patch`. See,
e.g., https://github.com/NixOS/nixpkgs/pull/166509.
2023-06-24 19:28:15 +02:00