Compare commits

..

17 Commits

Author SHA1 Message Date
David Arnold
6639e3a837 home-environment: remove no-op commands
(cherry picked from commit 989d4fa536)
2022-11-08 12:35:31 +01:00
Ronny Pfannschmidt
071e28c869 home-environment: fix activation on new style profiles
When using the new style profiles we get conflicts when trying to
replace the old `home-path` derivation. To avoid this conflict we
delete the old `home-path` before the install.

Unfortunately, `nix profile` does not yet have a equivalent for
`nix-env --set` and we have to do this hackish workaround. See

  https://github.com/NixOS/nix/issues/6349

for the associated issue in Nix.

Fixes #2848

(cherry picked from commit ccc9164b76)
2022-11-08 12:35:30 +01:00
Robert Helgesson
87d55517f6 ci: use the right Nixpkgs channel for 22.05 tests 2022-11-05 20:43:09 +01:00
David Arnold
d148e1dd61 targets/generic-linux: use the correct nix package
(cherry picked from commit 183a62f356)
2022-11-05 20:23:41 +01:00
Robert Helgesson
d78b3488a7 home-environment: update hm-version generation
Instead of home-made script use the Nixpkgs library functions. This
will hopefully be more robust and give more accurate results.

(cherry picked from commit 423211401c)
2022-11-03 10:51:58 +01:00
Robert Helgesson
ce4cfdce2c home-environment: make getVersion more robust
(cherry picked from commit f67649307d)
2022-11-03 10:51:49 +01:00
Robert Helgesson
2a4d5e6f44 home-environment: add hm-version file
This commits adds a file `hm-version` to the generated generation
directory. This file will contain the release version, and if
available, the Git commit hash.

(cherry picked from commit 32fe7d2ebb)
2022-11-03 10:51:42 +01:00
dependabot[bot]
f0ecd4b1db ci: bump cachix/cachix-action from 11 to 12
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 11 to 12.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v11...v12)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 10:40:27 +00:00
zimbatm
a13f155be7 ci: use the cachix auth token
(cherry picked from commit 722e8d65d3)
2022-11-01 11:39:12 +01:00
Robert Helgesson
d8b233ad03 docs: bump nmd
Also use `fetchTarball` instead of `fetchFromGitLab`.
2022-10-31 12:44:55 +01:00
dependabot[bot]
b81e128fc0 ci: bump cachix/cachix-action from 10 to 11
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 10 to 11.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v10...v11)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 08:44:25 +00:00
dependabot[bot]
152ecaf9ef ci: bump cachix/install-nix-action from 17 to 18
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 17 to 18.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v17...v18)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 07:31:47 +00:00
Robert Helgesson
737a00f5d2 redshift: remove petabyteboy from maintainers
(cherry picked from commit f2445620d1)
2022-10-17 09:28:48 +02:00
Robert Helgesson
17208be516 home-manager: set state version when uninstalling
Otherwise the switch exits with an error.

Fixes #3320

(cherry picked from commit ebe6d2c747)
2022-10-11 10:01:03 +02:00
Thiago Kenji Okada
4a3d01fb53 docs: update nmd 2022-06-25 16:09:15 +01:00
Eliza Velasquez
a839432a5c mujmap: add module
mujmap is a tool that synchronizes mail between a mail server and
notmuch via JMAP. It's very similar to lieer, so I heavily based the
implementation of the notmuch module on lieer's. I did not include an
equivalent to lieer's periodic synchronization service, however,
because I plan to soon introduce a daemon mode to mujmap.

https://github.com/elizagamedev/mujmap
(cherry picked from commit d059b9448a)
2022-06-21 23:51:30 -07:00
Robert Helgesson
40ec43d367 email: add support for JMAP
Co-authored-by: Eliza Velasquez <4576666+elizagamedev@users.noreply.github.com>
(cherry picked from commit 467617947d)
2022-06-21 23:51:13 -07:00
3673 changed files with 34579 additions and 156396 deletions

View File

@@ -1,35 +0,0 @@
image: nixos/unstable
sources:
- https://git.sr.ht/~rycee/home-manager
secrets:
- 01ad357c-3214-4f73-bb7e-2441e440cc51
- 7d16ccc0-1c4f-4fd6-91c1-c54fc0f5807f
- bd5f26ee-78b8-4a6f-9d68-8d8f53a068f1
environment:
NIX_CONFIG: "experimental-features = nix-command flakes"
packages:
- nixos.cachix
- nixos.jq
tasks:
- setup: |
cachix use rycee
- build: |
cd ./home-manager
gitBranch="$(git show -s --pretty=%D HEAD | sed '{ s/.*, //; s!origin/!!; }')"
[[ $gitBranch == master || $gitBranch == release-??.?? ]] || exit 0
nix build -L .#docs-html
cachix push rycee ./result
- deploy: |
cd ./home-manager
gitBranch="$(git show -s --pretty=%D HEAD | sed '{ s/.*, //; s!origin/!!; }')"
[[ $gitBranch == master || $gitBranch == release-??.?? ]] || exit 0
if [[ $gitBranch == master ]]; then
dirName="unstable"
else
dirName="$(jq -r .release < release.json)"
fi
rsync --delete -r --info=stats \
"result/share/doc/home-manager/" \
"hm-web:/srv/www/home-manager.dev/manual/$dirName"

View File

@@ -1,24 +0,0 @@
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# The JSON files contain newlines inconsistently
[*.json]
insert_final_newline = unset
# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab
[*.md]
trim_trailing_whitespace = false
[*.plist]
insert_final_newline = false

View File

@@ -1,49 +0,0 @@
# This file contains a list of commits that are not likely what you
# are looking for in a blame, such as mass reformatting or renaming.
#
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
# Treewide nixfmt-rfc-style
cba2f9ce95c8d10b66cacf05a275e3ad71959638
# Treewide remove with lib
0b491b460f52e87e23eb17bbf59c6ae64b7664c1
95711f926676018d279ba09fe7530d03b5d5b3e2
5e193cdcab61b5e7096ef3c132fdc0149e14f2d9
55cf1f16324e694c991e846ad5fc897f0f75ac64
a710f337d6f541f5ba50bc2d5daa6c34e9ee5834
10dca990ae02aaf41ff12c5b18dd3dcf258c0d04
d7f451d7b13bbe075abecfd345f8b149a000216a
65413f297f8c4c42a99270c15bce7bda1bfea724
b5976017741653251258112f7e6ee5d8b9e3a832
e0be70bcf94be20f8f0f6d215d909b614ab6ebeb
e30c6a41bc8548738341d10c0b17f8fead8e55ee
b5142d46a3f912ef99e9cec3e51d757fbeaf14ea
56374cc64d58451b359bb4e8502387d3a96e7c7b
32531e457215000b739da6cd40acfb080823f396
34d524f3edcf3a04c00ad2c09c24ec9d35d937f9
439a125afef8c97308ec0c6db75d38e15d92208d
5031c6d2978109336637977c165f82aa49fa16a7
b34b56689dcc75294e14e8c95db4e054a4e9573f
234613d77c939ff2e2c0f2c476a56d80930e5b8b
e3baf274f47678df6289c7482353cb6d38b7be5d
c90cd85b04ff3348978b05ba73ffc8e1b74b9fce
2d731a33b193209cb88b874e508ea912765f7d99
20fd9686b85dc64657a176466e23d0f3a5e1f760
96dee79b178d295b716052feca3ee46abc085abe
97d7946b5e107dd03cc82f21165251d4e0159655
0dfec9deb275854a56c97c356c40ef72e3a2e632
4b2d3b03becc184f2d1485e109c6a55f94d5f886
# Treewide remove lib.mdDoc
9f9e277b60a6e6915ad3a129e06861044b50fdf2
# Treewide replace usage of literalExample
bd11e2c5e67385970e59e55ba7a4c35d1ffaee4d
# Treewide nix fmt change
b4752b0eda6302b92a6d5dd554c83f188bc3ae6d
9136120c369d91144910a985262e3c3b8e8872d6
# Treewide remove noops
f2f1076c1f789595c2a2b18b76466fbd691025dd

471
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,471 @@
* @rycee
/flake.nix @bqv @kisik21
/modules/home-environment.nix @rycee
/modules/i18n/input-method @Kranzes
/tests/modules/i18n/input-method @Kranzes
/modules/launchd @midchildan
/modules/misc/dconf.nix @rycee
/modules/misc/fontconfig.nix @rycee
/tests/modules/misc/fontconfig @rycee
/modules/misc/gtk.nix @rycee
/modules/config/home-cursor.nix @polykernel @league
/modules/config/i18n.nix @midchildan
/tests/modules/config/i18n @midchildan
/modules/misc/news.nix @rycee
/modules/misc/nix.nix @polykernel
/tests/modules/misc/nix @polykernel
/modules/misc/nixpkgs-disabled.nix @thiagokokada
/modules/misc/numlock.nix @evanjs
/tests/modules/misc/numlock @evanjs
/modules/misc/pam.nix @rycee
/tests/modules/misc/pam @rycee
/modules/misc/qt.nix @rycee
/modules/misc/submodule-support.nix @rycee
/modules/misc/tmpfiles.nix @dawidsowa
/modules/misc/vte.nix @rycee
/modules/misc/xdg-mime-apps.nix @pacien
/modules/misc/xdg-user-dirs.nix @pacien
/modules/misc/xdg-system-dirs.nix @tadfisher
/tests/modules/misc/xdg/system-dirs.nix @tadfisher
/modules/misc/xdg-desktop-entries.nix @cwyc
/tests/modules/misc/xdg/desktop-entries.nix @cwyc
/tests/modules/misc/xdg/desktop-full-expected.desktop @cwyc
/tests/modules/misc/xdg/desktop-min-expected.desktop @cwyc
/modules/programs/aria2.nix @JustinLovinger
/modules/programs/autojump.nix @evanjs
/tests/modules/programs/autojump @evanjs
/modules/programs/atuin.nix @hawkw
/tests/modules/programs/atuin @hawkw
/modules/programs/autorandr.nix @uvNikita
/modules/programs/bash.nix @rycee
/modules/programs/bat.nix @marsam
/modules/programs/beets.nix @rycee
/modules/programs/bottom.nix @polykernel
/tests/modules/programs/bottom @polykernel
/modules/programs/broot.nix @aheaume
/modules/programs/dircolors.nix @JustinLovinger
/modules/programs/direnv.nix @rycee
/modules/programs/eclipse.nix @rycee
/modules/programs/emacs.nix @rycee
/modules/programs/eww.nix @mainrs
/modules/programs/exa.nix @kalhauge
/modules/programs/firefox.nix @rycee
/modules/programs/foot.nix @plabadens
/tests/modules/programs/foot @plabadens
/modules/services/fusuma.nix @iosmanthus
/tests/modules/services/fusuma @iosmanthus
/modules/programs/gh.nix @Gerschtli @berbiche
/tests/modules/programs/gh @Gerschtli @berbiche
/modules/programs/git.nix @rycee
/modules/programs/gitui/gitui.nix @mifom
/modules/programs/gitui/default_key_config.ron @mifom
/modules/programs/gnome-terminal.nix @kamadorueda @rycee
/modules/programs/go.nix @rvolosatovs
/modules/programs/helix.nix @Philipp-M
/tests/modules/programs/helix @Philipp-M
/modules/programs/hexchat.nix @thiagokokada
/tests/modules/programs/hexchat @thiagokokada
/modules/programs/himalaya.nix @ambroisie
/tests/modules/programs/himalaya @ambroisie
/modules/programs/home-manager.nix @rycee
/modules/programs/htop.nix @bjpbakker
/tests/modules/htop @bjpbakker
/modules/programs/i3status.nix @JustinLovinger
/modules/programs/i3status-rust.nix @workflow
/modules/programs/java.nix @ShamrockLee
/modules/programs/just.nix @maximsmol
/modules/programs/keychain.nix @marsam
/modules/programs/kodi.nix @dwagenk
/tests/modules/programs/kodi @dwagenk
/modules/programs/lazygit.nix @kalhauge
/modules/programs/less.nix @pamplemousse
/tests/modules/programs/less @pamplemousse
/modules/programs/lesspipe.nix @rycee
/modules/programs/lf.nix @owm111
/tests/modules/programs/lf @owm111
/modules/programs/lieer.nix @tadfisher
/modules/programs/lsd.nix @marsam
/modules/programs/matplotlib.nix @rprospero
/modules/programs/mangohud.nix @ZerataX
/tests/modules/programs/mangohud @ZerataX
/modules/programs/mbsync.nix @KarlJoad
/tests/modules/programs/mbsync @KarlJoad
/modules/programs/mcfly.nix @marsam
/modules/programs/mpv.nix @tadeokondrak @thiagokokada
/tests/modules/programs/mpv @thiagokokada
/modules/programs/mu.nix @KarlJoad
/modules/programs/mujmap.nix @elizagamedev
/tests/modules/programs/mujmap @elizagamedev
/modules/programs/navi.nix @marsam
/modules/programs/ncmpcpp.nix @olmokramer
/tests/modules/programs/ncmpcpp @olmokramer
/tests/modules/programs/ncmpcpp-linux @olmokramer
/modules/programs/ncspot.nix @marsam
/modules/programs/ne.nix @cwyc
/tests/modules/programs/ne @cwyc
/modules/programs/newsboat.nix @sumnerevans
/tests/modules/programs/newsboat @sumnerevans
/modules/programs/nix-index.nix @ambroisie
/tests/modules/programs/nix-index @ambroisie
/modules/programs/nnn.nix @thiagokokada
/tests/modules/programs/nnn @thiagokokada
/modules/programs/noti.nix @marsam
/modules/programs/nushell.nix @Philipp-M
/tests/modules/programs/nushell @Philipp-M
/modules/programs/obs-studio.nix @adisbladis
/modules/programs/octant.nix @06kellyjac
/modules/programs/opam.nix @marsam
/modules/programs/openssh.nix @rycee
/modules/programs/pandoc.nix @kirelagin
/tests/modules/programs/pandoc @kirelagin
/modules/programs/password-store.nix @pacien
/modules/programs/pazi.nix @marsam
/modules/programs/pidgin.nix @rycee
/modules/programs/piston-cli.nix @ethancedwards8
/modules/programs/powerline-go.nix @DamienCassou
/modules/programs/pubs.nix @loicreynier
/tests/modules/programs/pubs @loicreynier
/modules/programs/pylint.nix @florpe
/modules/programs/rbw.nix @ambroisie
/tests/modules/programs/rbw @ambroisie
/modules/programs/rofi.nix @thiagokokada
/tests/modules/programs/rofi @thiagokokada
/modules/programs/rofi-pass.nix @seylerius
/tests/modules/programs/rofi-pass @seylerius
/modules/programs/rtorrent.nix @marsam
/modules/programs/sagemath.nix @kirelagin
/tests/modules/programs/sagemath @kirelagin
/modules/programs/sbt.nix @kubukoz
/tests/modules/programs/sbt @kubukoz
/modules/programs/scmpuff.nix @cpcloud
/tests/modules/programs/scmpuff @cpcloud
/modules/programs/senpai.nix @malte-v
/modules/programs/sioyek.nix @podocarp
/modules/programs/sm64ex.nix @ivarwithoutbones
/tests/modules/programs/sm64ex @ivarwithoutbones
/modules/programs/sqls.nix @marsam
/modules/programs/ssh.nix @rycee
/modules/programs/starship.nix @marsam
/modules/programs/tealdeer.nix @marsam
/modules/programs/terminator.nix @chisui
/modules/programs/texlive.nix @rycee
/modules/programs/timidity.nix @amesgen
/modules/programs/tiny.nix @kmaasrud
/modules/programs/topgrade.nix @msfjarvis
/tests/modules/programs/topgrade @msfjarvis
/mdules/programs/watson.nix @polykernel
/tests/modules/programs/watson @polykernel
/modules/programs/waybar.nix @berbiche
/tests/modules/programs/waybar @berbiche
/modules/programs/xmobar.nix @t4ccer
/tests/modules/programs/xmobar @t4ccer
/modules/programs/z-lua.nix @marsam
/modules/programs/zathura.nix @rprospero
/modules/programs/zellij.nix @mainrs
/modules/programs/zoxide.nix @marsam
/modules/programs/zsh/prezto.nix @NickHu
/modules/services/barrier.nix @Kritnich
/tests/modules/services/barrier @Kritnich
/modules/services/betterlockscreen.nix @SebTM
/modules/services/caffeine.nix @uvNikita
/modules/services/cbatticon.nix @pmiddend
/modules/services/clipmenu.nix @DamienCassou
/modules/services/devilspie2.nix @dawidsowa
/tests/modules/services/devilspie2 @dawidsowa
/modules/services/dropbox.nix @eyJhb
/tests/modules/services/dropbox @eyJhb
/modules/services/dunst.nix @rycee
/modules/services/easyeffects.nix @fufexan
/modules/services/emacs.nix @tadfisher
/modules/services/etesync-dav.nix @Valodim
/modules/services/espanso.nix @lucasew
/modules/services/flameshot.nix @moredhel
/modules/services/fluidsynth.nix @Valodim
/modules/services/fnott.nix @polykernel
/tests/modules/services/fnott @polykernel
/modules/services/git-sync.nix @IvanMalison
/modules/services/gnome-keyring.nix @rycee
/modules/services/gpg-agent.nix @rycee
/modules/services/grobi.nix @mbrgm
/modules/services/gromit-mpx.nix @pjones
/tests/modules/services/gromit-mpx @pjones
/modules/services/home-manager-auto-upgrade.nix @pinage404
/tests/modules/services/home-manager-auto-upgrade @pinage404
/modules/services/hound.nix @adisbladis
/modules/services/imapnotify.nix @nickhu
/modules/services/kanshi.nix @nurelin
/tests/modules/services/kanshi @nurelin
/modules/services/kdeconnect.nix @adisbladis
/modules/services/keepassx.nix @rycee
/modules/services/lieer.nix @tadfisher
/modules/services/lorri.nix @Gerschtli
/modules/services/mako.nix @onny
/modules/services/mbsync.nix @pjones
/modules/services/mopidy.nix @foo-dogsquared
/tests/modules/services/mopidy @foo-dogsquared
/modules/services/mpdris2.nix @pjones
/modules/services/mpd-discord-rpc.nix @Kranzes
/modules/services/mpris-proxy.nix @ThibautMarty
/modules/services/muchsync.nix @pacien
/modules/services/network-manager-applet.nix @rycee
/modules/services/notify-osd.nix @imalison
/modules/services/opensnitch-ui.nix @onny
/modules/services/pantalaimon.nix @jojosch
/tests/modules/services/pantalaimon @jojosch
/modules/services/parcellite.nix @gleber
/modules/services/pass-secret-service.nix @cab404
/modules/services/password-store-sync.nix @pacien
/modules/services/pasystray.nix @pltanton
/modules/services/pbgopy.nix @ivarwithoutbones
/tests/modules/services/pbgopy @ivarwithoutbones
/modules/services/plan9port.nix @ehmry
/modules/services/playerctld.nix @fendse
/tests/modules/playerctld @fendse
/modules/services/poweralertd.nix @ThibautMarty
/modules/services/pulseeffects.nix @jonringer
/modules/services/random-background.nix @rycee
/modules/services/redshift-gammastep @rycee @petabyteboy @thiagokokada
/tests/modules/redshift-gammastep @thiagokokada
/modules/services/screen-locker.nix @jrobsonchase @rszamszur
/tests/modules/services/screen-locker @jrobsonchase @rszamszur
/modules/services/status-notifier-watcher.nix @pltanton
/modules/services/syncthing.nix @rycee
/modules/services/taffybar.nix @rycee
/modules/services/tahoe-lafs.nix @rycee
/modules/services/taskwarrior-sync.nix @minijackson @pacien
/modules/services/trayer.nix @AndreasMager
/tests/modules/services/trayer @AndreasMager
/modules/services/twmn.nix @Austreelis
/tests/modules/services/twmn @Austreelis
/modules/services/udiskie.nix @rycee
/modules/services/unison.nix @pacien
/modules/services/window-managers/bspwm @ncfavier
/tests/modules/services/window-managers/bspwm @ncfavier
/modules/services/window-managers/herbstluftwm @olmokramer
/tests/modules/services/window-managers/herbstluftwm @olmokramer
/modules/services/window-managers/i3-sway/i3.nix @sumnerevans @sebtm
/tests/modules/services/window-managers/i3 @sumnerevans @sebtm
/modules/services/window-managers/i3-sway/lib @sumnerevans @sebtm
/modules/services/window-managers/i3-sway/sway.nix @alexarice @sumnerevans @sebtm
/tests/modules/services/window-managers/sway @sumnerevans @sebtm
/modules/services/window-managers/i3-sway/swaynag.nix @polykernel
/modules/services/wlsunset.nix @matrss
/tests/modules/services/wlsunset @matrss
/modules/services/xcape.nix @nickhu
/modules/services/xembed-sni-proxy.nix @rycee
/modules/services/xidlehook.nix @dschrempf
/modules/services/xscreensaver.nix @rycee
/modules/services/xsuspender.nix @offlinehacker
/modules/systemd.nix @rycee
/modules/xresources.nix @rycee
/modules/xsession.nix @rycee
/modules/services/volnoti.nix @IvanMalison
/modules/services/systembus-notify.nix @asymmetric
/modules/targets/darwin @midchildan
/tests/modules/targets-darwin @midchildan
/modules/programs/tint2.nix @CarlosLoboxyz
Makefile @thiagokokada
/modules/services/swayidle.nix @c0deaddict
/tests/modules/services/swayidle @c0deaddict
/modules/programs/ion.nix @jo1gi
/modules/services/plex-mpv-shim.nix @starcraft66

View File

@@ -0,0 +1,15 @@
---
name: Feature request
about: Ask for a new feature to be added (module, program, etc.)
title: ''
labels: feature request
assignees: rycee, berbiche, sumnerevans
---
<!--
Note: Please search to see if the feature has already been requested
-->
### Description

View File

@@ -1,38 +0,0 @@
name: "✨ Feature Request"
description: "Suggest an improvement to Home Manager"
title: "[Feature Request] "
labels: ["feature request"]
body:
- type: markdown
attributes:
value: |
Thank you for contributing to Home Manager!
Before you open a new issue, please search the existing issues to see if your feature has already been requested or discussed.
- type: markdown
attributes:
value: "## 🔧 Existing Module Improvement"
- type: input
id: existing-module-name
attributes:
label: Module Name
description: "What is the name of the module?"
placeholder: "e.g., programs.git"
- type: textarea
id: existing-module-feature
attributes:
label: Requested Feature
description: "Please describe the new feature or improvement in detail."
- type: textarea
id: existing-module-limitation
attributes:
label: Current Limitations
description: "Why can't your goal be achieved with the current implementation? Please be specific."
- type: markdown
attributes:
value: "---"
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Add any other context, screenshots, or configuration examples about the feature request here.

View File

@@ -3,16 +3,11 @@ description: File a bug/issue
title: 'bug: '
labels: [bug, triage]
# We cannot use nix-community/home-manager
# See https://github.com/dear-github/dear-github/issues/170
assignees: [rycee, berbiche, sumnerevans]
body:
- type: checkboxes
attributes:
label: Are you following the right branch?
description: |
You should follow the branch of Home Manager that corresponds to your
version of Nixpkgs; see [the README](https://github.com/nix-community/home-manager#releases) for details.
options:
- label: My Nixpkgs and Home Manager versions are in sync
required: true
- type: checkboxes
attributes:
label: Is there an existing issue for this?
@@ -36,6 +31,7 @@ body:
label: Maintainer CC
description: |
Please @ people who are in the `meta.maintainers` list of the offending module.
If in doubt, check `git blame` for whoever last touched something.
validations:
required: false
- type: textarea

View File

@@ -1,37 +0,0 @@
name: "✨ New Module Request"
description: "Suggest an addition to Home Manager"
title: "[New Module Request] "
labels: ["new module request"]
body:
- type: markdown
attributes:
value: |
Thank you for contributing to Home Manager!
Before you open a new issue, please search the existing issues to see if your feature has already been requested or discussed.
- type: markdown
attributes:
value: "## New Program or Service"
- type: input
id: new-program-name
attributes:
label: Program/Service Name
description: "What is the name of the program or service you would like to add?"
placeholder: "e.g., my-cool-cli-tool"
- type: input
id: new-program-repo
attributes:
label: Upstream Repository
description: "Please provide a link to the source code repository."
placeholder: "https://github.com/user/repo"
- type: textarea
id: new-program-docs
attributes:
label: Configuration Documentation
description: "Please provide links to any relevant documentation for configuring this program."
placeholder: "e.g., man page, project wiki, configuration file examples, etc."
- type: textarea
id: new-program-reason
attributes:
label: Reason for Addition
description: "**Why do you want this program or service added to Home Manager?"

View File

@@ -15,35 +15,30 @@ pull-request.
Also make sure to read the guidelines found at
https://nix-community.github.io/home-manager/#sec-guidelines
https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-guidelines
-->
- [ ] Change is backwards compatible.
- [ ] Code formatted with `nix fmt` or
`nix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt`.
- [ ] Code formatted with `./format`.
- [ ] Code tested through `nix run .#tests -- test-all` or
`nix-shell --pure tests -A run.all`.
- [ ] Code tested through `nix-shell --pure tests -A run.all`.
- [ ] Test cases updated/added. See [example](https://github.com/nix-community/home-manager/commit/f3fbb50b68df20da47f9b0def5607857fcc0d021#diff-b61a6d542f9036550ba9c401c80f00ef).
- [ ] Commit messages are formatted like
```
{component}: {description}
```
{component}: {description}
{long description}
```
{long description}
```
See [CONTRIBUTING](https://nix-community.github.io/home-manager/#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
See [CONTRIBUTING](https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
- If this PR adds a new module
- [ ] Added myself as module maintainer. See [example](https://github.com/nix-community/home-manager/blob/a51598236f23c89e59ee77eb8e0614358b0e896c/modules/programs/lesspipe.nix#L11).
- [ ] Generate a news entry. See [News](https://nix-community.github.io/home-manager/index.xhtml#sec-news)
- [ ] Basic tests added. See [Tests](https://nix-community.github.io/home-manager/index.xhtml#sec-tests)
- [ ] Added myself as module maintainer. See [example](https://github.com/nix-community/home-manager/blob/068ff76a10e95820f886ac46957edcff4e44621d/modules/programs/lesspipe.nix#L6).
- If this PR adds an exciting new feature or contains a breaking change.
- [ ] Generate a news entry. See [News](https://nix-community.github.io/home-manager/index.xhtml#sec-news)
- [ ] Added myself and the module files to `.github/CODEOWNERS`.

View File

@@ -7,9 +7,10 @@ updates:
interval: "weekly"
commit-message:
prefix: "ci:"
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-25.11"
target-branch: "release-21.11"
schedule:
interval: "weekly"
commit-message:

583
.github/labeler.yml vendored
View File

@@ -1,583 +0,0 @@
"audio":
- changed-files:
- any-glob-to-any-file:
- modules/services/amberol.nix
- modules/programs/beets.nix
- modules/programs/cava.nix
- modules/programs/cavalier.nix
- modules/programs/cmus.nix
- modules/programs/ncmpcpp.nix
- modules/programs/ncspot.nix
- modules/programs/spotify-player.nix
- modules/programs/timidity.nix
- modules/services/easyeffects.nix
- modules/services/fluidsynth.nix
- modules/services/librespot.nix
- modules/services/listenbrainz-mpd.nix
- modules/services/mopidy.nix
- modules/services/mpd-discord-rpc.nix
- modules/services/mpd-mpris.nix
- modules/services/mpd.nix
- modules/services/mpdris2.nix
- modules/services/mpdscribble.nix
- modules/services/mpris-proxy.nix
- modules/services/pasystray.nix
- modules/services/playerctld.nix
- modules/services/pulseeffects.nix
- modules/services/rescrobbled.nix
- modules/services/spotifyd.nix
- tests/modules/services/mpd/**/*
"automation":
- changed-files:
- any-glob-to-any-file:
- modules/services/caffeine.nix
- modules/services/darkman.nix
- modules/services/devilspie2.nix
- modules/services/espanso.nix
- modules/services/keynav.nix
- modules/services/skhd.nix
"backup":
- changed-files:
- any-glob-to-any-file:
- modules/programs/borgmatic.nix
- modules/programs/rclone.nix
- modules/programs/restic.nix
- modules/services/borgmatic.nix
- tests/modules/programs/borgmatic/**/*
- tests/modules/services/borgmatic/**/*
"bars":
- changed-files:
- any-glob-to-any-file:
- modules/programs/eww.nix
- modules/programs/sketchybar.nix
- modules/programs/waybar.nix
- modules/programs/xmobar.nix
- modules/programs/yambar.nix
- modules/services/polybar.nix
- modules/services/taffybar.nix
- tests/modules/programs/waybar/**/*
- tests/modules/services/polybar/**/*
"browsers":
- changed-files:
- any-glob-to-any-file:
- modules/misc/mozilla-messaging-hosts.nix
- modules/programs/chromium.nix
- modules/programs/firefox/**/*
- modules/programs/floorp.nix
- modules/programs/librewolf.nix
- modules/programs/qutebrowser.nix
- tests/modules/programs/chromium/**/*
- tests/modules/programs/firefox/**/*
- tests/modules/programs/qutebrowser/**/*
"calendar":
- changed-files:
- any-glob-to-any-file:
- modules/*/vdirsyncer*.nix
- modules/accounts/calendar.nix
- modules/programs/khal*.nix
- modules/programs/qcal.nix
- tests/modules/programs/khal/**/*
"clipboard":
- changed-files:
- any-glob-to-any-file:
- modules/services/clipcat.nix
- modules/services/cliphist.nix
- modules/services/clipman.nix
- modules/services/clipmenu.nix
- modules/services/clipse.nix
- modules/services/copyq.nix
- modules/services/parcellite.nix
- modules/services/pbgopy.nix
- modules/services/wl-clip-persist.nix
- tests/modules/services/clipman/**/*
- tests/modules/services/copyq/**/*
- tests/modules/services/wl-clip-persist/**/*
"cli-tools":
- changed-files:
- any-glob-to-any-file:
- modules/programs/antidote.nix
- modules/programs/atuin.nix
- modules/programs/autojump.nix
- modules/programs/bashmount.nix
- modules/programs/bat.nix
- modules/programs/bottom.nix
- modules/programs/boxxy.nix
- modules/programs/broot.nix
- modules/programs/btop.nix
- modules/programs/carapace.nix
- modules/programs/dircolors.nix
- modules/programs/direnv.nix
- modules/programs/eza.nix
- modules/programs/fastfetch.nix
- modules/programs/fd.nix
- modules/programs/fzf.nix
- modules/programs/gurk-rs.nix
- modules/programs/hstr.nix
- modules/programs/htop.nix
- modules/programs/hwatch.nix
- modules/programs/hyfetch.nix
- modules/programs/jq*.nix
- modules/programs/just.nix
- modules/programs/keychain.nix
- modules/programs/less.nix
- modules/programs/lesspipe.nix
- modules/programs/lsd.nix
- modules/programs/man.nix
- modules/programs/mcfly.nix
- modules/programs/navi.nix
- modules/programs/nix-your-shell.nix
- modules/programs/pay-respects.nix
- modules/programs/pazi.nix
- modules/programs/pet.nix
- modules/programs/pistol.nix
- modules/programs/pls.nix
- modules/programs/readline.nix
- modules/programs/ripgrep*.nix
- modules/programs/scmpuff.nix
- modules/programs/script-directory.nix
- modules/programs/sesh.nix
- modules/programs/skim.nix
- modules/programs/superfile.nix
- modules/programs/tealdeer.nix
- modules/programs/television.nix
- modules/programs/thefuck.nix
- modules/programs/tmate.nix
- modules/programs/tmux.nix
- modules/programs/topgrade.nix
- modules/programs/translate-shell.nix
- modules/programs/uv.nix
- modules/programs/watson.nix
- modules/programs/z-lua.nix
- modules/programs/zellij.nix
- modules/programs/zk.nix
- modules/programs/zoxide.nix
- modules/programs/zplug.nix
- tests/modules/programs/fzf/**/*
- tests/modules/programs/tmux/**/*
"contacts":
- changed-files:
- any-glob-to-any-file:
- modules/accounts/contacts.nix
- modules/programs/abook.nix
- modules/programs/khard.nix
- tests/modules/programs/abook/**/*
- tests/modules/programs/khard/**/*
"containers":
- changed-files:
- any-glob-to-any-file:
- modules/services/podman-linux/**/*
- modules/programs/distrobox.nix
- modules/programs/docker-cli.nix
"desktop-ui":
- changed-files:
- any-glob-to-any-file:
- modules/services/avizo.nix
- modules/services/blanket.nix
- modules/services/flameshot.nix
- modules/programs/gnome-shell.nix
- modules/services/gromit-mpx.nix
- modules/services/linux-wallpaperengine.nix
- modules/services/random-background.nix
- modules/services/volnoti.nix
- modules/services/wob.nix
- modules/services/wpaperd.nix
"desktop-utilities":
- changed-files:
- any-glob-to-any-file:
- modules/services/autorandr.nix
- modules/services/blueman-applet.nix
- modules/services/gnome-keyring.nix
- modules/services/lxqt-policykit-agent.nix
- modules/services/network-manager-applet.nix
- modules/services/polkit-gnome.nix
- modules/services/sctd.nix
- modules/services/snixembed.nix
- modules/services/status-notifier-watcher.nix
- modules/services/systembus-notify.nix
- modules/services/trayscale.nix
- modules/services/udiskie.nix
- modules/services/unclutter.nix
- modules/services/xembed-sni-proxy.nix
"dev-tools":
- changed-files:
- any-glob-to-any-file:
- modules/programs/bacon.nix
- modules/programs/bun.nix
- modules/programs/darcs.nix
- modules/programs/earthly.nix
- modules/programs/eclipse.nix
- modules/programs/go.nix
- modules/programs/gradle.nix
- modules/programs/granted.nix
- modules/programs/java.nix
- modules/programs/jetbrains-remote.nix
- modules/programs/kubecolor.nix
- modules/programs/kubeswitch.nix
- modules/programs/lazydocker.nix
- modules/programs/matplotlib.nix
- modules/programs/mercurial.nix
- modules/programs/mergiraf.nix
- modules/programs/mise.nix
- modules/programs/mods.nix
- modules/programs/mr.nix
- modules/programs/nh.nix
- modules/programs/nix-index.nix
- modules/programs/nix-init.nix
- modules/programs/numbat.nix
- modules/programs/octant.nix
- modules/programs/opam.nix
- modules/programs/openstackclient.nix
- modules/programs/pgcli.nix
- modules/programs/piston-cli.nix
- modules/programs/poetry.nix
- modules/programs/pyenv.nix
- modules/programs/pylint.nix
- modules/programs/python*.nix
- modules/programs/pywal.nix
- modules/programs/rbenv.nix
- modules/programs/ruff.nix
- modules/programs/sagemath.nix
- modules/programs/sbt.nix
- modules/programs/sftpman.nix
- modules/programs/smug.nix
- modules/programs/sqls.nix
- modules/programs/tex-fmt.nix
- modules/programs/texlive.nix
- modules/programs/vim-vint.nix
- modules/programs/visidata.nix
- modules/services/lorri.nix
- tests/modules/programs/go/**/*
- tests/modules/programs/java/**/*
"editors":
- changed-files:
- any-glob-to-any-file:
- modules/programs/emacs.nix
- modules/programs/helix.nix
- modules/programs/kakoune.nix
- modules/programs/lapce.nix
- modules/programs/micro.nix
- modules/programs/ne.nix
- modules/programs/neovide.nix
- modules/programs/neovim.nix
- modules/programs/vim*.nix
- modules/programs/vscode.nix
- modules/programs/zed-editor.nix
- modules/services/emacs.nix
- tests/modules/programs/emacs/**/*
- tests/modules/programs/helix/**/*
- tests/modules/programs/neovim/**/*
- tests/modules/programs/vim/**/*
"file-manager":
- changed-files:
- any-glob-to-any-file:
- modules/programs/joshuto.nix
- modules/programs/lf.nix
- modules/programs/nnn.nix
- modules/programs/ranger.nix
- modules/programs/vifm.nix
- modules/programs/xplr.nix
- modules/programs/yazi.nix
- tests/modules/programs/lf/**/*
- tests/modules/programs/nnn/**/*
- tests/modules/programs/ranger/**/*
- tests/modules/programs/yazi/**/*
"gaming":
- changed-files:
- any-glob-to-any-file:
- modules/programs/kodi.nix
- modules/services/ludusavi.nix
- modules/programs/lutris.nix
- modules/programs/mangohud.nix
- modules/programs/sm64ex.nix
"git":
- changed-files:
- any-glob-to-any-file:
- modules/programs/gh*.nix
- modules/programs/git*.nix
- modules/programs/jujutsu.nix
- modules/programs/lazygit.nix
- modules/programs/sapling.nix
- modules/services/git-sync.nix
- tests/modules/programs/git/**/*
"mail":
- changed-files:
- any-glob-to-any-file:
- modules/*/mbsync*
- modules/programs/aerc*.nix
- modules/programs/alot*.nix
- modules/programs/getmail*
- modules/programs/himalaya.nix
- modules/programs/lieer.nix
- modules/programs/meli.nix
- modules/programs/msmtp*
- modules/programs/mu.nix
- modules/programs/mujmap.nix
- modules/programs/neomutt*
- modules/programs/notmuch*.nix
- modules/programs/offlineimap*.nix
- modules/programs/thunderbird.nix
- modules/services/imapnotify*.nix
- modules/services/lieer.nix
- modules/services/muchsync.nix
- tests/modules/programs/aerc/*
- tests/modules/programs/alot/*
- tests/modules/programs/himalaya/*
- tests/modules/programs/mbsync/*
- tests/modules/programs/mujmap/*
- tests/modules/programs/neomutt/*
- tests/modules/programs/thunderbird/*
"messaging":
- changed-files:
- any-glob-to-any-file:
- modules/programs/chawan.nix
- modules/programs/discocss.nix
- modules/programs/element-desktop.nix
- modules/programs/gurk-rs.nix
- modules/programs/halloy.nix
- modules/programs/havoc.nix
- modules/programs/hexchat.nix
- modules/programs/iamb.nix
- modules/programs/irssi.nix
- modules/programs/nheko.nix
- modules/programs/pidgin.nix
- modules/programs/senpai.nix
- modules/programs/tiny.nix
- modules/programs/vesktop.nix
- modules/services/pantalaimon.nix
- tests/modules/programs/irssi/**/*
- tests/modules/programs/nheko/**/*
"monitoring":
- changed-files:
- any-glob-to-any-file:
- modules/services/activitywatch.nix
- modules/services/batsignal.nix
- modules/services/cbatticon.nix
- modules/services/conky.nix
- modules/services/glance.nix
- modules/services/poweralertd.nix
"notification":
- changed-files:
- any-glob-to-any-file:
- modules/programs/noti.nix
- modules/services/dunst.nix
- modules/services/fnott.nix
- modules/services/mako.nix
- modules/services/notify-osd.nix
- modules/services/swaync.nix
- modules/services/twmn.nix
- tests/modules/services/dunst/**/*
- tests/modules/services/mako/**/*
"productivity":
- changed-files:
- any-glob-to-any-file:
- modules/programs/comodoro.nix
- modules/programs/info.nix
- modules/programs/joplin-desktop.nix
- modules/programs/ledger.nix
- modules/programs/newsboat.nix
- modules/programs/obsidian.nix
- modules/programs/onlyoffice.nix
- modules/programs/pandoc.nix
- modules/programs/papis.nix
- modules/programs/pubs.nix
- modules/programs/taskwarrior.nix
- modules/programs/todoman.nix
- modules/services/comodoro.nix
- modules/services/rsibreak.nix
- modules/services/safeeyes.nix
- modules/services/taskwarrior-sync.nix
"password-manager":
- changed-files:
- any-glob-to-any-file:
- modules/programs/browserpass.nix
- modules/programs/keepassxc.nix
- modules/programs/password-store.nix
- modules/programs/rbw.nix
- modules/services/pass-secret-service.nix
- tests/modules/programs/keepassxc/**/*
- tests/modules/programs/password-store/**/*
"photo":
- changed-files:
- any-glob-to-any-file:
- modules/programs/feh.nix
- modules/programs/gallery-dl.nix
- modules/programs/imv.nix
- modules/programs/pqiv.nix
- modules/programs/swayimg.nix
- modules/programs/wallust.nix
"shell":
- changed-files:
- any-glob-to-any-file:
- modules/lib/zsh.nix
- modules/programs/bash*.nix
- modules/programs/fish.nix
- modules/programs/ion.nix
- modules/programs/nushell.nix
- modules/programs/oh-my-posh.nix
- modules/programs/powerline-go.nix
- modules/programs/starship.nix
- modules/programs/zsh*.nix
- tests/modules/programs/bash/**/*
- tests/modules/programs/fish/**/*
- tests/modules/programs/nushell/**/*
- tests/modules/programs/zsh/**/*
"sync":
- changed-files:
- any-glob-to-any-file:
- modules/services/davmail.nix
- modules/services/dropbox.nix
- modules/services/etesync-dav.nix
- modules/services/kdeconnect.nix
- modules/services/megasync.nix
- modules/services/nextcloud-client.nix
- modules/programs/onedrive.nix
- modules/services/owncloud-client.nix
- modules/programs/rtorrent.nix
- modules/services/syncthing.nix
- modules/services/unison.nix
- tests/modules/services/dropbox/**/*
- tests/modules/services/syncthing/**/*
"system":
- changed-files:
- any-glob-to-any-file:
- modules/programs/gpg.nix
- modules/programs/home-manager.nix
- modules/programs/ssh.nix
- modules/services/gpg-agent.nix
- modules/services/home-manager*.nix
- modules/services/kbfs.nix
- modules/services/keybase.nix
- modules/services/nix-gc.nix
- modules/services/ssh-agent.nix
- modules/services/yubikey-agent.nix
- tests/modules/services/home-manager*/**/*
"system-tools":
- changed-files:
- any-glob-to-any-file:
- modules/programs/aria2.nix
- modules/services/arrpc.nix
- modules/services/cachix-agent.nix
- modules/services/fusuma.nix
- modules/services/grobi.nix
- modules/services/hound.nix
- modules/services/jankyborders.nix
- modules/services/ollama.nix
- modules/services/opensnitch-ui.nix
- modules/services/osmscout-server.nix
- modules/services/plan9port.nix
- modules/services/psd.nix
- modules/services/pueue.nix
- modules/services/recoll.nix
- modules/services/signaturepdf.nix
- modules/services/tahoe-lafs.nix
- modules/services/tldr-update.nix
"terminal":
- changed-files:
- any-glob-to-any-file:
- modules/programs/alacritty.nix
- modules/programs/foot.nix
- modules/programs/ghostty.nix
- modules/programs/gnome-terminal.nix
- modules/programs/kitty.nix
- modules/programs/ptyxis.nix
- modules/programs/rio.nix
- modules/programs/terminator.nix
- modules/programs/termite.nix
- modules/programs/urxvt.nix
- modules/programs/waveterm.nix
- modules/programs/wezterm.nix
- tests/modules/programs/alacritty/**/*
- tests/modules/programs/foot/**/*
- tests/modules/programs/kitty/**/*
"video":
- changed-files:
- any-glob-to-any-file:
- modules/programs/freetube.nix
- modules/programs/mpv.nix
- modules/programs/mpvpaper.nix
- modules/programs/obs-studio.nix
- modules/programs/streamlink.nix
- modules/programs/yt-dlp.nix
- modules/services/jellyfin-mpv-shim.nix
- modules/services/plex-mpv-shim.nix
- tests/modules/programs/mpv/**/*
"remote-desktop":
- changed-files:
- any-glob-to-any-file:
- modules/programs/looking-glass-client.nix
- modules/services/barrier.nix
- modules/services/remmina.nix
- modules/services/wayvnc.nix
"wayland":
- changed-files:
- any-glob-to-any-file:
- modules/programs/anyrun.nix
- modules/programs/bemenu.nix
- modules/programs/fuzzel.nix
- modules/programs/hyprlock.nix
- modules/programs/kickoff.nix
- modules/programs/onagre.nix
- modules/programs/sway-easyfocus.nix
- modules/programs/swaylock.nix
- modules/programs/swayr.nix
- modules/programs/tofi.nix
- modules/programs/waybar.nix
- modules/programs/waylogout.nix
- modules/programs/wayprompt.nix
- modules/programs/wlogout.nix
- modules/programs/wofi.nix
- modules/services/fnott.nix
- modules/services/hypridle.nix
- modules/services/hyprpaper.nix
- modules/services/hyprpolkitagent.nix
- modules/services/hyprsunset.nix
- modules/services/kanshi.nix
- modules/services/mako.nix
- modules/services/shikane.nix
- modules/services/swayidle.nix
- modules/services/swaync.nix
- modules/services/swayosd.nix
- modules/services/swww.nix
- modules/services/way-displays.nix
- modules/services/wlsunset.nix
- modules/services/wluma.nix
- modules/services/wpaperd.nix
- tests/modules/programs/swaylock/**/*
- tests/modules/programs/waybar/**/*
"window-managers":
- changed-files:
- any-glob-to-any-file:
- modules/programs/aerospace.nix
- modules/programs/i3bar-river.nix
- modules/programs/i3blocks.nix
- modules/programs/i3status-rust.nix
- modules/programs/i3status.nix
- modules/services/window-managers/**/*
"x11":
- changed-files:
- any-glob-to-any-file:
- modules/programs/i3*.nix
- modules/programs/rofi*.nix
- modules/programs/tint2.nix
- modules/programs/xmobar.nix
- modules/programs/yambar.nix
- modules/services/betterlockscreen.nix
- modules/services/dunst.nix
- modules/services/dwm-status.nix
- modules/services/picom.nix
- modules/services/polybar.nix
- modules/services/screen-locker.nix
- modules/services/stalonetray.nix
- modules/services/sxhkd.nix
- modules/services/taffybar.nix
- modules/services/trayer.nix
- modules/services/xcape.nix
- modules/services/xembed-sni-proxy.nix
- modules/services/xidlehook.nix
- modules/services/xscreensaver.nix
- modules/services/xsettingsd.nix
- modules/services/xsuspender.nix
- tests/modules/programs/i3*/**/*
- tests/modules/programs/rofi/**/*
- tests/modules/services/picom/**/*
- tests/modules/services/polybar/**/*

View File

@@ -1,45 +0,0 @@
# Based on
# https://github.com/NixOS/nixpkgs/blob/2566f9dc/.github/workflows/backport.yml
name: Backport
on:
pull_request_target:
types:
- closed
- labeled
permissions:
contents: write
pull-requests: write
jobs:
backport:
name: Backport Pull Request
if: >
vars.CI_APP_ID
&& github.event.pull_request.merged == true
&& (
github.event.action != 'labeled'
|| startsWith(github.event.label.name, 'backport')
)
runs-on: ubuntu-latest
steps:
- name: Create GitHub App token
uses: actions/create-github-app-token@v2
if: vars.CI_APP_ID
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Create backport PRs
id: backport
uses: korthout/backport-action@v4
with:
# See https://github.com/korthout/backport-action#inputs
github_token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
branch_name: backport/${target_branch}/${pull_number}
copy_labels_pattern: .*

View File

@@ -1,15 +0,0 @@
on:
push:
branches:
- master
jobs:
triage:
runs-on: ubuntu-latest
if: github.repository_owner == 'nix-community'
steps:
- uses: mschilde/auto-label-merge-conflicts@master
with:
CONFLICT_LABEL_NAME: "merge conflict"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAX_RETRIES: 5
WAIT_MS: 10000

View File

@@ -3,28 +3,26 @@ on:
push:
branches:
- master
workflow_dispatch:
jobs:
publish:
if: github.event_name != 'schedule' || github.repository_owner == 'nix-community'
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix-build -A docs.html
cp -r result/share/doc/home-manager public
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix-build -A docs.html
cp -r result/share/doc/home-manager public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

View File

@@ -1,24 +0,0 @@
name: "Label PR"
on:
- pull_request_target
# WARNING:
# When extending this action, be aware that $GITHUB_TOKEN allows some write
# access to the GitHub API. This means that it should not evaluate user input in
# a way that allows code injection.
permissions:
contents: read
pull-requests: write
issues: write
jobs:
labels:
runs-on: ubuntu-latest
if: github.repository_owner == 'nix-community'
steps:
- uses: actions/labeler@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true

View File

@@ -1,81 +0,0 @@
name: Tag Module Maintainers
on:
pull_request_target:
types: [opened, ready_for_review, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
tag-maintainers:
runs-on: ubuntu-latest
if: |
github.event.pull_request.draft == false &&
github.event.pull_request.state == 'open'
steps:
- name: Create GitHub App token
uses: actions/create-github-app-token@v2
if: vars.CI_APP_ID
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Get Nixpkgs revision from flake.lock
id: get-nixpkgs
run: |
echo "rev=$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)" >> "$GITHUB_OUTPUT"
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.get-nixpkgs.outputs.rev }}.tar.gz
extra_nix_config: |
experimental-features = nix-command flakes
- name: Get changed files
id: changed-files
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
CHANGED_FILES=$(gh pr diff $PR_NUMBER --name-only | grep '^modules/' | grep -v '^modules/\(po\|.*\/news\)/' || true)
echo "Changed files:"
echo "$CHANGED_FILES"
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGED_FILES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Extract Maintainers
id: extract-maintainers
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.changed_files }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
echo "Extracting maintainers from changed files..."
MAINTAINERS=$(lib/python/extract-maintainers.py \
--changed-files "$CHANGED_FILES" \
--pr-author "$PR_AUTHOR")
echo "maintainers=$MAINTAINERS" >> $GITHUB_OUTPUT
echo "Found maintainers: $MAINTAINERS"
- name: Manage Reviewers
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
MAINTAINERS: ${{ steps.extract-maintainers.outputs.maintainers }}
CHANGED_FILES: ${{ steps.changed-files.outputs.changed_files }}
BOT_NAME: ${{ steps.app-token.outputs.app-slug || 'github-actions' }}
run: |
./lib/python/manage-reviewers.py \
--owner "$OWNER" \
--repo "$REPO" \
--pr-number "$PR_NUMBER" \
--pr-author "$PR_AUTHOR" \
--current-maintainers "$MAINTAINERS" \
--changed-files "$CHANGED_FILES" \
--bot-user-name "$BOT_NAME"

View File

@@ -3,104 +3,28 @@ on:
pull_request:
schedule:
- cron: "30 2 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.changes.outputs.docs }}
format: ${{ steps.changes.outputs.format }}
hm: ${{ steps.changes.outputs.hm }}
tests: ${{ steps.changes.outputs.tests }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
tests:
- 'flake.lock'
- 'flake.nix'
- 'modules/**'
- 'nix-darwin/**'
- 'nixos/**'
- 'tests/**'
docs:
- '**.md'
- 'docs/**'
- 'flake.lock'
- 'flake.nix'
- 'modules/**'
format:
- '**/*.nix'
hm:
- 'flake.lock'
- 'flake.nix'
- 'home-manager/**'
tests:
needs: changes
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Get Nixpkgs revision from flake.lock
id: get-nixpkgs
run: |
echo "rev=$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)" >> "$GITHUB_OUTPUT"
- uses: cachix/install-nix-action@v31
if: github.event_name == 'schedule' || needs.changes.outputs.docs == 'true' || needs.changes.outputs.tests == 'true' || needs.changes.outputs.hm == 'true' || needs.changes.outputs.format == 'true'
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.get-nixpkgs.outputs.rev }}.tar.gz
- name: Build docs
if: github.event_name == 'schedule' || needs.changes.outputs.docs == 'true'
run: nix build --show-trace .#docs-jsonModuleMaintainers
- name: Format Check
if: github.event_name == 'schedule' || needs.changes.outputs.format == 'true'
run: nix fmt -- --ci
- name: Test init --switch with locked inputs
if: github.event_name == 'schedule' || needs.changes.outputs.hm == 'true'
run: |
# Copy lock file to home directory for consistent testing
mkdir -p ~/.config/home-manager
cp flake.lock ~/.config/home-manager/
nix run .#home-manager -- init --switch --override-input home-manager .
- name: Uninstall
if: github.event_name == 'schedule' || needs.changes.outputs.hm == 'true'
run: yes | nix run . -- uninstall
- name: Generate Job Summary
if: github.event_name == 'pull_request'
shell: bash
run: |
echo "### Test Job Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "A summary of tasks triggered by file changes in this PR:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.changes.outputs.docs }}" == "true" ]]; then
echo "- ✅ **Docs Build:** Triggered" >> $GITHUB_STEP_SUMMARY
else
echo "- ☑️ **Docs Build:** Skipped (no relevant files changed)" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ needs.changes.outputs.format }}" == "true" ]]; then
echo "- ✅ **Format Check:** Triggered" >> $GITHUB_STEP_SUMMARY
else
echo "- ☑️ **Format Check:** Skipped (no relevant files changed)" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ needs.changes.outputs.hm }}" == "true" ]]; then
echo "- ✅ **Home Manager Tests:** Triggered" >> $GITHUB_STEP_SUMMARY
else
echo "- ☑️ **Home Manager Tests:** Skipped (no relevant files changed)" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ needs.changes.outputs.tests }}" == "true" ]]; then
echo "- ✅ **General Tests:** Triggered" >> $GITHUB_STEP_SUMMARY
else
echo "- ☑️ **General Tests:** Skipped (no relevant files changed)" >> $GITHUB_STEP_SUMMARY
fi
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v12
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
if grep -R --exclude stdlib-extended.nix literalExample modules ; then
echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr
exit 1
fi
- run: nix-build -A docs.jsonModuleMaintainers
- run: ./format -c
- run: nix-shell . -A install
- run: nix-shell --arg enableBig false --pure tests -A run.all

View File

@@ -1,66 +0,0 @@
name: Update flake inputs
on:
schedule:
# Update every Sunday and Wednesday
- cron: "51 3 * * 0,3"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
if: github.event_name != 'schedule' || github.repository_owner == 'nix-community'
strategy:
fail-fast: false
matrix:
branch: [master, release-25.11]
steps:
- name: Create GitHub App token
uses: actions/create-github-app-token@v2
if: vars.CI_APP_ID
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- name: Get GitHub App user info
if: vars.CI_APP_ID
id: user-info
env:
GH_TOKEN: ${{ steps.app-token.outputs.token}}
slug: ${{ steps.app-token.outputs.app-slug }}
run: |
name="$slug[bot]"
id=$(gh api "/users/$name" --jq .id)
{
echo "id=$id"
echo "name=$name"
echo "email=$id+$name@users.noreply.github.com"
} >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ matrix.branch }}
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v28
with:
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
git-committer-name: ${{ steps.user-info.outputs.name || 'github-actions[bot]' }}
git-committer-email: ${{ steps.user-info.outputs.email || '41898282+github-actions[bot]@users.noreply.github.com' }}
git-author-name: ${{ steps.user-info.outputs.name || 'github-actions[bot]' }}
git-author-email: ${{ steps.user-info.outputs.email || '41898282+github-actions[bot]@users.noreply.github.com' }}
pr-labels: dependencies
pr-title: "[${{ matrix.branch }}] flake.lock: Update"
pr-body: |
Automated update by the [update-flake-lock] GitHub Action.
```
{{ env.GIT_COMMIT_MESSAGE }}
```
This PR was most recently updated by workflow run [${{ github.run_id }}].
[update-flake-lock]: https://github.com/DeterminateSystems/update-flake-lock
[${{ github.run_id }}]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
base: ${{ matrix.branch }}
branch: update/${{ matrix.branch }}

View File

@@ -1,286 +0,0 @@
name: Update maintainers list
on:
push:
branches:
- main
paths:
- lib/maintainers.nix
schedule:
# Update every Monday at 9 AM UTC
- cron: "0 9 * * 1"
workflow_dispatch:
inputs:
create_pr:
description: "Create PR even if no changes"
required: false
default: false
type: boolean
jobs:
update-maintainers:
runs-on: ubuntu-latest
if: github.repository_owner == 'nix-community' || github.event_name == 'workflow_dispatch'
permissions:
contents: write
pull-requests: write
issues: write
env:
pr_branch: update/maintainers-${{ github.ref_name }}
steps:
- name: Create GitHub App token
uses: actions/create-github-app-token@v2
if: vars.CI_APP_ID
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- name: Get GitHub App user info
id: user-info
if: vars.CI_APP_ID
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
slug: ${{ steps.app-token.outputs.app-slug }}
run: |
name="$slug[bot]"
id=$(gh api "/users/$name" --jq .id)
{
echo "id=$id"
echo "name=$name"
echo "email=$id+$name@users.noreply.github.com"
} >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token || github.token }}
- name: Get Nixpkgs revision from flake.lock
id: get-nixpkgs
run: |
echo "rev=$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)" >> "$GITHUB_OUTPUT"
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.get-nixpkgs.outputs.rev }}.tar.gz
- name: Setup Git
env:
name: ${{ steps.user-info.outputs.name || 'github-actions[bot]' }}
email: ${{ steps.user-info.outputs.email || '41898282+github-actions[bot]@users.noreply.github.com' }}
run: |
git config user.name "$name"
git config user.email "$email"
- name: Save old maintainers
id: old-maintainers
run: |
echo "📄 Saving old maintainers file for comparison..."
echo "old_maintainers=$(nix eval --file all-maintainers.nix --apply 'builtins.attrNames' --json 2>/dev/null || echo '[]')" >> "$GITHUB_OUTPUT"
- name: Generate updated maintainers list
run: |
echo "::group::📋 Generating updated generated/all-maintainers.nix..."
./lib/python/generate-all-maintainers.py
echo "::endgroup::"
echo "::group::🎨 Formatting with nixfmt..."
nix fmt all-maintainers.nix
echo "::endgroup::"
- name: Check for changes and compare maintainers
id: check-changes
env:
old_maintainers: ${{ steps.old-maintainers.outputs.old_maintainers }}
run: |
if git diff --quiet all-maintainers.nix; then
echo "No changes to all-maintainers.nix"
echo "has_changes=false" >> "$GITHUB_OUTPUT"
echo "maintainer_changes=No changes detected" >> "$GITHUB_OUTPUT"
else
echo "Changes detected in all-maintainers.nix"
echo "has_changes=true" >> "$GITHUB_OUTPUT"
# Get change statistics
added=$(git diff --numstat all-maintainers.nix | cut -f1)
removed=$(git diff --numstat all-maintainers.nix | cut -f2)
echo "changes_summary=+$added -$removed lines" >> "$GITHUB_OUTPUT"
# Compare old and new maintainers using nix eval
echo "🔍 Comparing maintainers..."
# Extract maintainer names from new file
new_maintainers=$(nix eval --file all-maintainers.nix --apply 'builtins.attrNames' --json)
# Compare using nix eval
comparison=$(nix eval --expr "
let
old = builtins.fromJSON ''$old_maintainers'';
new = builtins.fromJSON ''$new_maintainers'';
oldSet = builtins.listToAttrs (map (name: { name = name; value = true; }) old);
newSet = builtins.listToAttrs (map (name: { name = name; value = true; }) new);
added = builtins.filter (name: !(oldSet ? \${name})) new;
removed = builtins.filter (name: !(newSet ? \${name})) old;
in {
added = added;
removed = removed;
total_old = builtins.length old;
total_new = builtins.length new;
}
" --json)
# Format comparison output
added_count=$(echo "$comparison" | jq '.added | length')
removed_count=$(echo "$comparison" | jq '.removed | length')
total_old=$(echo "$comparison" | jq '.total_old')
total_new=$(echo "$comparison" | jq '.total_new')
maintainer_summary="**Added:** $added_count maintainers"
maintainer_summary="$maintainer_summary\n**Removed:** $removed_count maintainers"
maintainer_summary="$maintainer_summary\n**Total:** $total_old → $total_new maintainers"
if [ "$added_count" -gt 0 ]; then
added_names=$(echo "$comparison" | jq -r '.added | join(", ")')
maintainer_summary="$maintainer_summary\n\n**✅ Added:** $added_names"
fi
if [ "$removed_count" -gt 0 ]; then
removed_names=$(echo "$comparison" | jq -r '.removed | join(", ")')
maintainer_summary="$maintainer_summary\n\n**❌ Removed:** $removed_names"
fi
echo "maintainer_changes<<EOF" >> "$GITHUB_OUTPUT"
echo -e "$maintainer_summary" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
fi
- name: Validate generated file
if: steps.check-changes.outputs.has_changes == 'true'
run: |
echo "🔍 Validating generated all-maintainers.nix..."
if nix-instantiate --eval ./all-maintainers.nix --strict > /dev/null; then
echo "✅ Generated file has valid Nix syntax"
else
echo "❌ Generated file has invalid Nix syntax"
exit 1
fi
- name: Create update branch
run: |
git branch -D "$pr_branch" || echo "Nothing to delete"
git switch -c "$pr_branch"
- name: Get info on the current PR
id: open_pr_info
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
run: |
# Query for info about the already open update PR
info=$(
gh api graphql -F owner='{owner}' -F repo='{repo}' -F branch="$pr_branch" -f query='
query($owner:String!, $repo:String!, $branch:String!) {
repository(owner: $owner, name: $repo) {
pullRequests(first: 1, states: OPEN, headRefName: $branch) {
nodes {
number
url
}
}
}
}
' | jq --raw-output '
.data.repository.pullRequests.nodes[]
| to_entries[]
| "\(.key)=\(.value)"
'
)
if [[ -n "$info" ]]; then
echo "PR info:"
echo "$info"
echo "$info" >> $GITHUB_OUTPUT
else
echo "No PR is currently open"
fi
- name: Fetch current PR's branch
if: steps.open_pr_info.outputs.number
run: |
git fetch origin "$pr_branch"
git branch --set-upstream-to "origin/$pr_branch"
- name: Create Pull Request
id: create-pr
if: steps.check-changes.outputs.has_changes == 'true' || github.event.inputs.create_pr == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
title: "maintainers: update all-maintainers.nix"
commit_body: |
Automated update of the master maintainers list combining:
- Home Manager specific maintainers from modules/lib/maintainers.nix
- Nixpkgs maintainers referenced in Home Manager modules
${{ steps.check-changes.outputs.maintainer_changes }}
Generated by: lib/python/generate-all-maintainers.py
pr_url: ${{ steps.open_pr_info.outputs.url }}
pr_num: ${{ steps.open_pr_info.outputs.number }}
pr_body: |
## 📋 Summary
This PR updates the master maintainers list (`all-maintainers.nix`) which combines:
- **Home Manager specific maintainers** from `modules/lib/maintainers.nix`
- **Nixpkgs maintainers** referenced in Home Manager modules
## 🔄 Changes
**Statistics:** ${{ steps.check-changes.outputs.changes_summary || 'No content changes (format/comment updates only)' }}
${{ steps.check-changes.outputs.maintainer_changes }}
The updated list includes all maintainers needed for review assignments across the Home Manager project.
## 🤖 Automation
- **Generated by:** `lib/python/generate-all-maintainers.py`
- **Trigger:** ${{ github.event_name == 'schedule' && 'Scheduled weekly update' || 'Manual workflow dispatch' }}
- **Validation:** File syntax verified with `nix eval`
---
🤖 *This PR was automatically created by the [update-maintainers workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})*
run: |
# Commit the changes
git add all-maintainers.nix
git commit -m "$title" -m "$commit_body"
echo "Pushing to remote branch $pr_branch"
git push --force --set-upstream origin "$pr_branch"
if [ -z "$pr_num" ]; then
echo "Creating new pull request."
PR_URL=$(
gh pr create \
--title "$title" \
--body "$pr_body"
)
else
PR_URL=$pr_url
echo "Pull request already exists: $PR_URL"
gh pr edit "$pr_num" --body "$pr_body"
fi
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
- name: Summary
env:
has_changes: ${{ steps.check-changes.outputs.has_changes }}
changes: ${{ steps.check-changes.outputs.changes_summary }}
pr_url: ${{ steps.create-pr.outputs.pr_url}}
pr_num: ${{ steps.open_pr_info.outputs.number }}
run: |
if [[ "$has_changes" == "true" ]]; then
if [[ -n "$pr_num" ]]; then
echo "✅ Successfully updated PR with new changes."
echo "$changes"
echo "🔗 PR URL: $pr_url"
echo "### ✅ PR Updated" >> $GITHUB_STEP_SUMMARY
echo "[$pr_url]($pr_url)" >> $GITHUB_STEP_SUMMARY
elif [[ -n "$pr_url" ]]; then
echo "✅ Successfully created PR with maintainer updates."
echo "$changes"
echo "🔗 PR URL: $pr_url"
echo "### ✅ PR Created" >> $GITHUB_STEP_SUMMARY
echo "[$pr_url]($pr_url)" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Failed to create or update pull request."
echo "### ❌ PR Operation Failed" >> $GITHUB_STEP_SUMMARY
echo "A pull request was intended but the URL was not captured. Please check the logs." >> $GITHUB_STEP_SUMMARY
fi
else
echo " No changes detected - maintainers list is up to date."
echo "### No Changes" >> $GITHUB_STEP_SUMMARY
echo "The maintainers list is up-to-date. No PR was created." >> $GITHUB_STEP_SUMMARY
fi

View File

@@ -1,49 +0,0 @@
name: Validate maintainers.nix
on:
pull_request:
paths: ["modules/lib/maintainers.nix"]
workflow_dispatch:
inputs:
run_tests:
description: 'Run validation tests'
required: false
default: true
type: boolean
jobs:
validate-maintainers:
runs-on: ubuntu-latest
if: github.repository_owner == 'nix-community'
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Get Nixpkgs revision from flake.lock
id: get-nixpkgs
run: |
echo "rev=$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)" >> "$GITHUB_OUTPUT"
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.get-nixpkgs.outputs.rev }}.tar.gz
- name: Validate Nix syntax
run: ./lib/python/validate-maintainers-syntax.py
- name: Validate maintainer entries
run: ./lib/python/validate-maintainer-entries.py
- name: Check for duplicate maintainers
run: ./lib/python/check-duplicate-maintainers.py
- name: Test generation
if: inputs.run_tests == true
run: |
echo "🔍 Testing all-maintainers.nix generation..."
./lib/python/generate-all-maintainers.py
echo "🔍 Validating generated file..."
if nix eval --file ./all-maintainers.nix --json > /dev/null; then
echo "✅ Generated file has valid Nix syntax"
else
echo "❌ Generated file has invalid Nix syntax"
exit 1
fi
- name: Summary
run: |
echo "✅ All validation checks passed!"
echo "📋 The maintainers.nix file is ready for merge"

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
/flake.lock
/result*
/tests/flake.lock

View File

@@ -4,8 +4,17 @@ variables:
NIX_PATH: "nixpkgs=channel:nixos-unstable"
stages:
- test
- deploy
Run tests:
stage: test
script:
- nix-shell --pure tests -A run.files-text
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
pages:
stage: deploy
script:
@@ -18,3 +27,15 @@ pages:
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
Deploy NUR:
stage: deploy
variables:
HM_BRANCH: $CI_COMMIT_REF_NAME
HM_COMMIT_SHA: $CI_COMMIT_SHA
trigger:
project: rycee/nur-expressions
branch: master
rules:
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH =~ /^release-/
when: always

1
.release Normal file
View File

@@ -0,0 +1 @@
22.05

View File

@@ -1,16 +0,0 @@
# Common commands
#
# Contributing manual:
# - https://nix-community.github.io/home-manager/#ch-contributing
# List tests matching a pattern `pattern`
list *pattern:
nix run .#tests -- -l {{pattern}}
# Run all tests matching a pattern `pattern`
test *pattern:
nix run .#tests -- {{pattern}}
# Run integration tests
integration_tests:
nix run .#tests -- -t -l

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017-2025 Home Manager contributors
Copyright (c) 2017-2022 Home Manager contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,255 +0,0 @@
# Maintaining Home Manager
This file is intended as a reference for Home Manager's core maintainers,
although it may be interesting for anyone curious how we do certain things.
## Releasing
Home Manager releases stable versions in sync with NixOS/nixpkgs. A _`YY.05`_
version is released in May and a _`YY.11`_ version is released in November.
We do not need to wait for the release to come out of _"beta"_ before creating a
branch, however we _should_ wait before updating links and references on the
`master` branch.
Creating a stable branch may require temporarily disabling branch protection.
This can only be done by an "admin" or "owner".
Once a stable branch is created, its flake inputs should be updated to point to
the corresponding stable versions. The branch can be created before these exist,
in which case they should be updated when the corresponding stable inputs become
available.
Once a stable version is considered "out of beta", references to Home Manager's
stable branch should be updated on the `master` branch to reference the new
version.
### Release Workflow
The release process involves four phases in a specific order:
1. **On master - Mark current as stable**: Update all documentation and examples
to reflect the current release (e.g., 25.11) as stable, removing "(unstable)"
tags
2. **Cut the release branch**: Create the new release branch from master (e.g.,
`release-25.11`)
3. **On release branch - Mark as release branch**: Set `isReleaseBranch: true`
in `release.json`
4. **On master - Prepare for next**: Bump version to next release (e.g., 26.05)
and add "(unstable)" tag back
**Important**: The `isReleaseBranch` field in `release.json` is managed
differently on each branch:
- On **master**: Always remains `false`
- On **release branches**: Set to `true` in a separate commit after cutting the
branch from master
This workflow ensures that the release branch captures a stable snapshot of
master, which then moves forward to the next development cycle.
### Release Preparation Checklist
#### Step 1: On master - Mark Current as Stable
**When**: When ready to cut a new release branch (e.g., when preparing to
release 25.11)
Reference commits:
- `e08e6e2389234000b0447e57abf61d8ccd59a68e` (home-manager: set 25.05 as stable)
1. **README.md**
- Update example release branch references (e.g., `release-24.11`
`release-25.05`)
- Update current stable version references (e.g., `24.11``25.05`)
2. **docs/manual/installation/nix-darwin.md**
- Update channel version in example commands
- Update `home.stateVersion` in examples
3. **docs/manual/installation/nixos.md**
- Update channel version in example commands
- Update tarball URLs
- Update `home.stateVersion` in examples
4. **docs/manual/installation/standalone.md**
- Update channel version in example commands
5. **docs/manual/manual.md**
- Remove `(unstable)` suffix from version
6. **docs/manual/nix-flakes/standalone.md**
- Update flake references (e.g., `home-manager/release-24.11`
`home-manager/release-25.05`)
- Update `$branch` examples
7. **docs/manual/usage/configuration.md**
- Update `home.stateVersion` in example configurations
8. **docs/release-notes/rl-YYMM.md**
- Replace "This is the current unstable branch and the information in this
section is therefore not final."
- With: "The YY.MM release branch became stable in <Month>, YYYY."
9. **home-manager/home-manager** script
- Update default `home.stateVersion` in generated configurations
- Update `home.stateVersion` in uninstall function
10. **modules/misc/uninstall.nix**
- Update `home.stateVersion` in uninstall config
**Note**: Do NOT change `isReleaseBranch` in `release.json` - keep it as `false`
#### Step 2: Cut the release branch
**When**: After Step 1 is merged to master
1. Create the new release branch from master
- Example: `git checkout -b release-25.11 master`
2. Push the branch to the repository
#### Step 3: On the release branch - Mark as Release Branch
**When**: Immediately after creating the release branch
Reference commits:
- `70a787cc5` (release: set release branch)
1. **release.json**
- Change `isReleaseBranch` from `false` to `true`
- Do NOT change the `release` field (it's already correct from Step 1)
2. **flake.nix**
- Update the nixpkgs input to track the corresponding stable branch
- Example: For `release-25.11`, change from:
```nix
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
```
to:
```nix
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
```
- Run `nix flake update` to update flake.lock to the stable branch
- Commit the flake.nix and flake.lock changes
**Note**: The release branch should track the stable NixOS release channel
(e.g., `nixos-25.11`), while master continues to track `nixos-unstable`.
#### Step 3.5: On master - Update CI for the New Release Branch
**When**: After marking the release branch as a release branch (Step 3)
**Where**: On the **master** branch (CI workflows run from master)
**What**: Update GitHub Actions workflows to include the new stable branch
1. **.github/workflows/update-flake.yml** (on master)
- Replace the old stable branch with the new release branch in the matrix
- Example: When creating `release-25.11`, update the matrix from:
```yaml
strategy:
matrix:
branch: [master, release-25.05]
```
to:
```yaml
strategy:
matrix:
branch: [master, release-25.11]
```
- This ensures automated flake.lock updates run on the current stable branch
- Note: We only maintain CI for the latest stable release, not older releases
2. **.github/dependabot.yml** (on master)
- Replace the old stable branch with the new release branch
- Example: When creating `release-25.11`, update the target-branch from:
```yaml
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-25.05"
schedule:
interval: "weekly"
commit-message:
prefix: "ci:"
```
to:
```yaml
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-25.11"
schedule:
interval: "weekly"
commit-message:
prefix: "ci:"
```
- This ensures automated dependency updates for GitHub Actions on the current
stable branch
- Note: We only maintain dependabot for the latest stable release, not older
releases
**Important**: CI workflows are executed from master, so this change must be
committed to the master branch.
#### Step 4: On master - Prepare for Next Release
**When**: After cutting the release branch, prepare master for the next
development cycle
Reference commits:
- `9a4a9f1d6e43fe4044f6715ae7cc85ccb1d2fe09` (home-manager: prepare 25.11)
1. **docs/release-notes/rl-YYMM.md** (CREATE NEW)
- Create new release notes file for next version with unstable warning
- Example: Create `rl-2605.md` when preparing for 26.05
2. **docs/manual/manual.md**
- Update version to next release with `(unstable)` tag
- Example: `25.11` → `26.05 (unstable)`
3. **docs/release-notes/release-notes.md**
- Add new release notes file `rl-YYMM.md` at the top of the chapters list
4. **home-manager/home-manager** script
- Update `--version` output to next version
- Example: `echo 25.11-pre` → `echo 26.05-pre`
5. **modules/misc/version.nix**
- Add new version string to `stateVersion` enum list
- Example: Add `"26.05"` after `"25.11"`
6. **release.json**
- Update `release` field to next version (e.g., `"25.11"` → `"26.05"`)
- **IMPORTANT**: Keep `isReleaseBranch` as `false` on master
### Version State Changes
Each release may introduce state version changes that affect the default
behavior of Home Manager for users who set `home.stateVersion` to that version.
State version changes should be documented in the release notes under a "State
Version Changes" section, explaining what behavior changes for users who set
their state version to the new release.
### Backporting
Stable branches get bug fixes and security updates, but usually not new modules
or features. When backporting:
1. Use `git cherry-pick -x <commit>` to preserve the original commit reference
2. Test that the backport builds successfully
3. Consider whether the change might affect existing stable users
4. Update the PR/commit message to indicate it's a backport
If a user needs a module backported, they should open an issue explaining the
use case.

View File

@@ -17,4 +17,4 @@ test-install:
HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install
format:
nix-shell -p treefmt nixfmt deadnix keep-sorted --run "treefmt --config-file ./treefmt.toml"
./format

159
README.md
View File

@@ -1,123 +1,134 @@
Home Manager using Nix
======================
This project provides a basic system for managing a user environment using the
[Nix][] package manager together with the Nix libraries found in [Nixpkgs][]. It
allows declarative configuration of user specific (non-global) packages and
dotfiles.
This project provides a basic system for managing a user environment
using the [Nix][] package manager together with the Nix libraries
found in [Nixpkgs][]. It allows declarative configuration of user
specific (non global) packages and dotfiles.
Usage
-----
Before attempting to use Home Manager please read [the warning
below](#words-of-warning).
Before attempting to use Home Manager please read the warning below.
For a systematic overview of Home Manager and its available options, please see:
For a systematic overview of Home Manager and its available options,
please see
- [Home Manager manual][manual]
- [Home Manager configuration options][configuration options]
- [3rd party Home Manager option
search](https://home-manager-options.extranix.com/)
- the [Home Manager manual][manual] and
- the [Home Manager configuration options][configuration options].
If you would like to contribute to Home Manager, then please have a look at
["Contributing" in the manual][contributing].
Releases
--------
Home Manager is developed against `nixpkgs-unstable` branch, which often causes
it to contain tweaks for changes/packages not yet released in stable [NixOS][].
To avoid breaking users' configurations, Home Manager is released in branches
corresponding to NixOS releases (e.g. `release-25.11`). These branches get
fixes, but usually not new modules. If you need a module to be backported, then
feel free to open an issue.
If you would like to contribute to Home Manager
then please have a look at the [contributing][] chapter of the manual.
Words of warning
----------------
Unfortunately, it is quite possible to get difficult to understand errors when
working with Home Manager. You should therefore be comfortable using the [Nix][]
language and the various tools in the Nix ecosystem.
Unfortunately, it is quite possible to get difficult to understand
errors when working with Home Manager, such as infinite loops with no
clear source reference. You should therefore be comfortable using the
Nix language and the various tools in the Nix ecosystem. Reading
through the [Nix Pills][] document is a good way to familiarize
yourself with them.
If you are not very familiar with Nix but still want to use Home Manager then
you are strongly encouraged to start with a small and very simple configuration
and gradually make it more elaborate as you learn.
If you are not very familiar with Nix but still want to use Home
Manager then you are strongly encouraged to start with a small and
very simple configuration and gradually make it more elaborate as you
learn.
In some cases Home Manager cannot detect whether it will overwrite a previous
manual configuration. For example, the Gnome Terminal module will write to your
dconf store and cannot tell whether a configuration that it is about to be
overwritten was from a previous Home Manager generation or from manual
configuration.
In some cases Home Manager cannot detect whether it will overwrite a
previous manual configuration. For example, the Gnome Terminal module
will write to your dconf store and cannot tell whether a configuration
that it is about to be overwritten was from a previous Home Manager
generation or from manual configuration.
Home Manager targets [NixOS][] unstable and NixOS version 25.11 (the current
stable version), it may or may not work on other Linux distributions and NixOS
versions.
Home Manager targets [NixOS][] unstable and NixOS version 22.05 (the
current stable version), it may or may not work on other Linux
distributions and NixOS versions.
Now when your expectations have been built up and you are eager to try all this
out you can go ahead and read the rest of this text.
Also, the `home-manager` tool does not explicitly support rollbacks at
the moment so if your home directory gets messed up you'll have to fix
it yourself. See the [rollbacks][] section for instructions on how to
manually perform a rollback.
Now when your expectations have been built up and you are eager to try
all this out you can go ahead and read the rest of this text.
Contact
-------
You can chat with us on IRC in the channel [#home-manager][] on [OFTC][]. There
is also a [Matrix room](https://matrix.to/#/#hm:rycee.net), which is bridged to
the IRC channel.
You can chat with us on IRC in the channel [#home-manager][] on [OFTC][].
There is also a [Matrix room](https://matrix.to/#/#hm:rycee.net),
which is bridged to the IRC channel.
Installation
------------
Home Manager can be used in three primary ways:
1. Using the standalone `home-manager` tool. For platforms other than NixOS and
Darwin, this is the only available choice. It is also recommended for people
on [NixOS][] or Darwin that want to manage their home directory independently
of the system as a whole. See ["Standalone installation" in the
manual][manual standalone install] for instructions on how to perform this
installation.
1. Using the standalone `home-manager` tool. For platforms other than
NixOS and Darwin, this is the only available choice. It is also
recommended for people on NixOS or Darwin that want to manage their
home directory independently of the system as a whole. See
[Standalone installation][manual standalone install] in the manual
for instructions on how to perform this installation.
1. As a module within a NixOS system configuration. This allows the user
profiles to be built together with the system when running `nixos-rebuild`.
See ["NixOS module" in the manual][manual nixos install] for a description of
this setup.
2. As a module within a NixOS system configuration. This allows the
user profiles to be built together with the system when running
`nixos-rebuild`. See [NixOS module installation][manual nixos
install] in the manual for a description of this setup.
1. As a module within a [nix-darwin] system configuration. This allows the user
profiles to be built together with the system when running `darwin-rebuild`.
See ["nix-darwin module" in the manual][manual nix-darwin install] for a
3. As a module within a [nix-darwin][] system configuration. This
allows the user profiles to be built together with the system when
running `darwin-rebuild`. See [nix-darwin module
installation][manual nix-darwin install] in the manual for a
description of this setup.
Home Manager provides both the channel-based setup and the flake-based one. See
[Nix Flakes][manual nix flakes] for a description of the flake-based setup.
Home Manager provides both the channel-based setup and the flake-based one.
See [Nix Flakes][manual nix flakes] for a description of the flake-based setup.
Translations
------------
Home Manager has basic support for internationalization through
[gettext](https://www.gnu.org/software/gettext/). The translations are hosted by
[Weblate](https://weblate.org/). If you would like to contribute to the
translation effort then start by going to the [Home Manager Weblate
project](https://hosted.weblate.org/engage/home-manager/).
[gettext](https://www.gnu.org/software/gettext/). The translations are
hosted by [Weblate](https://weblate.org/). If you would like to
contribute to the translation effort then start by going to the
[Home Manager Weblate project](https://hosted.weblate.org/engage/home-manager/).
<a href="https://hosted.weblate.org/engage/home-manager/">
<img src="https://hosted.weblate.org/widgets/home-manager/-/multi-auto.svg" alt="Translation status" />
<img src="https://hosted.weblate.org/widgets/home-manager/-/multi-auto.svg" alt="Translation status" />
</a>
Releases
--------
Home Manager is developed against `nixpkgs-unstable` branch, which
often causes it to contain tweaks for changes/packages not yet
released in stable NixOS. To avoid breaking users' configurations,
Home Manager is released in branches corresponding to NixOS releases
(e.g. `release-22.05`). These branches get fixes, but usually not new
modules. If you need a module to be backported, then feel free to open
an issue.
License
-------
This project is licensed under the terms of the [MIT license](LICENSE).
[#home-manager]: https://webchat.oftc.net/?channels=home-manager
[Nix Flakes]: https://wiki.nixos.org/wiki/Flakes
[NixOS]: https://nixos.org/
[Nix]: https://nixos.org/explore.html
[NixOS]: https://nixos.org/
[Nixpkgs]: https://github.com/NixOS/nixpkgs
[OFTC]: https://oftc.net/
[configuration options]: https://nix-community.github.io/home-manager/options.xhtml
[manual]: https://nix-community.github.io/home-manager/index.html
[contributing]: https://nix-community.github.io/home-manager/#ch-contributing
[manual nix flakes]: https://nix-community.github.io/home-manager/#ch-nix-flakes
[manual nix-darwin install]: https://nix-community.github.io/home-manager/#sec-install-nix-darwin-module
[manual nixos install]: https://nix-community.github.io/home-manager/#sec-install-nixos-module
[manual standalone install]: https://nix-community.github.io/home-manager/#sec-install-standalone
[manual]: https://nix-community.github.io/home-manager/
[nix-darwin]: https://github.com/nix-darwin/nix-darwin
[rollbacks]: https://nix-community.github.io/home-manager/index.xhtml#sec-usage-rollbacks
[manual usage]: https://nix-community.github.io/home-manager/#ch-usage
[configuration options]: https://nix-community.github.io/home-manager/options.html
[#home-manager]: https://webchat.oftc.net/?channels=home-manager
[OFTC]: https://oftc.net/
[Nix Pills]: https://nixos.org/guides/nix-pills/
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
[nix-darwin]: https://github.com/LnL7/nix-darwin
[manual standalone install]: https://nix-community.github.io/home-manager/index.html#sec-install-standalone
[manual nixos install]: https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module
[manual nix-darwin install]: https://nix-community.github.io/home-manager/index.html#sec-install-nix-darwin-module
[manual nix flakes]: https://nix-community.github.io/home-manager/index.html#ch-nix-flakes
[rollbacks]: https://nix-community.github.io/home-manager/index.html#sec-usage-rollbacks

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
attribute = "buildbot"
flake_dir = "./tests"
lock_file = "./flake.lock"

View File

@@ -1,36 +1,19 @@
{
pkgs ? import <nixpkgs> { },
}:
{ pkgs ? import <nixpkgs> { } }:
let
path = builtins.path {
path = ./.;
name = "home-manager-source";
rec {
docs = with import ./docs { inherit pkgs; }; {
html = manual.html;
manPages = manPages;
json = options.json;
jsonModuleMaintainers = jsonModuleMaintainers; # Unstable, mainly for CI.
};
in
rec {
docs =
let
releaseInfo = pkgs.lib.importJSON ./release.json;
in
with import ./docs {
inherit pkgs;
inherit (releaseInfo) release isReleaseBranch;
};
{
home-manager = pkgs.callPackage ./home-manager { path = toString ./.; };
inherit manPages jsonModuleMaintainers;
inherit (manual) html htmlOpenTool;
inherit (options) json;
};
home-manager = pkgs.callPackage ./home-manager { inherit path; };
install = pkgs.callPackage ./home-manager/install.nix { inherit home-manager; };
install =
pkgs.callPackage ./home-manager/install.nix { inherit home-manager; };
nixos = import ./nixos;
lib = import ./lib { inherit (pkgs) lib; };
inherit path;
path = ./.;
}

258
docs/contributing.adoc Normal file
View File

@@ -0,0 +1,258 @@
[[ch-contributing]]
== Contributing
:open-issues: https://github.com/nix-community/home-manager/issues
:new-issue: https://github.com/nix-community/home-manager/issues/new
:fork-a-repo: https://help.github.com/articles/fork-a-repo/
:create-a-pull-request: https://help.github.com/articles/creating-a-pull-request/
:seven-rules: https://chris.beams.io/posts/git-commit/#seven-rules
:news-nix: https://github.com/nix-community/home-manager/blob/master/modules/misc/news.nix
:nixfmt: https://github.com/serokell/nixfmt/
:example-commit-message: https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef
Contributions to Home Manager are very welcome. To make the process as smooth as possible for both you and the Home Manager maintainers we provide some guidelines that we ask you to follow. See <<sec-contrib-getting-started>> for information on how to set up a suitable development environment and <<sec-guidelines>> for the actual guidelines.
This text is mainly directed at those who would like to make code contributions to Home Manager. If you just want to report a bug then first look among the already {open-issues}[open issues], if you find one matching yours then feel free to comment on it to add any additional information you may have. If no matching issue exists then go to the {new-issue}[new issue] page and write a description of your problem. Include as much information as you can, ideally also include relevant excerpts from your Home Manager configuration.
[[sec-contrib-getting-started]]
=== Getting started
If you have not previously forked Home Manager then you need to do that first. Have a look at GitHub's {fork-a-repo}[Fork a repo] for instructions on how to do this.
Once you have a fork of Home Manager you should create a branch starting at the most recent `master` branch. Give your branch a reasonably descriptive name. Commit your changes to this branch and when you are happy with the result and it fulfills <<sec-guidelines>> then push the branch to GitHub and {create-a-pull-request}[create a pull request].
Assuming your clone is at `$HOME/devel/home-manager` then you can make the `home-manager` command use it by either
1. overriding the default path by using the `-I` command line option:
+
[source,console]
$ home-manager -I home-manager=$HOME/devel/home-manager
+
or
2. changing the default path by ensuring your configuration includes
+
[source,nix]
----
programs.home-manager.enable = true;
programs.home-manager.path = "$HOME/devel/home-manager";
----
+
and running `home-manager switch` to activate the change. Afterwards, `home-manager build` and `home-manager switch` will use your cloned repository.
The first option is good if you only temporarily want to use your clone.
[[sec-guidelines]]
=== Guidelines
:irc-home-manager: https://webchat.oftc.net/?channels=home-manager
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
:assertions: https://nixos.org/manual/nixos/stable/index.html#sec-assertions
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
If you are uncertain how these rules affect the change you would like to make then feel free to start a discussion in the {irc-home-manager}[#home-manager] IRC channel, ideally before you start developing.
[[sec-guidelines-back-compat]]
==== Maintain backward compatibility
Your contribution should not cause another user's existing configuration to break unless there is a very good reason and the change should be announced to the user through an {assertions}[assertion] or similar.
Remember that Home Manager is used in many different environments and you should consider how your change may effect others. For example,
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
- Does your change work for people whose configuration is built on one system and deployed on another system?
[[sec-guidelines-forward-compat]]
==== Keep forward compatibility in mind
The master branch of Home Manager tracks the unstable channel of Nixpkgs, which may update package versions at any time. It is therefore important to consider how a package update may affect your code and try to reduce the risk of breakage.
The most effective way to reduce this risk is to follow the advice in <<sec-guidelines-valuable-options>>.
[[sec-guidelines-valuable-options]]
==== Add only valuable options
When creating a new module it is tempting to include every option supported by the software. This is _strongly_ discouraged. Providing many options increases maintenance burden and risk of breakage considerably. This is why only the most {valuable-options}[important software options] should be modeled explicitly. Less important options should be expressible through an `extraConfig` escape hatch.
A good rule of thumb for the first implementation of a module is to only add explicit options for those settings that absolutely must be set for the software to function correctly. It follows that a module for software that provides sensible default values for all settings would require no explicit options at all.
If the software uses a structured configuration format like a JSON, YAML, INI, TOML, or even a plain list of key/value pairs then consider using a `settings` option as described in {rfc-42}[Nix RFC 42].
[[sec-guidelines-add-tests]]
==== Add relevant tests
If at all possible, make sure to add new tests and expand existing tests so that your change will keep working in the future. See <<sec-tests>> for more information about the Home Manager test suite.
All contributed code _must_ pass the test suite.
[[sec-guidelines-module-maintainer]]
==== Add relevant documentation
:docbook: https://tdg.docbook.org/
:asciidoc: https://asciidoc.org/
:docbook-rocks: https://berbiche.github.io/docbook.rocks/
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
The HTML version of the manual containing both the module option descriptions and the documentation of Home Manager can be generated and opened by typing the following in a shell within a clone of the Home Manager Git repository:
[source,console]
$ nix-build -A docs.html
$ xdg-open ./result/share/doc/home-manager/index.html
When you have made changes to a module, it is a good idea to check that the man page version of the module options looks good:
[source,console]
$ nix-build -A docs.manPages
$ man ./result/share/man/man5/home-configuration.nix.5
==== Add yourself as a module maintainer
Every new module _must_ include a named maintainer using the `meta.maintainers` attribute. If you are a user of a module that currently lacks a maintainer then please consider adopting it.
If you are present in the NixOS maintainer list then you can use that entry. If you are not then you can add yourself to `modules/lib/maintainers.nix` in the Home Manager project.
Also add yourself to `.github/CODEOWNERS` as owner of the associated module files, including the test files. You will then be automatically added as a reviewer on any new pull request that touches your files.
Maintainers are encouraged to join the IRC channel and participate when they have opportunity.
[[sec-guidelines-code-style]]
==== Format your code
Make sure your code is formatted as described in <<sec-code-style>>. To maintain consistency throughout the project you are encouraged to browse through existing code and adopt its style also in new code.
[[sec-guidelines-commit-message-style]]
==== Format your commit messages
Similar to <<sec-guidelines-code-style>> we encourage a consistent commit message format as described in <<sec-commit-style>>.
[[sec-guidelines-news-style]]
==== Format your news entries
If your contribution includes a change that should be communicated to users of Home Manager then you can add a news entry. The entry must be formatted as described in <<sec-news>>.
When new modules are added a news entry should be included but you do not need to create this entry manually. The merging maintainer will create the entry for you. This is to reduce the risk of merge conflicts.
[[sec-guidelines-conditional-modules]]
==== Use conditional modules and news
Home Manager includes a number of modules that are only usable on some of the supported platforms. The most common example of platform specific modules are those that define systemd user services, which only works on Linux systems.
If you add a module that is platform specific then make sure to include a condition in the `loadModule` function call. This will make the module accessible only on systems where the condition evaluates to `true`.
Similarly, if you are adding a news entry then it should be shown only to users that may find it relevant, see <<sec-news>> for a description of conditional news.
[[sec-guidelines-licensing]]
==== Mind the license
The Home Manager project is covered by the MIT license and we can only accept contributions that fall under this license, or are licensed in a compatible way. When you contribute self written code and documentation it is assumed that you are doing so under the MIT license.
A potential gotcha with respect to licensing are option descriptions. Often it is convenient to copy from the upstream software documentation. When this is done it is important to verify that the license of the upstream documentation allows redistribution under the terms of the MIT license.
[[sec-commit-style]]
=== Commits
The commits in your pull request should be reasonably self-contained, that is, each commit should make sense in isolation. In particular, you will be asked to amend any commit that introduces syntax errors or similar problems even if they are fixed in a later commit.
The commit messages should follow the {seven-rules}[seven rules]. We also ask you to include the affected code component or module in the first line. That is, a commit message should follow the template
----
{component}: {description}
{long description}
----
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
[[ex-commit-message]]
.Compliant commit message
===============================================================================
The commit {example-commit-message}[69f8e47e9e74c8d3d060ca22e18246b7f7d988ef] contains the commit message
----
starship: allow running in Emacs if vterm is used
The vterm buffer is backed by libvterm and can handle Starship prompts
without issues.
----
which ticks all the boxes necessary to be accepted in Home Manager.
===============================================================================
Finally, when adding a new module, say `programs/foo.nix`, we use the fixed commit format `foo: add module`. You can, of course, still include a long description if you wish.
[[sec-code-style]]
=== Code Style
The code in Home Manager is formatted by the {nixfmt}[nixfmt] tool and the formatting is checked in the pull request tests. Run the `format` tool inside the project repository before submitting your pull request.
Keep lines at a reasonable width, ideally 80 characters or less. This also applies to string literals.
We prefer `lowerCamelCase` for variable and attribute names with the accepted exception of variables directly referencing packages in Nixpkgs which use a hyphenated style. For example, the Home Manager option `services.gpg-agent.enableSshSupport` references the `gpg-agent` package in Nixpkgs.
[[sec-news]]
=== News
Home Manager includes a system for presenting news to the user. When making a change you, therefore, have the option to also include an associated news entry. In general, a news entry should only be added for truly noteworthy news. For example, a bug fix or new option does generally not need a news entry.
If you do have a change worthy of a news entry then please add one in {news-nix}[`news.nix`] but you should follow some basic guidelines:
- The entry timestamp should be in ISO-8601 format having "+00:00" as time zone. For example, "2017-09-13T17:10:14+00:00". A suitable timestamp can be produced by the command
+
[source,console]
$ date --iso-8601=second --universal
- The entry condition should be as specific as possible. For example, if you are changing or deprecating a specific option then you could restrict the news to those users who actually use this option.
- Wrap the news message so that it will fit in the typical terminal, that is, at most 80 characters wide. Ideally a bit less.
- Unlike commit messages, news will be read without any connection to the Home Manager source code. It is therefore important to make the message understandable in isolation and to those who do not have knowledge of the Home Manager internals. To this end it should be written in more descriptive, prose like way.
- If you refer to an option then write its full attribute path. That is, instead of writing
+
----
The option 'foo' has been deprecated, please use 'bar' instead.
----
+
it should read
+
----
The option 'services.myservice.foo' has been deprecated, please
use 'services.myservice.bar' instead.
----
- A new module, say `foo.nix`, should always include a news entry that has a message along the lines of
+
----
A new module is available: 'services.foo'.
----
+
If the module is platform specific, e.g., a service module using systemd, then a condition like
+
[source,nix]
condition = hostPlatform.isLinux;
+
should be added. If you contribute a module then you don't need to add this entry, the merger will create an entry for you.
[[sec-tests]]
=== Tests
Home Manager includes a basic test suite and it is highly recommended to include at least one test when adding a module. Tests are typically in the form of "golden tests" where, for example, a generated configuration file is compared to a known correct file.
It is relatively easy to create tests by modeling the existing tests, found in the `tests` project directory.
The full Home Manager test suite can be run by executing
[source,console]
$ nix-shell --pure tests -A run.all
in the project root. List all test cases through
[source,console]
$ nix-shell --pure tests -A list
and run an individual test, for example `alacritty-empty-settings`, through
[source,console]
$ nix-shell --pure tests -A run.alacritty-empty-settings

View File

@@ -1,250 +1,129 @@
{
pkgs,
{ pkgs
# Note, this should be "the standard library" + HM extensions.
lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib,
release,
isReleaseBranch,
}:
# Note, this should be "the standard library" + HM extensions.
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
let
# Recursively replace each derivation in the given attribute set
# with the same derivation but with the `outPath` attribute set to
# the string `"\${pkgs.attribute.path}"`. This allows the
# documentation to refer to derivations through their values without
# establishing an actual dependency on the derivation output.
#
# This is not perfect, but it seems to cover a vast majority of use
# cases.
#
# Caveat: even if the package is reached by a different means, the
# path above will be shown and not e.g.
# `${config.services.foo.package}`.
scrubDerivations =
prefixPath: attrs:
let
scrubDerivation =
name: value:
let
pkgAttrName = prefixPath + "." + name;
in
if lib.isAttrs value then
scrubDerivations pkgAttrName value
// lib.optionalAttrs (lib.isDerivation value) {
outPath = "\${${pkgAttrName}}";
}
else
value;
in
lib.mapAttrs scrubDerivation attrs;
nmdSrc = fetchTarball {
url =
"https://gitlab.com/api/v4/projects/rycee%2Fnmd/repository/archive.tar.gz?sha=b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169";
sha256 = "0c2nq28rw4v559s3f1nf6y2p6fladgmbqgbsyf3vzs2przn5qn37";
};
nmd = import nmdSrc { inherit lib pkgs; };
# Make sure the used package is scrubbed to avoid actually
# instantiating derivations.
scrubbedPkgsModule = {
imports = [
{
_module.args = {
pkgs = lib.mkForce (scrubDerivations "pkgs" pkgs);
pkgs_i686 = lib.mkForce { };
imports = [{
_module.args = {
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
pkgs_i686 = lib.mkForce { };
};
}];
};
buildModulesDocs = args:
nmd.buildModulesDocs ({
moduleRootPaths = [ ./.. ];
mkModuleUrl = path:
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
channelName = "home-manager";
} // args);
hmModulesDocs = buildModulesDocs {
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [ scrubbedPkgsModule ];
docBook.id = "home-manager-options";
};
nixosModuleDocs = buildModulesDocs {
modules = let
nixosModule = module: pkgs.path + "/nixos/modules" + module;
mockedNixos = with lib; {
options = {
environment.pathsToLink = mkSinkUndeclaredOptions { };
systemd.services = mkSinkUndeclaredOptions { };
users.users = mkSinkUndeclaredOptions { };
};
}
};
in [
../nixos/default.nix
mockedNixos
(nixosModule "/misc/assertions.nix")
scrubbedPkgsModule
];
};
dontCheckDefinitions = {
_module.check = false;
};
gitHubDeclaration =
user: repo: subpath:
let
urlRef = if isReleaseBranch then "release-${release}" else "master";
in
{
url = "https://github.com/${user}/${repo}/blob/${urlRef}/${subpath}";
name = "<${repo}/${subpath}>";
docBook = {
id = "nixos-options";
optionIdPrefix = "nixos-opt";
};
};
hmPath = toString ./..;
buildOptionsDocs =
args@{
modules,
includeModuleSystemOptions ? true,
...
}:
let
# to discourage references from option descriptions and defaults.
poisonModule =
let
poisonAttr = n: {
name = n;
value = abort ''
error: the option documentation has a dependency on the configuration.
You may, for example, have added an option attribute like
default = ''${config.some.value};
Since the default value is included in the Home Manager manual, this
would make the manual depend on the user's configuration.
To avoid this problem in this particular case, consider changing to
default = ''${config.some.value};
defaultText = lib.literalExpression "\\''${config.some.value}";'';
};
in
{ options, ... }:
{
config = lib.listToAttrs (map poisonAttr (lib.filter (n: n != "_module") (lib.attrNames options)));
nixDarwinModuleDocs = buildModulesDocs {
modules = let
nixosModule = module: pkgs.path + "/nixos/modules" + module;
mockedNixDarwin = with lib; {
options = {
environment.pathsToLink = mkSinkUndeclaredOptions { };
system.activationScripts.postActivation.text =
mkSinkUndeclaredOptions { };
users.users = mkSinkUndeclaredOptions { };
};
options =
(lib.evalModules {
modules = modules ++ [ poisonModule ];
class = "homeManager";
}).options;
in
pkgs.buildPackages.nixosOptionsDoc (
{
options =
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
transformOptions =
opt:
opt
// {
# Clean up declaration sites to not refer to the Home Manager
# source tree.
declarations = map (
decl:
if lib.hasPrefix hmPath (toString decl) then
gitHubDeclaration "nix-community" "home-manager" (
lib.removePrefix "/" (lib.removePrefix hmPath (toString decl))
)
else if decl == "lib/modules.nix" then
# TODO: handle this in a better way (may require upstream
# changes to nixpkgs)
gitHubDeclaration "NixOS" "nixpkgs" decl
else
decl
) opt.declarations;
};
}
// builtins.removeAttrs args [
"modules"
"includeModuleSystemOptions"
]
);
hmOptionsDocs = buildOptionsDocs {
modules =
import ../modules/modules.nix {
inherit lib pkgs;
check = false;
}
++ [ scrubbedPkgsModule ];
variablelistId = "home-manager-options";
};
nixosOptionsDocs = buildOptionsDocs {
modules = [
../nixos
};
in [
../nix-darwin/default.nix
mockedNixDarwin
(nixosModule "/misc/assertions.nix")
scrubbedPkgsModule
dontCheckDefinitions
];
includeModuleSystemOptions = false;
variablelistId = "nixos-options";
optionIdPrefix = "nixos-opt-";
};
nixDarwinOptionsDocs = buildOptionsDocs {
modules = [
../nix-darwin
scrubbedPkgsModule
dontCheckDefinitions
];
includeModuleSystemOptions = false;
variablelistId = "nix-darwin-options";
optionIdPrefix = "nix-darwin-opt-";
};
release-config = builtins.fromJSON (builtins.readFile ../release.json);
revision = "release-${release-config.release}";
# Generate the `man home-configuration.nix` package
home-configuration-manual =
pkgs.runCommand "home-configuration-reference-manpage"
{
nativeBuildInputs = [
pkgs.buildPackages.installShellFiles
pkgs.nixos-render-docs
];
allowedReferences = [ "out" ];
}
''
# Generate manpages.
mkdir -p $out/share/man/man5
mkdir -p $out/share/man/man1
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
--revision ${revision} \
--header ${./home-configuration-nix-header.5} \
--footer ${./home-configuration-nix-footer.5} \
${hmOptionsDocs.optionsJSON}/share/doc/nixos/options.json \
$out/share/man/man5/home-configuration.nix.5
cp ${./home-manager.1} $out/share/man/man1/home-manager.1
'';
# Generate the HTML manual pages
home-manager-manual = pkgs.callPackage ./home-manager-manual.nix {
home-manager-options = {
home-manager = hmOptionsDocs.optionsJSON;
nixos = nixosOptionsDocs.optionsJSON;
nix-darwin = nixDarwinOptionsDocs.optionsJSON;
docBook = {
id = "nix-darwin-options";
optionIdPrefix = "nix-darwin-opt";
};
inherit revision;
};
html = home-manager-manual;
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix { } { inherit html; };
in
{
docs = nmd.buildDocBookDocs {
pathName = "home-manager";
projectName = "Home Manager";
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
documentsDirectory = ./.;
documentType = "book";
chunkToc = ''
<toc>
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
<d:tocentry linkend="ch-nixos-options"><?dbhtml filename="nixos-options.html"?></d:tocentry>
<d:tocentry linkend="ch-nix-darwin-options"><?dbhtml filename="nix-darwin-options.html"?></d:tocentry>
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
</d:tocentry>
</toc>
'';
};
in {
inherit nmdSrc;
options = {
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
# `nixosOptionsDoc` is more customizable.
json =
pkgs.runCommand "options.json"
{
meta.description = "List of Home Manager options in JSON format";
}
''
mkdir -p $out/{share/doc,nix-support}
cp -a ${hmOptionsDocs.optionsJSON}/share/doc/nixos $out/share/doc/home-manager
substitute \
${hmOptionsDocs.optionsJSON}/nix-support/hydra-build-products \
$out/nix-support/hydra-build-products \
--replace-fail \
'${hmOptionsDocs.optionsJSON}/share/doc/nixos' \
"$out/share/doc/home-manager"
'';
json = hmModulesDocs.json.override {
path = "share/doc/home-manager/options.json";
};
};
manPages = home-configuration-manual;
manPages = docs.manPages;
manual = { inherit html htmlOpenTool; };
manual = { inherit (docs) html htmlOpenTool; };
# Unstable, mainly for CI.
jsonModuleMaintainers = pkgs.writeText "hm-module-maintainers.json" (
let
result = lib.evalModules {
modules =
import ../modules/modules.nix {
inherit lib pkgs;
check = false;
}
++ [ scrubbedPkgsModule ];
class = "homeManager";
};
in
builtins.toJSON result.config.meta.maintainers
);
jsonModuleMaintainers = pkgs.writeText "hm-module-maintainers.json" (let
result = lib.evalModules {
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [ scrubbedPkgsModule ];
};
in builtins.toJSON result.config.meta.maintainers);
}

189
docs/faq.adoc Normal file
View File

@@ -0,0 +1,189 @@
[[ch-faq]]
== Frequently Asked Questions (FAQ)
=== Why is there a collision error when switching generation?
Home Manager currently installs packages into the user environment, precisely as if the packages were installed through `nix-env --install`. This means that you will get a collision error if your Home Manager configuration attempts to install a package that you already have installed manually, that is, packages that shows up when you run `nix-env --query`.
For example, imagine you have the `hello` package installed in your environment
[source,console]
----
$ nix-env --query
hello-2.10
----
and your Home Manager configuration contains
[source,nix]
----
home.packages = [ pkgs.hello ];
----
Then attempting to switch to this configuration will result in an error similar to
[source,console]
----
$ home-manager switch
these derivations will be built:
/nix/store/xg69wsnd1rp8xgs9qfsjal017nf0ldhm-home-manager-path.drv
[…]
Activating installPackages
replacing old home-manager-path
installing home-manager-path
building path(s) /nix/store/b5c0asjz9f06l52l9812w6k39ifr49jj-user-environment
Wide character in die at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 79.
collision between /nix/store/fmwa4axzghz11cnln5absh31nbhs9lq1-home-manager-path/bin/hello and /nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10/bin/hello; use nix-env --set-flag priority NUMBER PKGNAME to change the priority of one of the conflicting packages
builder for /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed with exit code 2
error: build of /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed
----
The solution is typically to uninstall the package from the environment using `nix-env --uninstall` and reattempt the Home Manager generation switch.
You could also opt to unistall _all_ of the packages from your profile with `nix-env --uninstall '*'`.
=== Why are the session variables not set?
:foreign-env: https://github.com/oh-my-fish/plugin-foreign-env
Home Manager is only able to set session variables automatically if it manages your Bash, Z shell, or fish shell configuration. To enable such management you use <<opt-programs.bash.enable>>, <<opt-programs.zsh.enable>>, or <<opt-programs.fish.enable>>.
If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
[source,bash]
----
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells. For fish shell, it is possible to source it using {foreign-env}[the foreign-env plugin]
[source,bash]
----
fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" > /dev/null
----
=== How to set up a configuration for multiple users/machines?
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
For example, if you have two machines, called "kronos" and "rhea" on which you want to configure your user "jane" then you could create the files
- `kronos-jane.nix`,
- `rhea-jane.nix`, and
- `common.nix`
in your repository. On the kronos and rhea machines you can then make `~jane/.config/nixpkgs/home.nix` be a symbolic link to the corresponding file in your configuration repository.
The `kronos-jane.nix` and `rhea-jane.nix` files follow the format
[source,nix]
----
{ ... }:
{
imports = [ ./common.nix ];
# Various options that are specific for this machine/user.
}
----
while the `common.nix` file contains configuration shared across the two logins. Of course, instead of just a single `common.nix` file you can have multiple ones, even one per program or service.
You can get some inspiration from the {post-your-homenix}[Post your home-manager home.nix file!] Reddit thread.
=== Why do I get an error message about `ca.desrt.dconf` or `dconf.service`?
You are most likely trying to configure something that uses dconf
but the DBus session is not aware of the dconf service.
The full error you might get is
----
error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
----
or
----
error: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit dconf.service not found.
----
The solution on NixOS is to add
[source,nix]
programs.dconf.enable = true;
to your system configuration.
=== How do I install packages from Nixpkgs unstable?
If you are using a stable version of Nixpkgs but would like to install some particular packages from Nixpkgs unstable or some other channel then you can import the unstable Nixpkgs and refer to its packages within your configuration. Something like
[source,nix]
----
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
home.packages = [
pkgsUnstable.foo
];
# …
}
----
should work provided you have a Nix channel called `nixpkgs-unstable`.
You can add the `nixpkgs-unstable` channel by running
[source,console]
----
# nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
# nix-channel --update
----
Note, the package will not be affected by any package overrides, overlays, etc.
=== How do I override the package used by a module?
:nixpkgs-overlays: https://nixos.org/nixpkgs/manual/#chap-overlays
By default Home Manager will install the package provided by your chosen `nixpkgs` channel but occasionally you might end up needing to change this package. This can typically be done in two ways.
1. If the module provides a `package` option, such as `programs.beets.package`, then this is the recommended way to perform the override. For example,
+
[source,nix]
programs.beets.package = pkgs.beets.override { enableCheck = true; };
2. If no `package` option is available then you can typically override the relevant package using an {nixpkgs-overlays}[overlay].
+
For example, if you want to use the `programs.skim` module but use the `skim` package from Nixpkgs unstable, then a configuration like
+
[source,nix]
----
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
programs.skim.enable = true;
nixpkgs.overlays = [
(self: super: {
skim = pkgsUnstable.skim;
})
];
# …
}
----
+
should work OK.

45
docs/flake.lock generated
View File

@@ -1,45 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1764081664,
"narHash": "sha256-sUoHmPr/EwXzRMpv1u/kH+dXuvJEyyF2Q7muE+t0EU4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dc205f7b4fdb04c8b7877b43edb7b73be7730081",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"scss-reset": "scss-reset"
}
},
"scss-reset": {
"flake": false,
"locked": {
"lastModified": 1683906868,
"narHash": "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE=",
"owner": "andreymatin",
"repo": "scss-reset",
"rev": "5a7bd491ac82441e6283fb0d5d54644b913b30c7",
"type": "github"
},
"original": {
"owner": "andreymatin",
"ref": "1.4.2",
"repo": "scss-reset",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -1,89 +0,0 @@
{
description = "Support developing Home Manager documentation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
scss-reset = {
url = "github:andreymatin/scss-reset/1.4.2";
flake = false;
};
};
outputs =
{
nixpkgs,
scss-reset,
...
}:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
# Note, this should be "the standard library" + HM extensions.
lib = import ../modules/lib/stdlib-extended.nix nixpkgs.lib;
forAllSystems = lib.genAttrs supportedSystems;
flakePkgs = pkgs: {
p-build = pkgs.writeShellScriptBin "p-build" ''
set -euo pipefail
export PATH=${
lib.makeBinPath [
pkgs.coreutils
pkgs.rsass
]
}
tmpfile=$(mktemp -d)
trap "rm -r $tmpfile" EXIT
ln -s "${scss-reset}/build" "$tmpfile/scss-reset"
rsass --load-path="$tmpfile" --style compressed \
./static/style.scss > ./static/style.css
echo "Generated ./static/style.css"
'';
};
releaseInfo = lib.importJSON ../release.json;
in
{
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
fpkgs = flakePkgs pkgs;
in
{
default = pkgs.mkShell {
name = "hm-docs";
packages = [ fpkgs.p-build ];
};
}
);
# Expose the docs outputs
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
docs = import ./default.nix {
inherit pkgs lib;
release = releaseInfo.release;
isReleaseBranch = releaseInfo.isReleaseBranch;
};
in
{
inherit (docs) manPages jsonModuleMaintainers;
inherit (docs.manual) html htmlOpenTool;
inherit (docs.options) json;
}
);
};
}

View File

@@ -1,3 +0,0 @@
.SH "AUTHORS"
.PP
Home Manager contributors

View File

@@ -1,17 +0,0 @@
.TH "HOME-CONFIGURATION\&.NIX" "5" "01/01/1980" "Home Manager"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" enable line breaks after slashes
.cflags 4 /
.SH "NAME"
\fIhome\-configuration\&.nix\fP \- Home Manager configuration specification
.SH "DESCRIPTION"
.sp
The file ~/\&.config/home\-manager/home\&.nix contains the declarative specification of your Home Manager configuration\&. The command \fBhome\-manager\fR takes this file and realises the user environment configuration specified therein\&.
.SH "OPTIONS"
.PP
You can use the following options in
home\-configuration\&.nix:
.PP

View File

@@ -1,75 +0,0 @@
{
stdenv,
lib,
documentation-highlighter,
revision,
home-manager-options,
nixos-render-docs,
}:
let
outputPath = "share/doc/home-manager";
in
stdenv.mkDerivation {
name = "home-manager-manual";
nativeBuildInputs = [ nixos-render-docs ];
src = ./manual;
buildPhase = ''
mkdir -p out/{highlightjs,media}
cp -t out/highlightjs \
${documentation-highlighter}/highlight.pack.js \
${documentation-highlighter}/LICENSE \
${documentation-highlighter}/mono-blue.css \
${documentation-highlighter}/loader.js
substituteInPlace ./options.md \
--subst-var-by \
OPTIONS_JSON \
${home-manager-options.home-manager}/share/doc/nixos/options.json
substituteInPlace ./nixos-options.md \
--subst-var-by \
OPTIONS_JSON \
${home-manager-options.nixos}/share/doc/nixos/options.json
substituteInPlace ./nix-darwin-options.md \
--subst-var-by \
OPTIONS_JSON \
${home-manager-options.nix-darwin}/share/doc/nixos/options.json
cp ${./options.html} out/options.html
cp ${./static/style.css} out/style.css
cp -r ${./release-notes} release-notes
nixos-render-docs manual html \
--manpage-urls ./manpage-urls.json \
--revision ${lib.trivial.revisionWithDefault revision} \
--stylesheet style.css \
--script highlightjs/highlight.pack.js \
--script highlightjs/loader.js \
--toc-depth 1 \
--section-toc-depth 1 \
manual.md \
out/index.xhtml
'';
installPhase = ''
dest="$out/${outputPath}"
mkdir -p "$(dirname "$dest")"
mv out "$dest"
mkdir -p $out/nix-support/
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
'';
passthru = { inherit home-manager-options; };
meta = {
maintainers = [ lib.maintainers.considerate ];
};
}

View File

@@ -1,424 +0,0 @@
.Dd January 1, 1980
.Dt home-manager 1
.Os Home Manager
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" enable line breaks after slashes
.cflags 4 /
.Sh NAME
.Nm home-manager
.Nd reconfigure a user environment
.
.
.
.Sh SYNOPSIS
.Nm home-manager
.Bro
.Cm build
.Cm | init Op Fl -switch Ar dir
.Cm | instantiate
.Cm | edit
.Cm | expire-generations Ar timestamp
.Cm | generations
.Cm | help
.Cm | news
.Cm | option Oo Fl -recursive Oc Ar option.name
.Cm | packages
.Cm | remove-generations Ar ID \&...
.Cm | switch
.Op Fl -rollback
.Op Bro Fl c | Fl -specialisation Brc Ar NAME
.Cm | uninstall
.Brc
.Op Fl A Ar attrPath
.Op Fl I Ar path
.Op Fl -flake Ar flake-uri
.Op Fl b Ar ext
.Op Bro Fl f | Fl -file Brc Ar path
.Op Bro Fl h | Fl -help Brc
.Op Fl -version
.Op Bro Fl n | Fl -dry-run Brc
.Op Fl -option Ar name Ar value
.Op Fl -cores Ar number
.Op Bro Fl j | Fl -max-jobs Brc Ar number
.Op Fl -option
.Op Fl -impure
.Op Fl -keep-failed
.Op Fl -keep-going
.Op Bro Fl L | Fl -print-build-logs Brc
.Op Fl -log-format
.Op Fl -show-trace
.Op Fl -(no-)substitute
.Op Fl -no-out-link
.Op Fl -refresh
.Op Bro Fl v | Fl -verbose Brc
.
.Sh DESCRIPTION
.Pp
This command updates the user environment so that it corresponds to the configuration specified in
$XDG_CONFIG_HOME/home-manager/home.nix
or
$XDG_CONFIG_HOME/home-manager/flake.nix.
.Pp
All operations using this tool expects a sub-command that indicates the operation to perform. It must be one of
.Pp
.Bl -tag -width Ds
.It Cm build
.RS 4
Build configuration into a result directory.
.RE
.It Cm init Op Fl -switch Op Ar dir
.RS 14
Generates an initial home.nix file for the current user. If Nix flakes are
enabled, then this command also generates a flake.nix file.
.sp
If a path
.Ar dir
is given then the configuration will be generated in that directory. Otherwise, the configuration will be generated in
~/.config/home-manager. The output directory will be created if it does not exist.
.sp
If the
.Fl -switch
option is given, then the generated configuration is activated.
.sp
Note, this command will not overwrite any existing files. It is therefore safe to initialize a configuration, edit it, and then re-run the
.Cm init
command with
.Fl -switch
enabled to activate the configuration.
.RE
.Pp
.It Cm instantiate
.RS 15
Instantiate the configuration and print the resulting derivation\&.
.RE
.Pp
.It Cm edit
.RS 16
Open the home configuration using the editor indicated by \fBVISUAL\fR or \fBEDITOR\fR\&.
.RE
.Pp
.It Cm expire-generations Ar timestamp
.RS 4
Remove generations older than
.Ar timestamp
where
.Ar timestamp
is interpreted as in the
.Fl d
argument of the
\fBdate\fR(1)
tool. For example
-30 days or 2018-01-01.
.RE
.PP
.It Cm generations
.RS 4
List all home environment generations\&.
.RE
.Pp
.It Cm help
.RS 4
Print tool help.
.RE
.Pp
.It Cm news
.RS 4
Show news entries in a pager.
.RE
.PP
.It Cm option Oo Fl -recursive Oc Ar option.name
.RS 4
Inspect the given option name in the home configuration, like
\fBnixos-option\fR(8)\&.
.sp
If the
.Fl -recursive
option is given, print all the values at or below the option name recursively\&.
.RE
.Pp
.It Cm packages
.RS 4
List all packages installed in home-manager-path.
.RE
.Pp
.It Cm remove-generations Ar ID \&...
.RS 4
Remove indicated generations. Use the
.Cm generations
sub-command to find suitable generation numbers.
.RE
.Pp
.It Cm switch Oo Fl -rollback Oc Oo Bro Fl c | Fl -specialisation Brc Ar NAME Oc
.RS 4
Build and activate the configuration\&.
.sp
If the
.Fl -rollback
option is given, then the build is not done, instead roll back to and
activate the configuration prior to the current configuration\&.
.sp
If the
.Fl -specialisation
option is given, then the named specialisation is activated\&.
.RE
.Pp
.It Cm uninstall
.RS 4
Remove Home Manager from the user environment\&. This will
.sp
.RE
.RS 4
.Bl -bullet
.It
remove all managed files from the home directory,
.RE
.sp
.RS 4
.It
remove packages installed through Home Manager from the user profile, and
.RE
.sp
.RS 4
.It
remove all Home Manager generations and make them available for immediate garbage collection\&.
.RE
.El
.sp
.RE
.El
.
.Sh OPTIONS
.Pp
The tool accepts the options
.Pp
.Bl -tag -width Ds
.It Cm Fl A Ar attrPath
.RS 4
Optional attribute that selects a configuration expression in the configuration file. That is, if
home.nix contains
.sp
.if n \{\
.RS 4
.\}
.nf
{
joe\-at\-work = {pkgs, \&.\&.\&.}: { home\&.packages = [ pkgs\&.fortune ]; };
joe\-at\-home = {pkgs, \&.\&.\&.}: { home\&.packages = [ pkgs\&.cowsay ]; };
}
.fi
.if n \{\
.RE
.\}
.sp
then the command
\fBhome\-manager switch \-A joe\-at\-work\fR
will activate the profile containing the fortune program\&.
.RE
.PP
.It Cm Fl I Ar path
.RS 4
Add a path to the Nix expression search path. For example, to build a Home Manager profile using a specific Nixpkgs run
.Cm home-manager Fl I Ar nixpkgs=/absolute/path/to/nixpkgs build.
By default
.Ar <nixpkgs>
is used.
.RE
.Pp
.It Cm Fl -flake Ar flake-uri[#name]
.RS 4
Build Home Manager configuration from the flake, which must contain the output homeConfigurations.name. If no name is specified it will first try username@hostname and then username.
.RE
.Pp
.It Cm Fl b Ar extension
.RS 4
Enable automatic resolution of collisions between unmanaged and managed files\&. The name of the original file will be suffixed by the given extension\&. For example,
.sp
.if n \{\
.RS 4
.\}
.nf
$ \fBhome\-manager \-b bck switch\fR
.fi
.if n \{\
.RE
.\}
.sp
will cause a colliding file
~/\&.config/foo\&.conf
to be moved to
~/\&.config/foo\&.conf\&.bck\&.
.RE
.Pp
.It Cm Fl f Ar path, Fl -file Ar path
.RS 4
Indicates the path to the Home Manager configuration file. If not given,
$XDG_CONFIG_HOME/home-manager/home.nix
is used.
.RE
.Pp
.It Cm Fl h, Fl -help
.RS 4
Prints usage information for the
\fBhome\-manager\fR
tool.
.RE
.Pp
.It Cm Fl -version
.RS 4
Prints the version number of the
\fBhome\-manager\fR
tool.
.RE
.Pp
.It Cm Fl n, Fl -dry-run
.RS 4
Perform a dry-run of the given operation, only prints what actions would be taken.
.RE
.Pp
.It Cm Fl -option Ar name Ar value
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl -cores Ar number
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl j Ar number, Fl -max-jobs Ar number
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.\" TODO
.Pp
.It Cm Fl -debug
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl -impure
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl -keep-failed
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl -keep-going
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl L, Fl -print-build-logs
.RS 4
Passed on to
\fBnix build\fR()
when building from a flake\&.
.RE
.Pp
.It Cm Fl -log-format Ar format
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl -show-trace
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl -(no-)substitute
.RS 4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.It Cm Fl -no-out-link
.RS 4
Passed on to
\fBnix-build\fR(1)
when running
\fBhome\-manager build\fR\&.
.RE
.Pp
.It Cm Fl -refresh
.RS 4
Passed on to
\fBnix-build\fR(1)
.RE
.Pp
.It Cm Fl v, Fl -verbose
.RS 4
Activates verbose output\&.
.RE
.El
.Sh FILES
.Pp
$XDG_DATA_HOME/home\-manager/news\-read\-ids
.RS 4
Identifiers of news items that have been shown\&. Can be deleted to reset the read news indicator\&.
.RE
.Sh BUGS
.Pp
Please report any bugs on the
\m[blue]\fBproject issue tracker\fR\m[]\&.
.Sh SEE ALSO
.Pp
\fBhome-configuration.nix\fR(5)
.Sh AUTHOR
.Pp
\fBHome Manager contributors\fR
.RS 4
Author.
.RE
.Sh COPYRIGHT
.br
Copyright \(co 2017\(en2025 Home Manager contributors
.br

View File

@@ -1,48 +0,0 @@
{
writeShellScriptBin,
makeDesktopItem,
symlinkJoin,
}:
{
html,
pathName ? "home-manager",
projectName ? pathName,
name ? "${pathName}-help",
}:
let
helpScript = writeShellScriptBin name ''
set -euo pipefail
if [[ ! -v BROWSER || -z $BROWSER ]]; then
for candidate in xdg-open open w3m; do
BROWSER="$(type -P $candidate || true)"
if [[ -x $BROWSER ]]; then
break;
fi
done
fi
if [[ ! -v BROWSER || -z $BROWSER ]]; then
echo "$0: unable to start a web browser; please set \$BROWSER"
exit 1
else
exec "$BROWSER" "${html}/share/doc/${pathName}/index.xhtml"
fi
'';
desktopItem = makeDesktopItem {
name = "${pathName}-manual";
desktopName = "${projectName} Manual";
genericName = "View ${projectName} documentation in a web browser";
icon = "nix-snowflake";
exec = "${helpScript}/bin/${name}";
categories = [ "System" ];
};
in
symlinkJoin {
inherit name;
paths = [
helpScript
desktopItem
];
}

335
docs/installation.adoc Normal file
View File

@@ -0,0 +1,335 @@
[[ch-installation]]
== Installing Home Manager
:nix-darwin: https://github.com/LnL7/nix-darwin/
Home Manager can be used in three primary ways:
1. Using the standalone `home-manager` tool. For platforms other than
NixOS and Darwin, this is the only available choice. It is also
recommended for people on NixOS or Darwin that want to manage their
home directory independently of the system as a whole. See
<<sec-install-standalone>> for instructions on how to perform this
installation.
2. As a module within a NixOS system configuration. This allows the
user profiles to be built together with the system when running
`nixos-rebuild`. See <<sec-install-nixos-module>> for a description of
this setup.
3. As a module within a {nix-darwin}[nix-darwin] system configuration.
This allows the user profiles to be built together with the system
when running `darwin-rebuild`. See <<sec-install-nix-darwin-module>>
for a description of this setup.
[[sec-install-standalone]]
=== Standalone installation
:nix-allowed-users: https://nixos.org/nix/manual/#conf-allowed-users
:nixos-allowed-users: https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers
:bash: https://www.gnu.org/software/bash/
:zsh: http://zsh.sourceforge.net/
:fish: https://fishshell.com
:plugin-foreign-env: https://github.com/oh-my-fish/plugin-foreign-env
:babelfish: https://github.com/bouk/babelfish
1. Make sure you have a working Nix installation. Specifically, make
sure that your user is able to build and install Nix packages. For
example, you should be able to successfully run a command like
`nix-instantiate '<nixpkgs>' -A hello` without having to switch to the
root user. For a multi-user install of Nix this means that your user
must be covered by the {nix-allowed-users}[`allowed-users`] Nix
option. On NixOS you can control this option using the
{nixos-allowed-users}[`nix.allowedUsers`] system option.
+
Note that Nix 2.4 is not yet fully supported. Most significantly, Home
Manager is incompatible with the new `nix profile`.
2. Add the appropriate Home Manager channel. If you are following
Nixpkgs master or an unstable channel you can run
+
[source,console]
----
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
----
+
and if you follow a Nixpkgs version 22.05 channel you can run
+
[source,console]
----
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager
$ nix-channel --update
----
+
On non-NixOS, you may have to add
+
[source,bash]
export NIX_PATH=$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels${NIX_PATH:+:$NIX_PATH}
+
to your shell (see https://github.com/NixOS/nix/issues/2033[nix#2033]
and
https://discourse.nixos.org/t/where-is-nix-path-supposed-to-be-set/16434/8[this
reply on the Nix Discourse]).
3. Run the Home Manager installation command and create the first Home
Manager generation:
+
[source,console]
$ nix-shell '<home-manager>' -A install
+
Once finished, Home Manager should be active and available in your
user environment.
4. If you do not plan on having Home Manager manage your shell
configuration then you must source the
+
[source,bash]
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
+
file in your shell configuration. Alternatively source
+
[source,bash]
/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh
+
when managing home configuration together with system configuration.
+
This file can be sourced directly by POSIX.2-like shells such as
{bash}[Bash] or {zsh}[Z shell]. {fish}[Fish] users can use utilities
such as {plugin-foreign-env}[foreign-env] or {babelfish}[babelfish].
+
For example, if you use Bash then add
+
[source,bash]
----
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
+
to your `~/.profile` file.
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the
<<opt-programs.home-manager.path>> option to specify the absolute path
to the repository.
Once installed you can see <<ch-usage>> for a more detailed
description of Home Manager and how to use it.
[[sec-install-nixos-module]]
=== NixOS module
Home Manager provides a NixOS module that allows you to prepare user
environments directly from the system configuration file, which often
is more convenient than using the `home-manager` tool. It also opens
up additional possibilities, for example, to automatically configure
user environments in NixOS declarative containers or on systems
deployed through NixOps.
To make the NixOS module available for use you must `import` it into
your system configuration. This is most conveniently done by adding a
Home Manager channel. For example, if you are following Nixpkgs master
or an unstable channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
# nix-channel --update
----
and if you follow a Nixpkgs version 22.05 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager
# nix-channel --update
----
It is then possible to add
[source,nix]
imports = [ <home-manager/nixos> ];
to your system `configuration.nix` file, which will introduce a new
NixOS option called `home-manager.users` whose type is an attribute
set that maps user names to Home Manager configurations.
For example, a NixOS configuration may include the lines
[source,nix]
----
users.users.eve.isNormalUser = true;
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
};
----
and after a `nixos-rebuild switch` the user eve's environment should
include a basic Bash configuration and the packages atool and httpie.
[NOTE]
====
If `nixos-rebuild switch` does not result in the environment you expect,
you can take a look at the output of the Home Manager activation script output using
[source,console]
$ systemctl status "home-manager-$USER.service"
====
If you do not plan on having Home Manager manage your shell
configuration then you must add either
[source,bash]
----
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
or
[source,bash]
----
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
----
to your shell configuration, depending on whether
<<nixos-opt-home-manager.useUserPackages>> is enabled. This file can
be sourced directly by POSIX.2-like shells such as {bash}[Bash] or
{zsh}[Z shell]. {fish}[Fish] users can use utilities such as
{plugin-foreign-env}[foreign-env] or {babelfish}[babelfish].
[NOTE]
====
By default packages will be installed to `$HOME/.nix-profile` but they
can be installed to `/etc/profiles` if
[source,nix]
home-manager.useUserPackages = true;
is added to the system configuration. This is necessary if, for
example, you wish to use `nixos-rebuild build-vm`. This option may
become the default value in the future.
====
[NOTE]
====
By default, Home Manager uses a private `pkgs` instance that is
configured via the `home-manager.users.<name>.nixpkgs` options. To
instead use the global `pkgs` that is configured via the system level
`nixpkgs` options, set
[source,nix]
home-manager.useGlobalPkgs = true;
This saves an extra Nixpkgs evaluation, adds consistency, and removes
the dependency on `NIX_PATH`, which is otherwise used for importing
Nixpkgs.
====
Once installed you can see <<ch-usage>> for a more detailed
description of Home Manager and how to use it.
[[sec-install-nix-darwin-module]]
=== nix-darwin module
Home Manager provides a module that allows you to prepare user
environments directly from the {nix-darwin}[nix-darwin] configuration
file, which often is more convenient than using the `home-manager`
tool.
To make the NixOS module available for use you must `import` it into
your system configuration. This is most conveniently done by adding a
Home Manager channel. For example, if you are following Nixpkgs master
or an unstable channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
# nix-channel --update
----
and if you follow a Nixpkgs version 22.05 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager
# nix-channel --update
----
It is then possible to add
[source,nix]
imports = [ <home-manager/nix-darwin> ];
to your nix-darwin `configuration.nix` file, which will introduce a
new NixOS option called `home-manager` whose type is an attribute set
that maps user names to Home Manager configurations.
For example, a nix-darwin configuration may include the lines
[source,nix]
----
users.users.eve = {
name = "eve";
home = "/Users/eve";
}
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
};
----
and after a `darwin-rebuild switch` the user eve's environment
should include a basic Bash configuration and the packages atool and
httpie.
If you do not plan on having Home Manager manage your shell
configuration then you must add either
[source,bash]
----
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
or
[source,bash]
----
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
----
to your shell configuration, depending on whether
<<nix-darwin-opt-home-manager.useUserPackages>> is enabled. This file
can be sourced directly by POSIX.2-like shells such as {bash}[Bash] or
{zsh}[Z shell]. {fish}[Fish] users can use utilities such as
{plugin-foreign-env}[foreign-env] or {babelfish}[babelfish].
[NOTE]
====
By default user packages will not be ignored in favor of
`environment.systemPackages`, but they will be intalled to
`/etc/profiles/per-user/$USERNAME` if
[source,nix]
home-manager.useUserPackages = true;
is added to the nix-darwin configuration. This option may become the
default value in the future.
====
[NOTE]
====
By default, Home Manager uses a private `pkgs` instance that is
configured via the `home-manager.users.<name>.nixpkgs` options. To
instead use the global `pkgs` that is configured via the system level
`nixpkgs` options, set
[source,nix]
home-manager.useGlobalPkgs = true;
This saves an extra Nixpkgs evaluation, adds consistency, and removes
the dependency on `NIX_PATH`, which is otherwise used for importing
Nixpkgs.
====
Once installed you can see <<ch-usage>> for a more detailed
description of Home Manager and how to use it.

View File

@@ -0,0 +1,40 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refmeta>
<refentrytitle><filename>home-configuration.nix</filename></refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo class="source">Home Manager</refmiscinfo>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
</refmeta>
<refnamediv>
<refname><filename>home-configuration.nix</filename></refname>
<refpurpose>Home Manager configuration specification</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para>
The file <filename>~/.config/nixpkgs/home.nix</filename> contains the
declarative specification of your Home Manager configuration. The command
<command>home-manager</command> takes this file and realises the user
environment configuration specified therein.
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
You can use the following options in
<filename>home-configuration.nix</filename>:
</para>
<xi:include href="./nmd-result/home-manager-options.xml" />
</refsection>
<refsection>
<title>See also</title>
<para>
<citerefentry>
<refentrytitle>home-manager</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>
</para>
</refsection>
</refentry>

634
docs/man-home-manager.xml Normal file
View File

@@ -0,0 +1,634 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refmeta>
<refentrytitle><command>home-manager</command>
</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="source">Home Manager</refmiscinfo>
</refmeta>
<refnamediv>
<refname><command>home-manager</command>
</refname><refpurpose>reconfigure a user environment</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>home-manager</command> <group choice="req">
<arg choice="plain">
build
</arg>
<arg choice="plain">
instantiate
</arg>
<arg choice="plain">
edit
</arg>
<arg choice="plain">
expire-generations <replaceable>timestamp</replaceable>
</arg>
<arg choice="plain">
generations
</arg>
<arg choice="plain">
help
</arg>
<arg choice="plain">
news
</arg>
<arg choice="plain">
option <replaceable>option.name</replaceable>
</arg>
<arg choice="plain">
packages
</arg>
<arg choice="plain">
remove-generations <replaceable>ID …</replaceable>
</arg>
<arg choice="plain">
switch
</arg>
<arg choice="plain">
uninstall
</arg>
</group>
<sbr />
<arg>
-A <replaceable>attrPath</replaceable>
</arg>
<arg>
-I <replaceable>path</replaceable>
</arg>
<arg>
--flake <replaceable>flake-uri</replaceable>
</arg>
<arg>
-b <replaceable>ext</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-f
</arg>
<arg choice="plain">
--file
</arg>
</group> <replaceable>path</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-h
</arg>
<arg choice="plain">
--help
</arg>
</group>
</arg>
<arg>
--version
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-n
</arg>
<arg choice="plain">
--dry-run
</arg>
</group>
</arg>
<arg>
--option <replaceable>name</replaceable> <replaceable>value</replaceable>
</arg>
<arg>
--cores <replaceable>number</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-j
</arg>
<arg choice="plain">
--max-jobs
</arg>
</group>
<replaceable>number</replaceable>
</arg>
<arg>
--debug
</arg>
<arg>
--impure
</arg>
<arg>
--keep-failed
</arg>
<arg>
--keep-going
</arg>
<arg>
--show-trace
</arg>
<arg>
--(no-)substitute
</arg>
<arg>
--no-out-link
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-v
</arg>
<arg choice="plain">
--verbose
</arg>
</group>
</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>
This command updates the user environment so that it corresponds to the
configuration specified in <filename>~/.config/nixpkgs/home.nix</filename> or <filename>~/.config/nixpkgs/flake.nix</filename>.
</para>
<para>
All operations using this tool expects a sub-command that indicates the
operation to perform. It must be one of
<variablelist>
<varlistentry>
<term>
<option>build</option>
</term>
<listitem>
<para>
Build configuration into a <filename>result</filename> directory.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>instantiate</option>
</term>
<listitem>
<para>
Instantiate the configuration and print the resulting derivation.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>edit</option>
</term>
<listitem>
<para>
Open the home configuration using the editor indicated by
<envar>EDITOR</envar>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>expire-generations <replaceable>timestamp</replaceable></option>
</term>
<listitem>
<para>
Remove generations older than <replaceable>timestamp</replaceable> where
<replaceable>timestamp</replaceable> is interpreted as in the
<option>-d</option> argument of the <citerefentry>
<refentrytitle>date</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry> tool. For example <literal>-30
days</literal> or <literal>2018-01-01</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>generations</option>
</term>
<listitem>
<para>
List all home environment generations.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>help</option>
</term>
<listitem>
<para>
Print tool help.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>news</option>
</term>
<listitem>
<para>
Show news entries in a pager.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>option <replaceable>option.name</replaceable></option>
</term>
<listitem>
<para>
Inspect the given option name in the home configuration, like <citerefentry>
<refentrytitle>nixos-option</refentrytitle>
<manvolnum>8</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>packages</option>
</term>
<listitem>
<para>
List all packages installed in <varname>home-manager-path</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>remove-generations <replaceable>ID …</replaceable></option>
</term>
<listitem>
<para>
Remove indicated generations. Use the <option>generations</option>
sub-command to find suitable generation numbers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>switch</option>
</term>
<listitem>
<para>
Build and activate the configuration.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>uninstall</option>
</term>
<listitem>
<para>
Remove Home Manager from the user environment. This will
<itemizedlist>
<listitem>
<para>
remove all managed files from the home directory,
</para>
</listitem>
<listitem>
<para>
remove packages installed through Home Manager from the user profile,
and
</para>
</listitem>
<listitem>
<para>
optionally remove all Home Manager generations and make them
available for immediate garbage collection.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
The tool accepts the options
</para>
<variablelist>
<varlistentry>
<term>
<option>-A <replaceable>attrPath</replaceable></option>
</term>
<listitem>
<para>
Optional attribute that selects a configuration expression in the
configuration file. That is, if <filename>home.nix</filename> contains
<programlisting language="nix">
{
joe-at-work = {pkgs, ...}: { home.packages = [ pkgs.fortune ]; };
joe-at-home = {pkgs, ...}: { home.packages = [ pkgs.cowsay ]; };
}
</programlisting>
then the command <command>home-manager switch -A joe-at-work</command>
will activate the profile containing the fortune program.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-I <replaceable>path</replaceable></option>
</term>
<listitem>
<para>
Add a path to the Nix expression search path. For example, to build a
Home Manager profile using a specific Nixpkgs run <command>home-manager
-I nixpkgs=/absolute/path/to/nixpkgs build</command>. By default
<literal>&lt;nixpkgs&gt;</literal> is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--flake <replaceable>flake-uri[#name]</replaceable></option>
</term>
<listitem>
<para>
Build Home Manager configuration from the flake, which must contain the
output homeConfigurations.name. If no name is specified it will first try
username@hostname and then username.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-b <replaceable>extension</replaceable></option>
</term>
<listitem>
<para>
Enable automatic resolution of collisions between unmanaged and managed
files. The name of the original file will be suffixed by the given
extension. For example,
<screen>
<prompt>$</prompt> <userinput>home-manager -b bck switch</userinput>
</screen>
will cause a colliding file <filename>~/.config/foo.conf</filename> to be
moved to <filename>~/.config/foo.conf.bck</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-f <replaceable>path</replaceable></option>
</term>
<term>
<option>--file <replaceable>path</replaceable></option>
</term>
<listitem>
<para>
Indicates the path to the Home Manager configuration file. If not given,
<filename>$XDG_CONFIG_HOME/nixpkgs/home.nix</filename> is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-h</option>
</term>
<term>
<option>--help</option>
</term>
<listitem>
<para>
Prints usage information for the <command>home-manager</command> tool.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--version</option>
</term>
<listitem>
<para>
Prints the version number of the <command>home-manager</command> tool.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-n</option>
</term>
<term>
<option>--dry-run</option>
</term>
<listitem>
<para>
Perform a dry-run of the given operation, only prints what actions would
be taken.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--option <replaceable>name</replaceable> <replaceable>value</replaceable></option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--cores <replaceable>number</replaceable></option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-j <replaceable>number</replaceable></option>
</term>
<term>
<option>--max-jobs <replaceable>number</replaceable></option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--debug</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--impure</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--keep-failed</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--keep-going</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--show-trace</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--(no-)substitute</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--no-out-link</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>
when running <command>home-manager build</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-v</option>
</term>
<term>
<option>--verbose</option>
</term>
<listitem>
<para>
Activates verbose output.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Files</title>
<variablelist>
<varlistentry>
<term>
<filename>$XDG_DATA_HOME/home-manager/news-read-ids</filename>
</term>
<listitem>
<para>
Identifiers of news items that have been shown. Can be deleted to reset
the read news indicator.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Bugs</title>
<para>
Please report any bugs on the
<link
xlink:href="https://github.com/nix-community/home-manager/issues">project
issue tracker</link>.
</para>
</refsection>
<refsection>
<title>See also</title>
<para>
<citerefentry>
<refentrytitle>home-configuration.nix</refentrytitle>
<manvolnum>5</manvolnum> </citerefentry>
</para>
</refsection>
</refentry>

12
docs/man-pages.xml Normal file
View File

@@ -0,0 +1,12 @@
<reference xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Home Manager Reference Pages</title>
<info>
<author><personname>Home Manager contributors</personname></author>
<copyright><year>20172022</year><holder>Home Manager contributors</holder>
</copyright>
</info>
<xi:include href="man-configuration.xml" />
<xi:include href="man-home-manager.xml" />
</reference>

56
docs/manual.xml Normal file
View File

@@ -0,0 +1,56 @@
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="book-home-manager-manual">
<info>
<title>Home Manager Manual</title>
</info>
<preface>
<title>Preface</title>
<para>
This manual will eventually describe how to install, use, and extend Home
Manager.
</para>
<para>
If you encounter problems then please reach out on the IRC channel
<link xlink:href="https://webchat.oftc.net/?channels=home-manager">#home-manager</link>
hosted by <link xlink:href="https://oftc.net/">OFTC</link>.
There is also a <link xlink:href="https://matrix.to/#/%23hm:rycee.net">Matrix room</link>,
which is bridged to the IRC channel.
If your problem is caused by a bug in Home Manager then it should
be reported on the
<link xlink:href="https://github.com/nix-community/home-manager/issues">Home Manager issue tracker</link>.
</para>
<note>
<para>
Commands prefixed with <literal>#</literal> have to be run as root, either
requiring to login as root user or temporarily switching to it using
<literal>sudo</literal> for example.
</para>
</note>
</preface>
<xi:include href="installation.xml" />
<xi:include href="usage.xml" />
<xi:include href="nix-flakes.xml" />
<xi:include href="writing-modules.xml" />
<xi:include href="contributing.xml" />
<xi:include href="faq.xml" />
<appendix xml:id="ch-options">
<title>Configuration Options</title>
<xi:include href="./nmd-result/home-manager-options.xml" />
</appendix>
<appendix xml:id="ch-nixos-options">
<title>NixOS Module Options</title>
<xi:include href="./nmd-result/nixos-options.xml" />
</appendix>
<appendix xml:id="ch-nix-darwin-options">
<title>nix-darwin Module Options</title>
<xi:include href="./nmd-result/nix-darwin-options.xml" />
</appendix>
<appendix xml:id="ch-tools">
<title>Tools</title>
<xi:include href="./man-home-manager.xml" />
</appendix>
<xi:include href="./release-notes/release-notes.xml" />
</book>

View File

@@ -1,14 +0,0 @@
# Third-Party Tools and Extensions {#ch-3rd-party}
Here is a collection of tools and extensions that relate to Home
Manager. Note, these are maintained outside the regular Home Manager
flow so quality and support may vary wildly. If you encounter problems
then please raise them in the corresponding project, not as issues in
the Home Manager tracker.
If you have made something interesting related to Home Manager then you
are encouraged to create a PR that expands this chapter.
```{=include=} sections
3rd-party/collections.md
```

View File

@@ -1,11 +0,0 @@
# Module Collections {#sec-3rd-party-module-collections}
- [xhmm --- extra Home Manager
modules](https://github.com/schuelermine/xhmm)
A collection of modules maintained by Anselm Schüler.
- [Stylix --- System-wide colorscheming and
typography](https://github.com/danth/stylix/)
Configure your applications to get coherent color scheme and font.

View File

@@ -1,27 +0,0 @@
# Contributing {#ch-contributing}
Contributions to Home Manager are very welcome. To make the process as
smooth as possible for both you and the Home Manager maintainers we
provide some guidelines that we ask you to follow. See [Getting
started](#sec-contrib-getting-started) for information on how to set up
a suitable development environment and [Guidelines](#sec-guidelines) for
the actual guidelines.
This text is mainly directed at those who would like to make code
contributions to Home Manager. If you just want to report a bug then
first look among the already [open
issues](https://github.com/nix-community/home-manager/issues), if you
find one matching yours then feel free to comment on it to add any
additional information you may have. If no matching issue exists then go
to the [new
issue](https://github.com/nix-community/home-manager/issues/new) page
and write a description of your problem. Include as much information as
you can, ideally also include relevant excerpts from your Home Manager
configuration.
```{=include=} sections
contributing/getting-started.md
contributing/guidelines.md
contributing/news.md
contributing/tests.md
```

View File

@@ -1,43 +0,0 @@
# Getting started {#sec-contrib-getting-started}
If you have not previously forked Home Manager then you need to do that
first. Have a look at GitHub's [Fork a
repo](https://help.github.com/articles/fork-a-repo/) for instructions on
how to do this.
Once you have a fork of Home Manager you should create a branch starting
at the most recent `master` branch. Give your branch a reasonably
descriptive name. Commit your changes to this branch and when you are
happy with the result and it fulfills [Guidelines](#sec-guidelines) then
push the branch to GitHub and [create a pull
request](https://help.github.com/articles/creating-a-pull-request/).
Assuming your clone is at `$HOME/devel/home-manager` then you can make
the `home-manager` command use it by either
1. overriding the default path by using the `-I` command line option:
``` shell
$ home-manager -I home-manager=$HOME/devel/home-manager
```
or, if using [flakes](#sec-flakes-standalone):
``` shell
$ home-manager --override-input home-manager ~/devel/home-manager
```
or
2. changing the default path by ensuring your configuration includes
``` nix
programs.home-manager.enable = true;
programs.home-manager.path = "$HOME/devel/home-manager";
```
and running `home-manager switch` to activate the change.
Afterwards, `home-manager build` and `home-manager switch` will use
your cloned repository.
The first option is good if you only temporarily want to use your clone.

View File

@@ -1,249 +0,0 @@
# Guidelines {#sec-guidelines}
If your contribution satisfy the following rules then there is a good
chance it will be merged without too much trouble. The rules are
enforced by the Home Manager maintainers and to a lesser extent the Home
Manager CI system.
If you are uncertain how these rules affect the change you would like to
make then feel free to start a discussion in the
[#home-manager](https://webchat.oftc.net/?channels=home-manager) IRC
channel, ideally before you start developing.
## Maintain backward compatibility {#sec-guidelines-back-compat}
Your contribution should not cause another user's existing configuration
to break unless there is a very good reason and the change should be
announced to the user through an
[assertion](https://nixos.org/manual/nixos/stable/index.html#sec-assertions)
or similar.
Remember that Home Manager is used in many different environments and
you should consider how your change may effect others. For example,
- Does your change work for people that do not use NixOS? Consider
other GNU/Linux distributions and macOS.
- Does your change work for people whose configuration is built on one
system and deployed on another system?
## Keep forward compatibility in mind {#sec-guidelines-forward-compat}
The master branch of Home Manager tracks the unstable channel of
Nixpkgs, which may update package versions at any time. It is therefore
important to consider how a package update may affect your code and try
to reduce the risk of breakage.
The most effective way to reduce this risk is to follow the advice in
[Add only valuable options](#sec-guidelines-valuable-options).
## Add only valuable options {#sec-guidelines-valuable-options}
When creating a new module it is tempting to include every option
supported by the software. This is *strongly* discouraged. Providing
many options increases maintenance burden and risk of breakage
considerably. This is why only the most [important software
options](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md#valuable-options)
should be modeled explicitly. Less important options should be
expressible through an `extraConfig` escape hatch.
A good rule of thumb for the first implementation of a module is to only
add explicit options for those settings that absolutely must be set for
the software to function correctly. It follows that a module for
software that provides sensible default values for all settings would
require no explicit options at all.
If the software uses a structured configuration format like a JSON,
YAML, INI, TOML, or even a plain list of key/value pairs then consider
using a `settings` option as described in [Nix RFC
42](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md).
## Add relevant tests {#sec-guidelines-add-tests}
If at all possible, make sure to add new tests and expand existing tests
so that your change will keep working in the future. See
[Tests](#sec-tests) for more information about the Home Manager test
suite.
All contributed code *must* pass the test suite.
## Add relevant documentation {#sec-guidelines-module-maintainer}
Many code changes require changing the documentation as well. The
documentation is written in
[Nixpkgs-flavoured Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup).
All text is hosted in Home Manager's Git repository.
The HTML version of the manual containing both the module option
descriptions and the documentation of Home Manager can be generated and
opened by typing the following in a shell within a clone of the Home
Manager Git repository:
``` shell
$ nix-build -A docs.html
$ xdg-open ./result/share/doc/home-manager/index.xhtml
```
When you have made changes to a module, it is a good idea to check that
the man page version of the module options looks good:
``` shell
$ nix-build -A docs.manPages
$ man ./result/share/man/man5/home-configuration.nix.5.gz
```
## Module Auto-importing {#sec-module-auto-importing}
Home Manager automatically imports all modules from the `modules/programs/` and
`modules/services/` directories. This auto-importing behavior follows these
rules:
- **Nix files**: All `.nix` files in these directories are automatically
imported
- **Directories**: All subdirectories are automatically imported (typically
containing a `default.nix` file)
- **Exclusions**: Files and directories starting with an underscore (`_`) are
excluded from auto-importing
This allows for flexible module organization:
```
modules/programs/
├── git.nix # Single-file module (imported)
├── firefox/ # Multi-file module (imported)
│ ├── default.nix
│ └── addons.nix
├── _experimental.nix # Excluded (starts with _)
└── _wip/ # Excluded directory (starts with _)
└── newfeature.nix
```
When adding a new module, simply place it in the appropriate directory
(`programs/` for user programs, `services/` for user services) and it will be
automatically discovered and included in the Home Manager module system.
## Add yourself as a module maintainer {#_add_yourself_as_a_module_maintainer}
Every new module *must* include a named maintainer using the
`meta.maintainers` attribute. If you are a user of a module that
currently lacks a maintainer then please consider adopting it.
If you are present in the nixpkgs maintainer list then you can use that
entry. If you are not then you can add yourself to
`modules/lib/maintainers.nix` in the Home Manager project.
As a maintainer you are expected to respond to issues and
pull-requests associated with your module.
Maintainers are encouraged to join the IRC or Matrix channel and
participate when they have opportunity.
## Format your code {#sec-guidelines-code-style}
Make sure your code is formatted as described in [Code
Style](#sec-code-style). To maintain consistency throughout the project
you are encouraged to browse through existing code and adopt its style
also in new code.
## Format your commit messages {#sec-guidelines-commit-message-style}
Similar to [Format your code](#sec-guidelines-code-style) we encourage a
consistent commit message format as described in
[Commits](#sec-commit-style).
## Format your news entries {#sec-guidelines-news-style}
If your contribution includes a change that should be communicated to
users of Home Manager then you can add a news entry. The entry must be
formatted as described in [News](#sec-news).
When new modules are added a news entry should be included.
## Use conditional modules and news {#sec-guidelines-conditional-modules}
Home Manager includes a number of modules that are only usable on some
of the supported platforms. The most common example of platform specific
modules are those that define systemd user services, which only works on
Linux systems.
If you add a module that is platform specific then make sure to include
a condition in the `loadModule` function call. This will make the module
accessible only on systems where the condition evaluates to `true`.
Similarly, if you are adding a news entry then it should be shown only
to users that may find it relevant, see [News](#sec-news) for a
description of conditional news.
## Mind the license {#sec-guidelines-licensing}
The Home Manager project is covered by the MIT license and we can only
accept contributions that fall under this license, or are licensed in a
compatible way. When you contribute self written code and documentation
it is assumed that you are doing so under the MIT license.
A potential gotcha with respect to licensing are option descriptions.
Often it is convenient to copy from the upstream software documentation.
When this is done it is important to verify that the license of the
upstream documentation allows redistribution under the terms of the MIT
license.
## Commits {#sec-commit-style}
The commits in your pull request should be reasonably self-contained,
that is, each commit should make sense in isolation. In particular, you
will be asked to amend any commit that introduces syntax errors or
similar problems even if they are fixed in a later commit.
The commit messages should follow the [seven
rules](https://chris.beams.io/posts/git-commit/#seven-rules), except for
\"Capitalize the subject line\". We also ask you to include the affected
code component or module in the first line. That is, a commit message
should follow the template
{component}: {description}
{long description}
where `{component}` refers to the code component (or module) your change
affects, `{description}` is a very brief description of your change, and
`{long description}` is an optional clarifying description. As a rare
exception, if there is no clear component, or your change affects many
components, then the `{component}` part is optional. See
[example_title](#ex-commit-message) for a commit message that fulfills
these requirements.
## Example commit {#ex-commit-message}
The commit
[69f8e47e9e74c8d3d060ca22e18246b7f7d988ef](https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef)
contains the commit message
```
starship: allow running in Emacs if vterm is used
The vterm buffer is backed by libvterm and can handle Starship prompts
without issues.
```
which ticks all the boxes necessary to be accepted in Home Manager.
Finally, when adding a new module, say `programs/foo.nix`, we use the
fixed commit format `foo: add module`. You can, of course, still include
a long description if you wish.
## Code Style {#sec-code-style}
The code in Home Manager is formatted by the [treefmt](https://treefmt.com) tool
and the formatting is checked in the pull request tests. Run `nix fmt` or
`treefmt` (with required formatters which can be found in `treefmt.toml` in your
`$PATH`) inside the project repository before submitting your pull request.
Keep lines at a reasonable width, ideally 80 characters or less. This
also applies to string literals.
We prefer `lowerCamelCase` for variable and attribute names with the
accepted exception of variables directly referencing packages in Nixpkgs
which use a hyphenated style. For example, the Home Manager option
`services.gpg-agent.enableSshSupport` references the `gpg-agent` package
in Nixpkgs.

View File

@@ -1,64 +0,0 @@
# News {#sec-news}
Home Manager includes a system for presenting news to the user. When
making a change you, therefore, have the option to also include an
associated news entry. In general, a news entry should only be added for
truly noteworthy news. For example, a bug fix or new option does
generally not need a news entry.
If you do have a change worthy of a news entry then please add one in
[`news.nix`](https://github.com/nix-community/home-manager/blob/master/modules/misc/news.nix)
but you should follow some basic guidelines:
- Use the included news entry generator to create a news entry file:
``` shell
$ nix run .#create-news-entry
```
Alternatively, you can directly use the script:
``` shell
$ modules/misc/news/create-news-entry.sh
```
This will create a new file inside the `modules/misc/news` directory
with some placeholder information that you can edit.
- The entry condition should be as specific as possible. For example,
if you are changing or deprecating a specific option then you could
restrict the news to those users who actually use this option.
- Wrap the news message so that it will fit in the typical terminal,
that is, at most 80 characters wide. Ideally a bit less.
- Unlike commit messages, news will be read without any connection to
the Home Manager source code. It is therefore important to make the
message understandable in isolation and to those who do not have
knowledge of the Home Manager internals. To this end it should be
written in more descriptive, prose like way.
- If you refer to an option then write its full attribute path. That
is, instead of writing
The option 'foo' has been deprecated, please use 'bar' instead.
it should read
The option 'services.myservice.foo' has been deprecated, please
use 'services.myservice.bar' instead.
- A new module, say `foo.nix`, should always include a news entry that
has a message along the lines of
A new module is available: 'services.foo'.
If the module is platform specific, e.g., a service module using
systemd, then a condition like
``` nix
condition = hostPlatform.isLinux;
```
should be added. If you contribute a module then you don't need to
add this entry, the merger will create an entry for you.

View File

@@ -1,233 +0,0 @@
# Tests {#sec-tests}
Home Manager includes a basic test suite and it is highly recommended to
include at least one test when adding a module. Tests are typically in
the form of \"golden tests\" where, for example, a generated
configuration file is compared to a known correct file.
It is relatively easy to create tests by modeling the existing tests,
found in the `tests` project directory.
## Writing Basic Tests {#sec-tests-basic}
Home Manager tests use the **NMT** framework, which provides
a set of assertion functions to verify that modules generate the expected files
and configurations. Tests are written as Nix expressions that define both the
Home Manager configuration and the test assertions.
### Test Structure {#sec-tests-structure}
A basic test file structure looks like:
```nix
{
# Home Manager configuration
programs.myprogram = {
enable = true;
settings = {
option = "value";
};
};
# NMT test script with assertions
nmt.script = ''
assertFileExists "home-files/.config/myprogram/config.toml"
assertFileContent "home-files/.config/myprogram/config.toml" ${./expected-config.toml}
'';
}
```
### Test Organization {#sec-tests-organization}
Tests are organized in the `tests` directory structure:
- `tests/modules/programs/myprogram/default.nix` - Lists all test cases for the module
- `tests/modules/programs/myprogram/basic-configuration.nix` - A basic test case
- `tests/modules/programs/myprogram/expected-config.toml` - Expected output file
The `default.nix` file should list all test cases:
```nix
{
myprogram-basic-configuration = ./basic-configuration.nix;
myprogram-empty-settings = ./empty-settings.nix;
}
```
### Common NMT Assertions {#sec-tests-assertions}
NMT provides several assertion functions:
- `assertFileExists "path"` - Verify a file was created
- `assertPathNotExists "path"` - Verify a file was NOT created
- `assertFileContent "path" expected-file` - Compare file contents
- `assertFileRegex "path" "regex"` - Check file matches regex
For a full reference to the functions available in test scripts, you can look at NMT's
[bash-lib](https://git.sr.ht/~rycee/nmt/tree/master/item/bash-lib).
### Practical Examples {#sec-tests-examples}
Here are some real-world examples of common test patterns:
**Testing that a configuration file is generated:**
```nix
{
programs.alacritty = {
enable = true;
settings.font.size = 12;
};
nmt.script = ''
assertFileExists "home-files/.config/alacritty/alacritty.yml"
assertFileContains "home-files/.config/alacritty/alacritty.yml" "size: 12"
'';
}
```
**Testing that no files are created when disabled:**
```nix
{
programs.alacritty.enable = false;
nmt.script = ''
assertPathNotExists "home-files/.config/alacritty"
'';
}
```
**Testing exact file content against expected output:**
```nix
{
programs.fastfetch = {
enable = true;
settings.display.color = "blue";
};
nmt.script =
let
configFile = "home-files/.config/fastfetch/config.jsonc";
in
''
assertFileExists "${configFile}"
assertFileContent "${configFile}" ${./expected-config.jsonc}
'';
}
```
**Testing multiple conditions in one test:**
```nix
{
programs.myprogram = {
enable = true;
configFile = "custom.conf";
extraConfig = "debug = true";
};
nmt.script = ''
assertFileExists "home-files/.config/myprogram/custom.conf"
assertFileRegex "home-files/.config/myprogram/custom.conf" "debug = true"
assertFileRegex "home-files/.config/myprogram/custom.conf" "^# Generated by Home Manager"
'';
}
```
### Platform-Specific Tests {#sec-tests-platform-specific}
When a module is platform-specific (Linux-only or Darwin-only), the test's `default.nix`
file should use `lib.optionalAttrs` to conditionally expose tests based on the platform.
This prevents evaluation errors on unsupported platforms during the test suite runs.
**Linux-only module tests:**
```nix
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
rofi-valid-config = ./valid-config.nix;
rofi-custom-theme = ./custom-theme.nix;
}
```
**Darwin-only module tests:**
```nix
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
sketchybar-basic = ./basic-configuration.nix;
sketchybar-lua-config = ./lua-config.nix;
}
```
For cross-platform modules that have packages which need to be stubbed on Darwin,
add the package names to `tests/darwinScrublist.nix` to prevent build failures
during cross-platform test runs.
## Using the tests command {#sec-tests-command}
Home Manager provides a convenient `tests` command for discovering and running tests:
``` shell
# List all available tests
$ nix run .#tests -- -l
# List tests matching a pattern
$ nix run .#tests -- -l alacritty
# Run all tests matching a pattern
$ nix run .#tests -- alacritty
# Run a specific test
$ nix run .#tests -- test-alacritty-empty-settings
# Run integration tests
$ nix run .#tests -- -t -l
# Interactive test selection (requires fzf)
$ python3 tests/tests.py -i
# Pass additional nix build flags
$ nix run .#tests -- alacritty -- --verbose
```
## Manual test commands {#sec-tests-manual}
For advanced usage or CI environments, you can also run tests manually using nix build commands.
The full Home Manager test suite can be run by executing
``` shell
$ nix-build --pure --option allow-import-from-derivation false tests -A build.all
```
in the project root. List all test cases through
``` shell
$ nix-build --pure tests --option allow-import-from-derivation false -A list
```
and run an individual test, for example `alacritty-empty-settings`,
through
``` shell
$ nix-build --pure tests --option allow-import-from-derivation false -A build.alacritty-empty-settings
```
However, those invocations will impurely source the system's Nixpkgs,
and may cause failures. To run against the Nixpkgs from the `flake.lock` file,
use instead e.g.
``` shell
$ nix build --reference-lock-file flake.lock --option allow-import-from-derivation false ./tests#test-all
```
or
``` shell
$ nix build --reference-lock-file flake.lock --option allow-import-from-derivation false ./tests#test-alacritty-empty-settings
```
Some tests may be marked with `enableLegacyIfd`, those may be run by run with e.g.
``` shell
$ nix-build --pure tests --arg enableLegacyIfd true -A build.mytest
```

View File

@@ -1,10 +0,0 @@
# Frequently Asked Questions (FAQ) {#ch-faq}
```{=include=} sections
faq/collision.md
faq/session-variables.md
faq/multiple-users-machines.md
faq/ca-desrt-dconf.md
faq/unstable.md
faq/change-package-module.md
```

View File

@@ -1,19 +0,0 @@
# Why do I get an error message about `ca.desrt.dconf` or `dconf.service`? {#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal}
You are most likely trying to configure something that uses dconf but
the DBus session is not aware of the dconf service. The full error you
might get is
error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
or
error: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit dconf.service not found.
The solution on NixOS is to add
``` nix
programs.dconf.enable = true;
```
to your system configuration.

View File

@@ -1,66 +0,0 @@
# How do I change the package used by a module? {#_how_do_i_change_the_package_used_by_a_module}
By default Home Manager will install the package provided by your chosen
`nixpkgs` channel but occasionally you might end up needing to change
this package. This can typically be done in two ways.
1. If the module provides a `package` option, such as
`programs.beets.package`, then this is the recommended way to
perform the change. For example,
``` nix
programs.beets.package = pkgs.beets.override { pluginOverrides = { beatport.enable = false; }; };
```
See [Nix pill 17](https://nixos.org/guides/nix-pills/nixpkgs-overriding-packages.html)
for more information on package overrides. Alternatively, if you want
to use the `beets` package from Nixpkgs unstable, then a configuration like
``` nix
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
programs.beets.package = pkgsUnstable.beets;
# …
}
```
should work OK.
3. If no `package` option is available then you can typically change
the relevant package using an
[overlay](https://nixos.org/nixpkgs/manual/#chap-overlays).
For example, if you want to use the `programs.skim` module but use
the `skim` package from Nixpkgs unstable, then a configuration like
``` nix
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
programs.skim.enable = true;
nixpkgs.overlays = [
(self: super: {
skim = pkgsUnstable.skim;
})
];
# …
}
```
should work OK.

View File

@@ -1,47 +0,0 @@
# Why is there a collision error when switching generation? {#_why_is_there_a_collision_error_when_switching_generation}
Home Manager currently installs packages into the user environment,
precisely as if the packages were installed through `nix-env --install`.
This means that you will get a collision error if your Home Manager
configuration attempts to install a package that you already have
installed manually, that is, packages that shows up when you run
`nix-env --query`.
For example, imagine you have the `hello` package installed in your
environment
``` shell
$ nix-env --query
hello-2.10
```
and your Home Manager configuration contains
``` nix
home.packages = [ pkgs.hello ];
```
Then attempting to switch to this configuration will result in an error
similar to
``` shell
$ home-manager switch
these derivations will be built:
/nix/store/xg69wsnd1rp8xgs9qfsjal017nf0ldhm-home-manager-path.drv
[…]
Activating installPackages
replacing old home-manager-path
installing home-manager-path
building path(s) /nix/store/b5c0asjz9f06l52l9812w6k39ifr49jj-user-environment
Wide character in die at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 79.
collision between /nix/store/fmwa4axzghz11cnln5absh31nbhs9lq1-home-manager-path/bin/hello and /nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10/bin/hello; use nix-env --set-flag priority NUMBER PKGNAME to change the priority of one of the conflicting packages
builder for /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed with exit code 2
error: build of /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed
```
The solution is typically to uninstall the package from the environment
using `nix-env --uninstall` and reattempt the Home Manager generation
switch.
You could also opt to uninstall *all* of the packages from your profile
with `nix-env --uninstall '*'`.

View File

@@ -1,39 +0,0 @@
# How to set up a configuration for multiple users/machines? {#_how_to_set_up_a_configuration_for_multiple_users_machines}
A typical way to prepare a repository of configurations for multiple
logins and machines is to prepare one \"top-level\" file for each unique
combination.
For example, if you have two machines, called \"kronos\" and \"rhea\" on
which you want to configure your user \"jane\" then you could create the
files
- `kronos-jane.nix`,
- `rhea-jane.nix`, and
- `common.nix`
in your repository. On the kronos and rhea machines you can then make
`~jane/.config/home-manager/home.nix` be a symbolic link to the
corresponding file in your configuration repository.
The `kronos-jane.nix` and `rhea-jane.nix` files follow the format
``` nix
{ ... }:
{
imports = [ ./common.nix ];
# Various options that are specific for this machine/user.
}
```
while the `common.nix` file contains configuration shared across the two
logins. Of course, instead of just a single `common.nix` file you can
have multiple ones, even one per program or service.
You can get some inspiration from the [Post your home-manager home.nix
file!](https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/)
Reddit thread.

View File

@@ -1,24 +0,0 @@
# Why are the session variables not set? {#_why_are_the_session_variables_not_set}
Home Manager is only able to set session variables automatically if it
manages your Bash, Z shell, or fish shell configuration. To enable such
management you use [programs.bash.enable](#opt-programs.bash.enable),
[programs.zsh.enable](#opt-programs.zsh.enable), or [programs.fish.enable](#opt-programs.fish.enable).
If you don't want to let Home Manager manage your shell then you will
have to manually source the
`~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate
way. In Bash and Z shell this can be done by adding
``` bash
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
```
to your `.profile` and `.zshrc` files, respectively. The
`hm-session-vars.sh` file should work in most Bourne-like shells. For
fish shell, it is possible to source it using [the foreign-env
plugin](https://github.com/oh-my-fish/plugin-foreign-env)
``` bash
fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" > /dev/null
```

View File

@@ -1,36 +0,0 @@
# How do I install packages from Nixpkgs unstable? {#_how_do_i_install_packages_from_nixpkgs_unstable}
If you are using a stable version of Nixpkgs but would like to install
some particular packages from Nixpkgs unstable -- or some other channel
-- then you can import the unstable Nixpkgs and refer to its packages
within your configuration. Something like
``` nix
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
home.packages = [
pkgsUnstable.foo
];
# …
}
```
should work provided you have a Nix channel called `nixpkgs-unstable`.
You can add the `nixpkgs-unstable` channel by running
``` shell
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
$ nix-channel --update
```
Note, the package will not be affected by any package overrides,
overlays, etc.

View File

@@ -1,35 +0,0 @@
# Installing Home Manager {#ch-installation}
Home Manager can be used in three primary ways:
1. Using the standalone `home-manager` tool. For platforms other than
NixOS and Darwin, this is the only available choice. It is also
recommended for people on NixOS or Darwin that want to manage their
home directory independently of the system as a whole. See
[Standalone installation](#sec-install-standalone) for instructions
on how to perform this installation.
2. As a module within a NixOS system configuration. This allows the
user profiles to be built together with the system when running
`nixos-rebuild`. See [NixOS module](#sec-install-nixos-module) for a
description of this setup.
3. As a module within a
[nix-darwin](https://github.com/nix-darwin/nix-darwin/) system
configuration. This allows the user profiles to be built together
with the system when running `darwin-rebuild`. See [nix-darwin
module](#sec-install-nix-darwin-module) for a description of this
setup.
:::{.note}
In this chapter we describe how to install Home Manager in the standard
way using channels. If you prefer to use [Nix
Flakes](https://wiki.nixos.org/wiki/Flakes) then please see the instructions
in [nix flakes](#ch-nix-flakes).
:::
```{=include=} sections
installation/standalone.md
installation/nixos.md
installation/nix-darwin.md
```

View File

@@ -1,115 +0,0 @@
# nix-darwin module {#sec-install-nix-darwin-module}
Home Manager provides a module that allows you to prepare user
environments directly from the
[nix-darwin](https://github.com/nix-darwin/nix-darwin/) configuration file,
which often is more convenient than using the `home-manager` tool.
To make the NixOS module available for use you must `import` it into
your system configuration. This is most conveniently done by adding a
Home Manager channel. For example, if you are following Nixpkgs master
or an unstable channel, you can run
``` shell
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
```
and if you follow a Nixpkgs version 25.11 channel, you can run
``` shell
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz home-manager
$ nix-channel --update
```
It is then possible to add
``` nix
imports = [ <home-manager/nix-darwin> ];
```
to your nix-darwin `configuration.nix` file, which will introduce a new
NixOS option called `home-manager` whose type is an attribute set that
maps user names to Home Manager configurations.
For example, a nix-darwin configuration may include the lines
``` nix
users.users.eve = {
name = "eve";
home = "/Users/eve";
};
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
# The state version is required and should stay at the version you
# originally installed.
home.stateVersion = "25.11";
};
```
and after a `darwin-rebuild switch` the user eve's environment should
include a basic Bash configuration and the packages atool and httpie.
If you do not plan on having Home Manager manage your shell
configuration then you must add either
``` bash
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
```
or
``` bash
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
```
to your shell configuration, depending on whether
[home-manager.useUserPackages](#nix-darwin-opt-home-manager.useUserPackages) is enabled. This
file can be sourced directly by POSIX.2-like shells such as
[Bash](https://www.gnu.org/software/bash/) or [Z
shell](http://zsh.sourceforge.net/). [Fish](https://fishshell.com) users
can use utilities such as
[foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) or
[babelfish](https://github.com/bouk/babelfish).
:::{.note}
By default user packages will not be ignored in favor of
`environment.systemPackages`, but they will be installed to
`/etc/profiles/per-user/$USERNAME` if
``` nix
home-manager.useUserPackages = true;
```
is added to the nix-darwin configuration. This option may become the
default value in the future.
:::
:::{.note}
By default, Home Manager uses a private `pkgs` instance that is
configured via the `home-manager.users.<name>.nixpkgs` options. To
instead use the global `pkgs` that is configured via the system level
`nixpkgs` options, set
``` nix
home-manager.useGlobalPkgs = true;
```
This saves an extra Nixpkgs evaluation, adds consistency, and removes
the dependency on `NIX_PATH`, which is otherwise used for importing
Nixpkgs.
:::
:::{.note}
Home Manager will pass `osConfig` as a module argument to any modules
you create. This contains the system's nix-darwin configuration.
``` nix
{ lib, pkgs, osConfig, ... }:
```
:::
Once installed you can see [Using Home Manager](#ch-usage) for a more detailed
description of Home Manager and how to use it.

View File

@@ -1,157 +0,0 @@
# NixOS module {#sec-install-nixos-module}
Home Manager provides a NixOS module that allows you to prepare user
environments directly from the system configuration file, which often is
more convenient than using the `home-manager` tool. It also opens up
additional possibilities, for example, to automatically configure user
environments in NixOS declarative containers or on systems deployed
through NixOps.
To make the NixOS module available for use you must `import` it into
your system configuration. This is most conveniently done by adding a
Home Manager channel to the root user. For example, if you are following
Nixpkgs master or an unstable channel, you can run
``` shell
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ sudo nix-channel --update
```
and if you follow a Nixpkgs version 25.11 channel, you can run
``` shell
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz home-manager
$ sudo nix-channel --update
```
It is then possible to add
``` nix
imports = [ <home-manager/nixos> ];
```
to your system `configuration.nix` file, which will introduce a new
NixOS option called `home-manager.users` whose type is an attribute set
that maps user names to Home Manager configurations.
Alternatively, home-manager installation can be done declaratively through configuration.nix using the following syntax:
```nix
{ config, pkgs, lib, ... }:
let
home-manager = builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz;
in
{
imports =
[
(import "${home-manager}/nixos")
];
users.users.eve.isNormalUser = true;
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
# The state version is required and should stay at the version you
# originally installed.
home.stateVersion = "25.11";
};
}
```
For example, a NixOS configuration may include the lines
``` nix
users.users.eve.isNormalUser = true;
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "25.11"; # Please read the comment before changing.
};
```
and after a `sudo nixos-rebuild switch` the user eve's environment
should include a basic Bash configuration and the packages atool and
httpie.
:::{.note}
If `nixos-rebuild switch` does not result in the environment you expect,
you can take a look at the output of the Home Manager activation script
output using
``` shell
$ systemctl status "home-manager-$USER.service"
```
:::
If you do not plan on having Home Manager manage your shell
configuration then you must add either
``` bash
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
```
or
``` bash
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
```
to your shell configuration, depending on whether
[home-manager.useUserPackages](#nixos-opt-home-manager.useUserPackages) is enabled. This file can
be sourced directly by POSIX.2-like shells such as
[Bash](https://www.gnu.org/software/bash/) or [Z
shell](http://zsh.sourceforge.net/). [Fish](https://fishshell.com) users
can use utilities such as
[foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) or
[babelfish](https://github.com/bouk/babelfish).
:::{.note}
By default packages will be installed to `$HOME/.nix-profile` but they
can be installed to `/etc/profiles` if
``` nix
home-manager.useUserPackages = true;
```
is added to the system configuration. This is necessary if, for example,
you wish to use `nixos-rebuild build-vm`. This option may become the
default value in the future.
:::
:::{.note}
By default, Home Manager uses a private `pkgs` instance that is
configured via the `home-manager.users.<name>.nixpkgs` options. To
instead use the global `pkgs` that is configured via the system level
`nixpkgs` options, set
``` nix
home-manager.useGlobalPkgs = true;
```
This saves an extra Nixpkgs evaluation, adds consistency, and removes
the dependency on `NIX_PATH`, which is otherwise used for importing
Nixpkgs.
:::
:::{.note}
Home Manager will pass `osConfig` as a module argument to any modules
you create. This contains the system's NixOS configuration.
``` nix
{ lib, pkgs, osConfig, ... }:
```
:::
Once installed you can see [Using Home Manager](#ch-usage) for a more detailed
description of Home Manager and how to use it.

View File

@@ -1,75 +0,0 @@
# Standalone installation {#sec-install-standalone}
1. Make sure you have a working Nix installation. Specifically, make
sure that your user is able to build and install Nix packages. For
example, you should be able to successfully run a command like
`nix-instantiate '<nixpkgs>' -A hello` without having to switch to
the root user. For a multi-user install of Nix this means that your
user must be covered by the
[`allowed-users`](https://nixos.org/nix/manual/#conf-allowed-users)
Nix option. On NixOS you can control this option using the
[`nix.settings.allowed-users`](https://nixos.org/manual/nixos/stable/options.html#opt-nix.settings.allowed-users)
system option.
2. Add the appropriate Home Manager channel. If you are following
Nixpkgs master or an unstable channel you can run
``` shell
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
```
and if you follow a Nixpkgs version 25.11 channel you can run
``` shell
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz home-manager
$ nix-channel --update
```
3. Run the Home Manager installation command and create the first Home
Manager generation:
``` shell
$ nix-shell '<home-manager>' -A install
```
Once finished, Home Manager should be active and available in your
user environment.
4. If you do not plan on having Home Manager manage your shell
configuration then you must source the
``` bash
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
```
file in your shell configuration. Alternatively source
``` bash
/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh
```
when managing home configuration together with system configuration.
This file can be sourced directly by POSIX.2-like shells such as
[Bash](https://www.gnu.org/software/bash/) or [Z
shell](http://zsh.sourceforge.net/). [Fish](https://fishshell.com)
users can use utilities such as
[foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) or
[babelfish](https://github.com/bouk/babelfish).
For example, if you use Bash then add
``` bash
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
```
to your `~/.profile` file.
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the
[home-manager.path](#opt-programs.home-manager.path) option to specify the absolute
path to the repository.
Once installed you can see [Using Home Manager](#ch-usage) for a more detailed
description of Home Manager and how to use it.

View File

@@ -1,11 +0,0 @@
# Home Manager Internals {#ch-internals}
This chapter collects some documentation about the internal workings
of Home Manager. The information here is mostly aimed to developers of
Home Manager and those who do non-trivial integration with Home
Manager.
```{=include=} sections
internals/activation.md
```

View File

@@ -1,40 +0,0 @@
# Activation {#sec-internals-activation}
Activating a Home Manager configuration ensures that the built
configuration is introduced into the user's environment. The
activation is performed by a suitably named script
{command}`activate`. This script is generated as part of the
configuration build and is placed in the root of the build output.
The activation script is implemented in the Bash language and consists
of initialization code followed by a number of _activation script
blocks_. These blocks are specified using the
[home.activation](#opt-home.activation) option. The blocks may have
dependencies among themselves and the generated activation script will
contain the blocks serialized such that the dependencies are
satisfied. A dependency cycle causes a failure when the configuration
is built.
Historically, the activation script has been responsible for creating
a new generation of the `home-manager` Nix profile. The more modern
way, however, is to let the _activation driver_ that is, the
software calling the activation script manage the profile. Indeed,
in some cases we may not have a `home-manager` profile at all! This is
the case when Home Manager is used as a NixOS or nix-darwin module, in
these cases the system profile will contain references to the
corresponding Home Manager configurations.
Note, to maintain backwards compatibility, the old activation script
behavior is still the default. To choose the new mode of operation you
have to call the activation script with the command line option
`--driver-version 1`. The old behavior is available using
`--driver-version 0`, or simply omit it entirely.
Unfortunately, driver software need to support both modes of operation
for the time being since a user may wish to activate an old generation
that contains an activation script that does not support
`--driver-version`. To determine whether support is available, check
the {file}`gen-version` file in the configuration build output root.
If the file is missing then the activation script does not support
`--driver-version`. If the file exists and contains the integer 1 or
higher, then `--driver-version 1` is supported.

View File

@@ -1,32 +0,0 @@
# Introduction to Home Manager {#ch-introduction}
Home Manager is a [Nix](https://nix.dev/)-powered tool for reproducible management of the contents of users' home directories.
This includes programs, configuration files, environment variables and, well… arbitrary files.
The following example snippet of Nix code:
```nix
programs.git = {
enable = true;
userEmail = "joe@example.org";
userName = "joe";
};
```
would make available to a user the `git` executable and man pages and a configuration file `~/.config/git/config`:
```ini
[user]
email = "joe@example.org"
name = "joe"
```
Since Home Manager is implemented in Nix, it provides several benefits:
- Contents are reproducible — a home will be the exact same every time it is built, unless of course, an intentional change is made.
This also means you can have the exact same home on different hosts.
- Significantly faster and more powerful than various backup strategies.
- Unlike "dotfiles" repositories, Home Manager supports specifying programs, as well as their configurations.
- Supported by <http://cache.nixos.org/>, so that you don't have to build from source.
- If you do want to build some programs from source, there is hardly a tool more useful than Nix for that, and the build instructions can be neatly integrated in your Home Manager usage.
- Infinitely composable, so that values in different configuration files and build instructions can share a source of truth.
- Connects you with the [most extensive](https://repology.org/repositories/statistics/total) and [most up-to-date](https://repology.org/repositories/statistics/newest) software package repository on earth, [Nixpkgs](https://github.com/NixOS/nixpkgs).

View File

@@ -1,32 +0,0 @@
{
"gnunet.conf(5)": "https://docs.gnunet.org/users/configuration.html",
"mpd(1)": "https://mpd.readthedocs.io/en/latest/mpd.1.html",
"mpd.conf(5)": "https://mpd.readthedocs.io/en/latest/mpd.conf.5.html",
"nix.conf(5)": "https://nixos.org/manual/nix/stable/command-ref/conf-file.html",
"journald.conf(5)": "https://www.freedesktop.org/software/systemd/man/journald.conf.html",
"logind.conf(5)": "https://www.freedesktop.org/software/systemd/man/logind.conf.html",
"networkd.conf(5)": "https://www.freedesktop.org/software/systemd/man/networkd.conf.html",
"systemd.automount(5)": "https://www.freedesktop.org/software/systemd/man/systemd.automount.html",
"systemd.exec(5)": "https://www.freedesktop.org/software/systemd/man/systemd.exec.html",
"systemd.link(5)": "https://www.freedesktop.org/software/systemd/man/systemd.link.html",
"systemd.mount(5)": "https://www.freedesktop.org/software/systemd/man/systemd.mount.html",
"systemd.netdev(5)": "https://www.freedesktop.org/software/systemd/man/systemd.netdev.html",
"systemd.network(5)": "https://www.freedesktop.org/software/systemd/man/systemd.network.html",
"systemd.nspawn(5)": "https://www.freedesktop.org/software/systemd/man/systemd.nspawn.html",
"systemd.path(5)": "https://www.freedesktop.org/software/systemd/man/systemd.path.html",
"systemd.resource-control(5)": "https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html",
"systemd.scope(5)": "https://www.freedesktop.org/software/systemd/man/systemd.scope.html",
"systemd.service(5)": "https://www.freedesktop.org/software/systemd/man/systemd.service.html",
"systemd.slice(5)": "https://www.freedesktop.org/software/systemd/man/systemd.slice.html",
"systemd.socket(5)": "https://www.freedesktop.org/software/systemd/man/systemd.socket.html",
"systemd.timer(5)": "https://www.freedesktop.org/software/systemd/man/systemd.timer.html",
"systemd.unit(5)": "https://www.freedesktop.org/software/systemd/man/systemd.unit.html",
"systemd-system.conf(5)": "https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html",
"systemd-user.conf(5)": "https://www.freedesktop.org/software/systemd/man/systemd-user.conf.html",
"timesyncd.conf(5)": "https://www.freedesktop.org/software/systemd/man/timesyncd.conf.html",
"tmpfiles.d(5)": "https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html",
"systemd.time(7)": "https://www.freedesktop.org/software/systemd/man/systemd.time.html",
"systemd-fstab-generator(8)": "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html",
"systemd-networkd-wait-online.service(8)": "https://www.freedesktop.org/software/systemd/man/systemd-networkd-wait-online.service.html"
}

View File

@@ -1,35 +0,0 @@
# Home Manager Manual {#home-manager-manual}
## Version 26.05 (unstable)
```{=include=} preface
preface.md
```
```{=include=} parts
introduction.md
installation.md
usage.md
nix-flakes.md
writing-modules.md
contributing.md
internals.md
3rd-party.md
faq.md
```
```{=include=} appendix html:into-file=//options.xhtml
options.md
```
```{=include=} appendix html:into-file=//nixos-options.xhtml
nixos-options.md
```
```{=include=} appendix html:into-file=//nix-darwin-options.xhtml
nix-darwin-options.md
```
```{=include=} appendix html:into-file=//release-notes.xhtml
release-notes/release-notes.md
```

View File

@@ -1,7 +0,0 @@
# nix-darwin Configuration Options {#ch-nix-darwin-options}
```{=include=} options
id-prefix: nix-darwin-opt-
list-id: nix-darwin-options
source: @OPTIONS_JSON@
```

View File

@@ -1,36 +0,0 @@
# Nix Flakes {#ch-nix-flakes}
Home Manager is compatible with [Nix
Flakes](https://wiki.nixos.org/wiki/Flakes). But please be aware that this
support is still experimental and may change in backwards
incompatible ways.
Just like in the standard installation you can use the Home Manager
flake in three ways:
1. Using the standalone `home-manager` tool. For platforms other than
NixOS and Darwin, this is the only available choice. It is also
recommended for people on NixOS or Darwin that want to manage their
home directory independently of the system as a whole. See
[Standalone setup](#sec-flakes-standalone) for instructions on how
to perform this installation.
2. As a module within a NixOS system configuration. This allows the
user profiles to be built together with the system when running
`nixos-rebuild`. See [NixOS module](#sec-flakes-nixos-module) for a
description of this setup.
3. This allows the user profiles to be built together with the system
when running `darwin-rebuild`. See [nix-darwin
module](#sec-flakes-nix-darwin-module) for a description of this
setup.
```{=include=} sections
nix-flakes/prerequisites.md
nix-flakes/standalone.md
nix-flakes/nixos.md
nix-flakes/nix-darwin.md
nix-flakes/flake-parts.md
```

View File

@@ -1,39 +0,0 @@
# flake-parts module {#sec-flakes-flake-parts-module}
When using [flake-parts](https://flake.parts)
you may wish to import Home Manager's flake module,
`flakeModules.home-manager`.
``` nix
{
description = "flake-parts configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
# Import home-manager's flake module
inputs.home-manager.flakeModules.home-manager
];
flake = {
# Define `homeModules`, `homeConfigurations`,
# `nixosConfigurations`, etc here
};
# See flake.parts for more features, such as `perSystem`
};
}
```
The flake module defines the `flake.homeModules` and `flake.homeConfigurations`
options, allowing them to be properly merged if they are defined in multiple
modules.
If you are only defining `homeModules` and/or `homeConfigurations` once in a
single module, flake-parts should work fine without importing
`flakeModules.home-manager`.

View File

@@ -1,47 +0,0 @@
# nix-darwin module {#sec-flakes-nix-darwin-module}
The flake-based setup of the Home Manager nix-darwin module is similar
to that of NixOS. The `flake.nix` would be:
``` nix
{
description = "Darwin configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
darwin.url = "github:nix-darwin/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, darwin, ... }: {
darwinConfigurations = {
hostname = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
./configuration.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = ./home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
};
};
};
}
```
and it is also rebuilt with the nix-darwin generations. The rebuild
command here may be `darwin-rebuild switch --flake <flake-uri>`.
You can use the above `flake.nix` as a template in `~/.config/darwin` by
``` shell
$ nix flake new ~/.config/darwin -t github:nix-community/home-manager#nix-darwin
```

View File

@@ -1,47 +0,0 @@
# NixOS module {#sec-flakes-nixos-module}
To use Home Manager as a NixOS module, a bare-minimum `flake.nix` would
be as follows:
``` nix
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, ... }: {
nixosConfigurations = {
hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = ./home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
};
};
};
}
```
The Home Manager configuration is then part of the NixOS configuration
and is automatically rebuilt with the system when using the appropriate
command for the system, such as
`nixos-rebuild switch --flake <flake-uri>`.
You can use the above `flake.nix` as a template in `/etc/nixos` by
``` shell
$ nix flake new /etc/nixos -t github:nix-community/home-manager#nixos
```

View File

@@ -1,37 +0,0 @@
# Prerequisites {#sec-flakes-prerequisites}
- Install Nix 2.4 or later, or have it in `nix-shell`.
- Enable experimental features `nix-command` and `flakes`.
- When using NixOS, add the following to your `configuration.nix`
and rebuild your system.
``` nix
nix.settings.experimental-features = "nix-command flakes";
```
- If you are not using NixOS, add the following to `nix.conf`
(located at `~/.config/nix/` or `/etc/nix/nix.conf`).
``` bash
experimental-features = nix-command flakes
```
You may need to restart the Nix daemon with, for example,
`sudo systemctl restart nix-daemon.service`.
- Alternatively, you can enable flakes on a per-command basis with
the following additional flags to `nix` and `home-manager`:
``` shell
$ nix --extra-experimental-features "nix-command flakes" <sub-commands>
$ home-manager --extra-experimental-features "nix-command flakes" <sub-commands>
```
- Prepare your Home Manager configuration (`home.nix`).
Unlike the channel-based setup, `home.nix` will be evaluated when
the flake is built, so it must be present before bootstrap of Home
Manager from the flake. See [Configuration Example](#sec-usage-configuration) for
introduction about writing a Home Manager configuration.

View File

@@ -1,62 +0,0 @@
# Standalone setup {#sec-flakes-standalone}
To prepare an initial Home Manager configuration for your logged in
user, you can run the Home Manager `init` command directly from its
flake.
For example, if you are using the unstable version of Nixpkgs or NixOS,
then to generate and activate a basic configuration run the command
``` shell
$ nix run home-manager/master -- init --switch
```
For Nixpkgs or NixOS version 25.11 run
``` shell
$ nix run home-manager/release-25.11 -- init --switch
```
This will generate a `flake.nix` and a `home.nix` file in
`~/.config/home-manager`, creating the directory if it does not exist.
If you omit the `--switch` option then the activation will not happen.
This is useful if you want to inspect and edit the configuration before
activating it.
``` shell
$ nix run home-manager/$branch -- init
$ # Edit files in ~/.config/home-manager
$ nix run home-manager/$branch -- init --switch
```
Where `$branch` is one of `master` or `release-25.11`.
After the initial activation has completed successfully then building
and activating your flake-based configuration is as simple as
``` shell
$ home-manager switch
```
It is possible to override the default configuration directory, if you
want. For example,
``` shell
$ nix run home-manager/$branch -- init --switch ~/hmconf
$ # And after the initial activation.
$ home-manager switch --flake ~/hmconf
```
::: {.note}
The flake inputs are not automatically updated by Home Manager. You need
to use the standard `nix flake update` command for that.
If you only want to update a single flake input, then the command
`nix flake lock --update-input <input>` can be used.
You can also pass flake-related options such as `--recreate-lock-file`
or `--update-input <input>` to `home-manager` when building or
switching, and these options will be forwarded to `nix build`. See the
[NixOS Wiki page](https://wiki.nixos.org/wiki/Flakes) for details.
:::

View File

@@ -1,7 +0,0 @@
# NixOS Configuration Options {#ch-nixos-options}
```{=include=} options
id-prefix: nixos-opt-
list-id: nixos-options
source: @OPTIONS_JSON@
```

View File

@@ -1,7 +0,0 @@
# Home Manager Configuration Options {#ch-options}
```{=include=} options
id-prefix: opt-
list-id: home-manager-options
source: @OPTIONS_JSON@
```

View File

@@ -1,20 +0,0 @@
# Preface {#preface}
This manual will eventually describe how to install, use, and extend Home
Manager.
If you encounter problems then please reach out on the IRC channel
[#home-manager](https://webchat.oftc.net/?channels=home-manager)
hosted by [OFTC](https://oftc.net/).
There is also a [Matrix room](https://matrix.to/#/%23hm:rycee.net),
which is bridged to the IRC channel.
If your problem is caused by a bug in Home Manager then it should
be reported on the
[Home Manager issue tracker](https://github.com/nix-community/home-manager/issues).
:::{.note}
Commands prefixed with `$ sudo` have to be run as root, either
requiring to login as root user or temporarily switching to it using
`sudo` for example.
:::

View File

@@ -1,65 +0,0 @@
# Using Home Manager {#ch-usage}
Your use of Home Manager is centered around the configuration file,
which is typically found at `~/.config/home-manager/home.nix` in the
standard installation or `~/.config/home-manager/flake.nix` in a Nix
flake based installation.
::: {.note}
The default configuration used to be placed in `~/.config/nixpkgs`¸ so
you may see references to that elsewhere. The old directory still works
but Home Manager will print a warning message when used.
:::
This configuration file can be *built* and *activated*.
Building a configuration produces a directory in the Nix store that
contains all files and programs that should be available in your home
directory and Nix user profile, respectively. The build step also checks
that the configuration is valid and it will fail with an error if you,
for example, assign a value to an option that does not exist or assign a
value of the wrong type. Some modules also have custom assertions that
perform more detailed, module specific, checks.
Concretely, if your configuration contains
``` nix
programs.emacs.enable = "yes";
```
then building it, for example using `home-manager build`, will result in
an error message saying something like
```console
$ home-manager build
error: A definition for option `programs.emacs.enable' is not of type `boolean'. Definition values:
- In `/home/jdoe/.config/home-manager/home.nix': "yes"
(use '--show-trace' to show detailed location information)
```
The message indicates that you must provide a Boolean value for this
option, that is, either `true` or `false`. The documentation of each
option will state the expected type, for
[programs.emacs.enable](#opt-programs.emacs.enable) you will see "Type: boolean". You
there also find information about the default value and a description of
the option. You can find the complete option documentation in
[Home Manager Configuration Options](#ch-options) or directly in the terminal by running
``` shell
man home-configuration.nix
```
Once a configuration is successfully built, it can be activated. The
activation performs the steps necessary to make the files, programs, and
services available in your user environment. The `home-manager switch`
command performs a combined build and activation.
```{=include=} sections
usage/configuration.md
usage/rollbacks.md
usage/dotfiles.md
usage/graphical.md
usage/gpu-non-nixos.md
usage/updating.md
usage/upgrading.md
```

View File

@@ -1,112 +0,0 @@
# Configuration Example {#sec-usage-configuration}
A fresh install of Home Manager will generate a minimal
`~/.config/home-manager/home.nix` file containing something like
``` nix
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "jdoe";
home.homeDirectory = "/home/jdoe";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "25.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
```
You can use this as a base for your further configurations.
::: {.note}
If you are not very familiar with the Nix language and NixOS modules
then it is encouraged to start with small and simple changes. As you
learn you can gradually grow the configuration with confidence.
:::
As an example, let us expand the initial configuration file to also
install the htop and fortune packages, install Emacs with a few extra
packages available, and enable the user gpg-agent service.
To satisfy the above setup we should elaborate the `home.nix` file as
follows:
``` nix
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "jdoe";
home.homeDirectory = "/home/jdoe";
# Packages that should be installed to the user profile.
home.packages = [
pkgs.htop
pkgs.fortune
];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "25.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.emacs = {
enable = true;
extraPackages = epkgs: [
epkgs.nix-mode
epkgs.magit
];
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
}
```
- Nixpkgs packages can be installed to the user profile using
[home.packages](#opt-home.packages).
- The option names of a program module typically start with
`programs.<package name>`.
- Similarly, for a service module, the names start with
`services.<package name>`. Note in some cases a package has both
programs *and* service options -- Emacs is such an example.
To activate this configuration you can run
``` shell
home-manager switch
```
or if you are not feeling so lucky,
``` shell
home-manager build
```
which will create a `result` link to a directory containing an
activation script and the generated home directory files.

View File

@@ -1,36 +0,0 @@
# Keeping your \~ safe from harm {#sec-usage-dotfiles}
To configure programs and services Home Manager must write various
things to your home directory. To prevent overwriting any existing files
when switching to a new generation, Home Manager will attempt to detect
collisions between existing files and generated files. If any such
collision is detected the activation will terminate before changing
anything on your computer.
For example, suppose you have a wonderful, painstakingly created
`~/.config/git/config` and add
``` nix
{
# …
programs.git = {
enable = true;
userName = "Jane Doe";
userEmail = "jane.doe@example.org";
};
# …
}
```
to your configuration. Attempting to switch to the generation will then
result in
``` shell
$ home-manager switch
Activating checkLinkTargets
Existing file '/home/jdoe/.config/git/config' is in the way
Please move the above files and try again
```

View File

@@ -1,202 +0,0 @@
# GPU on non-NixOS systems {#sec-usage-gpu-non-nixos}
To access the GPU, programs need access to OpenGL and Vulkan libraries. While
this works transparently on NixOS, it does not on other Linux systems. There are
two options:
1. Recommended: modify the host system slightly so that the graphics libraries
can be found where programs from Nixpkgs can find them.
2. Wrap programs from Nixpkgs in an environment which tells them where to find
graphics libraries.
The first option is very clean because the needed modifications to the host OS
are small. However, it does require root/sudo access to the system, which may
not be available. The second approach avoids that. However, it injects libraries
from Nixpkgs into the environment of wrapped programs, which can make it
impossible to launch programs of the host OS from wrapped programs.
## When sudo is available: fixing the host OS {#sec-usage-gpu-sudo}
The {option}`targets.genericLinux.gpu` module is automatically enabled whenever
the option {option}`targets.genericLinux.enable` is set (unless
[NixGL](#sec-usage-gpu-nosudo) is used instead), which is recommended for
non-NixOS Linux distributions in any case. The module can also be explicitly
enabled by setting {option}`targets.genericLinux.gpu.enable`.
This module builds a directory containing GPU libraries. When activating the
home configuration by `home-manager switch`, the host system is examined: for
compatibility with NixOS, these libraries need to be placed in
`/run/opengl-driver`. If this directory does not exist, or contains a different
set of libraries, the activation script will print a warning such as
```text
Activating checkExistingGpuDrivers
GPU drivers require an update, run
sudo /nix/store/HASH-non-nixos-gpu/bin/non-nixos-gpu-setup
```
Because the `/run` directory is volatile and disappears on reboot, libraries
cannot be simply copied or linked there. The `non-nixos-gpu-setup` script
installs a Systemd service which ensures that the drivers are linked to
`/run/opengl-driver` on boot. Home Manager will always check and warn you when
this setup needs to be refreshed.
If you ever wish to uninstall these drivers, all you need to do is
```sh
sudo rm /run/opengl-driver
sudo systemctl disable --now non-nixos-gpu.service
sudo rm /etc/systemd/system/non-nixos-gpu.service
```
### GPU offloading {#sec-usage-gpu-offloading}
You can use the {option}`targets.genericLinux.nixGL.prime.installScript` option.
It installs the `prime-offload` script which is configured through options under
{option}`targets.genericLinux.nixGL.prime`. This functionality is independent
from the rest of NixGL and can be used when
{option}`targets.genericLinux.nixGL.packages` is left `null`, which it should be
when using drivers from `/run/opengl-driver`.
### Nvidia drivers {#sec-usage-gpu-nvidia}
If you need to include the proprietary Nvidia drivers, the process is a bit more
involved. You need to:
1. Determine the exact version used by the host system. Example: `550.163.01`
1. Fetch that version of the drivers from Nvidia and calculate their hash.
Example:
```sh
nix store prefetch-file \
https://download.nvidia.com/XFree86/Linux-x86_64/550.163.01/NVIDIA-Linux-x86_64-550.163.01.run
```
Attention: the version and architecture are present twice. If you are on an
ARM system, replace `x86_64` with `aarch64`.
1. Put this information into your home configuration. Example:
```nix
targets.genericLinux.gpu.nvidia = {
enable = true;
version = "550.163.01";
sha256 = "sha256-74FJ9bNFlUYBRen7+C08ku5Gc1uFYGeqlIh7l1yrmi4=";
};
```
::: {.warning}
The Nvidia driver version **must** match the host system. This means that you
must pay attention when upgrading the system and update the home configuration
as well.
:::
## No root access: wrapping programs {#sec-usage-gpu-nosudo}
The wrapping approach is facilitated by
[NixGL](https://github.com/nix-community/nixGL), which can be integrated into
Home Manager.
::: {.warning}
This approach can cause issues when a wrapped program from Nixpkgs executes a
program from the host. For example, Firefox from Nixpkgs must be wrapped by
NixGL in order for graphical acceleration to work. If you then download a PDF
file and open it in a PDF viewer that is not installed from Nixpkgs but is
provided by the host distribution, there may be issues. Because Firefox's
environment injects libraries from NixGL, they are inherited by the PDF viewer,
and unless they are the same or compatible version as the libraries on the host,
the viewer will not work. This problem manifests more often with Vulkan because
it needs a larger set of injected libraries than OpenGL.
The problem typically manifests with errors similar to
```text
/nix/store/HASH-gcc-12.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.31' not found
```
:::
To enable the integration, import NixGL into your home configuration, either as
a channel, or as a flake input passed via `extraSpecialArgs`. Then, set the
`targets.genericLinux.nixGL.packages` option to the package set provided by
NixGL.
Once integration is enabled, it can be used in two ways: as Nix functions for
wrapping programs installed via Home Manager, and as shell commands for running
programs installed by other means (such as `nix shell`). In either case, there
are several wrappers available. They can be broadly categorized
- by vendor: as Mesa (for Free drivers of all vendors) and Nvidia (for
Nvidia-specific proprietary drivers).
- by GPU selection: as primary and secondary (offloading).
For example, the `mesa` wrapper provides support for running programs on the
primary GPU for Intel, AMD and Nouveau drivers, while the `mesaPrime` wrapper
does the same for the secondary GPU.
**Note:** when using Nvidia wrappers together with flakes, your home
configuration will not be pure and needs to be built using `home-manager switch
--impure`. Otherwise, the build will fail, complaining about missing attribute
`currentTime`.
Wrapper functions are available under `config.lib.nixGL.wrappers`. However, it
can be more convenient to use the `config.lib.nixGL.wrap` alias, which can be
configured to use any of the wrappers. It is intended to provide a customization
point when the same home configuration is used across several machines with
different hardware. There is also the `config.lib.nixGL.wrapOffload` alias for
two-GPU systems.
Another convenience is that all wrapper functions are always available. However,
when `targets.genericLinux.nixGL.packages` option is unset, they are no-ops.
This allows them to be used even when the home configuration is used on NixOS
machines. The exception is the `prime-offload` script which ignores
`targets.genericLinux.nixGL.packages` and is installed into the environment
whenever `targets.genericLinux.nixGL.prime.installScript` is set. This script,
which can be used to start a program on a secondary GPU, does not depend on
NixGL and is useful on NixOS systems as well.
Below is an abbreviated example for an Optimus laptop that makes use of both
Mesa and Nvidia wrappers, where the latter is used in dGPU offloading mode. It
demonstrates how to wrap `mpv` to run on the integrated Intel GPU, wrap FreeCAD
to run on the Nvidia dGPU, and how to install the wrapper scripts. It also wraps
Xonotic to run on the dGPU, but uses the wrapper function directly for
demonstration purposes.
```nix
{ config, lib, pkgs, nixgl, ... }:
{
targets.genericLinux.nixGL = {
packages = nixgl.packages;
defaultWrapper = "mesa";
offloadWrapper = "nvidiaPrime";
installScripts = [ "mesa" "nvidiaPrime" ];
};
programs.mpv = {
enable = true;
package = config.lib.nixGL.wrap pkgs.mpv;
};
home.packages = [
(config.lib.nixGL.wrapOffload pkgs.freecad)
(config.lib.nixGL.wrappers.nvidiaPrime pkgs.xonotic)
];
}
```
The above example assumes a flake-based setup where `nixgl` was passed from the
flake. When using channels, the example would instead begin with
```nix
{ config, lib, pkgs, ... }:
{
targets.genericLinux.nixGL.packages = import <nixgl> { inherit pkgs; };
# The rest is the same as above
...
```

View File

@@ -1,32 +0,0 @@
# Graphical services {#sec-usage-graphical}
Home Manager includes a number of services intended to run in a
graphical session, for example `xscreensaver` and `dunst`.
Unfortunately, such services will not be started automatically unless
you let Home Manager start your X session. That is, you have something
like
``` nix
{
# …
services.xserver.enable = true;
# …
}
```
in your system configuration and
``` nix
{
# …
xsession.enable = true;
xsession.windowManager.command = "…";
# …
}
```
in your Home Manager configuration.

View File

@@ -1,45 +0,0 @@
# Rollbacks {#sec-usage-rollbacks}
When you perform a `home-manager switch` and discover a problem then
it is possible to _roll back_ to the previous version of your
configuration using `home-manager switch --rollback`. This will turn
the previous configuration into the current configuration.
::: {.example #ex-rollback-scenario}
### Home Manager Rollback
Imagine you have just updated Nixpkgs and switched to a new Home
Manager configuration. You discover that a package update included in
your new configuration has a bug that was not present in the previous
configuration.
You can then run `home-manager switch --rollback` to recover your
previous configuration, which includes the working version of the
package.
To see what happened above we can observe the list of Home Manager
generations before and after the rollback:
``` shell
$ home-manager generations
2024-01-04 11:56 : id 765 -> /nix/store/kahm1rxk77mnvd2l8pfvd4jkkffk5ijk-home-manager-generation (current)
2024-01-03 10:29 : id 764 -> /nix/store/2wsmsliqr5yynqkdyjzb1y57pr5q2lsj-home-manager-generation
2024-01-01 12:21 : id 763 -> /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation
2023-12-29 21:03 : id 762 -> /nix/store/6c0k1r03fxckql4vgqcn9ccb616ynb94-home-manager-generation
2023-12-25 18:51 : id 761 -> /nix/store/czc5y6vi1rvnkfv83cs3rn84jarcgsgh-home-manager-generation
$ home-manager switch --rollback
Starting home manager activation
$ home-manager generations
2024-01-04 11:56 : id 765 -> /nix/store/kahm1rxk77mnvd2l8pfvd4jkkffk5ijk-home-manager-generation
2024-01-03 10:29 : id 764 -> /nix/store/2wsmsliqr5yynqkdyjzb1y57pr5q2lsj-home-manager-generation (current)
2024-01-01 12:21 : id 763 -> /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation
2023-12-29 21:03 : id 762 -> /nix/store/6c0k1r03fxckql4vgqcn9ccb616ynb94-home-manager-generation
2023-12-25 18:51 : id 761 -> /nix/store/czc5y6vi1rvnkfv83cs3rn84jarcgsgh-home-manager-generation
```
:::

View File

@@ -1,12 +0,0 @@
# Updating {#sec-updating}
If you have installed Home Manager using the Nix channel method then
updating Home Manager is done by first updating the channel. You can
then switch to the updated Home Manager environment.
``` shell
$ nix-channel --update
unpacking channels...
$ home-manager switch
```

View File

@@ -1,148 +0,0 @@
# Upgrading to a new Home Manager release {#sec-upgrade-release}
## Overview {#sec-upgrade-release-overview}
When upgrading NixOS to a new major version (e.g., from 24.11 to
25.05), you also need to upgrade your Home Manager channel to maintain
compatibility. This guide covers the proper steps to upgrade Home
Manager channels for NixOS 25.05.
## Understanding Home Manager Versioning {#sec-upgrade-release-understanding-versioning}
Home Manager follows NixOS release cycles and provides corresponding branches:
- **release-##.##**: Stable branch for NixOS ##.## (current stable)
- **master**: Development branch (tracks nixos-unstable)
:::{.note}
Always use the Home Manager version that matches your NixOS version to
avoid compatibility issues.
:::
## Channel-Based Installation (Traditional) {#sec-upgrade-release-understanding-channel}
1. First, verify your current Home Manager channel:
``` shell
$ nix-channel --list
```
You should see something like:
```
home-manager https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz
```
1. Update the Home Manager channel to a NixOS 25.05 compatible version:
``` shell
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz home-manager
$ nix-channel --update
```
1. Apply the changes:
``` shell
$ home-manager switch
```
## Flake-Based Installation (Modern) {#sec-upgrade-release-understanding-flake}
If you're using Home Manager with Nix flakes, update your `flake.nix`:
```nix
{
description = "Home Manager configuration";
inputs = {
# Increment release branch for NixOS
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
home-manager = {
# Follow corresponding `release` branch from Home Manager
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }: {
homeConfigurations."yourusername" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [ ./home.nix ];
};
};
}
```
Then update and rebuild. If you are using Home Manager standalone:
``` shell
$ nix flake update
$ home-manager switch --flake .
```
And if you are using Home Manager as a NixOS module then you will need
to update your system configuration instead and run
``` shell
$ nix flake update
$ sudo nixos-rebuild switch
```
## State Version Management {#sec-upgrade-release-state-version}
:::{.warning}
Careful updating your `home.stateVersion` when upgrading Home Manager.
:::
The `stateVersion` is best to remain set to the NixOS version you
**first installed** Home Manager
```nix
{
home.stateVersion = "24.11"; # Example: if you first installed on 24.11
}
```
**Why?** The `stateVersion` ensures backward compatibility and
prevents breaking changes from affecting your existing configuration.
**Remember:** Channel version is not the same as State version. Update
the channel, keep the `stateVersion` unchanged. Advanced users can
view the changes between releases and see if any of the `stateVersion`
changes will affect them and increment, if they migrate their
configurations to follow the changed evaluation.
## Troubleshooting {#sec-upgrade-release-state-troubleshooting}
### Common Issues {#sec-upgrade-release-state-troubleshooting-common-issues}
Check the [Home Manager Release Notes](#ch-release-notes) for breaking changes.
1. **Version Mismatch Warning**: If you see warnings about version
mismatches, ensure your Home Manager version matches your NixOS
version.
1. **Module Changes**: Modules are constantly being updated with new
features to keep up with changes in upstream packaging or to fix
bugs and add features. If you have an unexpected change, check if
there was something noted in the release notes or news entries.
1. **Channel Not Found**: If `nix-channel --list` shows no channels,
you might be using a different installation method (like flakes or
NixOS module).
### Verification {#sec-upgrade-release-state-troubleshooting-verification}
After upgrading, verify the installation:
``` shell
$ home-manager --version
```
This should show version 25.05 or indicate it's using the release-25.05 branch.
## Additional Resources {#sec-upgrade-release-resources}
- [NixOS Stable Release Notes](https://nixos.org/manual/nixos/stable/release-notes)
- [Home Manager Release Notes](#ch-release-notes)

View File

@@ -1,13 +0,0 @@
# Writing Home Manager Modules {#ch-writing-modules}
The module system in Home Manager is based entirely on the NixOS module
system so we will here only highlight aspects that are specific for Home
Manager. For information about the module system as such please refer to
the [Writing NixOS
Modules](https://nixos.org/nixos/manual/index.html#sec-writing-modules)
chapter of the NixOS manual.
```{=include=} sections
writing-modules/types.md
```

View File

@@ -1,368 +0,0 @@
# Option Types {#sec-option-types}
Overall the basic option types are the same in Home Manager as NixOS. A
few Home Manager options, however, make use of custom types that are
worth describing in more detail. These are the option types `dagOf` and
`gvariant` that are used, for example, by
[programs.ssh.matchBlocks](#opt-programs.ssh.matchBlocks) and [dconf.settings](#opt-dconf.settings).
[]{#sec-option-types-dag}`hm.types.dagOf`
: Options of this type have attribute sets as values where each member
is a node in a [directed acyclic
graph](https://en.wikipedia.org/w/index.php?title=Directed_acyclic_graph&oldid=939656095)
(DAG). This allows the attribute set entries to express dependency
relations among themselves. This can, for example, be used to
control the order of match blocks in a OpenSSH client configuration
or the order of activation script blocks in
[home.activation](#opt-home.activation).
A number of functions are provided to create DAG nodes. The
functions are shown below with examples using an option `foo.bar` of
type `hm.types.dagOf types.int`.
[]{#sec-option-types-dag-entryAnywhere}`hm.dag.entryAnywhere (value: T) : DagEntry<T>`
: Indicates that `value` can be placed anywhere within the DAG.
This is also the default for plain attribute set entries, that
is
``` nix
foo.bar = {
a = hm.dag.entryAnywhere 0;
}
```
and
``` nix
foo.bar = {
a = 0;
}
```
are equivalent.
[]{#sec-option-types-dag-entryAfter}`hm.dag.entryAfter (afters: list string) (value: T) : DagEntry<T>`
: Indicates that `value` must be placed *after* each of the
attribute names in the given list. For example
``` nix
foo.bar = {
a = 0;
b = hm.dag.entryAfter [ "a" ] 1;
}
```
would place `b` after `a` in the graph.
[]{#sec-option-types-dag-entryBefore}`hm.dag.entryBefore (befores: list string) (value: T) : DagEntry<T>`
: Indicates that `value` must be placed *before* each of the
attribute names in the given list. For example
``` nix
foo.bar = {
b = hm.dag.entryBefore [ "a" ] 1;
a = 0;
}
```
would place `b` before `a` in the graph.
[]{#sec-option-types-dag-entryBetween}`hm.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry<T>`
: Indicates that `value` must be placed *before* the attribute
names in the first list and *after* the attribute names in the
second list. For example
``` nix
foo.bar = {
a = 0;
c = hm.dag.entryBetween [ "b" ] [ "a" ] 2;
b = 1;
}
```
would place `c` before `b` and after `a` in the graph.
There are also a set of functions that generate a DAG from a list.
These are convenient when you just want to have a linear list of DAG
entries, without having to manually enter the relationship between
each entry. Each of these functions take a `tag` as argument and the
DAG entries will be named `${tag}-${index}`.
[]{#sec-option-types-dag-entriesAnywhere}`hm.dag.entriesAnywhere (tag: string) (values: [T]) : Dag<T>`
: Creates a DAG with the given values with each entry labeled
using the given tag. For example
``` nix
foo.bar = hm.dag.entriesAnywhere "a" [ 0 1 ];
```
is equivalent to
``` nix
foo.bar = {
a-0 = 0;
a-1 = hm.dag.entryAfter [ "a-0" ] 1;
}
```
[]{#sec-option-types-dag-entriesAfter}`hm.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag<T>`
: Creates a DAG with the given values with each entry labeled
using the given tag. The list of values are placed are placed
*after* each of the attribute names in `afters`. For example
``` nix
foo.bar =
{ b = 0; }
// hm.dag.entriesAfter "a" [ "b" ] [ 1 2 ];
```
is equivalent to
``` nix
foo.bar = {
b = 0;
a-0 = hm.dag.entryAfter [ "b" ] 1;
a-1 = hm.dag.entryAfter [ "a-0" ] 2;
}
```
[]{#sec-option-types-dag-entriesBefore}`hm.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag<T>`
: Creates a DAG with the given values with each entry labeled
using the given tag. The list of values are placed *before* each
of the attribute names in `befores`. For example
``` nix
foo.bar =
{ b = 0; }
// hm.dag.entriesBefore "a" [ "b" ] [ 1 2 ];
```
is equivalent to
``` nix
foo.bar = {
b = 0;
a-0 = 1;
a-1 = hm.dag.entryBetween [ "b" ] [ "a-0" ] 2;
}
```
[]{#sec-option-types-dag-entriesBetween}`hm.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag<T>`
: Creates a DAG with the given values with each entry labeled
using the given tag. The list of values are placed *before* each
of the attribute names in `befores` and *after* each of the
attribute names in `afters`. For example
``` nix
foo.bar =
{ b = 0; c = 3; }
// hm.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ];
```
is equivalent to
``` nix
foo.bar = {
b = 0;
c = 3;
a-0 = hm.dag.entryAfter [ "c" ] 1;
a-1 = hm.dag.entryBetween [ "b" ] [ "a-0" ] 2;
}
```
[]{#sec-option-types-gvariant}`hm.types.gvariant`
: This type is useful for options representing
[GVariant](https://docs.gtk.org/glib/struct.Variant.html#description)
values. The type accepts all primitive GVariant types as well as
arrays, tuples, "maybe" types, and dictionaries.
Some Nix values are automatically coerced to matching GVariant value
but the GVariant model is richer so you may need to use one of the
provided constructor functions. Examples assume an option `foo.bar`
of type `hm.types.gvariant`.
[]{#sec-option-types-gvariant-mkBoolean}`hm.gvariant.mkBoolean (v: bool)`
: Takes a Nix value `v` to a GVariant `boolean` value (GVariant
format string `b`). Note, Nix booleans are automatically coerced
using this function. That is,
``` nix
foo.bar = hm.gvariant.mkBoolean true;
```
is equivalent to
``` nix
foo.bar = true;
```
[]{#sec-option-types-gvariant-mkString}`hm.gvariant.mkString (v: string)`
: Takes a Nix value `v` to a GVariant `string` value (GVariant
format string `s`). Note, Nix strings are automatically coerced
using this function. That is,
``` nix
foo.bar = hm.gvariant.mkString "a string";
```
is equivalent to
``` nix
foo.bar = "a string";
```
[]{#sec-option-types-gvariant-mkObjectpath}`hm.gvariant.mkObjectpath (v: string)`
: Takes a Nix value `v` to a GVariant `objectpath` value (GVariant
format string `o`).
[]{#sec-option-types-gvariant-mkUchar}`hm.gvariant.mkUchar (v: string)`
: Takes a Nix value `v` to a GVariant `uchar` value (GVariant
format string `y`).
[]{#sec-option-types-gvariant-mkInt16}`hm.gvariant.mkInt16 (v: int)`
: Takes a Nix value `v` to a GVariant `int16` value (GVariant
format string `n`).
[]{#sec-option-types-gvariant-mkUint16}`hm.gvariant.mkUint16 (v: int)`
: Takes a Nix value `v` to a GVariant `uint16` value (GVariant
format string `q`).
[]{#sec-option-types-gvariant-mkInt32}`hm.gvariant.mkInt32 (v: int)`
: Takes a Nix value `v` to a GVariant `int32` value (GVariant
format string `i`). Note, Nix integers are automatically coerced
using this function. That is,
``` nix
foo.bar = hm.gvariant.mkInt32 7;
```
is equivalent to
``` nix
foo.bar = 7;
```
[]{#sec-option-types-gvariant-mkUint32}`hm.gvariant.mkUint32 (v: int)`
: Takes a Nix value `v` to a GVariant `uint32` value (GVariant
format string `u`).
[]{#sec-option-types-gvariant-mkInt64}`hm.gvariant.mkInt64 (v: int)`
: Takes a Nix value `v` to a GVariant `int64` value (GVariant
format string `x`).
[]{#sec-option-types-gvariant-mkUint64}`hm.gvariant.mkUint64 (v: int)`
: Takes a Nix value `v` to a GVariant `uint64` value (GVariant
format string `t`).
[]{#sec-option-types-gvariant-mkDouble}`hm.gvariant.mkDouble (v: double)`
: Takes a Nix value `v` to a GVariant `double` value (GVariant
format string `d`). Note, Nix floats are automatically coerced
using this function. That is,
``` nix
foo.bar = hm.gvariant.mkDouble 3.14;
```
is equivalent to
``` nix
foo.bar = 3.14;
```
[]{#sec-option-types-gvariant-mkArray}`hm.gvariant.mkArray type elements`
: Builds a GVariant array containing the given list of elements,
where each element is a GVariant value of the given type
(GVariant format string `a${type}`). The `type` value can be
constructed using
- `hm.gvariant.type.string` (GVariant format string `s`)
- `hm.gvariant.type.boolean` (GVariant format string `b`)
- `hm.gvariant.type.uchar` (GVariant format string `y`)
- `hm.gvariant.type.int16` (GVariant format string `n`)
- `hm.gvariant.type.uint16` (GVariant format string `q`)
- `hm.gvariant.type.int32` (GVariant format string `i`)
- `hm.gvariant.type.uint32` (GVariant format string `u`)
- `hm.gvariant.type.int64` (GVariant format string `x`)
- `hm.gvariant.type.uint64` (GVariant format string `t`)
- `hm.gvariant.type.double` (GVariant format string `d`)
- `hm.gvariant.type.variant` (GVariant format string `v`)
- `hm.gvariant.type.arrayOf type` (GVariant format string
`a${type}`)
- `hm.gvariant.type.maybeOf type` (GVariant format string
`m${type}`)
- `hm.gvariant.type.tupleOf types` (GVariant format string
`(${lib.concatStrings types})`)
- `hm.gvariant.type.dictionaryEntryOf [keyType valueType]`
(GVariant format string `{${keyType}${valueType}}`)
where `type` and `types` are themselves a type and list of
types, respectively.
[]{#sec-option-types-gvariant-mkEmptyArray}`hm.gvariant.mkEmptyArray type`
: An alias of
[`hm.gvariant.mkArray type []`](#sec-option-types-gvariant-mkArray).
[]{#sec-option-types-gvariant-mkNothing}`hm.gvariant.mkNothing type`
: Builds a GVariant maybe value (GVariant format string
`m${type}`) whose (non-existent) element is of the given type.
The `type` value is constructed as described for the
[`mkArray`](#sec-option-types-gvariant-mkArray) function above.
[]{#sec-option-types-gvariant-mkJust}`hm.gvariant.mkJust element`
: Builds a GVariant maybe value (GVariant format string
`m${element.type}`) containing the given GVariant element.
[]{#sec-option-types-gvariant-mkTuple}`hm.gvariant.mkTuple elements`
: Builds a GVariant tuple containing the given list of elements,
where each element is a GVariant value.
[]{#sec-option-types-gvariant-mkVariant}`hm.gvariant.mkVariant element`
: Builds a GVariant variant (GVariant format string `v`) which
contains the value of a GVariant element.
[]{#sec-option-types-gvariant-mkDictionaryEntry}`hm.gvariant.mkDictionaryEntry [key value]`
: Builds a GVariant dictionary entry containing the given list of
elements (GVariant format string `{${key.type}${value.type}}`),
where each element is a GVariant value.

223
docs/nix-flakes.adoc Normal file
View File

@@ -0,0 +1,223 @@
[[ch-nix-flakes]]
== Nix Flakes
:nixos-wiki-flakes: https://nixos.wiki/wiki/Flakes
Home Manager includes a `flake.nix` file for compatibility with {nixos-wiki-flakes}[Nix Flakes].
The support is still experimental and may change in backwards incompatible ways.
[[sec-flakes-prerequisties]]
=== Prerequisties
* Install Nix 2.4 or have it in `nix-shell`.
* Enable experimental features `nix-command` and `flakes`.
+
Either set in `nix.conf`
+
[source,bash]
experimental-features = nix-command flakes
+
or pass them to `nix` and `home-manager` by
+
[source,console]
----
$ nix --extra-experimental-features "nix-command flakes" <sub-commands>
$ home-manager --extra-experimental-features "nix-command flakes" <sub-commands>
----
* Prepare your Home Manager configuration (`home.nix`).
+
Unlike the channel-based setup,
`home.nix` will be evaluated when the flake is built,
so it must be present before bootstrap of Home Manager from the flake.
See <<sec-usage-configuration>> for introduction about
writing a Home Manager configuration.
+
[NOTE]
====
The `stateVersion` will be specified in the flake instead of in the configuration file.
Remove the line containing `home.stateVersion` in the example.
====
[[sec-flakes-standalone]]
=== Standalone setup
1. Set up a flake with a `flake.nix` as follows:
+
[source,nix]
----
{
description = "Home Manager configuration of Jane Doe";
inputs = {
# Specify the source of Home Manager and Nixpkgs
home-manager.url = "github:nix-community/home-manager";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { home-manager, ... }:
let
system = "x86_64-linux";
username = "jdoe";
in {
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
# Specify the path to your home configuration here
configuration = import ./home.nix;
inherit system username;
homeDirectory = "/home/${username}";
# Update the state version as needed.
# See the changelog here:
# https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05
stateVersion = "22.05";
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
};
};
}
----
+
[NOTE]
====
* The above example tracks the master branch of Home Manager
and nixos-unstable branch of Nixpkgs.
If you would like to use the `release-22.05` branch,
change the `home-manager` input url to `github:nix-community/home-manager/release-22.05`
and `nixpkgs` url to `github:NixOS/nixpkgs/nixos-22.05`.
Make sure to also update to the `stateVersion` option accordingly.
* The Home Manager library is exported by the flake under
`lib.hm`.
====
2. Install Home Manager and apply the configuration by
+
[source,console]
----
$ nix build --no-link <flake-uri>#homeConfigurations.jdoe.activationPackage
$ "$(nix path-info <flake-uri>#homeConfigurations.jdoe.activationPackage)"/activate
----
+
Substitute `<flake-uri>` with the flake URI of the configuration flake.
If `flake.nix` resides in `~/.config/nixpkgs`,
`<flake-uri>` may be `~/.config/nixpkgs`
as a Git tree or `path:~/.config/nixpkgs` if not.
3. Since the release `21.05`,
building a flake-based configuration is as simple as
+
[source,console]
$ home-manager switch --flake '<flake-uri>#jdoe'
+
once home-manager is installed.
+
Here, `jdoe` is a configuration specified in the flake file,
and `<flake-uri>#jdoe` will be expanded to
`<flake-uri>#homeConfigurations.jdoe.activationPackage`
and be built by Nix.
[NOTE]
====
The flake inputs are not upgraded automatically when switching.
The analogy to the command `home-manager --update ...` is `nix flake update`.
If updating more than one input is undesirable,
the command `nix flake lock --update-input <input-name>` can be used.
You can also pass flake-related options
such as `--recreate-lock-file` or `--update-input [input]`
to `home-manager` when building/switching,
and these options will be forwarded to `nix build`.
See the {nixos-wiki-flakes}[NixOS Wiki page] for detail.
====
[[sec-flakes-nixos-module]]
=== NixOS module
To use Home Manager as a NixOS module,
a bare-minimum `flake.nix` would be as follows:
[source,nix]
----
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, ... }: {
nixosConfigurations = {
hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = import ./home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
};
};
};
}
----
The Home Manager configuration is then part of the NixOS configuration
and is automatically rebuilt with the system when using the appropriate command
for the system, such as `nixos-rebuild switch --flake <flake-uri>`.
[[sec-flakes-nix-darwin-module]]
=== nix-darwin module
The flake-based setup of the Home Manager nix-darwin module
is similar to that of NixOS. The `flake.nix` would be:
[source,nix]
----
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, nix-darwin, ... }: {
darwinConfigurations = {
hostname = nix-darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
./configuration.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = import ./home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
};
};
};
}
----
and it is also rebuilt with the nix-darwin generations.
The rebuild command here may be `darwin-rebuild switch --flake <flake-uri>`.

View File

@@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Redirecting&hellip;</title>
<meta charset="utf-8">
<link rel="canonical" href="options.xhtml">
<noscript><meta http-equiv="refresh" content="0; url=options.xhtml"></noscript>
</head>
<body>
<h1>Redirecting&hellip;</h1>
<script>
window.location.href = "options.xhtml" + (window.location.search || "") + (window.location.hash || "");
</script>
</body>
</html>

View File

@@ -0,0 +1,25 @@
[[ch-release-notes]]
[appendix]
== Release Notes
This section lists the release notes for stable versions of Home Manager and the current unstable version.
:leveloffset: 1
include::rl-2205.adoc[]
include::rl-2111.adoc[]
include::rl-2105.adoc[]
include::rl-2009.adoc[]
include::rl-2003.adoc[]
include::rl-1909.adoc[]
include::rl-1903.adoc[]
include::rl-1809.adoc[]
:leveloffset: 0

View File

@@ -1,23 +0,0 @@
# Release Notes {#ch-release-notes}
This section lists the release notes for stable versions of Home Manager
and the current unstable version.
```{=include=} chapters
rl-2605.md
rl-2511.md
rl-2505.md
rl-2411.md
rl-2405.md
rl-2311.md
rl-2305.md
rl-2211.md
rl-2205.md
rl-2111.md
rl-2105.md
rl-2009.md
rl-2003.md
rl-1909.md
rl-1903.md
rl-1809.md
```

View File

@@ -1,3 +1,4 @@
# Release 18.09 {#sec-release-18.09}
[[sec-release-18.09]]
== Release 18.09
The 18.09 release branch became the stable branch in September, 2018.

View File

@@ -0,0 +1,59 @@
[[sec-release-19.03]]
== Release 19.03
The 19.03 release branch became the stable branch in April, 2019.
[[sec-release-19.03-highlights]]
=== Highlights
:opt-home-file-source: opt-home.file._name_.source
This release has the following notable changes:
* The <<{opt-home-file-source}>> option now allows source files to be
hidden, that is, having a name starting with the `.` character. It
also allows the source file name to contain characters not typically
allowed for Nix store paths. For example, your configuration can now
contain things such as
+
[source,nix]
----
home.file."my file".source = ./. + "/file with spaces!";
----
* The type used for the systemd unit options under
<<opt-systemd.user.services>>, <<opt-systemd.user.sockets>>, etc. has
been changed to offer more robust merging of configurations. If you
don't override values within systemd units then you are not affected
by this change. Unfortunately, if you do override unit values you may
encounter errors.
+
In particular, if you get an error saying that a ``unique option'' is
``defined multiple times'' then you need to use the
https://nixos.org/nixos/manual/#sec-option-definitions-setting-priorities[`mkForce`]
function. For example,
+
[source,nix]
----
systemd.user.services.foo.Service.ExecStart = "/foo/bar";
----
+
becomes
+
[source,nix]
----
systemd.user.services.foo.Service.ExecStart = lib.mkForce "/foo/bar";
----
+
We had to make this change because the old merging was causing too
many confusing situations for people.
[[sec-release-19.03-state-version-changes]]
=== State Version Changes
The state version in this release includes the changes below. These
changes are only active if the <<opt-home.stateVersion>> option is set
to ``19.03'' or later.
* There is now an option <<opt-programs.beets.enable>> that defaults
to `false`. Before the module would be active if the
<<opt-programs.beets.settings>> option was non-empty.

View File

@@ -1,52 +0,0 @@
# Release 19.03 {#sec-release-19.03}
The 19.03 release branch became the stable branch in April, 2019.
## Highlights {#sec-release-19.03-highlights}
This release has the following notable changes:
- The [home.file._name_.source](#opt-home.file._name_.source) option now allows source
files to be hidden, that is, having a name starting with the `.`
character. It also allows the source file name to contain characters
not typically allowed for Nix store paths. For example, your
configuration can now contain things such as
``` nix
home.file."my file".source = ./. + "/file with spaces!";
```
- The type used for the systemd unit options under
[systemd.user.sockets](#opt-systemd.user.sockets),
etc. has been changed to offer more robust merging of
configurations. If you don't override values within systemd units
then you are not affected by this change. Unfortunately, if you do
override unit values you may encounter errors.
In particular, if you get an error saying that a "unique option" is
"defined multiple times" then you need to use the
[`mkForce`](https://nixos.org/nixos/manual/#sec-option-definitions-setting-priorities)
function. For example,
``` nix
systemd.user.services.foo.Service.ExecStart = "/foo/bar";
```
becomes
``` nix
systemd.user.services.foo.Service.ExecStart = lib.mkForce "/foo/bar";
```
We had to make this change because the old merging was causing too
many confusing situations for people.
## State Version Changes {#sec-release-19.03-state-version-changes}
The state version in this release includes the changes below. These
changes are only active if the [home.stateVersion](#opt-home.stateVersion) option is
set to "19.03" or later.
- There is now an option [programs.beets.enable](#opt-programs.beets.enable) that
defaults to `false`. Before the module would be active if the
[programs.beets.settings](#opt-programs.beets.settings) option was non-empty.

View File

@@ -0,0 +1,31 @@
[[sec-release-19.09]]
== Release 19.09
The 19.09 release branch became the stable branch in October, 2019.
[[sec-release-19.09-highlights]]
=== Highlights
This release has the following notable changes:
* The `programs.firefox.enableGoogleTalk` and
`programs.firefox.enableIcedTea` options are now deprecated
and will only work if Firefox ESR 52.x is used.
* The `home-manager` tool now provides an `uninstall` sub-command that
can be used to uninstall Home Manager, if used in the standalone
mode. That is, not as a NixOS module.
[[sec-release-19.09-state-version-changes]]
=== State Version Changes
The state version in this release includes the changes below. These
changes are only active if the `home.stateVersion` option is set to
"19.09" or later.
* The <<opt-programs.firefox.package>> option now expects a wrapped
Firefox package and defaults to `pkgs.firefox`.
* The options <<opt-home.keyboard.layout>> and
<<opt-home.keyboard.variant>> now default to `null`, which indicates
that the system value should be used.

View File

@@ -1,28 +0,0 @@
# Release 19.09 {#sec-release-19.09}
The 19.09 release branch became the stable branch in October, 2019.
## Highlights {#sec-release-19.09-highlights}
This release has the following notable changes:
- The `programs.firefox.enableGoogleTalk` and
`programs.firefox.enableIcedTea` options are now deprecated and will
only work if Firefox ESR 52.x is used.
- The `home-manager` tool now provides an `uninstall` sub-command that
can be used to uninstall Home Manager, if used in the standalone
mode. That is, not as a NixOS module.
## State Version Changes {#sec-release-19.09-state-version-changes}
The state version in this release includes the changes below. These
changes are only active if the `home.stateVersion` option is set to
\"19.09\" or later.
- The [programs.firefox.package](#opt-programs.firefox.package) option now expects a
wrapped Firefox package and defaults to `pkgs.firefox`.
- The options [home.keyboard.layout](#opt-home.keyboard.layout) and
[home.keyboard.variant](#opt-home.keyboard.variant) now default to `null`, which
indicates that the system value should be used.

View File

@@ -0,0 +1,126 @@
[[sec-release-20.03]]
== Release 20.03
The 20.03 release branch became the stable branch in April, 2020.
[[sec-release-20.03-highlights]]
=== Highlights
This release has the following notable changes:
* Assigning a list to the <<opt-home.file>>, <<opt-xdg.configFile>>,
and <<opt-xdg.dataFile>> options is now deprecated and will produce a
warning message if used. Specifically, if your configuration currently
contains something like
+
[source,nix]
----
home.file = [
{
target = ".config/foo.txt";
text = "bar";
}
]
----
+
then it should be updated to instead use the equivalent attribute set form
+
[source,nix]
----
home.file = {
".config/foo.txt".text = "bar";
}
----
+
Support for the list form will be removed in Home Manager version
20.09.
* The `lib` function attribute given to modules is now enriched with
an attribute `hm` containing extra library functions specific for Home
Manager. More specifically, `lib.hm` is now the same as `config.lib`
and should be the preferred choice since it is more robust.
+
Therefore, if your configuration makes use of, for example,
`config.lib.dag` to create activation script blocks, it is recommended
to change to `lib.hm.dag`.
+
Note, in the unlikely case that you are
+
** using Home Manager's NixOS or nix-darwin module,
** have made your own Home Manager module containing an top-level
option named `config` or `options`, and
** assign to this option in your system configuration inside a plain
attribute set, i.e., without a function argument,
+
then you must update your configuration to perform the option
assignment inside a `config` attribute. For example, instead of
+
[source,nix]
----
home-manager.users.jane = { config = "foo"; };
----
+
use
+
[source,nix]
----
home-manager.users.jane = { config.config = "foo"; };
----
* The `services.compton` module has been deprecated and instead the
new module `services.picom` should be used. This is because Nixpkgs no
longer packages compton, and instead packages the (mostly) compatible
fork called picom.
* The list form of the <<opt-programs.ssh.matchBlocks>> option has
been deprecated and configurations requiring match blocks in a defined
order should switch to using DAG entries instead. For example, a
configuration
+
[source,nix]
----
programs.ssh.matchBlocks = [
{
host = "alpha.foo.com";
user = "jd";
}
{
host = "*.foo.com";
user = "john.doe";
}
];
----
+
can be expressed along the lines of
+
[source,nix]
----
programs.ssh.matchBlocks = {
"*.example.com" = {
user = "john.doe";
}
"alpha.example.com" = lib.hm.dag.entryBefore ["*.example.com"] {
user = "jd";
}
};
----
+
Support for the list form will be removed in Home Manager version
20.09.
[[sec-release-20.03-state-version-changes]]
=== State Version Changes
The state version in this release includes the changes below. These
changes are only active if the `home.stateVersion` option is set to
"20.03" or later.
* The <<opt-programs.zsh.history.path>> option is no longer prepended
by `$HOME`, which allows specifying absolute paths, for example,
using the xdg module. Also, the default value is fixed to
`$HOME/.zsh_history` and `dotDir` path is not prepended to it
anymore.
* The newsboat module will now default in displaying `queries` before `urls` in
its main window. This makes sense in the case when one has a lot of URLs and
few queries.

View File

@@ -1,122 +0,0 @@
# Release 20.03 {#sec-release-20.03}
The 20.03 release branch became the stable branch in April, 2020.
## Highlights {#sec-release-20.03-highlights}
This release has the following notable changes:
- Assigning a list to the [home.file](#opt-home.file),
[xdg.dataFile](#opt-xdg.dataFile) options is
now deprecated and will produce a warning message if used.
Specifically, if your configuration currently contains something
like
``` nix
home.file = [
{
target = ".config/foo.txt";
text = "bar";
}
]
```
then it should be updated to instead use the equivalent attribute
set form
``` nix
home.file = {
".config/foo.txt".text = "bar";
}
```
Support for the list form will be removed in Home Manager version
20.09.
- The `lib` function attribute given to modules is now enriched with
an attribute `hm` containing extra library functions specific for
Home Manager. More specifically, `lib.hm` is now the same as
`config.lib` and should be the preferred choice since it is more
robust.
Therefore, if your configuration makes use of, for example,
`config.lib.dag` to create activation script blocks, it is
recommended to change to `lib.hm.dag`.
Note, in the unlikely case that you are
- using Home Manager's NixOS or nix-darwin module,
- have made your own Home Manager module containing an top-level
option named `config` or `options`, and
- assign to this option in your system configuration inside a
plain attribute set, i.e., without a function argument,
then you must update your configuration to perform the option
assignment inside a `config` attribute. For example, instead of
``` nix
home-manager.users.jane = { config = "foo"; };
```
use
``` nix
home-manager.users.jane = { config.config = "foo"; };
```
- The `services.compton` module has been deprecated and instead the
new module `services.picom` should be used. This is because Nixpkgs
no longer packages compton, and instead packages the (mostly)
compatible fork called picom.
- The list form of the [programs.ssh.matchBlocks](#opt-programs.ssh.matchBlocks) option has
been deprecated and configurations requiring match blocks in a
defined order should switch to using DAG entries instead. For
example, a configuration
``` nix
programs.ssh.matchBlocks = [
{
host = "alpha.foo.com";
user = "jd";
}
{
host = "*.foo.com";
user = "john.doe";
}
];
```
can be expressed along the lines of
``` nix
programs.ssh.matchBlocks = {
"*.example.com" = {
user = "john.doe";
}
"alpha.example.com" = lib.hm.dag.entryBefore ["*.example.com"] {
user = "jd";
}
};
```
Support for the list form will be removed in Home Manager version
20.09.
## State Version Changes {#sec-release-20.03-state-version-changes}
The state version in this release includes the changes below. These
changes are only active if the `home.stateVersion` option is set to
\"20.03\" or later.
- The [programs.zsh.history.path](#opt-programs.zsh.history.path) option is no longer
prepended by `$HOME`, which allows specifying absolute paths, for
example, using the xdg module. Also, the default value is fixed to
`$HOME/.zsh_history` and `dotDir` path is not prepended to it
anymore.
- The newsboat module will now default in displaying `queries` before
`urls` in its main window. This makes sense in the case when one has
a lot of URLs and few queries.

Some files were not shown because too many files have changed in this diff Show More