1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
Commit graph

195 commits

Author SHA1 Message Date
Austin Horstman
6fd639dbe5 docs: update news.md to highlight create-news-entry command
Update the documentation to inform users they can create news entries
themselves using `nix run .#create-news-entry` without waiting for
maintainers. This makes the contribution process more self-service
and improves the documentation to match the recently exposed flake
package.
2025-05-10 11:00:39 -05:00
pancho horrillo
5d428b68dd
docs: update filename of generated HTML manual (#7010)
Since 613dbb35db, the manual
produces an `index.xhtml` file, instead of a plain `index.html`.
2025-05-09 08:17:06 -05:00
Andrew Marshall
708074ae6d treewide: Prevent IFD by default
Import-from-derivation (IFD) has problematic performance, and is disabled in
Nixpkgs by policy. It is arguably good practice for libraries to avoid
it whenever possible, as it has poor ergonomics in some cases,
especially with dry builds, as it requires multiple eval+build phases.

As such, prevent its use in Home Manager by default by putting existing
tests that use IFD behind a config. In CI, run a first pass with IFD
disabled, skipping tests without the config. Then run a second pass with
IFD enabled and including tests with the config. This second pass will
also run tests without the config, but they should be cached from the
previous run, so the cost is not double (only eval time should be paid
twice). It’s necessary to change from using NMT’s `run` to `build` as
`run` itself uses IFD.

Of the tests that have the config:

- kitty/theme-to-themeFile: this is a test for deprecated config, and so
  should be removed eventually anyway
- podman: the implementation relies on IFD to create individual systemd
  units from the derivation output, and so it is not straightforward to
  remove the IFD; doing so would require rethinking how the module works
  to instead have the systemd unit files included as-is rather than as
  individually configured units in the Nix config.
2025-05-07 10:34:18 -05:00
awwpotato
5da6eafceb
treewide: remove unused code (#6985) 2025-05-07 10:03:21 -05:00
Austin Horstman
cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00
Austin Horstman
14269b06a0 docs/flake.nix: add flake outputs for docs
We have stuff that's referenced in CI but not available as flake outputs
to build. Adding default.nix outputs to flake.nix so flake users can
reference them easier.
2025-04-07 08:15:20 -07:00
Thiago Kenji Okada
d094c6763c
news: create an individual file for each news entry (#6747)
The current way to define a news entry in Home-Manager is error prone
(since you need to type the date manually) and also it is common cause
of conflicts after merges because all entries are defined in the same
file.

This commit fixes this: we can now create individual news entries for
each new entry. A script `create-news-entry.sh` also helps to create it
in the correct format (with the correct filenames and structure).
2025-04-05 11:13:59 -05:00
Austin Horstman
0afad8f080
Revert "nixos-module: Fix potential recursion between users.users and home-ma…" (#6745)
This reverts commit 216690777e.

Reverts #6622

Seems to be causing issues for other users, though. Will revert and we can try again with some tests in place.
2025-04-01 09:52:10 -05:00
Proesmans Bert
216690777e
nixos-module: Fix potential recursion between users.users and home-manager.users (#6622)
Pushing users.users.<name>.packages from matching home-manager users leads to a circular dependency when
one attribute set is calculated from the other.
A configuration pull approach replaces the previous one to break up the circular dependency. This new approach
allows more flexibility in configuring both option sets, including calculating from each other.

EXAMPLE;

```nix
{lib, /* custom arg */ flake, config, ...}: {
    home-manager.useUserPackages = true;
    home-manager.users = builtins.intersectAttrs (lib.filterAttrs (_: v: v.isNormalUser) config.users.users) (flake.outputs.homeModules.users);
}
```

EXAMPLE;
```nix
{lib, /* custom arg */ flake, config, ...}: {
    home-manager.useUserPackages = true;
    home-manager.users = { inherit (flake.outputs.homeModules.users) demo-user; };
    users.users = lib.mapAttrs (_: _: { isNormalUser = true; }) (lib.filterAttrs (_: v: v.programs.git.enable) config.home-manager.users);
}
```

fixes #594

* options-manual: Remove `users` option set from documentation

The option declaration `users.users` is owned by the upstream
nixos modules and should not be documented by home-manager.

Home-manager declares an incomplete/partial option definition for
`users.users` that cannot be documented without the full definition from
the nixos modules. This partial definition is removed from the options
set while generating documentation for the home-manager nixos module.
2025-03-31 09:19:52 -05:00
Tobor
2760046f34
docs: correct improper import of home.nix (#6732)
This change improves the module system's error messages.
2025-03-30 09:39:15 -05:00
Cat
fc189507bc
docs: nixos module declarative installation instructions (#6208)
Added instructions for a different installation method for home manager on NixOS.
2025-03-20 11:50:36 -05:00
imsuck
229648c51e home-manager: support --log-format flag (#6093)
You can now pass `--log-format FORMAT` to `nix-build`,
useful for piping into `nix-output-monitor`.
2025-03-19 13:32:33 -05:00
Jérémy Garniaux
ef257da52a
docs: enhance comment for home.stateVersion option (#6116)
Enhance comment for home.stateVersion option (see issue #5794)
2025-03-13 08:50:10 -05:00
Austin Horstman
2c87a6475f
flake-module: rename homeManagerModules to homeModules (#6406)
This reverts commit 066ba0c5cf. After
further discussion, we want to maintain this as the naming scheme going
forward to be similar to standards that have been trying to be
implemented in naming configurations and modules.
2025-03-08 19:14:01 +01:00
Heitor Augusto
066ba0c5cf
flake-module: rename homeModules to homeManagerModules (#6392) 2025-02-03 13:19:46 -06:00
Robert Helgesson
a8159195bf
flake-module: fix naming 2025-01-30 23:22:29 +01:00
Matt Sturgeon
a5e196d61f
flake-module: add flake-parts module (#5229)
Add a flake-parts module, output as flakeModules.home-manager and flakeModules.default.

The module defines options for flake.homeModules and flake.homeConfigurations, based on the respective nixos equivalents; flake.nixosModules and flake.nixosConfigurations.
2025-01-30 12:17:53 -06:00
Robert Helgesson
1b9fe46e9f
home-manager: move tests into new test flake
Having the tests available in the main Nix Flake introduces
unnecessary evaluation for non-developer users and, worse, a
dependency on the nmt library.

Fixes #6354
2025-01-24 22:31:22 +01:00
Robert Helgesson
f4f8d09f90
home-manager: update copyright year 2025-01-03 10:56:26 +01:00
Robert Helgesson
9a9fef316a
systemd: use sd-switch by default
Also remove the legacy Ruby alternative.

Fixes #5452
2025-01-01 16:31:32 +01:00
Simone Ragusa
83ecd50915
docs: fix typo in 24.11 release notes 2024-12-16 11:23:18 +01:00
Robert Helgesson
4964f3c6fc
home-manager: prepare 24.11 release 2024-12-01 10:31:51 +01:00
Robert Helgesson
05d3b6215a
home-manager: prepare 25.05-pre 2024-11-18 00:13:46 +01:00
Jure Varlec
8bd6e0a1a8
nixgl: add support for channel-based configuration 2024-10-25 10:20:38 +02:00
Jure Varlec
7a5879707b
nixgl: API rework for flexibility and dual-GPU 2024-10-25 10:20:38 +02:00
Sergey
2a4fd1cfd8
eza: fix icons option
Fixes the icons option for eza which was breaking completion in zsh.
2024-10-15 23:22:21 +02:00
Sandro
d47d33254f
home-manager-manual: expose options.json 2024-10-10 20:29:24 +02:00
leoTlr
4803bf558b
swayidle: make -w optional
The option -w causes swayidle to wait on timeouts/events to finish.
This can cause problems with certain timout/event commands (see
https://github.com/swaywm/swaylock/issues/86#issuecomment-662702180)
2024-09-20 11:13:54 +02:00
Robert Helgesson
51e4664342
treewide: use non-deprecated substitute arguments 2024-09-12 13:54:47 +02:00
Shahar "Dawn" Or
1a4f12ae0b
docs: introduction chapter
Adds an introduction chapter to the manual.
2024-06-26 23:48:52 +02:00
Mario Rodas
8bdb74eaff
docs: add redirect from the previous options.html
After migrating to nixos-render-docs, the extension move to .xtml.
Unfortunately, this broke links to the previous Options Page.

This patch provides a basic redirect support to the new Options Page.
2024-06-09 13:09:00 +02:00
Robert Helgesson
d179da4e81
home-manager: prepare 24.11-pre 2024-05-25 22:13:25 +02:00
Robert Helgesson
548ba194d0
home-manager: prepare release 24.05 2024-05-25 22:13:25 +02:00
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