Merge commit '2d1c929d73a2ee617a44dbe13ba2ee39842b76f8' as 'infra/libkookie/home-manager-stable'

main
Katharina Fey 2 years ago
commit 86e8fbb36c
  1. 468
      infra/libkookie/home-manager-stable/.github/CODEOWNERS
  2. 15
      infra/libkookie/home-manager-stable/.github/ISSUE_TEMPLATE/feature-request.md
  3. 46
      infra/libkookie/home-manager-stable/.github/ISSUE_TEMPLATE/issue.yaml
  4. 44
      infra/libkookie/home-manager-stable/.github/PULL_REQUEST_TEMPLATE.md
  5. 17
      infra/libkookie/home-manager-stable/.github/dependabot.yml
  6. 71
      infra/libkookie/home-manager-stable/.github/stale.yml
  7. 28
      infra/libkookie/home-manager-stable/.github/workflows/github_pages.yml
  8. 30
      infra/libkookie/home-manager-stable/.github/workflows/test.yml
  9. 2
      infra/libkookie/home-manager-stable/.gitignore
  10. 41
      infra/libkookie/home-manager-stable/.gitlab-ci.yml
  11. 1
      infra/libkookie/home-manager-stable/.release
  12. 21
      infra/libkookie/home-manager-stable/LICENSE
  13. 20
      infra/libkookie/home-manager-stable/Makefile
  14. 134
      infra/libkookie/home-manager-stable/README.md
  15. 19
      infra/libkookie/home-manager-stable/default.nix
  16. 258
      infra/libkookie/home-manager-stable/docs/contributing.adoc
  17. 131
      infra/libkookie/home-manager-stable/docs/default.nix
  18. 189
      infra/libkookie/home-manager-stable/docs/faq.adoc
  19. 335
      infra/libkookie/home-manager-stable/docs/installation.adoc
  20. 40
      infra/libkookie/home-manager-stable/docs/man-configuration.xml
  21. 634
      infra/libkookie/home-manager-stable/docs/man-home-manager.xml
  22. 12
      infra/libkookie/home-manager-stable/docs/man-pages.xml
  23. 56
      infra/libkookie/home-manager-stable/docs/manual.xml
  24. 223
      infra/libkookie/home-manager-stable/docs/nix-flakes.adoc
  25. 25
      infra/libkookie/home-manager-stable/docs/release-notes/release-notes.adoc
  26. 4
      infra/libkookie/home-manager-stable/docs/release-notes/rl-1809.adoc
  27. 59
      infra/libkookie/home-manager-stable/docs/release-notes/rl-1903.adoc
  28. 31
      infra/libkookie/home-manager-stable/docs/release-notes/rl-1909.adoc
  29. 126
      infra/libkookie/home-manager-stable/docs/release-notes/rl-2003.adoc
  30. 96
      infra/libkookie/home-manager-stable/docs/release-notes/rl-2009.adoc
  31. 200
      infra/libkookie/home-manager-stable/docs/release-notes/rl-2105.adoc
  32. 73
      infra/libkookie/home-manager-stable/docs/release-notes/rl-2111.adoc
  33. 44
      infra/libkookie/home-manager-stable/docs/release-notes/rl-2205.adoc
  34. 245
      infra/libkookie/home-manager-stable/docs/usage.adoc
  35. 187
      infra/libkookie/home-manager-stable/docs/writing-modules.adoc
  36. 60
      infra/libkookie/home-manager-stable/flake.nix
  37. 32
      infra/libkookie/home-manager-stable/format
  38. 366
      infra/libkookie/home-manager-stable/home-manager/completion.bash
  39. 70
      infra/libkookie/home-manager-stable/home-manager/completion.fish
  40. 73
      infra/libkookie/home-manager-stable/home-manager/completion.zsh
  41. 55
      infra/libkookie/home-manager-stable/home-manager/default.nix
  42. 736
      infra/libkookie/home-manager-stable/home-manager/home-manager
  43. 89
      infra/libkookie/home-manager-stable/home-manager/home-manager.nix
  44. 85
      infra/libkookie/home-manager-stable/home-manager/install.nix
  45. 189
      infra/libkookie/home-manager-stable/home-manager/po/de.po
  46. 185
      infra/libkookie/home-manager-stable/home-manager/po/es.po
  47. 169
      infra/libkookie/home-manager-stable/home-manager/po/fa.po
  48. 191
      infra/libkookie/home-manager-stable/home-manager/po/fr.po
  49. 167
      infra/libkookie/home-manager-stable/home-manager/po/home-manager.pot
  50. 185
      infra/libkookie/home-manager-stable/home-manager/po/it.po
  51. 186
      infra/libkookie/home-manager-stable/home-manager/po/ja.po
  52. 186
      infra/libkookie/home-manager-stable/home-manager/po/ko.po
  53. 172
      infra/libkookie/home-manager-stable/home-manager/po/nb_NO.po
  54. 191
      infra/libkookie/home-manager-stable/home-manager/po/pl.po
  55. 188
      infra/libkookie/home-manager-stable/home-manager/po/pt_BR.po
  56. 188
      infra/libkookie/home-manager-stable/home-manager/po/ru.po
  57. 183
      infra/libkookie/home-manager-stable/home-manager/po/sv.po
  58. 186
      infra/libkookie/home-manager-stable/home-manager/po/tr.po
  59. 180
      infra/libkookie/home-manager-stable/home-manager/po/zh_Hans.po
  60. 180
      infra/libkookie/home-manager-stable/home-manager/po/zh_Hant.po
  61. 41
      infra/libkookie/home-manager-stable/lib/bash/color-echo
  62. 85
      infra/libkookie/home-manager-stable/lib/bash/home-manager.sh
  63. 418
      infra/libkookie/home-manager-stable/modules/accounts/email.nix
  64. 156
      infra/libkookie/home-manager-stable/modules/config/home-cursor.nix
  65. 46
      infra/libkookie/home-manager-stable/modules/config/i18n.nix
  66. 66
      infra/libkookie/home-manager-stable/modules/default.nix
  67. 405
      infra/libkookie/home-manager-stable/modules/files.nix
  68. 715
      infra/libkookie/home-manager-stable/modules/home-environment.nix
  69. 106
      infra/libkookie/home-manager-stable/modules/i18n/input-method/default.nix
  70. 50
      infra/libkookie/home-manager-stable/modules/i18n/input-method/fcitx.nix
  71. 42
      infra/libkookie/home-manager-stable/modules/i18n/input-method/fcitx5.nix
  72. 23
      infra/libkookie/home-manager-stable/modules/i18n/input-method/hime.nix
  73. 59
      infra/libkookie/home-manager-stable/modules/i18n/input-method/kime.nix
  74. 23
      infra/libkookie/home-manager-stable/modules/i18n/input-method/nabi.nix
  75. 45
      infra/libkookie/home-manager-stable/modules/i18n/input-method/uim.nix
  76. 213
      infra/libkookie/home-manager-stable/modules/launchd/default.nix
  77. 869
      infra/libkookie/home-manager-stable/modules/launchd/launchd.nix
  78. 83
      infra/libkookie/home-manager-stable/modules/lib-bash/activation-init.sh
  79. 39
      infra/libkookie/home-manager-stable/modules/lib-bash/color-echo.sh
  80. 14
      infra/libkookie/home-manager-stable/modules/lib/assertions.nix
  81. 5
      infra/libkookie/home-manager-stable/modules/lib/booleans.nix
  82. 116
      infra/libkookie/home-manager-stable/modules/lib/dag.nix
  83. 29
      infra/libkookie/home-manager-stable/modules/lib/default.nix
  84. 116
      infra/libkookie/home-manager-stable/modules/lib/file-type.nix
  85. 159
      infra/libkookie/home-manager-stable/modules/lib/gvariant.nix
  86. 274
      infra/libkookie/home-manager-stable/modules/lib/maintainers.nix
  87. 11
      infra/libkookie/home-manager-stable/modules/lib/shell.nix
  88. 13
      infra/libkookie/home-manager-stable/modules/lib/stdlib-extended.nix
  89. 23
      infra/libkookie/home-manager-stable/modules/lib/strings.nix
  90. 106
      infra/libkookie/home-manager-stable/modules/lib/types-dag.nix
  91. 107
      infra/libkookie/home-manager-stable/modules/lib/types.nix
  92. 30
      infra/libkookie/home-manager-stable/modules/lib/zsh.nix
  93. 68
      infra/libkookie/home-manager-stable/modules/manual.nix
  94. 75
      infra/libkookie/home-manager-stable/modules/misc/dconf.nix
  95. 26
      infra/libkookie/home-manager-stable/modules/misc/debug.nix
  96. 95
      infra/libkookie/home-manager-stable/modules/misc/fontconfig.nix
  97. 273
      infra/libkookie/home-manager-stable/modules/misc/gtk.nix
  98. 14
      infra/libkookie/home-manager-stable/modules/misc/lib.nix
  99. 559
      infra/libkookie/home-manager-stable/modules/misc/news.nix
  100. 240
      infra/libkookie/home-manager-stable/modules/misc/nix.nix
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,468 @@
* @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/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

@ -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

@ -0,0 +1,46 @@
name: Bug Report
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: Is there an existing issue for this?
description: |
Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Issue description
description: |
Please describe the issue.
For support and help please use the IRC channel #home-manager at irc.oftc.net or
Matrix room <https://matrix.to/#/#hm:rycee.net> instead.
validations:
required: false
- type: textarea
attributes:
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
id: system
attributes:
label: System information
description: |
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
render: markdown
validations:
required: true

@ -0,0 +1,44 @@
### Description
<!--
Please provide a brief description of your change.
-->
### Checklist
<!--
Please go through the following checklist before opening a non-WIP
pull-request.
Also make sure to read the guidelines found at
https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-guidelines
-->
- [ ] Change is backwards compatible.
- [ ] Code formatted with `./format`.
- [ ] 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}
{long description}
```
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/068ff76a10e95820f886ac46957edcff4e44621d/modules/programs/lesspipe.nix#L6).
- [ ] Added myself and the module files to `.github/CODEOWNERS`.

@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "master"
schedule:
interval: "weekly"
commit-message:
prefix: "ci:"
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-21.11"
schedule:
interval: "weekly"
commit-message:
prefix: "ci:"

@ -0,0 +1,71 @@
# Configuration for probot-stale - https://github.com/probot/stale
daysUntilStale: 90
daysUntilClose: false
staleLabel: "status: stale"
issues:
markComment: |
<p>
Thank you for your contribution!
I marked this issue as stale due to inactivity.
Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'.
We welcome additional information that will help resolve this issue.
<b>Please read the relevant sections below before commenting.</b>
</p>
<details>
<summary><b>If you are the original author of the issue</b></summary>
<p>
* If this is resolved, please consider closing it so that the maintainers know not to focus on this.
* If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
</p>
</details>
<details>
<summary><b>If you are <i>not</i> the original author of the issue</b></summary>
<p>
* If you are also experiencing this issue, please add details of your situation to help with the debugging process.
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
</p>
</details>
<details>
<summary><b>Memorandum on closing issues</b></summary>
<p>
Don't be afraid to manually close an issue, even if it holds valuable information.
Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost!
Closing obsolete issues is an important way to help maintainers focus their time and effort.
</p>
</details>
pulls:
markComment: |
<p>
Thank you for your contribution!
I marked this pull request as stale due to inactivity.
<b>Please read the relevant sections below before commenting.</b>
</p>
<details>
<summary><b>If you are the original author of the PR</b></summary>
<p>
* GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. *If you have addressed the reviews* you can [officially ask for a review](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from those who commented to you or anyone else.
* If it is unfinished but you plan to finish it, please mark it as a draft.
* If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
* To get things rolling again, rebase the PR against the target branch and address valid comments.
</p>
</details>
<details>
<summary><b>If you are <i>not</i> the original author of the PR</b></summary>
<p>
* If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
</p>
</details>

@ -0,0 +1,28 @@
name: GitHub Pages
on:
push:
branches:
- master
jobs:
publish:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- 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

@ -0,0 +1,30 @@
name: Test
on:
pull_request:
schedule:
- cron: "30 2 * * *"
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- 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

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

@ -0,0 +1,41 @@
image: nixos/nix:latest
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:
- nix-build -A docs.html
- mkdir public
- cp -r ./result/share/doc/home-manager/* public/
artifacts:
paths:
- public
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

@ -0,0 +1,21 @@
MIT License
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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,20 @@
.PHONY: all all-tests test test-install format
NIXPKGS_REV := nixpkgs-unstable
NIX_PATH := nixpkgs=https://github.com/NixOS/nixpkgs/archive/${NIXPKGS_REV}.tar.gz
all: all-tests test-install
all-tests:
$(MAKE) test TEST=all
test:
ifndef TEST
$(error Use 'make test TEST=<test_name>' to run desired test)
endif
nix-shell --pure tests -I ${NIX_PATH} -A run.${TEST}
test-install:
HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install
format:
./format

@ -0,0 +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.
Usage
-----
Before attempting to use Home Manager please read the warning below.
For a systematic overview of Home Manager and its available options,
please see
- 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 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, 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.
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 22.05 (the
current stable version), it may or may not work on other Linux
distributions and NixOS versions.
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.
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][manual standalone install] in the manual
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 installation][manual nixos
install] in the manual for a description of this setup.
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.
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/).
<a href="https://hosted.weblate.org/engage/home-manager/">
<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).
[Nix]: https://nixos.org/explore.html
[NixOS]: https://nixos.org/
[Nixpkgs]: https://github.com/NixOS/nixpkgs
[manual]: https://nix-community.github.io/home-manager/index.html
[contributing]: https://nix-community.github.io/home-manager/#ch-contributing
[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

@ -0,0 +1,19 @@
{ pkgs ? import <nixpkgs> { } }:
rec {
docs = with import ./docs { inherit pkgs; }; {
html = manual.html;
manPages = manPages;
json = options.json;
jsonModuleMaintainers = jsonModuleMaintainers; # Unstable, mainly for CI.
};
home-manager = pkgs.callPackage ./home-manager { path = toString ./.; };
install =
pkgs.callPackage ./home-manager/install.nix { inherit home-manager; };
nixos = import ./nixos;
path = ./.;
}

@ -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

@ -0,0 +1,131 @@
{ pkgs
# Note, this should be "the standard library" + HM extensions.
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
let
nmdSrc = pkgs.fetchFromGitLab {
name = "nmd";
owner = "rycee";
repo = "nmd";
rev = "9e7a20e6ee3f6751f699f79c0b299390f81f7bcd";
sha256 = "1s49gjn1wapcjn0q4gabi8jwp8k5f18354a9c1vji0hfqsaknxzj";
};
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 (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
];
docBook = {
id = "nixos-options";
optionIdPrefix = "nixos-opt";
};
};
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 { };
};
};
in [
../nix-darwin/default.nix
mockedNixDarwin
(nixosModule "/misc/assertions.nix")
scrubbedPkgsModule
];
docBook = {
id = "nix-darwin-options";
optionIdPrefix = "nix-darwin-opt";
};
};
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 = {
json = hmModulesDocs.json.override {
path = "share/doc/home-manager/options.json";
};
};
manPages = docs.manPages;
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 ];
};
in builtins.toJSON result.config.meta.maintainers);
}

@ -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.

@ -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.

@ -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>

@ -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>

@ -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>2017–2022</year><holder>Home Manager contributors</holder>
</copyright>
</info>
<xi:include href="man-configuration.xml" />
<xi:include href="man-home-manager.xml" />
</reference>

@ -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>

@ -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>`.

@ -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

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

@ -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.

@ -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.

@ -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.

@ -0,0 +1,96 @@
[[sec-release-20.09]]
== Release 20.09
The 20.09 release branch became the stable branch in late September, 2020.
[[sec-release-20.09-highlights]]
=== Highlights
This release has the following notable changes:
* Nothing has happened.
[[sec-release-20.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
"20.09" or later.
* The options <<opt-home.homeDirectory>> and <<opt-home.username>> no
longer have default values and must therefore be provided in your
configuration. Previously their values would default to the content of
the environment variables `HOME` and `USER`, respectively.
+
--
Further, the options <<opt-xdg.cacheHome>>, <<opt-xdg.configHome>>,
and <<opt-xdg.dataHome>> will no longer be affected by the
`XDG_CACHE_HOME`, `XDG_CONFIG_HOME`, and `XDG_DATA_HOME` environment
variables. They now unconditionally default to
- `"${config.home.homeDirectory}/.cache"`,
- `"${config.home.homeDirectory}/.config"`, and
- `"${config.home.homeDirectory}/.local/share"`.
If you choose to switch to state version 20.09 then you must set these
options if you use non-default XDG base directory paths.
The initial configuration generated by
[source,console]
$ nix-shell '<home-manager>' -A install
will automatically include these options, when necessary.
--
* Git's `smtpEncryption` option is now set to `tls` only if both <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> and <<opt-accounts.email.accounts.\_name_.smtp.tls.useStartTls>> are `true`. If only <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> is `true`, `ssl` is used instead.
* The `nixpkgs` module no longer references `<nixpkgs>`. Before it would do so when building the `pkgs` module argument. Starting with state version 20.09, the `pkgs` argument is instead built from the same Nixpkgs that was used to initialize the Home Manager modules. This is useful, for example, when using Home Manager within a Nix Flake. If you want to keep using `<nixpkgs>` with state version ≥ 20.09 then add
+
[source,nix]
_module.args.pkgsPath = <nixpkgs>;
+
to your Home Manager configuration.
* The options `wayland.windowManager.sway.config.bars` and `opt-xsession.windowManager.i3.config.bars` have been changed so that most of the suboptions are now nullable and default to `null`. The default for these two options has been changed to manually set the old defaults for each suboption. The overall effect is that if the `bars` options is not set, then the default remains the same. On the other hand, something like:
+
--
[source,nix]
----
bars = [ {
command = "waybar";
} ];
----
will now create the config:
....
bar {
swaybar_command waybar
}
....
instead of
....
bar {
font pango:monospace 8
mode dock
hidden_state hide
position bottom
status_command /nix/store/h7s6i9q1z5fxrlyyw5ls8vqxhf5bcs5a-i3status-2.13/bin/i3status
swaybar_command waybar
workspace_buttons yes
strip_workspace_numbers no
tray_output primary
colors {
background #000000
statusline #ffffff
separator #666666
focused_workspace #4c7899 #285577 #ffffff
active_workspace #333333 #5f676a #ffffff
inactive_workspace #333333 #222222 #888888
urgent_workspace #2f343a #900000 #ffffff
binding_mode #2f343a #900000 #ffffff
}
}
....
--

@ -0,0 +1,200 @@
[[sec-release-21.05]]
== Release 21.05
The 21.05 release branch became the stable branch in May, 2021.
[[sec-release-21.05-highlights]]
=== Highlights
This release has the following notable changes:
* The <<opt-programs.broot.verbs>> option is now a list rather than an
attribute set. To migrate, move the keys of the attrset into the list
items' `invocation` keys. For example,
+
[source,nix]
----
programs.broot.verbs = {
"p" = { execution = ":parent"; };
};
----
+
becomes
+
[source,nix]
----
programs.broot.verbs = [
{
invocation = "p";
execution = ":parent";
}
];
----
* The <<opt-programs.mpv.package>> option has been changed to allow custom
derivations. The following configuration is now possible:
+
[source,nix]
----
programs.mpv.package = (pkgs.wrapMpv (pkgs.mpv-unwrapped.override {
vapoursynthSupport = true;
}) {
extraMakeWrapperArgs = [
"--prefix" "LD_LIBRARY_PATH" ":" "${pkgs.vapoursynth-mvtools}/lib/vapoursynth"
];
});
----
+
As a result of this change, <<opt-programs.mpv.package>> is no longer the
resulting derivation. Use the newly introduced `programs.mpv.finalPackage`
instead.
* The <<opt-programs.rofi.extraConfig>> option is now an attribute set rather
than a string. To migrate, move each line into the attribute set,
removing the `rofi.` prefix from the keys. For example,
+
[source,nix]
----
programs.rofi.extraConfig = ''
rofi.show-icons: true
rofi.modi: drun,emoji,ssh
'';
----
+
becomes
+
[source,nix]
----
programs.rofi.extraConfig = {
show-icons = true;
modi = "drun,emoji,ssh";
};
----
+
* The <<opt-programs.rofi.theme>> option now supports defining a theme
using an attribute set, the following configuration is now possible:
+
[source,nix]
----
programs.rofi.theme = let
# Necessary to avoid quoting non-string values
inherit (config.lib.formats.rasi) mkLiteral;
in {
"@import" = "~/.config/rofi/theme.rasi";
"*" = {
background-color = mkLiteral "#000000";
foreground-color = mkLiteral "rgba ( 250, 251, 252, 100 % )";
border-color = mkLiteral "#FFFFFF";
width = 512;
};
"#textbox-prompt-colon" = {
expand = false;
str = ":";
margin = mkLiteral "0px 0.3em 0em 0em";
text-color = mkLiteral "@foreground-color";
};
};
----
* The `services.redshift.extraOptions` and `services.gammastep.extraOptions`
options were removed in favor of <<opt-services.redshift.settings>> and
`services.gammastep.settings`, that are now an attribute set rather
than a string. They also support new features not available before, for
example:
+
[source,nix]
----
services.redshift = {
dawnTime = "6:00-7:45";
duskTime = "18:35-20:15";
settings = {
redshift = {
gamma = 0.8;
adjustment-method = "randr";
};
randr = {
screen = 0;
};
};
};
----
+
It is recommended to check either
https://github.com/jonls/redshift/blob/master/redshift.conf.sample[redshift.conf.sample] or
https://gitlab.com/chinstrap/gammastep/-/blob/master/gammastep.conf.sample[gammastep.conf.sample]
for the available additional options in each program.
* Specifying `programs.neomutt.binds.map` or `programs.neomutt.macros.map` as a
single string is now deprecated in favor of specfiying it as a list of
strings.
* The `programs.neovim.configure` is deprecated in favor of other `programs.neovim` options;
please use the other options at your disposal:
+
[source,nix]
----
configure.packages.*.opt -> programs.neovim.plugins = [ { plugin = ...; optional = true; }]
configure.packages.*.start -> programs.neovim.plugins = [ { plugin = ...; }]
configure.customRC -> programs.neovim.extraConfig
----
* Home Manager now respects the `NO_COLOR` environment variable as per
https://no-color.org/[].
* Qt module now supports <<opt-qt.style.name>> to specify a theme name and
<<opt-qt.style.package>> to specify a theme package. If you have set
<<opt-qt.platformTheme>> to `gnome`, a <<opt-qt.style.package>> compatible
with both Qt and Gtk is now required to be set. For instance:
+
[source,nix]
----
qt = {
platformTheme = "gnome";
style = {
name = "adwaita-dark";
package = pkgs.adwaita-qt;
};
};
----
* The library type `fontType` now has a `size` attribute in addition to `name`. For example:
+
[source,nix]
----
font = {
name = "DejaVu Sans";
size = 8;
};
----
* The <<opt-programs.htop.settings>> option is introduced to replace individual
options in `programs.htop`. To migrate, set the htop options directly in
<<opt-programs.htop.settings>>. For example:
+
[source,nix]
----
programs.htop = {
enabled = true;
settings = {
color_scheme = 5;
delay = 15;
highlight_base_name = 1;
highlight_megabytes = 1;
highlight_threads = 1;
};
};
----
[[sec-release-21.05-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
"21.05" or later.
* The `newsboat` module now stores generated configuration in
`$XDG_CONFIG_HOME/newsboat`.

@ -0,0 +1,73 @@
[[sec-release-21.11]]
== Release 21.11
The 21.11 release branch became the stable branch in November, 2021.
[[sec-release-21.11-highlights]]
=== Highlights
This release has the following notable changes:
* All Home Manager modules are now loaded on all platforms. With this
change you will get a more descriptive error message if you attempt to
enable a module that is incompatible with the host platform.
+
Previously, modules that were platform specific would only be loaded
on that particular platform. For example, a module defining a
https://systemd.io/[systemd] service would only be loaded when the
host platform was Linux. This reduced evaluation times, simplified the
generated documentation, and made it impossible to accidentally use
modules that do not support the host platform.
+
While the above benefits are quite nice, avoiding module loads also
brings a few problems. For example, the
https://nix-community.github.io/home-manager/[public documentation]
will only show the options available for Linux hosts and the
documentation cannot make references to options within modules that
are unavailable on some hosts. Finally, users who wish to use the same
configuration file for different platforms cannot do so, even if the
platform incompatible options are unused.
+
Ultimately, the benefits of loading all modules won and the behavior
has now changed. For associated discussion see
https://github.com/nix-community/home-manager/issues/1906[issue #1906].
* Rofi version 1.7.0 removed many options that were used by the module and replaced them with custom themes, which are more flexible and powerful.
+
You can replicate your old configuration by moving those options to <<opt-programs.rofi.theme>>. Keep in mind that the syntax is different so you may need to do some changes.
* Taskwarrior version 2.6.0 respects XDG Specification for the config file now.
Option <<opt-programs.taskwarrior.config>> and friends now generate the config file at
`$XDG_CONFIG_HOME/task/taskrc` instead of `~/.taskrc`.
[[sec-release-21.11-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
"21.11" or later.
* The <<opt-home.keyboard>> option now defaults to `null`, meaning that Home Manager won't do any keyboard layout management. For example, `setxkbmap` won't be run in X sessions.
* The <<opt-programs.pet.settings>> option no longer place its value inside a `General` attribute.
For example,
+
[source,nix]
programs.pet.settings.editor = "nvim";
+
becomes
+
[source,nix]
programs.pet.settings.General.editor = "nvim";
* The <<opt-programs.waybar.settings>> option now allows defining modules directly under <<opt-programs.waybar.settings>>.
For example,
+
[source,nix]
programs.waybar.settings.modules."custom/my-module" = { };
+
becomes
+
[source,nix]
programs.waybar.settings."custom/my-module" = { };

@ -0,0 +1,44 @@
[[sec-release-22.05]]
== Release 22.05
The 22.05 release branch became the stable branch in May, 2022.
[[sec-release-22.05-highlights]]
=== Highlights
:hm-weblate: https://hosted.weblate.org/projects/home-manager/
This release has the following notable changes:
* The `programs.waybar.settings.modules` option was removed.
Waybar modules should now be declared directly under `programs.waybar.settings`.
* Home Manager now partially support translation of texts into different languages.
Note, the support is quite limited at the moment.
Specifically, it only applies to parts of the system written in the Bash language,
such as the `home-manager` command line tool and the activation script.
+
If you would like to contribute to the translation effort
then you can do so through the {hm-weblate}[Home Manager Weblate project].
* A new module, `launchd.agents` was added.
Use this to enable services based on macOS LaunchAgents.
[[sec-release-22.05-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 "22.05" or later.
* The <<opt-programs.waybar.settings>> option now allows defining modules directly under <<opt-programs.waybar.settings>>.
Defining modules under `programs.waybar.settings.modules` will now be an error.
For example,
+
[source,nix]
programs.waybar.settings.modules."custom/my-module" = { };
+
becomes
+
[source,nix]
programs.waybar.settings."custom/my-module" = { };

@ -0,0 +1,245 @@
[[ch-usage]]
== Using Home Manager
Your use of Home Manager is centered around the configuration file, which is typically found at `~/.config/nixpkgs/home.nix`.
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
[source,nix]
programs.emacs.enable = "yes";
then building it, for example using `home-manager build`, will result in an error message saying something like
[source,console]
----
$ home-manager build
error: A definition for option `programs.emacs.enable' is not of type `boolean'. Definition values:
- In `/home/jdoe/.config/nixpkgs/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 <<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 <<ch-options>> or directly in the terminal by running
[source,console]
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.
[[sec-usage-configuration]]
=== Configuration Example
A fresh install of Home Manager will generate a minimal `~/.config/nixpkgs/home.nix` file containing something like
[source,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 = "22.05";
# 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:
[source,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 = [ <1>
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 = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.emacs = { <2>
enable = true;
extraPackages = epkgs: [
epkgs.nix-mode
epkgs.magit
];
};
services.gpg-agent = { <3>
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
}
----
<1> Nixpkgs packages can be installed to the user profile using <<opt-home.packages>>.
<2> The option names of a program module typically start with `programs.<package name>`.
<3> 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
[source,console]
home-manager switch
or if you are not feeling so lucky,
[source,console]
home-manager build
which will create a `result` link to a directory containing an
activation script and the generated home directory files.
[[sec-usage-rollbacks]]
=== Rollbacks
While the `home-manager` tool does not explicitly support rollbacks at the moment it is relatively easy to perform one manually. The steps to do so are
1. Run `home-manager generations` to determine which generation you wish to rollback to:
+
[source,console]
----
$ home-manager generations
2018-01-04 11:56 : id 765 -> /nix/store/kahm1rxk77mnvd2l8pfvd4jkkffk5ijk-home-manager-generation
2018-01-03 10:29 : id 764 -> /nix/store/2wsmsliqr5yynqkdyjzb1y57pr5q2lsj-home-manager-generation
2018-01-01 12:21 : id 763 -> /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation
2017-12-29 21:03 : id 762 -> /nix/store/6c0k1r03fxckql4vgqcn9ccb616ynb94-home-manager-generation
2017-12-25 18:51 : id 761 -> /nix/store/czc5y6vi1rvnkfv83cs3rn84jarcgsgh-home-manager-generation
----
2. Copy the Nix store path of the generation you chose, e.g.,
+
----
/nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation
----
+
for generation 763.
3. Run the `activate` script inside the copied store path:
+
[source,console]
----
$ /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation/activate
Starting home manager activation
----
[[sec-usage-dotfiles]]
=== Keeping your ~ safe from harm
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
[source,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
[source,console]
----
$ home-manager switch
Activating checkLinkTargets
Existing file '/home/jdoe/.config/git/config' is in the way
Please move the above files and try again
----
[[sec-usage-graphical]]
=== Graphical services
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
[source,nix]
----
{
# …
services.xserver.enable = true;
# …
}
----
in your system configuration and
[source,nix]
----
{
# …
xsession.enable = true;
xsession.windowManager.command = "…";
# …
}
----
in your Home Manager configuration.
[[sec-updating]]
=== 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.
[source,console]
----
$ nix-channel --update
unpacking channels...
$ home-manager switch
----

@ -0,0 +1,187 @@
[[ch-writing-modules]]
== Writing Home Manager Modules
:writing-nixos-modules: https://nixos.org/nixos/manual/index.html#sec-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}[Writing NixOS Modules] chapter of the NixOS manual.
[[sec-option-types]]
=== Option Types
:wikipedia-dag: https://en.wikipedia.org/w/index.php?title=Directed_acyclic_graph&oldid=939656095
:gvariant-description: https://developer.gnome.org/glib/stable/glib-GVariant.html#glib-GVariant.description
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 <<opt-programs.ssh.matchBlocks>> and <<opt-dconf.settings>>.
`hm.types.dagOf`::
Options of this type have attribute sets as values where each member is a node in a {wikipedia-dag}[directed acyclic graph] (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 <<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`.
+
`hm.dag.entryAnywhere (value: T)`:::
Indicates that `value` can be placed anywhere within the DAG. This is also the default for plain attribute set entries, that is
+
[source,nix]
----
foo.bar = {
a = hm.dag.entryAnywhere 0;
}
----
+
and
+
[source,nix]
----
foo.bar = {
a = 0;
}
----
+
are equivalent.
+
`hm.dag.entryAfter (afters: list string) (value: T)`:::
Indicates that `value` must be placed _after_ each of the attribute names in the given list. For example
+
[source,nix]
----
foo.bar = {
a = 0;
b = hm.dag.entryAfter [ "a" ] 1;
}
----
+
would place `b` after `a` in the graph.
+
`hm.dag.entryBefore (befores: list string) (value: T)`:::
Indicates that `value` must be placed _before_ each of the attribute names in the given list. For example
+
[source,nix]
----
foo.bar = {
b = hm.dag.entryBefore [ "a" ] 1;
a = 0;
}
----
+
would place `b` before `a` in the graph.
+
`hm.dag.entryBetween (befores: list string) (afters: list string) (value: 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
+
[source,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.
`hm.types.gvariant`::
This type is useful for options representing {gvariant-description}[GVariant] values. The type accepts all primitive GVariant types as well as arrays and tuples. Dictionaries are not currently supported.
+
To create a GVariant value you can use a number of provided functions. Examples assume an option `foo.bar` of type `hm.types.gvariant`.
+
`hm.gvariant.mkBoolean (v: bool)`:::
Takes a Nix value `v` to a GVariant `boolean` value. Note, Nix booleans are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkBoolean true;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = true;
----
`hm.gvariant.mkString (v: string)`:::
Takes a Nix value `v` to a GVariant `string` value. Note, Nix strings are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkString "a string";
----
+
is equivalent to
+
[source,nix]
----
foo.bar = "a string";
----
`hm.gvariant.mkObjectpath (v: string)`:::
Takes a Nix value `v` to a GVariant `objectpath` value.
`hm.gvariant.mkUchar (v: string)`:::
Takes a Nix value `v` to a GVariant `uchar` value.
`hm.gvariant.mkInt16 (v: int)`:::
Takes a Nix value `v` to a GVariant `int16` value.
`hm.gvariant.mkUint16 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint16` value.
`hm.gvariant.mkInt32 (v: int)`:::
Takes a Nix value `v` to a GVariant `int32` value. Note, Nix integers are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkInt32 7;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = 7;
----
`hm.gvariant.mkUint32 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint32` value.
`hm.gvariant.mkInt64 (v: int)`:::
Takes a Nix value `v` to a GVariant `int64` value.
`hm.gvariant.mkUint64 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint64` value.
`hm.gvariant.mkDouble (v: double)`:::
Takes a Nix value `v` to a GVariant `double` value. Note, Nix floats are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkDouble 3.14;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = 3.14;
----
+
`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. The `type` value can be constructed using
+
--
- `hm.gvariant.type.string`
- `hm.gvariant.type.boolean`
- `hm.gvariant.type.uchar`
- `hm.gvariant.type.int16`
- `hm.gvariant.type.uint16`
- `hm.gvariant.type.int32`
- `hm.gvariant.type.uint32`
- `hm.gvariant.type.int64`
- `hm.gvariant.type.uint64`
- `hm.gvariant.type.double`
- `hm.gvariant.type.arrayOf type`
- `hm.gvariant.type.maybeOf type`
- `hm.gvariant.type.tupleOf types`
--
+
where `type` and `types` are themselves a type and list of types, respectively.
+
`hm.gvariant.mkEmptyArray type`:::
An alias of `hm.gvariant.mkArray type []`.
+
`hm.gvariant.mkNothing type`:::
Builds a GVariant maybe value whose (non-existent) element is of the given type. The `type` value is constructed as described for the `mkArray` function above.
+
`hm.gvariant.mkJust element`:::
Builds a GVariant maybe value containing the given GVariant element.
+
`hm.gvariant.mkTuple elements`:::
Builds a GVariant tuple containing the given list of elements, where each element is a GVariant value.

@ -0,0 +1,60 @@
{
description = "Home Manager for Nix";
outputs = { self, nixpkgs }:
let
# List of systems supported by home-manager binary
supportedSystems = with nixpkgs.lib.platforms; linux ++ darwin;
# Function to generate a set based on supported systems
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in rec {
nixosModules.home-manager = import ./nixos;
nixosModule = self.nixosModules.home-manager;
darwinModules.home-manager = import ./nix-darwin;
darwinModule = self.darwinModules.home-manager;
packages = forAllSystems (system:
let docs = import ./docs { pkgs = nixpkgsFor.${system}; };
in {
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
docs-html = docs.manual.html;
docs-manpages = docs.manPages;
docs-json = docs.options.json;
default = self.packages.${system}.home-manager;
});
# defaultPackage is deprecated as of Nix 2.7.0
defaultPackage = forAllSystems (system: self.packages.${system}.default);
apps = forAllSystems (system: {
home-manager = {
type = "app";
program = "${defaultPackage.${system}}/bin/home-manager";
};
});
defaultApp = forAllSystems (system: apps.${system}.home-manager);
lib = {
hm = import ./modules/lib { lib = nixpkgs.lib; };
homeManagerConfiguration = { configuration, system, homeDirectory
, username, extraModules ? [ ], extraSpecialArgs ? { }
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
, lib ? pkgs.lib, check ? true, stateVersion ? "20.09" }@args:
assert nixpkgs.lib.versionAtLeast stateVersion "20.09";
import ./modules {
inherit pkgs lib check extraSpecialArgs;
configuration = { ... }: {
imports = [ configuration ] ++ extraModules;
home = { inherit homeDirectory stateVersion username; };
nixpkgs = { inherit (pkgs) config overlays; };
};
};
};
};
}

@ -0,0 +1,32 @@
#! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/5edf5b60c3d8f82b5fc5e73e822b6f7460584945.tar.gz -i bash -p findutils nixfmt
CHECK_ARG=
case $1 in
-h)
echo "$0 [-c]"
;;
-c)
CHECK_ARG=-c
;;
esac
# The excludes are for files touched by open pull requests and we want
# to avoid merge conflicts.
find . -name '*.nix' \
! -path ./home-manager/home-manager.nix \
! -path ./modules/default.nix \
! -path ./modules/files.nix \
! -path ./modules/home-environment.nix \
! -path ./modules/launchd/launchd.nix \
! -path ./modules/lib/default.nix \
! -path ./modules/lib/file-type.nix \
! -path ./modules/manual.nix \
! -path ./modules/misc/news.nix \
! -path ./modules/programs/bash.nix \
! -path ./modules/programs/ssh.nix \
! -path ./modules/programs/zsh.nix \
! -path ./nix-darwin/default.nix \
! -path ./tests/default.nix \
-exec nixfmt $CHECK_ARG {} +

@ -0,0 +1,366 @@
#!/bin/env bash
##################################################
# « home-manager » command-line completion
#
# © 2019 "Sam Boosalis" <samboosalis@gmail.com>
#
# MIT License
#
##################################################
# Contributing:
# Compatibility — Bash 3.
#
# OSX won't update Bash 3 (last updated circa 2009) to Bash 4,
# and we'd like this completion script to work on both Linux and Mac.
#
# For example, OSX Yosemite (released circa 2014) ships with Bash 3:
#
# $ echo $BASH_VERSION
# 3.2
#
# While Ubuntu LTS 14.04 (a.k.a. Trusty, also released circa 2016)
# ships with the latest version, Bash 4 (updated circa 2016):
#
# $ echo $BASH_VERSION
# 4.3
#
# Testing
#
# (1) Invoke « shellcheck »
#
# * source: « https://github.com/koalaman/shellcheck »
# * run: « shellcheck ./share/bash-completion/completions/home-manager »
#
# (2) Interpret via Bash 3
#
# * run: « bash --noprofile --norc ./share/bash-completion/completions/home-manager »
#
##################################################
# Examples:
# $ home-manager <TAB>
#
# -A
# -I
# -f
# --file
# -h
# --help
# -n
# --dry-run
# -v
# --verbose
# build
# edit
# expire-generations
# generations
# help
# news
# option
# packages
# remove-generations
# switch
# uninstall
# $ home-manager e<TAB>
#
# edit
# expire-generations
# $ home-manager remove-generations 20<TAB>
#
# 200
# 201
# 202
# 203
##################################################
# Notes:
# « home-manager » Subcommands:
#
# help
# edit
# option
# build
# switch
# generations
# remove-generations
# expire-generations
# packages
# news
# uninstall
# « home-manager » Options:
#
# -b EXT
# -f FILE
# --file FILE
# -A ATTRIBUTE
# -I PATH
# -v
# --verbose
# -n
# --dry-run
# -h
# --help
# $ home-manager
#
# Usage: /home/sboo/.nix-profile/bin/home-manager [OPTION] COMMAND
#
# Options
#
# -f FILE The home configuration file.
# Default is '~/.config/nixpkgs/home.nix'.
# -A ATTRIBUTE Optional attribute that selects a configuration
# expression in the configuration file.
# -I PATH Add a path to the Nix expression search path.
# -b EXT Move existing files to new path rather than fail.
# -v Verbose output
# -n Do a dry run, only prints what actions would be taken
# -h Print this help
#
# Commands
#
# help Print this help
#
# edit Open the home configuration in $EDITOR
#
# option OPTION.NAME
# Inspect configuration option named OPTION.NAME.
#
# build Build configuration into result directory
#
# switch Build and activate configuration
#
# generations List all home environment generations
#
# remove-generations ID...
# Remove indicated generations. Use 'generations' command to
# find suitable generation numbers.
#
# expire-generations TIMESTAMP
# Remove generations older than TIMESTAMP where TIMESTAMP is
# interpreted as in the -d argument of the date tool. For
# example "-30 days" or "2018-01-01".
#
# packages List all packages installed in home-manager-path
#
# news Show news entries in a pager
#
# uninstall Remove Home Manager
#
##################################################
# Dependencies:
command -v home-manager >/dev/null
command -v grep >/dev/null
command -v sed >/dev/null
##################################################
# Code:
_home-manager_list-generation-identifiers ()
{
home-manager generations | sed -n -e 's/^................ : id \([[:alnum:]]\+\) -> .*/\1/p'
}
# NOTES
#
# (1) the « sed -n -e 's/.../.../p' » invocation:
#
# * the « -e '...' » option takes a Sed Script.
# * the « -n » option only prints when « .../p » would print.
# * the « s/xxx/yyy/ » Sed Script substitutes « yyy » whenever « xxx » is matched.
#
# (2) the « '^................ : id \([[:alnum:]]\+\) -> .*' » regular expression:
#
# * matches « 199 », for example, in the line « 2019-03-13 15:26 : id 199 -> /nix/store/mv619y9pzgsx3kndq0q7fjfvbqqdy5k8-home-manager-generation »
#
#
#------------------------------------------------#
# shellcheck disable=SC2120
_home-manager_list-nix-attributes ()
{
local HomeFile
local HomeAttrsString
# local HomeAttrsArray
# local HomeAttr
if [ -z "$1" ]
then
HomeFile=$(readlink -f "$(_home-manager_get-default-home-file)")
else
HomeFile="$1"
fi
HomeAttrsString=$(nix-instantiate --eval -E "let home = import ${HomeFile}; in (builtins.trace (builtins.toString (builtins.attrNames home)) null)" |& grep '^trace: ')
HomeAttrsString="${HomeAttrsString#trace: }"
echo "${HomeAttrsString}"
# IFS=" " read -ar HomeAttrsArray <<< "${HomeAttrsString}"
#
# local HomeAttr
# for HomeAttr in "${HomeAttrsArray[@]}"
# do
# echo "${HomeAttr}"
# done
}
# e.g.:
#
# $ nix-instantiate --eval -E 'let home = import /home/sboo/configuration/configs/nixpkgs/home-attrs.nix; in (builtins.trace (builtins.toString (builtins.attrNames home)) null)' 1>/dev/null
# trace: darwin linux
#
# $ _home-manager_list-nix-attributes
# linux darwin
#
#------------------------------------------------#
_home-manager_get-default-home-file ()
{
local HomeFileDefault
HomeFileDefault="$(_home-manager_xdg-get-config-home)/nixpkgs/home.nix"
echo "${HomeFileDefault}"
}
# e.g.:
#
# $ _home-manager_get-default-home-file
# ~/.config/nixpkgs/home.nix
#
##################################################
# XDG-BaseDirs:
_home-manager_xdg-get-config-home () {
echo "${XDG_CONFIG_HOME:-$HOME/.config}"
}
#------------------------------------------------#
_home-manager_xdg-get-data-home () {
echo "${XDG_DATA_HOME:-$HOME/.local/share}"
}
#------------------------------------------------#
_home-manager_xdg-get-cache-home () {
echo "${XDG_CACHE_HOME:-$HOME/.cache}"
}
##################################################
# shellcheck disable=SC2207
_home-manager_completions ()
{
#--------------------------#
local Subcommands
Subcommands=( "help" "edit" "option" "build" "instantiate" "switch" "generations" "remove-generations" "expire-generations" "packages" "news" "uninstall" )
# ^ « home-manager »'s subcommands.
#--------------------------#
local Options
Options=( "-f" "--file" "-b" "-A" "-I" "-h" "--help" "-n" "--dry-run" "-v" \
"--verbose" "--cores" "--debug" "--impure" "--keep-failed" \
"--keep-going" "-j" "--max-jobs" "--no-substitute" "--no-out-link" \
"--show-trace" "--substitute" "--builders" "--version" \
"--update-input" "--override-input" "--experimental-features" \
"--extra-experimental-features" )
# ^ « home-manager »'s options.
#--------------------------#
local CurrentWord
CurrentWord="${COMP_WORDS[$COMP_CWORD]}"
# ^ the word currently being completed
local PreviousWord
if [ "$COMP_CWORD" -ge 1 ]
then
PreviousWord="${COMP_WORDS[COMP_CWORD-1]}"
else
PreviousWord=""
fi
# ^ the word to the left of the current word.
#
# e.g. in « home-manager -v -f ./<TAB> »:
#
# PreviousWord="-f"
# CurrentWord="./"
#--------------------------#
COMPREPLY=()
case "$PreviousWord" in
"-f"|"--file")
COMPREPLY+=( $( compgen -A file -- "$CurrentWord") )
;;
"-I")
COMPREPLY+=( $( compgen -A directory -- "$CurrentWord") )
;;
"-A")
# shellcheck disable=SC2119
COMPREPLY+=( $( compgen -W "$(_home-manager_list-nix-attributes)" -- "$CurrentWord") )
;;
"remove-generations")
COMPREPLY+=( $( compgen -W "$(_home-manager_list-generation-identifiers)" -- "$CurrentWord" ) )
;;
*)
COMPREPLY+=( $( compgen -W "${Subcommands[*]}" -- "$CurrentWord" ) )
COMPREPLY+=( $( compgen -W "${Options[*]}" -- "$CurrentWord" ) )
;;
esac
#--------------------------#
}
##################################################
complete -F _home-manager_completions -o default home-manager
#complete -W "help edit option build switch generations remove-generations expire-generations packages news" home-manager

@ -0,0 +1,70 @@
#!/bin/env fish
##################################################
# « home-manager » command-line fish completion
#
# © 2021 "Ariel AxionL" <i at axionl dot me>
#
# MIT License
#
##################################################
### Functions
function __home_manager_generations --description "Get all generations"
for i in (home-manager generations)
set -l split (string split " " $i)
set -l gen_id $split[5]
set -l gen_datetime $split[1..2]
set -l gen_hash (string match -r '\w{32}' $i)
echo $gen_id\t$gen_datetime $gen_hash
end
end
### SubCommands
complete -c home-manager -n "__fish_use_subcommand" -f -a "help" -d "Print home-manager help"
complete -c home-manager -n "__fish_use_subcommand" -f -a "edit" -d "Open the home configuration in $EDITOR"
complete -c home-manager -n "__fish_use_subcommand" -f -a "option" -d "Inspect configuration option"
complete -c home-manager -n "__fish_use_subcommand" -f -a "build" -d "Build configuration into result directory"
complete -c home-manager -n "__fish_use_subcommand" -f -a "instantiate" -d "Instantiate the configuration and print the resulting derivation"
complete -c home-manager -n "__fish_use_subcommand" -f -a "switch" -d "Build and activate configuration"
complete -c home-manager -n "__fish_use_subcommand" -f -a "generations" -d "List all home environment generations"
complete -c home-manager -n "__fish_use_subcommand" -f -a "packages" -d "List all packages installed in home-manager-path"
complete -c home-manager -n "__fish_use_subcommand" -f -a "news" -d "Show news entries in a pager"
complete -c home-manager -n "__fish_use_subcommand" -f -a "uninstall" -d "Remove Home Manager"
complete -c home-manager -n "__fish_use_subcommand" -x -a "remove-generations" -d "Remove indicated generations"
complete -c home-manager -n "__fish_seen_subcommand_from remove-generations" -f -ka '(__home_manager_generations)'
complete -c home-manager -n "__fish_use_subcommand" -x -a "expire-generations" -d "Remove generations older than TIMESTAMP"
### Options
complete -c home-manager -F -s f -l "file" -d "The home configuration file"
complete -c home-manager -x -s A -d "Select an expression in the configuration file"
complete -c home-manager -F -s I -d "Add a path to the Nix expression search path"
complete -c home-manager -F -l "flake" -d "Use Home Manager configuration at specified flake-uri"
complete -c home-manager -F -s b -d "Move existing files to new path rather than fail"
complete -c home-manager -f -s v -l "verbose" -d "Verbose output"
complete -c home-manager -f -s n -l "dry-run" -d "Do a dry run, only prints what actions would be taken"
complete -c home-manager -f -s h -l "help" -d "Print this help"
complete -c home-manager -f -s h -l "version" -d "Print the Home Manager version"
complete -c home-manager -x -l "arg" -d "Override inputs passed to home-manager.nix"
complete -c home-manager -x -l "argstr" -d "Like --arg but the value is a string"
complete -c home-manager -x -l "cores" -d "Threads per job (e.g. -j argument to make)"
complete -c home-manager -x -l "debug"
complete -c home-manager -x -l "impure"
complete -c home-manager -f -l "keep-failed" -d "Keep temporary directory used by failed builds"
complete -c home-manager -f -l "keep-going" -d "Keep going in case of failed builds"
complete -c home-manager -x -s j -l "max-jobs" -d "Max number of build jobs in parallel"
complete -c home-manager -x -l "option" -d "Set Nix configuration option"
complete -c home-manager -x -l "builders" -d "Remote builders"
complete -c home-manager -f -l "show-trace" -d "Print stack trace of evaluation errors"
complete -c home-manager -f -l "substitute"
complete -c home-manager -f -l "no-substitute"
complete -c home-manager -f -l "no-out-link"
complete -c home-manager -f -l "update-input"
complete -c home-manager -f -l "override-input"
complete -c home-manager -f -l "experimental-features"
complete -c home-manager -f -l "extra-experimental-features"

@ -0,0 +1,73 @@
#compdef home-manager
local state ret=1
_arguments \
'-A[attribute]:ATTRIBUTE:()' \
'-I[search path]:PATH:_files -/' \
'-b[backup files]:EXT:()' \
'--cores[cores]:NUM:()' \
'--debug[debug]' \
'--impure[impure]' \
'--keep-failed[keep failed]' \
'--keep-going[keep going]' \
'--version[version]' \
'(-h --help)'{--help,-h}'[help]' \
'(-v --verbose)'{--verbose,-v}'[verbose]' \
'(-n --dry-run)'{--dry-run,-n}'[dry run]' \
'(-f --file)'{--file,-f}'[configuration file]:FILE:_files' \
'(-j --max-jobs)'{--max-jobs,-j}'[max jobs]:NUM:()' \
'--option[option]:NAME VALUE:()' \
'--builders[builders]:SPEC:()' \
'--show-trace[show trace]' \
'--override-input[override flake input]:NAME VALUE:()' \
'--update-input[update flake input]:NAME:()' \
'--experimental-features[set experimental Nix features]:VALUE:()' \
'--extra-experimental-features:[append to experimental Nix features]:VALUE:()' \
'1: :->cmds' \
'*:: :->args' && ret=0
case "$state" in
cmds)
_values 'command' \
'help[help]' \
'edit[edit]' \
'option[inspect option]' \
'build[build]' \
'switch[switch]' \
'generations[list generations]' \
'remove-generations[remove generations]' \
'expire-generations[expire generations]' \
'packages[managed packages]' \
'news[read the news]' \
'uninstall[uninstall]' && ret=0
;;
args)
case $line[1] in
remove-generations)
_values 'generations' \
$(home-manager generations | cut -d ' ' -f 5) && ret=0
;;
build|switch)
_arguments \
'--cores[cores]:NUM:()' \
'--debug[debug]' \
'--impure[impure]' \
'--keep-failed[keep failed]' \
'--keep-going[keep going]' \
'--max-jobs[max jobs]:NUM:()' \
'--no-out-link[no out link]' \
'--no-substitute[no substitute]' \
'--option[option]:NAME VALUE:()' \
'--show-trace[show trace]' \
'--substitute[substitute]' \
'--builders[builders]:SPEC:()' \
'--override-input[override flake input]:NAME VALUE:()' \
'--update-input[update flake input]:NAME:()' \
'--experimental-features[set experimental Nix features]:VALUE:()' \
'--extra-experimental-features:[append to experimental Nix features]:VALUE:()'
;;
esac
esac
return ret

@ -0,0 +1,55 @@
{ runCommand, lib, bash, callPackage, coreutils, findutils, gettext, gnused
, less
# used for pkgs.path for nixos-option
, pkgs
# Extra path to Home Manager. If set then this path will be tried
# before `$HOME/.config/nixpkgs/home-manager` and
# `$HOME/.nixpkgs/home-manager`.
, path ? null }:
let
pathStr = if path == null then "" else path;
nixos-option = pkgs.nixos-option or (callPackage
(pkgs.path + "/nixos/modules/installer/tools/nixos-option") { });
in runCommand "home-manager" {
preferLocalBuild = true;
nativeBuildInputs = [ gettext ];
meta = with lib; {
description = "A user environment configurator";
maintainers = [ maintainers.rycee ];
platforms = platforms.unix;
license = licenses.mit;
};
} ''
install -v -D -m755 ${./home-manager} $out/bin/home-manager
substituteInPlace $out/bin/home-manager \
--subst-var-by bash "${bash}" \
--subst-var-by DEP_PATH "${
lib.makeBinPath [ coreutils findutils gettext gnused less nixos-option ]
}" \
--subst-var-by HOME_MANAGER_LIB '${../lib/bash/home-manager.sh}' \
--subst-var-by HOME_MANAGER_PATH '${pathStr}' \
--subst-var-by OUT "$out"
install -D -m755 ${./completion.bash} \
$out/share/bash-completion/completions/home-manager
install -D -m755 ${./completion.zsh} \
$out/share/zsh/site-functions/_home-manager
install -D -m755 ${./completion.fish} \
$out/share/fish/vendor_completions.d/home-manager.fish
install -D -m755 ${../lib/bash/home-manager.sh} \
"$out/share/bash/home-manager.sh"
for path in ${./po}/*.po; do
lang="''${path##*/}"
lang="''${lang%%.*}"
mkdir -p "$out/share/locale/$lang/LC_MESSAGES"
msgfmt -o "$out/share/locale/$lang/LC_MESSAGES/home-manager.mo" "$path"
done
''

@ -0,0 +1,736 @@
#!@bash@/bin/bash
# Prepare to use tools from Nixpkgs.
PATH=@DEP_PATH@${PATH:+:}$PATH
set -euo pipefail
export TEXTDOMAIN=home-manager
export TEXTDOMAINDIR=@OUT@/share/locale
# shellcheck disable=1091
source @HOME_MANAGER_LIB@
function removeByName() {
nix profile list \
| { grep "$1" || test $? = 1; } \
| cut -d ' ' -f 4 \
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
}
function setNixProfileCommands() {
if [[ -e ~/.nix-profile/manifest.json ]] ; then
LIST_OUTPATH_CMD="nix profile list"
REMOVE_CMD="removeByName"
else
LIST_OUTPATH_CMD="nix-env -q --out-path"
REMOVE_CMD="nix-env -q"
fi
}
function setVerboseAndDryRun() {
if [[ -v VERBOSE ]]; then
export VERBOSE_ARG="--verbose"
else
export VERBOSE_ARG=""
fi
if [[ -v DRY_RUN ]] ; then
export DRY_RUN_CMD=echo
else
export DRY_RUN_CMD=""
fi
}
function setWorkDir() {
if [[ ! -v WORK_DIR ]]; then
WORK_DIR="$(mktemp --tmpdir -d home-manager-build.XXXXXXXXXX)"
# shellcheck disable=2064
trap "rm -r '$WORK_DIR'" EXIT
fi
}
# Attempts to set the HOME_MANAGER_CONFIG global variable.
#
# If no configuration file can be found then this function will print
# an error message and exit with an error code.
function setConfigFile() {
if [[ -v HOME_MANAGER_CONFIG ]] ; then
if [[ ! -e "$HOME_MANAGER_CONFIG" ]] ; then
_i "No configuration file found at %s" \
"$HOME_MANAGER_CONFIG" >&2
exit 1
fi
HOME_MANAGER_CONFIG="$(realpath "$HOME_MANAGER_CONFIG")"
return
fi
local defaultConfFile="${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix"
local confFile
for confFile in "$defaultConfFile" \
"$HOME/.nixpkgs/home.nix" ; do
if [[ -e "$confFile" ]] ; then
HOME_MANAGER_CONFIG="$(realpath "$confFile")"
return
fi
done
_i "No configuration file found. Please create one at %s" \
"$defaultConfFile" >&2
exit 1
}
function setHomeManagerNixPath() {
local path
for path in "@HOME_MANAGER_PATH@" \
"${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home-manager" \
"$HOME/.nixpkgs/home-manager" ; do
if [[ -e "$path" || "$path" =~ ^https?:// ]] ; then
export NIX_PATH="home-manager=$path${NIX_PATH:+:}$NIX_PATH"
return
fi
done
}
function setFlakeAttribute() {
local configFlake="${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/flake.nix"
if [[ -z $FLAKE_ARG && ! -v HOME_MANAGER_CONFIG && -e "$configFlake" ]]; then
FLAKE_ARG="$(dirname "$(readlink -f "$configFlake")")"
fi
if [[ -n "$FLAKE_ARG" ]]; then
local flake="${FLAKE_ARG%#*}"
case $FLAKE_ARG in
*#*)
local name="${FLAKE_ARG#*#}"
;;
*)
local name="$USER@$(hostname)"
if [ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$name\"")" = "false" ]; then
name="$USER"
fi
;;
esac
export FLAKE_CONFIG_URI="$flake#homeConfigurations.\"$name\""
fi
}
function doInspectOption() {
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
_iError "Can't inspect options of a flake configuration"
exit 1
fi
setConfigFile
setHomeManagerNixPath
local extraArgs=("$@")
for p in "${EXTRA_NIX_PATH[@]}"; do
extraArgs=("${extraArgs[@]}" "-I" "$p")
done
if [[ -v VERBOSE ]]; then
extraArgs=("${extraArgs[@]}" "--show-trace")
fi
local HOME_MANAGER_CONFIG_NIX HOME_MANAGER_CONFIG_ATTRIBUTE_NIX
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG//'\'/'\\'}
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//'"'/'\"'}
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//$'\n'/$'\\n'}
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE//'\'/'\\'}
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//'"'/'\"'}
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//$'\n'/$'\\n'}
local modulesExpr
modulesExpr="let confPath = \"${HOME_MANAGER_CONFIG_NIX}\"; "
modulesExpr+="confAttr = \"${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX}\"; in "
modulesExpr+="(import <home-manager/modules> {"
modulesExpr+=" configuration = if confAttr == \"\" then confPath else (import confPath).\${confAttr};"
modulesExpr+=" pkgs = import <nixpkgs> {}; check = true; })"
nixos-option \
--options_expr "$modulesExpr.options" \
--config_expr "$modulesExpr.config" \
"${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}"
}
function doInstantiate() {
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
_i "Can't instantiate a flake configuration" >&2
exit 1
fi
setConfigFile
setHomeManagerNixPath
local extraArgs=()
for p in "${EXTRA_NIX_PATH[@]}"; do
extraArgs=("${extraArgs[@]}" "-I" "$p")
done
if [[ -v VERBOSE ]]; then
extraArgs=("${extraArgs[@]}" "--show-trace")
fi
nix-instantiate \
"<home-manager/home-manager/home-manager.nix>" \
"${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}" \
--argstr confPath "$HOME_MANAGER_CONFIG" \
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
}
function doBuildAttr() {
setConfigFile
setHomeManagerNixPath
local extraArgs=("$@")
for p in "${EXTRA_NIX_PATH[@]}"; do
extraArgs=("${extraArgs[@]}" "-I" "$p")
done
if [[ -v VERBOSE ]]; then
extraArgs=("${extraArgs[@]}" "--show-trace")
fi
nix-build \
"<home-manager/home-manager/home-manager.nix>" \
"${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}" \
--argstr confPath "$HOME_MANAGER_CONFIG" \
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
}
function doBuildFlake() {
local extraArgs=("$@")
if [[ -v VERBOSE ]]; then
extraArgs=("${extraArgs[@]}" "--verbose")
fi
nix build \
"${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}"
}
# Presents news to the user. Takes as argument the path to a "news
# info" file as generated by `buildNews`.
function presentNews() {
local infoFile="$1"
# shellcheck source=/dev/null
. "$infoFile"
# shellcheck disable=2154
if [[ $newsNumUnread -eq 0 ]]; then
return
elif [[ "$newsDisplay" == "silent" ]]; then
return
elif [[ "$newsDisplay" == "notify" ]]; then
local cmd msg
cmd="$(basename "$0")"
msg="$(_ip \
$'There is %d unread and relevant news item.\nRead it by running the command "%s news".' \
$'There are %d unread and relevant news items.\nRead them by running the command "%s news".' \
"$newsNumUnread" "$newsNumUnread" "$cmd")"
# Not actually an error but here stdout is reserved for
# nix-build output.
echo $'\n'"$msg"$'\n' >&2
if [[ -v DISPLAY ]] && type -P notify-send > /dev/null; then
notify-send "Home Manager" "$msg"
fi
elif [[ "$newsDisplay" == "show" ]]; then
doShowNews --unread
else
_i 'Unknown "news.display" setting "%s".' "$newsDisplay" >&2
fi
}
function doEdit() {
if [[ ! -v EDITOR || -z $EDITOR ]]; then
# shellcheck disable=2016
_i 'Please set the $EDITOR environment variable' >&2
return 1
fi
setConfigFile
# Don't quote $EDITOR in order to support values including options, e.g.,
# "code --wait".
#
# shellcheck disable=2086
exec $EDITOR "$HOME_MANAGER_CONFIG"
}
function doBuild() {
if [[ ! -w . ]]; then
_i 'Cannot run build in read-only directory' >&2
return 1
fi
setWorkDir
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
doBuildFlake \
"$FLAKE_CONFIG_URI.activationPackage" \
${DRY_RUN+--dry-run} \
${NO_OUT_LINK+--no-link} \
|| return
else
doBuildAttr \
${NO_OUT_LINK+--no-out-link} \
--attr activationPackage \
|| return
local newsInfo
newsInfo=$(buildNews)
presentNews "$newsInfo"
fi
}
function doSwitch() {
setWorkDir
local generation
# Build the generation and run the activate script. Note, we
# specify an output link so that it is treated as a GC root. This
# prevents an unfortunately timed GC from removing the generation
# before activation completes.
generation="$WORK_DIR/generation"
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
doBuildFlake \
"$FLAKE_CONFIG_URI.activationPackage" \
--out-link "$generation" \
&& "$generation/activate" || return
else
doBuildAttr \
--out-link "$generation" \
--attr activationPackage \
&& "$generation/activate" || return
local newsInfo
newsInfo=$(buildNews)
presentNews "$newsInfo"
fi
}
function doListGens() {
# Whether to colorize the generations output.
local color="never"
if [[ ! -v NO_COLOR && -t 1 ]]; then
color="always"
fi
pushd "$NIX_STATE_DIR/profiles/per-user/$USER" > /dev/null
# shellcheck disable=2012
ls --color=$color -gG --time-style=long-iso --sort time home-manager-*-link \
| cut -d' ' -f 4- \
| sed -E 's/home-manager-([[:digit:]]*)-link/: id \1/'
popd > /dev/null
}
# Removes linked generations. Takes as arguments identifiers of
# generations to remove.
function doRmGenerations() {
setVerboseAndDryRun
pushd "$NIX_STATE_DIR/profiles/per-user/$USER" > /dev/null
for generationId in "$@"; do
local linkName="home-manager-$generationId-link"
if [[ ! -e $linkName ]]; then
_i 'No generation with ID %s' "$generationId" >&2
elif [[ $linkName == $(readlink home-manager) ]]; then
_i 'Cannot remove the current generation %s' "$generationId" >&2
else
_i 'Removing generation %s' "$generationId"
$DRY_RUN_CMD rm $VERBOSE_ARG $linkName
fi
done
popd > /dev/null
}
function doRmAllGenerations() {
$DRY_RUN_CMD rm $VERBOSE_ARG \
"$NIX_STATE_DIR/profiles/per-user/$USER/home-manager"*
}
function doExpireGenerations() {
local profileDir="$NIX_STATE_DIR/profiles/per-user/$USER"
local generations
generations="$( \
find "$profileDir" -name 'home-manager-*-link' -not -newermt "$1" \
| sed 's/^.*-\([0-9]*\)-link$/\1/' \
)"
if [[ -n $generations ]]; then
# shellcheck disable=2086
doRmGenerations $generations
elif [[ -v VERBOSE ]]; then
_i "No generations to expire"
fi
}
function doListPackages() {
setNixProfileCommands
local outPath
outPath="$($LIST_OUTPATH_CMD | grep -o '/.*home-manager-path$')"
if [[ -n "$outPath" ]] ; then
nix-store -q --references "$outPath" | sed 's/[^-]*-//'
else
_i 'No home-manager packages seem to be installed.' >&2
fi
}
function newsReadIdsFile() {
local dataDir="${XDG_DATA_HOME:-$HOME/.local/share}/home-manager"
local path="$dataDir/news-read-ids"
# If the path doesn't exist then we should create it, otherwise
# Nix will error out when we attempt to use builtins.readFile.
if [[ ! -f "$path" ]]; then
mkdir -p "$dataDir"
touch "$path"
fi
echo "$path"
}
# Builds news meta information to be sourced into this script.
#
# Note, we suppress build output to remove unnecessary verbosity. We
# put the output in the work directory to avoid the risk of an
# unfortunately timed GC removing it.
function buildNews() {
local output
output="$WORK_DIR/news-info.sh"
doBuildAttr \
--out-link "$output" \
--no-build-output \
--quiet \
--arg check false \
--argstr newsReadIdsFile "$(newsReadIdsFile)" \
--attr newsInfo \
> /dev/null
echo "$output"
}
function doShowNews() {
setWorkDir
local infoFile
infoFile=$(buildNews) || return 1
# shellcheck source=/dev/null
. "$infoFile"
# shellcheck disable=2154
case $1 in
--all)
${PAGER:-less} "$newsFileAll"
;;
--unread)
${PAGER:-less} "$newsFileUnread"
;;
*)
_i 'Unknown argument %s' "$1"
return 1
esac
# shellcheck disable=2154
if [[ -s "$newsUnreadIdsFile" ]]; then
local newsReadIdsFile
newsReadIdsFile="$(newsReadIdsFile)"
cat "$newsUnreadIdsFile" >> "$newsReadIdsFile"
fi
}
function doUninstall() {
setVerboseAndDryRun
setNixProfileCommands
_i 'This will remove Home Manager from your system.'
if [[ -v DRY_RUN ]]; then
_i 'This is a dry run, nothing will actually be uninstalled.'
fi
local confirmation
read -r -n 1 -p "$(_i 'Really uninstall Home Manager?') [y/n] " confirmation
echo
case $confirmation in
y|Y)
_i "Switching to empty Home Manager configuration..."
HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)"
echo "{ lib, ... }: { home.file = lib.mkForce {}; }" > "$HOME_MANAGER_CONFIG"
doSwitch
$DRY_RUN_CMD $REMOVE_CMD home-manager-path || true
rm "$HOME_MANAGER_CONFIG"
$DRY_RUN_CMD rm $VERBOSE_ARG -r \
"${XDG_DATA_HOME:-$HOME/.local/share}/home-manager"
$DRY_RUN_CMD rm $VERBOSE_ARG \
"$NIX_STATE_DIR/gcroots/per-user/$USER/current-home"
;;
*)
_i "Yay!"
exit 0
;;
esac
local deleteProfiles
read -r -n 1 \
-p "$(_i 'Remove all Home Manager generations?') [y/n] " \
deleteProfiles
echo
case $deleteProfiles in
y|Y)
doRmAllGenerations
_i 'All generations are now eligible for garbage collection.'
;;
*)
_i 'Leaving generations but they may still be garbage collected.'
;;
esac
_i "Home Manager is uninstalled but your home.nix is left untouched."
}
function doHelp() {
echo "Usage: $0 [OPTION] COMMAND"
echo
echo "Options"
echo
echo " -f FILE The home configuration file."
echo " Default is '~/.config/nixpkgs/home.nix'."
echo " -A ATTRIBUTE Optional attribute that selects a configuration"
echo " expression in the configuration file."
echo " -I PATH Add a path to the Nix expression search path."
echo " --flake flake-uri Use Home Manager configuration at flake-uri"
echo " -b EXT Move existing files to new path rather than fail."
echo " -v Verbose output"
echo " -n Do a dry run, only prints what actions would be taken"
echo " -h Print this help"
echo " --version Print the Home Manager version"
echo
echo "Options passed on to nix-build(1)"
echo
echo " --arg(str) NAME VALUE Override inputs passed to home-manager.nix"
echo " --cores NUM"
echo " --debug"
echo " --impure"
echo " --keep-failed"
echo " --keep-going"
echo " -j, --max-jobs NUM"
echo " --option NAME VALUE"
echo " --show-trace"
echo " --(no-)substitute"
echo " --no-out-link Do not create a symlink to the output path"
echo " --no-write-lock-file"
echo " --builders VALUE"
echo
echo "Commands"
echo
echo " help Print this help"
echo
echo " edit Open the home configuration in \$EDITOR"
echo
echo " option OPTION.NAME"
echo " Inspect configuration option named OPTION.NAME."
echo
echo " build Build configuration into result directory"
echo
echo " instantiate Instantiate the configuration and print the resulting derivation"
echo
echo " switch Build and activate configuration"
echo
echo " generations List all home environment generations"
echo
echo " remove-generations ID..."
echo " Remove indicated generations. Use 'generations' command to"
echo " find suitable generation numbers."
echo
echo " expire-generations TIMESTAMP"
echo " Remove generations older than TIMESTAMP where TIMESTAMP is"
echo " interpreted as in the -d argument of the date tool. For"
echo " example \"-30 days\" or \"2018-01-01\"."
echo
echo " packages List all packages installed in home-manager-path"
echo
echo " news Show news entries in a pager"
echo
echo " uninstall Remove Home Manager"
}
readonly NIX_STATE_DIR="${NIX_STATE_DIR:-/nix/var/nix}"
EXTRA_NIX_PATH=()
HOME_MANAGER_CONFIG_ATTRIBUTE=""
PASSTHROUGH_OPTS=()
COMMAND=""
COMMAND_ARGS=()
FLAKE_ARG=""
while [[ $# -gt 0 ]]; do
opt="$1"
shift
case $opt in
build|instantiate|option|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
COMMAND="$opt"
;;
-A)
HOME_MANAGER_CONFIG_ATTRIBUTE="$1"
shift
;;
-I)
EXTRA_NIX_PATH+=("$1")
shift
;;
-b)
export HOME_MANAGER_BACKUP_EXT="$1"
shift
;;
-f|--file)
HOME_MANAGER_CONFIG="$1"
shift
;;
--flake)
FLAKE_ARG="$1"
shift
;;
--recreate-lock-file|--no-update-lock-file|--no-write-lock-file|--no-registries|--commit-lock-file)
PASSTHROUGH_OPTS+=("$opt")
;;
--update-input)
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--override-input)
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
shift 2
;;
--experimental-features)
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--extra-experimental-features)
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--no-out-link)
NO_OUT_LINK=1
;;
-h|--help)
doHelp
exit 0
;;
-n|--dry-run)
export DRY_RUN=1
;;
--option|--arg|--argstr)
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
shift 2
;;
-j|--max-jobs|--cores|--builders)
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--debug|--keep-failed|--keep-going|--show-trace\
|--substitute|--no-substitute|--impure)
PASSTHROUGH_OPTS+=("$opt")
;;
-v|--verbose)
export VERBOSE=1
;;
--version)
echo 22.05
exit 0
;;
*)
case $COMMAND in
expire-generations|remove-generations|option)
COMMAND_ARGS+=("$opt")
;;
*)
_iError "%s: unknown option '%s'" "$0" "$opt" >&2
_i "Run '%s --help' for usage help" "$0" >&2
exit 1
;;
esac
;;
esac
done
if [[ -z $COMMAND ]]; then
doHelp >&2
exit 1
fi
case $COMMAND in
edit)
doEdit
;;
build)
doBuild
;;
instantiate)
doInstantiate
;;
switch)
doSwitch
;;
generations)
doListGens
;;
remove-generations)
doRmGenerations "${COMMAND_ARGS[@]}"
;;
expire-generations)
if [[ ${#COMMAND_ARGS[@]} != 1 ]]; then
_i 'expire-generations expects one argument, got %d.' "${#COMMAND_ARGS[@]}" >&2
exit 1
else
doExpireGenerations "${COMMAND_ARGS[@]}"
fi
;;
option)
doInspectOption "${COMMAND_ARGS[@]}"
;;
packages)
doListPackages
;;
news)
doShowNews --all
;;
uninstall)
doUninstall
;;
help)
doHelp
;;
*)
_iError 'Unknown command: %s' "$COMMAND" >&2
doHelp >&2
exit 1
;;
esac
# vim: ft=bash

@ -0,0 +1,89 @@
{ pkgs ? import <nixpkgs> {}
, confPath
, confAttr ? null
, check ? true
, newsReadIdsFile ? null
}:
let
inherit (pkgs.lib)
concatMapStringsSep fileContents filter length optionalString removeSuffix
replaceStrings splitString;
env = import ../modules {
configuration =
if confAttr == "" || confAttr == null
then confPath
else (import confPath).${confAttr};
pkgs = pkgs;
check = check;
};
newsReadIds =
if newsReadIdsFile == null
then {}
else
let
ids = splitString "\n" (fileContents newsReadIdsFile);
in
builtins.listToAttrs (map (id: { name = id; value = null; }) ids);
newsIsRead = entry: builtins.hasAttr entry.id newsReadIds;
newsFiltered =
let
pred = entry: entry.condition && ! newsIsRead entry;
in
filter pred env.newsEntries;
newsNumUnread = length newsFiltered;
newsFileUnread = pkgs.writeText "news-unread.txt" (
concatMapStringsSep "\n\n" (entry:
let
time = replaceStrings ["T"] [" "] (removeSuffix "+00:00" entry.time);
in
''
* ${time}
${replaceStrings ["\n"] ["\n "] entry.message}
''
) newsFiltered
);
newsFileAll = pkgs.writeText "news-all.txt" (
concatMapStringsSep "\n\n" (entry:
let
flag = if newsIsRead entry then "read" else "unread";
time = replaceStrings ["T"] [" "] (removeSuffix "+00:00" entry.time);
in
''
* ${time} [${flag}]
${replaceStrings ["\n"] ["\n "] entry.message}
''
) env.newsEntries
);
# File where each line corresponds to an unread news entry
# identifier. If non-empty then the file ends in "\n".
newsUnreadIdsFile = pkgs.writeText "news-unread-ids" (
let
text = concatMapStringsSep "\n" (entry: entry.id) newsFiltered;
in
text + optionalString (text != "") "\n"
);
newsInfo = pkgs.writeText "news-info.sh" ''
local newsNumUnread=${toString newsNumUnread}
local newsDisplay="${env.newsDisplay}"
local newsFileAll="${newsFileAll}"
local newsFileUnread="${newsFileUnread}"
local newsUnreadIdsFile="${newsUnreadIdsFile}"
'';
in
{
inherit (env) activationPackage;
inherit newsInfo;
}

@ -0,0 +1,85 @@
{ home-manager, gettext, runCommand, ncurses }:
let
hmBashLibInit = ''
export TEXTDOMAIN=home-manager
export TEXTDOMAINDIR=${home-manager}/share/locale
source ${home-manager}/share/bash/home-manager.sh
'';
in runCommand "home-manager-install" {
propagatedBuildInputs = [ home-manager gettext ncurses ];
preferLocalBuild = true;
shellHookOnly = true;
shellHook = ''
${hmBashLibInit}
confFile="''${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix"
if [[ ! -e $confFile ]]; then
echo
_i "Creating initial Home Manager configuration..."
nl=$'\n'
xdgVars=""
if [[ -v XDG_CACHE_HOME && $XDG_CACHE_HOME != "$HOME/.cache" ]]; then
xdgVars="$xdgVars xdg.cacheHome = \"$XDG_CACHE_HOME\";$nl"
fi
if [[ -v XDG_CONFIG_HOME && $XDG_CONFIG_HOME != "$HOME/.config" ]]; then
xdgVars="$xdgVars xdg.configHome = \"$XDG_CONFIG_HOME\";$nl"
fi
if [[ -v XDG_DATA_HOME && $XDG_DATA_HOME != "$HOME/.local/share" ]]; then
xdgVars="$xdgVars xdg.dataHome = \"$XDG_DATA_HOME\";$nl"
fi
if [[ -v XDG_STATE_HOME && $XDG_STATE_HOME != "$HOME/.local/state" ]]; then
xdgVars="$xdgVars xdg.stateHome = \"$XDG_STATE_HOME\";$nl"
fi
mkdir -p "$(dirname "$confFile")"
cat > $confFile <<EOF
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "$USER";
home.homeDirectory = "$HOME";
$xdgVars
# 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 = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
EOF
fi
echo
_i "Creating initial Home Manager generation..."
echo
if home-manager switch ; then
# translators: The "%s" specifier will be replaced by a file path.
_i $'All done! The home-manager tool should now be installed and you can edit\n\n %s\n\nto configure Home Manager. Run \'man home-configuration.nix\' to\nsee all available options.' \
"$confFile"
exit 0
else
# translators: The "%s" specifier will be replaced by a URL.
_i $'Uh oh, the installation failed! Please create an issue at\n\n %s\n\nif the error seems to be the fault of Home Manager.' \
"https://github.com/nix-community/home-manager/issues"
exit 1
fi
'';
} ''
${hmBashLibInit}
_iError 'This derivation is not buildable, please run it using nix-shell.'
exit 1
''

@ -0,0 +1,189 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-03-23 18:56+0000\n"
"Last-Translator: Manu [tennox] <tennox@posteo.de>\n"
"Language-Team: German <https://hosted.weblate.org/projects/home-manager/cli/"
"de/>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.12-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Keine Konfigurationsdatei unter %s gefunden"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Keine Konfigurationsdatei gefunden. Bitte erstellen Sie eine unter %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr ""
"Die Optionen einer Flake-Konfigurationen können nicht inspizieren werden"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Kann eine Flake-Konfiguration nicht instanziieren"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Es gibt eine ungelesene und relevante Nachricht.\n"
"Lesen Sie sie, indem Sie den Befehl \"%s news\" ausführen."
msgstr[1] ""
"Es gibt %d ungelesene und relevante Nachrichten.\n"
"Lesen Sie sie, indem Sie den Befehl \"%s news\" ausführen."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Unbekannte \"news.display\" Einstellung \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Bitte legen Sie die $EDITOR Variable fest"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Build kann nicht im schreibgeschützten Ordner ausgeführt werden"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Keine Generation mit ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Die jetzige Generation %s kann nicht entfernt werden"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Entferne Generation %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Keine ablaufenden Generationen"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Es scheint, als ob keine Home Manager Pakete installiert sind."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Unbekannte Argumente %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Dies wird Home Manager von Ihrem System entfernen."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Dies ist ein Probelauf, es wird nichts vom System deinstalliert."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Möchten Sie wirklich Home Manager deinstallieren?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Wechsle zu einer leeren Home Manager Konfiguration..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Juhu!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Entferne alle Home Manager Generationen?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Alle Generationen kommen nun für die Garbage Collection in Frage."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"Ignoriere Generationen, aber diese könnten immer noch mittels des Garbage "
"Collectors aufgeräumt werden."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
"Home Manager ist installiert, aber Ihre home.nix Datei bleibt unberührt."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: unbekannte Option '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Führe '%s --help' aus, um Hilfe zur Verwendung zu erhalten"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations erwartet ein Argument, hat aber %d erhalten."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Unbekannter Befehl: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Erstelle initiale Home Manager Konfiguration..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Erstelle initiale Home Manager Generation..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Alles fertig! Das Home Manager Tool sollte nun installiert sein. Sie können\n"
"\n"
" %s\n"
"\n"
"bearbeiten um Home Manager zu konfigurieren. Führen Sie\n"
"'man home-configuration.nix' aus, um alle verfügbaren Optionen zu\n"
"sehen."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Ups, die Installation schlug fehl. Bitte erstellen Sie ein Issue unter\n"
"\n"
" %s\n"
"\n"
"falls der Fehler auf Home Manager zurückzuführen ist."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Diese Derivation ist nicht kompilierbar. Bitte führen Sie nix-shell aus."

@ -0,0 +1,185 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-01-11 21:45+0000\n"
"Last-Translator: Robert Helgesson <robert@rycee.net>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/home-manager/cli/"
"es/>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10.1\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Archivo de configuración no encontrado en %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Archivo de configuración no encontrado. Por favor cree uno en %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "No se pudo inspeccionar las opciones de la configuración flake"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "No se pudo instanciar una configuración flake"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Hay %d noticia relevante no leída.\n"
"Léala ejecutando el comando \"%s news\"."
msgstr[1] ""
"Hay %d noticias relevantes no leídas.\n"
"Léalas ejecutando el comando \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Configuración \"news.display\" no reconocida \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Defina la variable de ambiente $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "No se puede ejecutar en un directorio de sólo lectura"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "No existe la generación con ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "No se pudo borrar la generación actual %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Borrando generación %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "No se encontraron generaciones para expirar"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "No se encontró ningún paquete home-manager instalado."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Argumento desconocido %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Home Manager será borrado del sistema."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Este es un simulacro, nada será realmente desinstalado."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Desinstalar Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Cambiando a configuración vacía de Home Manager..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Bien!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Borrar todas las generaciones de Home Manager?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Ahora todas las generaciones son aptas para recolección de basura."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"Dejando generaciones aunque podrían aún ser borradas por el recolector de "
"basura."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager desinstalado pero no se ha modificado home.nix."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: opción desconocida '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Ejecute '%s --help' para ver ayuda"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations espera un argumento pero se dieron %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Comando desconocido %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Creando configuración inicial de Home Manager..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Creando generación inicial de Home Manager..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Listo! home-manager ha sido instalado y ahora puede editar\n"
"\n"
" %s\n"
"\n"
"para configurar Home Manager. Ejecute 'man home-configuration.nix' para\n"
"ver todas las opciones disponibles."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"La instalación ha fallado. Por favor notifíquelo en\n"
"\n"
" %s\n"
"\n"
"si el error parecer ser culpa de Home Manager."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr "Esta derivación no se puede construir, ejecute con nix-shell."

@ -0,0 +1,169 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-04-09 18:11+0000\n"
"Last-Translator: Artin Mobasher <mobasherartin.icm@gmail.com>\n"
"Language-Team: Persian <https://hosted.weblate.org/projects/home-manager/cli/"
"fa/>\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.12-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "هیچ فایل تنظیماتی در %s پیدا نشد"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "هیچ فایل تنظیماتی پیدا نشد. لطفا یک فایل در %s بسازید"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr ""
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr ""
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
msgstr[1] ""
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr ""
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr ""
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr ""
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr ""
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr ""
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr ""
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr ""
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr ""
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr ""
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr ""
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr ""
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr ""
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr ""
#: home-manager/home-manager:493
#, fuzzy
msgid "Yay!"
msgstr "آره!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr ""
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr ""
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr ""
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr ""
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr ""
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "دستور ناشناخته: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "ایجاد تنظیمات اولیه Home-Manager..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr ""
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""

@ -0,0 +1,191 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2021-12-19 16:51+0000\n"
"Last-Translator: TheBlackBeans <adrien.mathieu.net@gmail.com>\n"
"Language-Team: French <https://hosted.weblate.org/projects/home-manager/cli/"
"fr/>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.10\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Aucun fichier de configuration trouvé à l'emplacement %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr ""
"Aucun fichier de configuration trouvé. Veuillez en créer un à l'emplacement "
"%s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Impossible d'inspecter les options d'une configuration en flocons"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Impossible d'instancier une configuration flake"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Il y a %d nouvel élément non lu et pertinent.\n"
"Vous pouvez le lire en exécutant la commande \"%s news\"."
msgstr[1] ""
"Il y a %d nouveaux éléments non lus et pertinents.\n"
"Vous pouvez les lire en exécutant la commande \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Configuration \"news.display\" iconnue \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Veuillez définir la variable d'environnement $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Impossible de lancer une compilation dans un dossier en écriture seule"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Aucune génération avec l'identifiant %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Impossible de supprimer la génération courante %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Suppression de la génération %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Aucune génération expirée"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Aucun paquet home-manager ne semble être installé."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Aucun argument %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Cela va supprimer Home Manager de votre système."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "C'est un essai, rien ne sera réellement désinstallé."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Voulez-vous vraiment désinstaller Home Manager ?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Changement vers une configuration vierge de Home Manager..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Yay !"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Supprimer toutes les générations de Home Manager ?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr ""
"Toutes les générations sont maintenant éligibles pour la collecte des "
"ordures."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"Les générations sortantes mais elles peuvent encore être collectées par les "
"ordures."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager est désinstallé mais votre home.nix reste intact."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s : option inconnue « %s »"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Exécuter « %s --help » pour de l'aide sur l'utilisation"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations attend un argument, a obtenu %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Commande inconnue : %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Création de la configuration initiale de Home Manager..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Création de la génération initiale de Home Manager..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Tout est fait! Home Manager devrait désormais être installé et vous pouvez "
"éditer\n"
"\n"
" %s\n"
"\n"
"pour configurer Home Manager. Pour avoir une liste des options disponibles,\n"
"essayez 'man home-configuration.nix'."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Uh oh, l'installation n'a pas réussi! Veuillez signaler cette erreur à "
"l'adresse suivante\n"
"\n"
" %s\n"
"\n"
"si l'erreur semble être liée à Home Manager."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr "Cette dérivation ne peut être construite, essayez avec nix-shell."

@ -0,0 +1,167 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr ""
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr ""
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr ""
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr ""
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
msgstr[1] ""
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr ""
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr ""
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr ""
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr ""
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr ""
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr ""
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr ""
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr ""
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr ""
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr ""
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr ""
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr ""
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr ""
#: home-manager/home-manager:493
msgid "Yay!"
msgstr ""
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr ""
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr ""
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr ""
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr ""
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr ""
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr ""
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr ""
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr ""
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""

@ -0,0 +1,185 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-04-20 18:18+0000\n"
"Last-Translator: Frankie McEyes <mceyes@protonmail.com>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/home-manager/cli/"
"it/>\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.12-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Nessun file di configurazione trovato in %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Nessun file di configurazione trovato. Per favore crearne uno in %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Impossibile ispezionare le opzioni di configurazione flake"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Impossibile istanziare una configurazione flake"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"C'è %d novità di elementi non letta.\n"
"Leggila con il comando \"%s news\"."
msgstr[1] ""
"Ci sono %d novità di elementi non letti\n"
"Leggile con il comando \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Opzione \"news.display\" sconosciuta \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Per favore impostare la variabile d'ambient $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Impossibile eseguire la build in una cartella in sola lettura"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Nessuna generazione con ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Impossibile rimuovere la generazione corrente %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Rimuovo la generazione %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Nessuna generazione in scadenza"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Nessun pacchetto home-manager sembra essere installato."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Argomento sconosciuto: %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Questo rimuoverà Home Manger dal tuo sistema."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Questo è un avvio a secco, nulla verrà realmente disinstallato."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Vuoi davvero disinstallare Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Cambio ad una configurazione Home Manager vuota..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Urrà!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Rimuovere tutte le generazioni Home Manager?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Tutte le generazioni sono ora pronte per essere cestinate."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "Abbandono le generazioni, ma possono essere ancora cestinate."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager è disinstallato ma la tua home.Nix non è stata toccata."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: opzione sconosciuta '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Esegui '%s --help' per ottenere aiuto"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations si aspetta un solo argomento, invece di %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Comando sconosciuto: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Creando la configurazione iniziale di Home Manager..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Creando la generazione iniziale di Home Manager..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Tutto fatto! Home-manager dovrebbe essere installato e puoi modificare\n"
"\n"
"%s\n"
"\n"
"per configurare Home Manager. Esegui 'man home-configurazion.nix' per\n"
"consultare tutte le opzioni disponibili."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Oh no, l'installazione non è andata a buon fine! Per favore aprire un ticket "
"issue a\n"
"\n"
"%s\n"
"\n"
"se l'errore sembra essere causato da Home Manager."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Questa derivazione non è compilabile, prova ad eseguila usando nix-shell."

@ -0,0 +1,186 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-02-10 04:55+0000\n"
"Last-Translator: Heman Gandhi <hemangandhi@gmail.com>\n"
"Language-Team: Japanese <https://hosted.weblate.org/projects/home-manager/"
"cli/ja/>\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.11-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "%s に設定ファイルを見つかりません"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "設定ファイルがありません。ファイルを %s に作ってください"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "flake設定のオプションを検査できません"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "flake設定をインスタンス化できません"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"未読の関連ニュースが%d件あります\n"
"\"%s news\"コマンドを使って読んでください。"
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "知らない\"news.display\"設定\"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "$EDITOR環境変数を設定してください"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "読み込み専用ディレクトリ内ではbuild(作成)できません"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "ID %s を持つ世代はありません"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "現在使用中の世代 %s は削除できません"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "世代 %s を削除中です"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "期限切れで削除する世代はありません"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "home-managerパッケージはインストールされていないようです。"
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "不明な引数 %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "これはシステムからHome Managerを削除します。"
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "これはdry run (予行練習)で、実際にはアンインストールは行われません。"
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "本当にHome Managerをアンインストールしますか?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "空のHome Managerの設定に切り替え中です..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "イェイ!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Home-managerの全ての世代を削除しますか?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "全ての世代がガベージコレクションの対象になりました。"
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"世代を残していますが、それらはガベージコレクションで回収されるかもしれませ"
"ん。"
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
"Home Managerはアンインストールされましたが、home.nixはそのまま残してありま"
"す。"
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: 不明なオプション '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "利用方法のヘルプは'%s --help' を実行してください"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations は一つの引数を期待しますが、%d が与えられました。"
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "不明なコマンド: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Home Managerの初期設定を生成しています..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Home Managertの最初の世代を生成しています..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"全て実行しました! 現在Home-managerツールはインストールされているはずで、\n"
"\n"
" %s\n"
"\n"
"でHome Managerの設定を編集することができます。利用可能なオプションを見るに"
"は\n"
"'man home-configuration.nix' を実行してください。"
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"うあ、インストールに失敗しました!もしこのエラーがHome Managerの欠陥のせいで"
"生じたようなら、\n"
"\n"
" %s\n"
"\n"
"というissueを立ててください。"
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr "この派生はビルドできませんので、nix-shellを使って実行してください。"

@ -0,0 +1,186 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-01-30 21:50+0000\n"
"Last-Translator: 박수원 <bboxone@gmail.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/home-manager/cli/"
"ko/>\n"
"Language: ko\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.11-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "%s에서 설정 파일을 찾을 수 없음"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "설정 파일을 찾을 수 없음. %s에 설정 파일을 생성하십시오"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "flake 설정의 옵션들을 검사할 수 없음"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "flake 설정을 인스턴스화 할 수 없음"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"읽지 않은 관련된 뉴스 항목들이 %d 개 있습니다.\n"
"\"%s news\" 명령어를 실행해 읽어보십시오."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "알 수 없는 \"news.display\"의 설정 \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "환경변수 $EDITOR를 설정하십시오"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "읽기전용 폴더에서 빌드를 실행할 수 없습니다"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "ID %s를 갖는 세대가 존재하지 않음"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "현재 세대인 %s를 삭제할 수 없음"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "%s 세대를 삭제하는 중"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "유효 기간이 지난 세대가 없음"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "홈 매니저 패키지들이 설치되지 않은 것으로 보입니다."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "알 수 없는 매개변수 %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "시스템에서 홈 매니저를 삭제할 것입니다."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "모의 실행 중으로, 아무것도 실제로 설치되지 않습니다."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "정말로 홈 매니저를 삭제할까요?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "빈 홈 매니저 설정으로 바꾸는 중..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "야호!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "모든 홈 매니저 세대를 지울까요?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "이제 모든 세대가 쓰레기 수집(가비지 컬렉션)의 대상이 됩니다."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"세대들을 그대로 놔두지만 그들은 여전히 쓰레기 수집(가비지 컬렉션) 될 수 있습"
"니다."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "홈 매니저는 삭제되지만 home.nix 파일은 남겨집니다."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: 알 수 없는 옵션 '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "도움말을 보려면 '%s --help'를 실행하십시오"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr ""
"expire-generations 명령어는 매개변수가 한 개 필요한데, %d 개가 입력되었습니"
"다."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "알 수 없는 명령어: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "최초의 홈 매니저 설정을 생성하는 중..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "최초의 홈 매니저 세대를 생성하는 중..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"완료! 홈 매니저 도구들이 설치 되었고 이제 \n"
"\n"
" %s\n"
"\n"
"파일을 수정해서 홈 매니저를 설정할 수 있습니다. 'man home-configuration."
"nix'를\n"
"실행해서 가능한 모든 옵션을 살펴보십시오."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"이런, 설치가 실패했습니다! 만약 에러가 홈 매니저의 문제라고 생각된다면\n"
"\n"
" %s\n"
"\n"
"위 사이트에서 이슈를 생성하십시오."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"이 derivation은 빌드 할 수 없습니다. nix-shell을 이용해서 실행해 주십시오."

@ -0,0 +1,172 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2021-12-13 20:50+0000\n"
"Last-Translator: Allan Nordhøy <epost@anotheragency.no>\n"
"Language-Team: Norwegian Bokmål <https://hosted.weblate.org/projects/home-"
"manager/cli/nb_NO/>\n"
"Language: nb_NO\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Fant ingen oppsettsfil i %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Fant ikke noenoppsettsfil. Opprett en i %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Kan ikke inspisere alternativer for et flake-oppsett"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Kan ikke igangsette flak-oppsett"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Det er %d ulest og relevant nyhetselement.\n"
"Les det ved å kjøre kommandoen «%s news»."
msgstr[1] ""
"Det er %d uleste og relevant nyhetselementer.\n"
"Les det ved å kjøre kommandoen «%s news»."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Ukjent «news.display»-innstilling «%s»."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Sett «$EDITOR»-miljøvariabelen"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Kan ikke kjøre bygg i skrivebeskyttet mappe"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Ingen generering med ID-en %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Kan ikke fjerne nåværende generering %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Fjerner generering %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Ingen genereringer til utløp"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Ingen «home-manager»-pakker ser ut til å være installert."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Ukjent argument %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Dette vil fjerne Home Manager fra systemet ditt."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Dette er en testkjøring. Ingenting vil bli avinstallert."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Vil du avinstallere Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Bytter til tomt Home Manager-oppsett …"
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Hurra."
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Fjern alle Home Manager-genereringer?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Alle genereringer kan nå hentes av søppelinnsamling."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "Levner genereringer, men de kan fremdeles hentes av søppelinnsamling."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager er avinstallert, men din home.nix er levnet uforandret."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: ukjent alternativ «%s»"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Kjør «%s --help» for brukshjelp"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "«expire-generations» forventet ett argument, mottok %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Ukjent kommando: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr ""
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr ""
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""

@ -0,0 +1,191 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2021-12-29 08:48+0000\n"
"Last-Translator: Tomasz Czyż <tomasz.czyz@eskapizm.pl>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/home-manager/cli/"
"pl/>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.10.1\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Nie znaleziono pliku konfiguracyjnego %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Nie znaleziono pliku konfiguracyjnego. Proszę utworzyć plik %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Nie mogę sprawdzić konfiguracji flake'a"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Nie mogę zinstancjować konfiguracji flake'a"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Jest %d nieodczytana wiadomość.\n"
"Możesz ją odczytać uruchamiając „%s news”."
msgstr[1] ""
"Jest %d nieodczytanych wiadomości.\n"
"Możesz je odczytać uruchamiając „%s news”."
msgstr[2] ""
"Jest %d nieodczytanych wiadomości.\n"
"Możesz je odczytać uruchamiając „%s news”."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Nieznane ustawienie „%s” „news.display”."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Proszę ustawić zmienną środowiskową $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Nie mogę uruchomić budowania w katalogu tylko-do-odczytu"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Brak generacji z ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Nie mogę usunąć bieżącej generacji %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Usuwanie generacji %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Brak wygasających generacji"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Pakiety home-manager nie wydają się być zainstalowane."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Nieznany argument %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "To usunie Home Managera z twojego systemu."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "To jest próba, faktycznie nic nie będzie usunięte."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Jesteś pewien usunięcia Home Managera?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Przełączanie do pustej konfiguracji Home Managera..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Jej!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Usunąć wszystkie generacje Home Managera?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr ""
"Wszystkie generacje są uwzględnione przy oczyszczaniu (garbage collection)."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"Zostawiam generacje ale wciąż mogą zostać usunięte (garbage collection)."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
"Home Manager jest usunięty ale twój home.nix jest pozostawiony nietknięty."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: nieznana opcja „%s”"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Uruchom „%s --help” by otrzymać pomoc"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations oczekuje jednego argumentu, otrzymane %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Nieznana komenda: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Tworzenie pierwotnej konfiguracji Home Managera..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Tworzenie pierwotnej generacji Home Managera..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Skończone! Narzędzie home-manager powinno być zainstalowane i może edytować\n"
"\n"
" %s\n"
"\n"
"by skonfigurować Home Managera. Uruchom „man home-configuration.nix” aby\n"
"sprawdzić wszystkie możliwe opcje konfiguracyjne."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Ojoj, instalacja nie powiodła się! Proszę opisz problem na\n"
"\n"
" %s\n"
"\n"
"jeśli myślisz, że problem spowodowany jest przez błąd Home Managera."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Ta paczka (derivation) nie da się budować, proszę uruchom używając nix-shell."

@ -0,0 +1,188 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-04-04 11:11+0000\n"
"Last-Translator: Alex Miranda <alexmirandamoraes@gmail.com>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"home-manager/cli/pt_BR/>\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.12-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Nenhum arquivo de configuração encontrado no %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Arquivo de configuração não encontrado. Por favor crie um em %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Não é possivel inspecionar a opção de configuração do flake"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Não foi possível instanciar a configuração de flake"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Há %d novo item relevante não lido\n"
"Leia executando o comando \"%s news\"."
msgstr[1] ""
"Há %d novos itens relevants não lidos\n"
"Leia executando o comando \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Valor \"%s\" para configuração \"news.display\" não reconhecido."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Por favor defina a variável de ambiente $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Não é possível fazer o build em um diretório somente leitura"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Nenhuma geração com ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Não foi possível remover a geração atual %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Removendo geração %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Nenhuma geração a expirar"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Nenhum pacote parece instalado com home-manager."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Argumento desconhecido %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Isso irá remover o Home Manager do seu sistema."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Essa é uma execução de teste, nada de fato será desinstalado."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Confirma a desinstalação do Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Trocando para configuração vazia do Home Manager..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Boa!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Remover todas as gerações do Home Manager?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Todas gerações agora são elegíveis para coleta do garbage collector."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"Deixando gerações, entretanto elas ainda poderão ser limpas pelo garbage "
"collector."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager foi desinstalado, mas o seu home.nix foi deixado intacto."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: opção não reconhecida '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Execute '%s --help' para instruções de uso"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations espera um argumento, recebeu %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Comando não reconhecido: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Criando a configuração inicial do Home Manager..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Criando a geração inicial do Home Manager..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Pronto! O home-manager deve ser instalado agora e você poderá editar o "
"arquivo\n"
"\n"
" %s\n"
"\n"
"para configurar o Home Manager. Execute 'man home-configuration.nix' para\n"
"ver todas as opções disponíveis."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Ixi, a instalação falhou! Por favor crie um issue no\n"
"\n"
" %s\n"
"\n"
"se o erro lhe parecer ser um problema do Home Manager."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"O build dessa derivation não pode ser feito, por favor rode usando o nix-"
"shell."

@ -0,0 +1,188 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2021-12-21 19:55+0000\n"
"Last-Translator: Mikhail Chekan <chekoopa@mail.ru>\n"
"Language-Team: Russian <https://hosted.weblate.org/projects/home-manager/cli/"
"ru/>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.10\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Не найден файл конфигурации в %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Не найден файл конфигурации. Пожалуйста, создайте его в %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Не могу получить опции для flake-конфигурации"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Не могу создать экземляр для flake-конфигурации"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"У вас есть %d непрочитанная и релевантная новость.\n"
"Прочтите её, выполнив команду \"%s news\"."
msgstr[1] ""
"У вас есть %d непрочитанные и релевантные новости.\n"
"Прочтите их, выполнив команду \"%s news\"."
msgstr[2] ""
"У вас есть %d непрочитанных и релевантных новостей.\n"
"Прочтите их, выполнив команду \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Неизвестное значение \"news.display\": \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Пожалуйста, определите переменную среды $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Не могу начать сборку в директории, защищённой от записи"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Поколение под номером %s не существует"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Не могу удалить текущее поколение %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Удаляю поколение %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Нет поколений, которые можно просрочить"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Не обнаружено пакетов, установленных через home-manager."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Неизвестный аргумент %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Это удалит Home Manager из вашей системы."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Это пробный запуск, на самом деле ничего не удаляется."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Действительно хотите удалить Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Переключаюсь на пустую конфигурацию Home Manager..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Ура!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Удалить все поколения Home Manager?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Теперь все поколения готовы к удалению сборщиком мусора."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "Поколения остаются, но их ещё можно удалить сборщиком мусора."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager удалён, но ваш home.nix остался нетронутым."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: неизвестная опция '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Выполните '%s --help', чтобы получить справку"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations требует один аргумент, но передано %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Неизвестная команда: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Создаю начальную конфигурацию Home Manager..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Создаю начальное поколение Home Manager..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Готово! Теперь вам должна быть доступна утилита home-manager,\n"
"и вы можете отредактировать настройки в файле\n"
"\n"
" %s\n"
"\n"
"Выполните 'man home-configuration.nix', чтобы увидеть доступные опции."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Ой, установка не удалась! Пожалуйста, создайте тему в багтрекере\n"
"\n"
" %s\n"
"\n"
"если считаете, что в ошибке виноват Home Manager."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Это определение нельзя собрать. Пожалуйста, запустите его через nix-shell."

@ -0,0 +1,183 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2021-12-17 20:50+0000\n"
"Last-Translator: Robert Helgesson <robert@rycee.net>\n"
"Language-Team: Swedish <https://hosted.weblate.org/projects/home-manager/cli/"
"sv/>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Det finns ingen konfigurationsfil i %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Hittade ingen konfigurationsfil. Skapa en i %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Kan inte granska alternativ i en flake-konfiguration"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Kan inte instansera en flake-konfiguration"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Det finns %d oläst och relevant nyhet.\n"
"Läs den genom att köra kommandot \"%s news\"."
msgstr[1] ""
"Det finns %d olästa och relevanta nyheter.\n"
"Läs dem genom att köra kommandot \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Okänt \"news.display\"-värde \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Vänligen tilldela miljövariablen $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Kan inte bygga i katalog med bara läsrättigheter"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Ingen generation med ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Kan inte ta bort nuvarande generation %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Tar bort generation %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Ingen generation att förfalla"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Paketet home-manager verkar inte vara installerat."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Okänt argument %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Detta kommer att ta bort Home Manager från ditt system."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Detta är en testkörning, inget kommer att bli avinstallerat."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Verkligen avinstallera Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Byter till tom Home Manager-konfiguration..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Hurra!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Ta bort alla Home Manager-generationer?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Alla generationer kan nu skräpsamlas."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "Låter generationer vara kvar men de kan fortfarande skräpsamlas."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager är avinstallerad men din home.nix är orörd."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: okänt val '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Kör '%s --help' för användarhjälp"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expect-generations förväntar sig ett argument, fick %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Okänt kommando: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Skapar initial Home Manager-konfiguration..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Skapar initial Home Manager-generation..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Färdig! Verktyget home-manager borde nu vara installerat och du kan editera\n"
"\n"
" %s\n"
"\n"
"för att konfigurera Home Manager. Kör 'man home-configuration.nix' för\n"
"att se alla tillgängliga alternativ."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Ajdå, installationen misslyckades! Skapa gärna en rapport på\n"
"\n"
" %s\n"
"\n"
"om problemet verkar bero på något Home Manager gör fel."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr "Denna derivation är inte byggbar, kör den med nix-shell istället."

@ -0,0 +1,186 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-03-26 23:57+0000\n"
"Last-Translator: Oğuz Ersen <oguz@ersen.moe>\n"
"Language-Team: Turkish <https://hosted.weblate.org/projects/home-manager/cli/"
"tr/>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.12-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "%s konumunda yapılandırma dosyası bulunamadı"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr ""
"Yapılandırma dosyası bulunamadı. Lütfen %s konumunda bir tane oluşturun"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Flake yapılandırmasının ayarları incelenemiyor"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Flake yapılandırması örneklendirilemiyor"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"%d tane okunmamış ilgili haber bulunmakta.\n"
"Okumak için \"%s news\"."
msgstr[1] ""
"%d tane okunmamış ilgili haberler bulunmakta.\n"
"Okumak için \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Bilinmeyen \"news.display\" seçeneği \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Lütfen $EDITOR ortam değişkenini tanımlayın"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "İnşa, sadece okunabilir bir klasörde çalıştırılamaz"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "%s ID'sine sahip inşa bulunamadı"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Kullanımda olan %s inşası silinemez"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "İnşa siliniyor %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Süresi dolacak inşa yok"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Galiba home-manager paketi kurulu değil."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Bilinmeyen argüman %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Bu, sisteminizden Home Manager'ı kaldıracak."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Bu sadece bir inşa denemesi, hiçbir şey silinmeyecek."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Home Manager'ı silmek istediğinize emin misiniz?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Boş Home Manager yapılandırmasına geçiliyor..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Güzel!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Tüm Home Manager inşaları kaldırılsın mı?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Artık tüm inşalar çöp olarak toplanabilir."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "İnşalar yine de çöp olarak toplanabilir."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager kaldırıldı ama home.nix dosyasına dokunulmadı."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: Bilinmeyen komut '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Yardım için '%s --help'"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations bir argüman istiyor, %d tane girildi."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Bilinmeyen komut: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "İlk Home Manager yapılandırması oluşturuluyor..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "İlk Home Manager inşası oluşturuluyor..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Herşey tamam! home-manager aracı kuruldu. Home Manager'ı yapılandırmak için\n"
"\n"
" %s\n"
"\n"
"dosyasını düzenleyin. Kullanılabilir seçenekleri görmek için:\n"
"'man home-configuration.nix'."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Eyvah, kurulum başarısız! Eğer hatanın Home Manager'dan kaynaklandığını "
"düşünüyorsanız\n"
"\n"
" %s\n"
"\n"
"adresinden bildirin."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Bu türetim inşa edilebilir değil, lütfen onu nix-shell kullanarak çalıştırın."

@ -0,0 +1,180 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2021-12-28 12:41+0000\n"
"Last-Translator: WhiredPlanck <fungdaat31@outlook.com>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
"home-manager/cli/zh_Hans/>\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.10.1\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "未在 %s 找到配置文件"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "未找到配置文件。请在 %s 处创建一份"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "无法检查 flake 配置中的选项"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "无法创建 flake 配置实例"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"有 %d 条未读的相关新闻或消息。\n"
"可运行 “%s news” 命令进行阅读。"
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "未知的 “news.display” 设置项 “%s”。"
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "请设定 $EDITOR 环境变量"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "无法在只读目录中运行构建"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "没有 ID 为 %s 的世代"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "无法移除当前世代 %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "正在移除世代 %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "没有即将过期的世代"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "似乎没有安装 home-manager 软件包。"
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "未知参数 %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "这将会从系统中移除 Home Manager。"
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "这是试运行结果,没有实际卸载任何软件包。"
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "确定要卸载 Home Manager 吗?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "正在切换至空的 Home Manager 配置 ..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "好耶!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "要移除所有 Home Manager 配置世代吗?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "所有世代现在均符合垃圾回收的条件。"
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "保留世代,但它们仍然可能被垃圾回收。"
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager 已卸载,但未改动您的 home.nix 配置文件。"
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s:未知选项 ‘%s’"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "运行 ‘%s --help’ 获取用法帮助"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations 须要一个参数,但获取到了 %d 个。"
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "未知命令:%s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "正在创建初始 Home Manager 配置 ..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "正在创建初始 Home Manager 世代 ..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"全部工作完成了!home-manager 工具现应已安装,您可以编辑\n"
"\n"
" %s\n"
"\n"
"来配置 Home Manager。运行 ‘man home-configuration.nix’\n"
"来查看所有可用选项。"
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"啊哦,安装失败了!如果感觉是 Home Manager 造成的错误,请在下方\n"
"\n"
" %s\n"
"\n"
"处创建 Issue 告知我们。"
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr "此配置文件/变体不可构建,请在 nix-shell 中运行它。"

@ -0,0 +1,180 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2021-12-29 08:48+0000\n"
"Last-Translator: WhiredPlanck <fungdaat31@outlook.com>\n"
"Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/"
"home-manager/cli/zh_Hant/>\n"
"Language: zh_Hant\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.10.1\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "未在 %s 處找到配置檔案"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "未找到配置檔案。請在 %s 處建立一份"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "無法檢查 flake 配置中的選項"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "無法建立 flake 配置例項"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"有 %d 條未讀的相關新聞或訊息。\n"
"可執行 “%s news” 命令進行閱讀。"
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "未知的 “news.display” 設定項 “%s”。"
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "請設定 $EDITOR 環境變數"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "無法在只讀目錄中執行構建"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "沒有 ID 為 %s 的世代"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "無法移除當前世代 %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "正在移除世代 %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "沒有即將過期的世代"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "似乎沒有安裝 home-manager 軟體包。"
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "未知引數 %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "這將會從系統中移除 Home Manager。"
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "這是試執行結果,沒有實際解除安裝任何軟體包。"
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "確定要解除安裝 Home Manager 嗎?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "正在切換至空的 Home Manager 配置 ..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "好耶!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "要移除所有 Home Manager 配置世代嗎?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "所有世代現在均符合垃圾回收的條件。"
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "保留世代,但它們仍然可能被垃圾回收。"
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager 已解除安裝,但未改動您的 home.nix 配置檔案。"
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s:未知選項 ‘%s’"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "執行 ‘%s --help’ 獲取用法幫助"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations 須要一個引數,但獲取到了 %d 個。"
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "未知命令:%s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "正在建立初始 Home Manager 配置 ..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "正在建立初始 Home Manager 世代 ..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"全部工作完成了!home-manager 工具現應已安裝,您可以編輯\n"
"\n"
" %s\n"
"\n"
"來配置 Home Manager。執行 ‘man home-configuration.nix’\n"
"來檢視所有可用選項。"
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"啊哦,安裝失敗了!如果感覺是 Home Manager 造成的錯誤,請在下方\n"
"\n"
" %s\n"
"\n"
"處建立 Issue 告知我們。"
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr "此配置檔案/變體不可構建,請在 nix-shell 中執行它。"

@ -0,0 +1,41 @@
#!/usr/bin/env bash
# The check for terminal output and color support is heavily inspired
# by https://unix.stackexchange.com/a/10065.
#
# Allow opt out by respecting the `NO_COLOR` environment variable.
function setupColors() {
normalColor=""
errorColor=""
warnColor=""
noteColor=""
# Enable colors for terminals, and allow opting out.
if [[ ! -v NO_COLOR && -t 1 ]]; then
# See if it supports colors.
local ncolors
ncolors=$(tput colors)
if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then
normalColor="$(tput sgr0)"
errorColor="$(tput bold)$(tput setaf 1)"
warnColor="$(tput setaf 3)"
noteColor="$(tput bold)$(tput setaf 6)"
fi
fi
}
setupColors
function errorEcho() {
echo "${errorColor}$*${normalColor}"
}
function warnEcho() {
echo "${warnColor}$*${normalColor}"
}
function noteEcho() {
echo "${noteColor}$*${normalColor}"
}

@ -0,0 +1,85 @@
#!/usr/bin/env bash
#
# This file contains a number of utilities for use by the home-manager tool and
# the generated Home Manager activation scripts. No guarantee is made about
# backwards or forward compatibility.
#
# Sets up colors suitable for the `errorEcho`, `warnEcho`, and `noteEcho`
# functions.
#
# The check for terminal output and color support is heavily inspired by
# https://unix.stackexchange.com/a/10065.
#
# The setup respects the `NO_COLOR` environment variable.
function setupColors() {
normalColor=""
errorColor=""
warnColor=""
noteColor=""
# Enable colors for terminals, and allow opting out.
if [[ ! -v NO_COLOR && -t 1 ]]; then
# See if it supports colors.
local ncolors
ncolors=$(tput colors)
if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then
normalColor="$(tput sgr0)"
errorColor="$(tput bold)$(tput setaf 1)"
warnColor="$(tput setaf 3)"
noteColor="$(tput bold)$(tput setaf 6)"
fi
fi
}
setupColors
function errorEcho() {
echo "${errorColor}$*${normalColor}"
}
function warnEcho() {
echo "${warnColor}$*${normalColor}"
}
function noteEcho() {
echo "${noteColor}$*${normalColor}"
}
function _i() {
local msgid="$1"
shift
# shellcheck disable=2059
printf "$(gettext "$msgid")\n" "$@"
}
function _ip() {
local msgid="$1"
local msgidPlural="$2"
local count="$3"
shift 3
# shellcheck disable=2059
printf "$(ngettext "$msgid" "$msgidPlural" "$count")\n" "$@"
}
function _iError() {
echo -n "${errorColor}"
_i "$@"
echo -n "${normalColor}"
}
function _iWarn() {
echo -n "${warnColor}"
_i "$@"
echo -n "${normalColor}"
}
function _iNote() {
echo -n "${noteColor}"
_i "$@"
echo -n "${normalColor}"
}

@ -0,0 +1,418 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.accounts.email;
gpgModule = types.submodule {
options = {
key = mkOption {
type = types.str;
description = ''
The key to use as listed in <command>gpg --list-keys</command>.
'';
};
signByDefault = mkOption {
type = types.bool;
default = false;
description = "Sign messages by default.";
};
encryptByDefault = mkOption {
type = types.bool;
default = false;
description = "Encrypt outgoing messages by default.";
};
};
};
signatureModule = types.submodule {
options = {
text = mkOption {
type = types.str;
default = "";
example = ''
--
Luke Skywalker
May the force be with you.
'';
description = ''
Signature content.
'';
};
command = mkOption {
type = with types; nullOr path;
default = null;
example = literalExpression ''
pkgs.writeScript "signature" "echo This is my signature"
'';
description = "A command that generates a signature.";
};
showSignature = mkOption {
type = types.enum [ "append" "attach" "none" ];
default = "none";
description = "Method to communicate the signature.";
};
};
};
tlsModule = types.submodule {
options = {
enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to enable TLS/SSL.
'';
};
useStartTls = mkOption {
type = types.bool;
default = false;
description = ''
Whether to use STARTTLS.
'';
};
certificatesFile = mkOption {
type = types.nullOr types.path;
default = config.accounts.email.certificatesFile;
defaultText = "config.accounts.email.certificatesFile";
description = ''
Path to file containing certificate authorities that should
be used to validate the connection authenticity. If
<literal>null</literal> then the system default is used.
Note, if set then the system default may still be accepted.
'';
};
};
};
imapModule = types.submodule {
options = {
host = mkOption {
type = types.str;
example = "imap.example.org";
description = ''
Hostname of IMAP server.
'';
};
port = mkOption {
type = types.nullOr types.port;
default = null;
example = 993;
description = ''
The port on which the IMAP server listens. If
<literal>null</literal> then the default port is used.
'';
};
tls = mkOption {
type = tlsModule;
default = { };
description = ''
Configuration for secure connections.
'';
};
};
};
smtpModule = types.submodule {
options = {
host = mkOption {
type = types.str;
example = "smtp.example.org";
description = ''
Hostname of SMTP server.
'';
};
port = mkOption {
type = types.nullOr types.port;
default = null;
example = 465;
description = ''
The port on which the SMTP server listens. If
<literal>null</literal> then the default port is used.
'';
};
tls = mkOption {
type = tlsModule;
default = { };
description = ''
Configuration for secure connections.
'';
};
};
};
maildirModule = types.submodule ({ config, ... }: {
options = {
path = mkOption {
type = types.str;
description = ''
Path to maildir directory where mail for this account is
stored. This is relative to the base maildir path.
'';
};
absPath = mkOption {
type = types.path;
readOnly = true;
internal = true;
default = "${cfg.maildirBasePath}/${config.path}";
description = ''
A convenience option whose value is the absolute path of
this maildir.
'';
};
};
});
mailAccountOpts = { name, config, ... }: {
options = {
name = mkOption {
type = types.str;
readOnly = true;
description = ''
Unique identifier of the account. This is set to the
attribute name of the account configuration.
'';
};
primary = mkOption {
type = types.bool;
default = false;
description = ''
Whether this is the primary account. Only one account may be
set as primary.
'';
};
flavor = mkOption {
type = types.enum [ "plain" "gmail.com" "runbox.com" "fastmail.com" ];
default = "plain";
description = ''
Some email providers have peculiar behavior that require
special treatment. This option is therefore intended to
indicate the nature of the provider.
</para><para>
When this indicates a specific provider then, for example,
the IMAP and SMTP server configuration may be set
automatically.
'';
};
address = mkOption {
type = types.strMatching ".*@.*";
example = "jane.doe@example.org";
description = "The email address of this account.";
};
aliases = mkOption {
type = types.listOf (types.strMatching ".*@.*");
default = [ ];
example = [ "webmaster@example.org" "admin@example.org" ];
description = "Alternative email addresses of this account.";
};
realName = mkOption {
type = types.str;
example = "Jane Doe";
description = "Name displayed when sending mails.";
};
userName = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
The server username of this account. This will be used as
the SMTP and IMAP user name.
'';
};
passwordCommand = mkOption {
type = types.nullOr (types.either types.str (types.listOf types.str));
default = null;
apply = p: if isString p then splitString " " p else p;
example = "secret-tool lookup email me@example.org";
description = ''
A command, which when run writes the account password on
standard output.
'';
};
folders = mkOption {
type = types.submodule {
options = {
inbox = mkOption {
type = types.str;
default = "Inbox";
description = ''
Relative path of the inbox mail.
'';
};
sent = mkOption {
type = types.nullOr types.str;
default = "Sent";
description = ''
Relative path of the sent mail folder.
'';
};
drafts = mkOption {
type = types.str;
default = "Drafts";
description = ''
Relative path of the drafts mail folder.
'';
};
trash = mkOption {
type = types.str;
default = "Trash";
description = ''
Relative path of the deleted mail folder.
'';
};
};
};
default = { };
description = ''
Standard email folders.
'';
};
imap = mkOption {
type = types.nullOr imapModule;
default = null;
description = ''
The IMAP configuration to use for this account.
'';
};
signature = mkOption {
type = signatureModule;
default = { };
description = ''
Signature configuration.
'';
};
gpg = mkOption {
type = types.nullOr gpgModule;
default = null;
description = ''
GPG configuration.
'';
};
smtp = mkOption {
type = types.nullOr smtpModule;
default = null;
description = ''
The SMTP configuration to use for this account.
'';
};
maildir = mkOption {
type = types.nullOr maildirModule;
defaultText = { path = "\${name}"; };
description = ''
Maildir configuration for this account.
'';
};
};
config = mkMerge [
{
name = name;
maildir = mkOptionDefault { path = "${name}"; };
}
(mkIf (config.flavor == "fastmail.com") {
userName = mkDefault config.address;
smtp = {
host = "smtp.fastmail.com";
port = if config.smtp.tls.useStartTls then 587 else 465;
};
imap = {
host = "imap.fastmail.com";
port = 993;
};
})
(mkIf (config.flavor == "gmail.com") {
userName = mkDefault config.address;
imap = {
host = "imap.gmail.com";
port = 993;
};
smtp = {
host = "smtp.gmail.com";
port = if config.smtp.tls.useStartTls then 587 else 465;
};
})
(mkIf (config.flavor == "runbox.com") {
imap = { host = "mail.runbox.com"; };
smtp = { host = "mail.runbox.com"; };
})
];
};
in {
options.accounts.email = {
certificatesFile = mkOption {
type = types.nullOr types.path;
default = "/etc/ssl/certs/ca-certificates.crt";
description = ''
Path to default file containing certificate authorities that
should be used to validate the connection authenticity. This
path may be overridden on a per-account basis.
'';
};
maildirBasePath = mkOption {
type = types.str;
default = "${config.home.homeDirectory}/Maildir";
defaultText = "$HOME/Maildir";
apply = p:
if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}";
description = ''
The base directory for account maildir directories. May be a
relative path, in which case it is relative the home
directory.
'';
};
accounts = mkOption {
type = types.attrsOf (types.submodule mailAccountOpts);
default = { };
description = "List of email accounts.";
};
};
config = mkIf (cfg.accounts != { }) {
assertions = [
(let
primaries =
catAttrs "name" (filter (a: a.primary) (attrValues cfg.accounts));
in {
assertion = length primaries == 1;
message = "Must have exactly one primary mail account but found "
+ toString (length primaries) + optionalString (length primaries > 1)
(", namely " + concatStringsSep ", " primaries);
})
];
};
}

@ -0,0 +1,156 @@
{ config, options, lib, pkgs, ... }:
with lib;
let
cfg = config.home.pointerCursor;
pointerCursorModule = types.submodule {
options = {
package = mkOption {
type = types.package;
example = literalExpression "pkgs.vanilla-dmz";
description = "Package providing the cursor theme.";
};
name = mkOption {
type = types.str;
example = "Vanilla-DMZ";
description = "The cursor name within the package.";
};
size = mkOption {
type = types.int;
default = 32;
example = 64;
description = "The cursor size.";
};
x11 = {
enable = mkEnableOption ''
x11 config generation for <option>home.pointerCursor</option>
'';
defaultCursor = mkOption {
type = types.str;
default = "left_ptr";
example = "X_cursor";
description = "The default cursor file to use within the package.";
};
};
gtk = {
enable = mkEnableOption ''
gtk config generation for <option>home.pointerCursor</option>
'';
};
};
};
cursorPath = "${cfg.package}/share/icons/${escapeShellArg cfg.name}/cursors/${
escapeShellArg cfg.x11.defaultCursor
}";
in {
meta.maintainers = [ maintainers.polykernel maintainers.league ];
imports = [
(mkAliasOptionModule [ "xsession" "pointerCursor" "package" ] [
"home"
"pointerCursor"
"package"
])
(mkAliasOptionModule [ "xsession" "pointerCursor" "name" ] [
"home"
"pointerCursor"
"name"
])
(mkAliasOptionModule [ "xsession" "pointerCursor" "size" ] [
"home"
"pointerCursor"
"size"
])
(mkAliasOptionModule [ "xsession" "pointerCursor" "defaultCursor" ] [
"home"
"pointerCursor"
"x11"
"defaultCursor"
])
({ ... }: {
warnings = optional (any (x:
getAttrFromPath
([ "xsession" "pointerCursor" ] ++ [ x ] ++ [ "isDefined" ])
options) [ "package" "name" "size" "defaultCursor" ]) ''
The option `xsession.pointerCursor` has been merged into `home.pointerCursor` and will be removed
in the future. Please change to set `home.pointerCursor` directly and enable `home.pointerCursor.x11.enable`
to generate x11 specific cursor configurations. You can refer to the documentation for more details.
'';
})
];
options = {
home.pointerCursor = mkOption {
type = types.nullOr pointerCursorModule;
default = null;
description = ''
Cursor configuration. Set to <literal>null</literal> to disable.
</para><para>
Top-level options declared under this submodule are backend indepedent
options. Options declared under namespaces such as <literal>x11</literal>
are backend specific options. By default, only backend independent cursor
configurations are generated. If you need configurations for specific
backends, you can toggle them via the enable option. For example, <varname>
<link linkend="opt-home.pointerCursor.x11.enable">home.pointerCursor.x11.enable</link>
</varname> will enable x11 cursor configurations.
'';
};
};
config = mkIf (cfg != null) (mkMerge [
{
assertions = [
(hm.assertions.assertPlatform "home.pointerCursor" pkgs platforms.linux)
];
home.packages = [ cfg.package ];
# Set name in icons theme, for compatibility with AwesomeWM etc. See:
# https://github.com/nix-community/home-manager/issues/2081
# https://wiki.archlinux.org/title/Cursor_themes#XDG_specification
home.file.".icons/default/index.theme".text = ''
[icon theme]
Name=Default
Comment=Default Cursor Theme
Inherits=${cfg.name}
'';
# Set directory to look for cursors in, needed for some applications
# that are unable to find cursors otherwise. See:
# https://github.com/nix-community/home-manager/issues/2812
# https://wiki.archlinux.org/title/Cursor_themes#Environment_variable
home.sessionVariables = {
XCURSOR_PATH = "$XCURSOR_PATH\${XCURSOR_PATH:+:}"
+ "${config.home.profileDirectory}/share/icons";
};
}
(mkIf cfg.x11.enable {
xsession.initExtra = ''
${pkgs.xorg.xsetroot}/bin/xsetroot -xcf ${cursorPath} ${
toString cfg.size
}
'';
xresources.properties = {
"Xcursor.theme" = cfg.name;
"Xcursor.size" = cfg.size;
};
})
(mkIf cfg.gtk.enable {
gtk.cursorTheme = mkDefault { inherit (cfg) package name size; };
})
]);
}

@ -0,0 +1,46 @@
# The glibc package in Nixpkgs is patched to make it possible to specify
# an alternative path for the locale archive through a special environment
# variable. This would allow different versions of glibc to coexist on the
# same system because each version of glibc could look up different paths
# for its locale archive should the archive format ever change in
# incompatible ways.
#
# See also:
# - localedef(1)
# - https://nixos.org/manual/nixpkgs/stable/#locales
# - https://github.com/NixOS/nixpkgs/issues/38991
#
# Note, the name of the said environment variable gets updated with each
# breaking release of the glibcLocales package. Periodically check the link
# below for changes:
# https://github.com/NixOS/nixpkgs/blob/nixpkgs-unstable/pkgs/development/libraries/glibc/nix-locale-archive.patch
{ lib, pkgs, ... }:
with lib;
let
inherit (pkgs.glibcLocales) version;
archivePath = "${pkgs.glibcLocales}/lib/locale/locale-archive";
# lookup the version of glibcLocales and set the appropriate environment vars
localeVars = if versionAtLeast version "2.27" then {
LOCALE_ARCHIVE_2_27 = archivePath;
} else if versionAtLeast version "2.11" then {
LOCALE_ARCHIVE_2_11 = archivePath;
} else
{ };
in {
meta.maintainers = with maintainers; [ midchildan ];
config = mkIf pkgs.stdenv.hostPlatform.isLinux {
# For shell sessions.
home.sessionVariables = localeVars;
# For desktop apps.
systemd.user.sessionVariables = localeVars;
};
}

@ -0,0 +1,66 @@
{ configuration
, pkgs
, lib ? pkgs.lib
# Whether to check that each option has a matching declaration.
, check ? true
# Extra arguments passed to specialArgs.
, extraSpecialArgs ? { }
}:
with lib;
let
collectFailed = cfg:
map (x: x.message) (filter (x: !x.assertion) cfg.assertions);
showWarnings = res:
let
f = w: x: builtins.trace "warning: ${w}" x;
in
fold f res res.config.warnings;
extendedLib = import ./lib/stdlib-extended.nix lib;
hmModules =
import ./modules.nix {
inherit check pkgs;
lib = extendedLib;
};
rawModule = extendedLib.evalModules {
modules = [ configuration ] ++ hmModules;
specialArgs = {
modulesPath = builtins.toString ./.;
} // extraSpecialArgs;
};
module = showWarnings (
let
failed = collectFailed rawModule.config;
failedStr = concatStringsSep "\n" (map (x: "- ${x}") failed);
in
if failed == []
then rawModule
else throw "\nFailed assertions:\n${failedStr}"
);
in
{
inherit (module) options config;
activationPackage = module.config.home.activationPackage;
# For backwards compatibility. Please use activationPackage instead.
activation-script = module.config.home.activationPackage;
newsDisplay = rawModule.config.news.display;
newsEntries =
sort (a: b: a.time > b.time) (
filter (a: a.condition) rawModule.config.news.entries
);
inherit (module._module.args) pkgs;
}

@ -0,0 +1,405 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.home.file;
homeDirectory = config.home.homeDirectory;
fileType = (import lib/file-type.nix {
inherit homeDirectory lib pkgs;
}).fileType;
sourceStorePath = file:
let
sourcePath = toString file.source;
sourceName = config.lib.strings.storeFileName (baseNameOf sourcePath);
in
if builtins.hasContext sourcePath
then file.source
else builtins.path { path = file.source; name = sourceName; };
in
{
options = {
home.file = mkOption {
description = "Attribute set of files to link into the user home.";
default = {};
type = fileType "<envar>HOME</envar>" homeDirectory;
};
home-files = mkOption {
type = types.package;
internal = true;
description = "Package to contain all home files";
};
};
config = {
assertions = [(
let
dups =
attrNames
(filterAttrs (n: v: v > 1)
(foldAttrs (acc: v: acc + v) 0
(mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)));
dupsStr = concatStringsSep ", " dups;
in {
assertion = dups == [];
message = ''
Conflicting managed target files: ${dupsStr}
This may happen, for example, if you have a configuration similar to
home.file = {
conflict1 = { source = ./foo.nix; target = "baz"; };
conflict2 = { source = ./bar.nix; target = "baz"; };
}'';
})
];
lib.file.mkOutOfStoreSymlink = path:
let
pathStr = toString path;
name = hm.strings.storeFileName (baseNameOf pathStr);
in
pkgs.runCommandLocal name {} ''ln -s ${escapeShellArg pathStr} $out'';
# This verifies that the links we are about to create will not
# overwrite an existing file.
home.activation.checkLinkTargets = hm.dag.entryBefore ["writeBoundary"] (
let
# Paths that should be forcibly overwritten by Home Manager.
# Caveat emptor!
forcedPaths =
concatMapStringsSep " " (p: ''"$HOME"/${escapeShellArg p}'')
(mapAttrsToList (n: v: v.target)
(filterAttrs (n: v: v.force) cfg));
check = pkgs.writeText "check" ''
${config.lib.bash.initHomeManagerLib}
# A symbolic link whose target path matches this pattern will be
# considered part of a Home Manager generation.
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
forcedPaths=(${forcedPaths})
newGenFiles="$1"
shift
for sourcePath in "$@" ; do
relativePath="''${sourcePath#$newGenFiles/}"
targetPath="$HOME/$relativePath"
forced=""
for forcedPath in "''${forcedPaths[@]}"; do
if [[ $targetPath == $forcedPath* ]]; then
forced="yeah"
break
fi
done
if [[ -n $forced ]]; then
$VERBOSE_ECHO "Skipping collision check for $targetPath"
elif [[ -e "$targetPath" \
&& ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
# The target file already exists and it isn't a symlink owned by Home Manager.
if cmp -s "$sourcePath" "$targetPath"; then
# First compare the files' content. If they're equal, we're fine.
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be skipped since they are the same"
elif [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
# Next, try to move the file to a backup location if configured and possible
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
if [[ -e "$backup" ]]; then
errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'"
collision=1
else
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be moved to '$backup'"
fi
else
# Fail if nothing else works
errorEcho "Existing file '$targetPath' is in the way of '$sourcePath'"
collision=1
fi
fi
done
if [[ -v collision ]] ; then
errorEcho "Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically."
exit 1
fi
'';
in
''
function checkNewGenCollision() {
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
find "$newGenFiles" \( -type f -or -type l \) \
-exec bash ${check} "$newGenFiles" {} +
}
checkNewGenCollision || exit 1
''
);
# This activation script will
#
# 1. Remove files from the old generation that are not in the new
# generation.
#
# 2. Switch over the Home Manager gcroot and current profile
# links.
#
# 3. Symlink files from the new generation into $HOME.
#
# This order is needed to ensure that we always know which links
# belong to which generation. Specifically, if we're moving from
# generation A to generation B having sets of home file links FA
# and FB, respectively then cleaning before linking produces state
# transitions similar to
#
# FA → FA ∩ FB → (FA ∩ FB) ∪ FB = FB
#
# and a failure during the intermediate state FA ∩ FB will not
# result in lost links because this set of links are in both the
# source and target generation.
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (
let
link = pkgs.writeShellScript "link" ''
newGenFiles="$1"
shift
for sourcePath in "$@" ; do
relativePath="''${sourcePath#$newGenFiles/}"
targetPath="$HOME/$relativePath"
if [[ -e "$targetPath" && ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
# The target exists, back it up
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
$DRY_RUN_CMD mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!"
fi
if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s "$sourcePath" "$targetPath" ; then
# The target exists but is identical – don't do anything.
$VERBOSE_ECHO "Skipping '$targetPath' as it is identical to '$sourcePath'"
else
# Place that symlink, --force
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
fi
done
'';
cleanup = pkgs.writeShellScript "cleanup" ''
${config.lib.bash.initHomeManagerLib}
# A symbolic link whose target path matches this pattern will be
# considered part of a Home Manager generation.
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
newGenFiles="$1"
shift 1
for relativePath in "$@" ; do
targetPath="$HOME/$relativePath"
if [[ -e "$newGenFiles/$relativePath" ]] ; then
$VERBOSE_ECHO "Checking $targetPath: exists"
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete."
else
$VERBOSE_ECHO "Checking $targetPath: gone (deleting)"
$DRY_RUN_CMD rm $VERBOSE_ARG "$targetPath"
# Recursively delete empty parent directories.
targetDir="$(dirname "$relativePath")"
if [[ "$targetDir" != "." ]] ; then
pushd "$HOME" > /dev/null
# Call rmdir with a relative path excluding $HOME.
# Otherwise, it might try to delete $HOME and exit
# with a permission error.
$DRY_RUN_CMD rmdir $VERBOSE_ARG \
-p --ignore-fail-on-non-empty \
"$targetDir"
popd > /dev/null
fi
fi
done
'';
in
''
function linkNewGen() {
_i "Creating home file links in %s" "$HOME"
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
find "$newGenFiles" \( -type f -or -type l \) \
-exec bash ${link} "$newGenFiles" {} +
}
function cleanOldGen() {
if [[ ! -v oldGenPath || ! -e "$oldGenPath/home-files" ]] ; then
return
fi
_i "Cleaning up orphan links from %s" "$HOME"
local newGenFiles oldGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
# Apply the cleanup script on each leaf in the old
# generation. The find command below will print the
# relative path of the entry.
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
| xargs -0 bash ${cleanup} "$newGenFiles"
}
cleanOldGen
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
_i "Creating profile generation %s" $newGenNum
if [[ -e "$genProfilePath"/manifest.json ]] ; then
# Remove all packages from "$genProfilePath"
# `nix profile remove '.*' --profile "$genProfilePath"` was not working, so here is a workaround:
nix profile list --profile "$genProfilePath" \
| cut -d ' ' -f 4 \
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG --profile "$genProfilePath"
$DRY_RUN_CMD nix profile install $VERBOSE_ARG --profile "$genProfilePath" "$newGenPath"
else
$DRY_RUN_CMD nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath"
fi
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenGcPath"
else
_i "No change so reusing latest profile generation %s" "$oldGenNum"
fi
linkNewGen
''
);
home.activation.checkFilesChanged = hm.dag.entryBefore ["linkGeneration"] (
let
homeDirArg = escapeShellArg homeDirectory;
in ''
function _cmp() {
if [[ -d $1 && -d $2 ]]; then
diff -rq "$1" "$2" &> /dev/null
else
cmp --quiet "$1" "$2"
fi
}
declare -A changedFiles
'' + concatMapStrings (v:
let
sourceArg = escapeShellArg (sourceStorePath v);
targetArg = escapeShellArg v.target;
in ''
_cmp ${sourceArg} ${homeDirArg}/${targetArg} \
&& changedFiles[${targetArg}]=0 \
|| changedFiles[${targetArg}]=1
'') (filter (v: v.onChange != "") (attrValues cfg))
+ ''
unset -f _cmp
''
);
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (
concatMapStrings (v: ''
if (( ''${changedFiles[${escapeShellArg v.target}]} == 1 )); then
if [[ -v DRY_RUN || -v VERBOSE ]]; then
echo "Running onChange hook for" ${escapeShellArg v.target}
fi
if [[ ! -v DRY_RUN ]]; then
${v.onChange}
fi
fi
'') (filter (v: v.onChange != "") (attrValues cfg))
);
# Symlink directories and files that have the right execute bit.
# Copy files that need their execute bit changed.
home-files = pkgs.runCommandLocal
"home-manager-files"
{
nativeBuildInputs = [ pkgs.xorg.lndir ];
}
(''
mkdir -p $out
# Needed in case /nix is a symbolic link.
realOut="$(realpath -m "$out")"
function insertFile() {
local source="$1"
local relTarget="$2"
local executable="$3"
local recursive="$4"
# If the target already exists then we have a collision. Note, this
# should not happen due to the assertion found in the 'files' module.
# We therefore simply log the conflict and otherwise ignore it, mainly
# to make the `files-target-config` test work as expected.
if [[ -e "$realOut/$relTarget" ]]; then
echo "File conflict for file '$relTarget'" >&2
return
fi
# Figure out the real absolute path to the target.
local target
target="$(realpath -m "$realOut/$relTarget")"
# Target path must be within $HOME.
if [[ ! $target == $realOut* ]] ; then
echo "Error installing file '$relTarget' outside \$HOME" >&2
exit 1
fi
mkdir -p "$(dirname "$target")"
if [[ -d $source ]]; then
if [[ $recursive ]]; then
mkdir -p "$target"
lndir -silent "$source" "$target"
else
ln -s "$source" "$target"
fi
else
[[ -x $source ]] && isExecutable=1 || isExecutable=""
# Link the file into the home file directory if possible,
# i.e., if the executable bit of the source is the same we
# expect for the target. Otherwise, we copy the file and
# set the executable bit to the expected value.
if [[ $executable == inherit || $isExecutable == $executable ]]; then
ln -s "$source" "$target"
else
cp "$source" "$target"
if [[ $executable == inherit ]]; then
# Don't change file mode if it should match the source.
:
elif [[ $executable ]]; then
chmod +x "$target"
else
chmod -x "$target"
fi
fi
fi
}
'' + concatStrings (
mapAttrsToList (n: v: ''
insertFile ${
escapeShellArgs [
(sourceStorePath v)
v.target
(if v.executable == null
then "inherit"
else toString v.executable)
(toString v.recursive)
]}
'') cfg
));
};
}

@ -0,0 +1,715 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (config.home) stateVersion;
cfg = config.home;
languageSubModule = types.submodule {
options = {
base = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use unless overridden by a more specific option.
'';
};
ctype = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
Character classification category.
'';
};
numeric = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for numerical values.
'';
};
time = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for formatting times.
'';
};
collate = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for collation (alphabetical ordering).
'';
};
monetary = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for formatting currencies and money amounts.
'';
};
messages = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for messages, application UI languages, etc.
'';
};
paper = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for paper sizes.
'';
};
name = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for personal names.
'';
};
address = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for addresses.
'';
};
telephone = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for telephone numbers.
'';
};
measurement = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for measurement values.
'';
};
};
};
keyboardSubModule = types.submodule {
options = {
layout = mkOption {
type = with types; nullOr str;
default =
if versionAtLeast config.home.stateVersion "19.09"
then null
else "us";
defaultText = literalExpression "null";
description = ''
Keyboard layout. If <literal>null</literal>, then the system
configuration will be used.
</para><para>
This defaults to <literal>null</literal> for state
version  19.09 and <literal>"us"</literal> otherwise.
'';
};
model = mkOption {
type = with types; nullOr str;
default = null;
example = "presario";
description = ''
Keyboard model.
'';
};
options = mkOption {
type = types.listOf types.str;
default = [];
example = ["grp:caps_toggle" "grp_led:scroll"];
description = ''
X keyboard options; layout switching goes here.
'';
};
variant = mkOption {
type = with types; nullOr str;
default =
if versionAtLeast config.home.stateVersion "19.09"
then null
else "";
defaultText = literalExpression "null";
example = "colemak";
description = ''
X keyboard variant. If <literal>null</literal>, then the
system configuration will be used.
</para><para>
This defaults to <literal>null</literal> for state
version  19.09 and <literal>""</literal> otherwise.
'';
};
};
};
in
{
meta.maintainers = [ maintainers.rycee ];
imports = [
(mkRemovedOptionModule [ "home" "sessionVariableSetter" ] ''
Session variables are now always set through the shell. This is
done automatically if the shell configuration is managed by Home
Manager. If not, then you must source the
~/.nix-profile/etc/profile.d/hm-session-vars.sh
file yourself.
'')
];
options = {
home.username = mkOption {
type = types.str;
defaultText = literalExpression ''
"$USER" for state version < 20.09,
undefined for state version 20.09
'';
example = "jane.doe";
description = "The user's username.";
};
home.homeDirectory = mkOption {
type = types.path;
defaultText = literalExpression ''
"$HOME" for state version < 20.09,
undefined for state version 20.09
'';
apply = toString;
example = "/home/jane.doe";
description = "The user's home directory. Must be an absolute path.";
};
home.profileDirectory = mkOption {
type = types.path;
defaultText = literalExpression ''
"''${home.homeDirectory}/.nix-profile" or
"/etc/profiles/per-user/''${home.username}"
'';
readOnly = true;
description = ''
The profile directory where Home Manager generations are installed.
'';
};
home.language = mkOption {
type = languageSubModule;
default = {};
description = "Language configuration.";
};
home.keyboard = mkOption {
type = types.nullOr keyboardSubModule;
default = if versionAtLeast stateVersion "21.11" then null else { };
defaultText = literalExpression ''
"{ }" for state version < 21.11,
"null" for state version 21.11
'';
description = ''
Keyboard configuration. Set to <literal>null</literal> to
disable Home Manager keyboard management.
'';
};
home.shellAliases = mkOption {
type = with types; attrsOf str;
default = { };
example = literalExpression ''
{
g = "git";
"..." = "cd ../..";
}
'';
description = ''
An attribute set that maps aliases (the top level attribute names
in this option) to command strings or directly to build outputs.
</para><para>
This option should only be used to manage simple aliases that are
compatible across all shells. If you need to use a shell specific
feature then make sure to use a shell specific option, for example
<xref linkend="opt-programs.bash.shellAliases"/> for Bash.
'';
};
home.sessionVariables = mkOption {
default = {};
type = types.attrs;
example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; };
description = ''
Environment variables to always set at login.
</para><para>
The values may refer to other environment variables using
POSIX.2 style variable references. For example, a variable
<varname>parameter</varname> may be referenced as
<code>$parameter</code> or <code>''${parameter}</code>. A
default value <literal>foo</literal> may be given as per
<code>''${parameter:-foo}</code> and, similarly, an alternate
value <literal>bar</literal> can be given as per
<code>''${parameter:+bar}</code>.
</para><para>
Note, these variables may be set in any order so no session
variable may have a runtime dependency on another session
variable. In particular code like
<programlisting language="nix">
home.sessionVariables = {
FOO = "Hello";
BAR = "$FOO World!";
};
</programlisting>
may not work as expected. If you need to reference another
session variable, then do so inside Nix instead. The above
example then becomes
<programlisting language="nix">
home.sessionVariables = {
FOO = "Hello";
BAR = "''${config.home.sessionVariables.FOO} World!";
};
</programlisting>
'';
};
home.sessionPath = mkOption {
type = with types; listOf str;
default = [ ];
example = [
"$HOME/.local/bin"
"\${xdg.configHome}/emacs/bin"
".git/safe/../../bin"
];
description = ''
Extra directories to add to <envar>PATH</envar>.
</para><para>
These directories are added to the <envar>PATH</envar> variable in a
double-quoted context, so expressions like <code>$HOME</code> are
expanded by the shell. However, since expressions like <code>~</code> or
<code>*</code> are escaped, they will end up in the <envar>PATH</envar>
verbatim.
'';
};
home.sessionVariablesExtra = mkOption {
type = types.lines;
default = "";
internal = true;
description = ''
Extra configuration to add to the
<filename>hm-session-vars.sh</filename> file.
'';
};
home.packages = mkOption {
type = types.listOf types.package;
default = [];
description = "The set of packages to appear in the user environment.";
};
home.extraOutputsToInstall = mkOption {
type = types.listOf types.str;
default = [];
example = [ "doc" "info" "devdoc" ];
description = ''
List of additional package outputs of the packages
<varname>home.packages</varname> that should be installed into
the user environment.
'';
};
home.path = mkOption {
internal = true;
description = "The derivation installing the user packages.";
};
home.emptyActivationPath = mkOption {
internal = true;
default = false;
type = types.bool;
description = ''
Whether the activation script should start with an empty
<envar>PATH</envar> variable. When <literal>false</literal>
then the user's <envar>PATH</envar> will be used.
'';
};
home.activation = mkOption {
type = hm.types.dagOf types.str;
default = {};
example = literalExpression ''
{
myActivationAction = lib.hm.dag.entryAfter ["writeBoundary"] '''
$DRY_RUN_CMD ln -s $VERBOSE_ARG \
''${builtins.toPath ./link-me-directly} $HOME
''';
}
'';
description = ''
The activation scripts blocks to run when activating a Home
Manager generation. Any entry here should be idempotent,
meaning running twice or more times produces the same result
as running it once.
</para><para>
If the script block produces any observable side effect, such
as writing or deleting files, then it
<emphasis>must</emphasis> be placed after the special
<literal>writeBoundary</literal> script block. Prior to the
write boundary one can place script blocks that verifies, but
does not modify, the state of the system and exits if an
unexpected state is found. For example, the
<literal>checkLinkTargets</literal> script block checks for
collisions between non-managed files and files defined in
<varname><link linkend="opt-home.file">home.file</link></varname>.
</para><para>
A script block should respect the <varname>DRY_RUN</varname>
variable, if it is set then the actions taken by the script
should be logged to standard out and not actually performed.
The variable <varname>DRY_RUN_CMD</varname> is set to
<command>echo</command> if dry run is enabled.
</para><para>
A script block should also respect the
<varname>VERBOSE</varname> variable, and if set print
information on standard out that may be useful for debugging
any issue that may arise. The variable
<varname>VERBOSE_ARG</varname> is set to
<option>--verbose</option> if verbose output is enabled.
'';
};
home.activationPackage = mkOption {
internal = true;
type = types.package;
description = "The package containing the complete activation script.";
};
home.extraActivationPath = mkOption {
internal = true;
type = types.listOf types.package;
default = [ ];
description = ''
Extra packages to add to <envar>PATH</envar> within the activation
script.
'';
};
home.extraBuilderCommands = mkOption {
type = types.lines;
default = "";
internal = true;
description = ''
Extra commands to run in the Home Manager generation builder.
'';
};
home.extraProfileCommands = mkOption {
type = types.lines;
default = "";
internal = true;
description = ''
Extra commands to run in the Home Manager profile builder.
'';
};
home.enableNixpkgsReleaseCheck = mkOption {
type = types.bool;
default = false; # Temporarily disabled until release stabilizes.
description = ''
Determines whether to check for release version mismatch between Home
Manager and Nixpkgs. Using mismatched versions is likely to cause errors
and unexpected behavior. It is therefore highly recommended to use a
release of Home Manager than corresponds with your chosen release of
Nixpkgs.
</para><para>
When this option is enabled and a mismatch is detected then a warning
will be printed when the user configuration is being built.
'';
};
};
config = {
assertions = [
{
assertion = config.home.username != "";
message = "Username could not be determined";
}
{
assertion = config.home.homeDirectory != "";
message = "Home directory could not be determined";
}
];
warnings =
let
hmRelease = fileContents ../.release;
nixpkgsRelease = pkgs.lib.trivial.release;
releaseMismatch =
config.home.enableNixpkgsReleaseCheck
&& hmRelease != nixpkgsRelease;
in
optional releaseMismatch ''
You are using
Home Manager version ${hmRelease} and
Nixpkgs version ${nixpkgsRelease}.
Using mismatched versions is likely to cause errors and unexpected
behavior. It is therefore highly recommended to use a release of Home
Manager than corresponds with your chosen release of Nixpkgs.
If you insist then you can disable this warning by adding
home.enableNixpkgsReleaseCheck = false;
to your configuration.
'';
home.username =
mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "USER"));
home.homeDirectory =
mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "HOME"));
home.profileDirectory =
if config.submoduleSupport.enable
&& config.submoduleSupport.externalPackageInstall
then "/etc/profiles/per-user/${cfg.username}"
else cfg.homeDirectory + "/.nix-profile";
programs.bash.shellAliases = cfg.shellAliases;
programs.zsh.shellAliases = cfg.shellAliases;
programs.fish.shellAliases = cfg.shellAliases;
home.sessionVariables =
let
maybeSet = n: v: optionalAttrs (v != null) { ${n} = v; };
in
(maybeSet "LANG" cfg.language.base)
//
(maybeSet "LC_CTYPE" cfg.language.ctype)
//
(maybeSet "LC_NUMERIC" cfg.language.numeric)
//
(maybeSet "LC_TIME" cfg.language.time)
//
(maybeSet "LC_COLLATE" cfg.language.collate)
//
(maybeSet "LC_MONETARY" cfg.language.monetary)
//
(maybeSet "LC_MESSAGES" cfg.language.messages)
//
(maybeSet "LC_PAPER" cfg.language.paper)
//
(maybeSet "LC_NAME" cfg.language.name)
//
(maybeSet "LC_ADDRESS" cfg.language.address)
//
(maybeSet "LC_TELEPHONE" cfg.language.telephone)
//
(maybeSet "LC_MEASUREMENT" cfg.language.measurement);
home.packages = [
# Provide a file holding all session variables.
(
pkgs.writeTextFile {
name = "hm-session-vars.sh";
destination = "/etc/profile.d/hm-session-vars.sh";
text = ''
# Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1
${config.lib.shell.exportAll cfg.sessionVariables}
'' + lib.optionalString (cfg.sessionPath != [ ]) ''
export PATH="$PATH''${PATH:+:}${concatStringsSep ":" cfg.sessionPath}"
'' + cfg.sessionVariablesExtra;
}
)
];
# A dummy entry acting as a boundary between the activation
# script's "check" and the "write" phases.
home.activation.writeBoundary = hm.dag.entryAnywhere "";
# Install packages to the user environment.
#
# Note, sometimes our target may not allow modification of the Nix
# store and then we cannot rely on `nix-env -i`. This is the case,
# for example, if we are running as a NixOS module and building a
# virtual machine. Then we must instead rely on an external
# mechanism for installing packages, which in NixOS is provided by
# the `users.users.<name?>.packages` option. The activation
# command is still needed since some modules need to run their
# activation commands after the packages are guaranteed to be
# installed.
#
# In case the user has moved from a user-install of Home Manager
# to a submodule managed one we attempt to uninstall the
# `home-manager-path` package if it is installed.
home.activation.installPackages = hm.dag.entryAfter ["writeBoundary"] (
if config.submoduleSupport.externalPackageInstall
then
''
if [[ -e "$nixProfilePath"/manifest.json ]] ; then
nix profile list \
| { grep 'home-manager-path$' || test $? = 1; } \
| awk -F ' ' '{ print $4 }' \
| cut -d ' ' -f 4 \
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
else
if nix-env -q | grep '^home-manager-path$'; then
$DRY_RUN_CMD nix-env -e home-manager-path
fi
fi
''
else
''
if [[ -e "$nixProfilePath"/manifest.json ]] ; then
INSTALL_CMD="nix profile install"
LIST_CMD="nix profile list"
REMOVE_CMD_SYNTAX='nix profile remove {number | store path}'
else
INSTALL_CMD="nix-env -i"
LIST_CMD="nix-env -q"
REMOVE_CMD_SYNTAX='nix-env -e {package name}'
fi
if ! $DRY_RUN_CMD $INSTALL_CMD ${cfg.path} ; then
echo
_iError $'Oops, Nix failed to install your new Home Manager profile!\n\nPerhaps there is a conflict with a package that was installed using\n"%s"? Try running\n\n %s\n\nand if there is a conflicting package you can remove it with\n\n %s\n\nThen try activating your Home Manager configuration again.' "$INSTALL_CMD" "$LIST_CMD" "$REMOVE_CMD_SYNTAX"
exit 1
fi
unset INSTALL_CMD LIST_CMD REMOVE_CMD_SYNTAX
''
);
# Text containing Bash commands that will initialize the Home Manager Bash
# library. Most importantly, this will prepare for using translated strings
# in the `hm-modules` text domain.
lib.bash.initHomeManagerLib =
let
domainDir = pkgs.runCommand "hm-modules-messages" {
nativeBuildInputs = [ pkgs.buildPackages.gettext ];
} ''
for path in ${./po}/*.po; do
lang="''${path##*/}"
lang="''${lang%%.*}"
mkdir -p "$out/$lang/LC_MESSAGES"
msgfmt -o "$out/$lang/LC_MESSAGES/hm-modules.mo" "$path"
done
'';
in
''
export TEXTDOMAIN=hm-modules
export TEXTDOMAINDIR=${domainDir}
source ${../lib/bash/home-manager.sh}
'';
home.activationPackage =
let
mkCmd = res: ''
_iNote "Activating %s" "${res.name}"
${res.data}
'';
sortedCommands = hm.dag.topoSort cfg.activation;
activationCmds =
if sortedCommands ? result then
concatStringsSep "\n" (map mkCmd sortedCommands.result)
else
abort ("Dependency cycle in activation script: "
+ builtins.toJSON sortedCommands);
# Programs that always should be available on the activation
# script's PATH.
activationBinPaths = lib.makeBinPath (
with pkgs; [
bash
coreutils
diffutils # For `cmp` and `diff`.
findutils
gettext
gnugrep
gnused
ncurses # For `tput`.
] ++ config.home.extraActivationPath
)
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
activationScript = pkgs.writeShellScript "activation-script" ''
set -eu
set -o pipefail
cd $HOME
export PATH="${activationBinPaths}"
${config.lib.bash.initHomeManagerLib}
${builtins.readFile ./lib-bash/activation-init.sh}
${activationCmds}
'';
in
pkgs.runCommand
"home-manager-generation"
{
preferLocalBuild = true;
}
''
mkdir -p $out
cp ${activationScript} $out/activate
mkdir $out/bin
ln -s $out/activate $out/bin/home-manager-generation
substituteInPlace $out/activate \
--subst-var-by GENERATION_DIR $out
ln -s ${config.home-files} $out/home-files
ln -s ${cfg.path} $out/home-path
${cfg.extraBuilderCommands}
'';
home.path = pkgs.buildEnv {
name = "home-manager-path";
paths = cfg.packages;
inherit (cfg) extraOutputsToInstall;
postBuild = cfg.extraProfileCommands;
meta = {
description = "Environment of packages installed through home-manager";
};
};
};
}

@ -0,0 +1,106 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod;
gtk2Cache = pkgs.runCommandLocal "gtk2-immodule.cache" {
buildInputs = [ pkgs.gtk2 cfg.package ];
} ''
mkdir -p $out/etc/gtk-2.0/
GTK_PATH=${cfg.package}/lib/gtk-2.0/ \
gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache
'';
gtk3Cache = pkgs.runCommandLocal "gtk3-immodule.cache" {
buildInputs = [ pkgs.gtk3 cfg.package ];
} ''
mkdir -p $out/etc/gtk-3.0/
GTK_PATH=${cfg.package}/lib/gtk-3.0/ \
gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache
'';
in {
imports =
[ ./fcitx.nix ./fcitx5.nix ./hime.nix ./kime.nix ./nabi.nix ./uim.nix ];
options.i18n = {
inputMethod = {
enabled = mkOption {
type = types.nullOr
(types.enum [ "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]);
default = null;
example = "fcitx";
description = ''
Select the enabled input method. Input methods is a software to input
symbols that are not available on standard input devices.
</para><para>
Input methods are specially used to input Chinese, Japanese and Korean
characters.
</para><para>
Currently the following input methods are available in Home Manager:
<variablelist>
<varlistentry>
<term><literal>fcitx</literal></term>
<listitem><para>
A customizable lightweight input method
extra input engines can be added using
<literal>i18n.inputMethod.fcitx.engines</literal>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>fcitx5</literal></term>
<listitem><para>
The next generation of fcitx,
addons (including engines, dictionaries, skins) can be added using
<literal>i18n.inputMethod.fcitx5.addons</literal>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>nabi</literal></term>
<listitem><para>
A Korean input method based on XIM. Nabi doesn't support Qt 5.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>uim</literal></term>
<listitem><para>
The universal input method, is a library with a XIM bridge.
uim mainly support Chinese, Japanese and Korean.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>hime</literal></term>
<listitem><para>An extremely easy-to-use input method framework.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>kime</literal></term>
<listitem><para>A Korean IME.</para></listitem>
</varlistentry>
</variablelist>
'';
};
package = mkOption {
internal = true;
type = types.nullOr types.path;
default = null;
description = ''
The input method method package.
'';
};
};
};
config = mkIf (cfg.enabled != null) {
assertions = [
(hm.assertions.assertPlatform "i18n.inputMethod" pkgs platforms.linux)
];
home.packages = [ cfg.package gtk2Cache gtk3Cache ];
};
meta.maintainers = with lib; [ hm.maintainers.kranzes ];
}

@ -0,0 +1,50 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod.fcitx;
fcitxPackage = pkgs.fcitx.override { plugins = cfg.engines; };
fcitxEngine = types.package // {
name = "fcitx-engine";
check = x:
types.package.check x && attrByPath [ "meta" "isFcitxEngine" ] false x;
};
in {
options = {
i18n.inputMethod.fcitx = {
engines = mkOption {
type = with types; listOf fcitxEngine;
default = [ ];
example = literalExpression "with pkgs.fcitx-engines; [ mozc hangul ]";
description = let
enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines;
engines = concatStringsSep ", "
(map (name: "<literal>${name}</literal>") (attrNames enginesDrv));
in "Enabled Fcitx engines. Available engines are: ${engines}.";
};
};
};
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
i18n.inputMethod.package = fcitxPackage;
home.sessionVariables = {
GTK_IM_MODULE = "fcitx";
QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";
};
systemd.user.services.fcitx-daemon = {
Unit = {
Description = "Fcitx input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = "${fcitxPackage}/bin/fcitx";
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

@ -0,0 +1,42 @@
{ config, pkgs, lib, ... }:
with lib;
let
im = config.i18n.inputMethod;
cfg = im.fcitx5;
fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
in {
options = {
i18n.inputMethod.fcitx5 = {
addons = mkOption {
type = with types; listOf package;
default = [ ];
example = literalExpression "with pkgs; [ fcitx5-rime ]";
description = ''
Enabled Fcitx5 addons.
'';
};
};
};
config = mkIf (im.enabled == "fcitx5") {
i18n.inputMethod.package = fcitx5Package;
home.sessionVariables = {
GTK_IM_MODULE = "fcitx";
QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";
};
systemd.user.services.fcitx5-daemon = {
Unit = {
Description = "Fcitx5 input method editor";
PartOf = [ "graphical-session.target" ];
};
Service.ExecStart = "${fcitx5Package}/bin/fcitx5";
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
with lib; {
config = mkIf (config.i18n.inputMethod.enabled == "hime") {
i18n.inputMethod.package = pkgs.hime;
home.sessionVariables = {
GTK_IM_MODULE = "hime";
QT_IM_MODULE = "hime";
XMODIFIERS = "@im=hime";
};
systemd.user.services.hime-daemon = {
Unit = {
Description = "Hime input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = "${pkgs.hime}/bin/hime";
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

@ -0,0 +1,59 @@
{ config, pkgs, lib, generators, ... }:
with lib;
let
cfg = config.i18n.inputMethod.kime;
yamlFormat = pkgs.formats.yaml { };
in {
options = {
i18n.inputMethod.kime = {
config = mkOption {
type = yamlFormat.type;
default = { };
example = literalExpression ''
{
daemon = {
modules = ["Xim" "Indicator"];
};
indicator = {
icon_color = "White";
};
engine = {
hangul = {
layout = "dubeolsik";
};
};
}
'';
description = ''
kime configuration. Refer to
<link xlink:href="https://github.com/Riey/kime/blob/develop/docs/CONFIGURATION.md"/>
for details on supported values.
'';
};
};
};
config = mkIf (config.i18n.inputMethod.enabled == "kime") {
i18n.inputMethod.package = pkgs.kime;
home.sessionVariables = {
GTK_IM_MODULE = "kime";
QT_IM_MODULE = "kime";
XMODIFIERS = "@im=kime";
};
xdg.configFile."kime/config.yaml".text =
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config);
systemd.user.services.kime-daemon = {
Unit = {
Description = "Kime input method editor";
PartOf = [ "graphical-session.target" ];
};
Service.ExecStart = "${pkgs.kime}/bin/kime";
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
with lib; {
config = mkIf (config.i18n.inputMethod.enabled == "nabi") {
i18n.inputMethod.package = pkgs.nabi;
home.sessionVariables = {
GTK_IM_MODULE = "nabi";
QT_IM_MODULE = "nabi";
XMODIFIERS = "@im=nabi";
};
systemd.user.services.nabi-daemon = {
Unit = {
Description = "Nabi input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = "${pkgs.nabi}/bin/nabi";
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

@ -0,0 +1,45 @@
{ config, pkgs, lib, ... }:
with lib;
let cfg = config.i18n.inputMethod.uim;
in {
options = {
i18n.inputMethod.uim = {
toolbar = mkOption {
type = types.enum [ "gtk" "gtk3" "gtk-systray" "gtk3-systray" "qt4" ];
default = "gtk";
example = "gtk-systray";
description = ''
Selected UIM toolbar.
'';
};
};
};
config = mkIf (config.i18n.inputMethod.enabled == "uim") {
i18n.inputMethod.package = pkgs.uim;
home.sessionVariables = {
GTK_IM_MODULE = "uim";
QT_IM_MODULE = "uim";
XMODIFIERS = "@im=uim";
};
systemd.user.services.uim-daemon = {
Unit = {
Description = "Uim input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = toString
(pkgs.writeShellScript "start-uim-xim-and-uim-toolbar" ''
${pkgs.uim}/bin/uim-xim &
${pkgs.uim}/bin/uim-toolbar-${cfg.toolbar}
'');
Install.WantedBy = [ "graphical-session.target" ];
};
};
}

@ -0,0 +1,213 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
inherit (lib.generators) toPlist;
cfg = config.launchd;
labelPrefix = "org.nix-community.home.";
dstDir = "${config.home.homeDirectory}/Library/LaunchAgents";
launchdConfig = { config, name, ... }: {
options = {
enable = mkEnableOption name;
config = mkOption {
type = types.submodule (import ./launchd.nix);
default = { };
example = literalExpression ''
{
ProgramArguments = [ "/usr/bin/say" "Good afternoon" ];
StartCalendarInterval = {
Hour = 12;
Minute = 0;
};
}
'';
description = ''
Define a launchd job. See <citerefentry>
<refentrytitle>launchd.plist</refentrytitle><manvolnum>5</manvolnum>
</citerefentry> for details.
'';
};
};
config = { config.Label = mkDefault "${labelPrefix}${name}"; };
};
toAgent = config: pkgs.writeText "${config.Label}.plist" (toPlist { } config);
agentPlists =
mapAttrs' (n: v: nameValuePair "${v.config.Label}.plist" (toAgent v.config))
(filterAttrs (n: v: v.enable) cfg.agents);
agentsDrv = pkgs.runCommand "home-manager-agents" { } ''
mkdir -p "$out"
declare -A plists
plists=(${
concatStringsSep " "
(mapAttrsToList (name: value: "['${name}']='${value}'") agentPlists)
})
for dest in "''${!plists[@]}"; do
src="''${plists[$dest]}"
ln -s "$src" "$out/$dest"
done
'';
in {
meta.maintainers = with maintainers; [ midchildan ];
options.launchd = {
enable = mkOption {
type = types.bool;
default = isDarwin;
defaultText = literalExpression "pkgs.stdenv.hostPlatform.isDarwin";
description = ''
Whether to enable Home Manager to define per-user daemons by making use
of launchd's LaunchAgents.
'';
};
agents = mkOption {
type = with types; attrsOf (submodule launchdConfig);
default = { };
description = "Define LaunchAgents.";
};
};
config = mkMerge [
{
assertions = [{
assertion = (cfg.enable && agentPlists != { }) -> isDarwin;
message = let names = lib.concatStringsSep ", " (attrNames agentPlists);
in "Must use Darwin for modules that require Launchd: " + names;
}];
}
(mkIf isDarwin {
home.extraBuilderCommands = ''
ln -s "${agentsDrv}" $out/LaunchAgents
'';
home.activation.checkLaunchAgents =
hm.dag.entryBefore [ "writeBoundary" ] ''
checkLaunchAgents() {
local oldDir newDir dstDir err
oldDir=""
err=0
if [[ -n "''${oldGenPath:-}" ]]; then
oldDir="$(readlink -m "$oldGenPath/LaunchAgents")" || err=$?
if (( err )); then
oldDir=""
fi
fi
newDir=${escapeShellArg agentsDrv}
dstDir=${escapeShellArg dstDir}
local oldSrcPath newSrcPath dstPath agentFile agentName
find -L "$newDir" -maxdepth 1 -name '*.plist' -type f -print0 \
| while IFS= read -rd "" newSrcPath; do
agentFile="''${newSrcPath##*/}"
agentName="''${agentFile%.plist}"
dstPath="$dstDir/$agentFile"
oldSrcPath="$oldDir/$agentFile"
if [[ ! -e "$dstPath" ]]; then
continue
fi
if ! cmp --quiet "$oldSrcPath" "$dstPath"; then
errorEcho "Existing file '$dstPath' is in the way of '$newSrcPath'"
exit 1
fi
done
}
checkLaunchAgents
'';
# NOTE: Launch Agent configurations can't be symlinked from the Nix store
# because it needs to be owned by the user running it.
home.activation.setupLaunchAgents =
hm.dag.entryAfter [ "writeBoundary" ] ''
setupLaunchAgents() {
local oldDir newDir dstDir domain err
oldDir=""
err=0
if [[ -n "''${oldGenPath:-}" ]]; then
oldDir="$(readlink -m "$oldGenPath/LaunchAgents")" || err=$?
if (( err )); then
oldDir=""
fi
fi
newDir="$(readlink -m "$newGenPath/LaunchAgents")"
dstDir=${escapeShellArg dstDir}
domain="gui/$UID"
err=0
local srcPath dstPath agentFile agentName i bootout_retries
bootout_retries=10
find -L "$newDir" -maxdepth 1 -name '*.plist' -type f -print0 \
| while IFS= read -rd "" srcPath; do
agentFile="''${srcPath##*/}"
agentName="''${agentFile%.plist}"
dstPath="$dstDir/$agentFile"
if cmp --quiet "$srcPath" "$dstPath"; then
continue
fi
if [[ -f "$dstPath" ]]; then
for (( i = 0; i < bootout_retries; i++ )); do
$DRY_RUN_CMD launchctl bootout "$domain/$agentName" || err=$?
if [[ -v DRY_RUN ]]; then
break
fi
if (( err != 9216 )) &&
! launchctl print "$domain/$agentName" &> /dev/null; then
break
fi
sleep 1
done
if (( i == bootout_retries )); then
warnEcho "Failed to stop '$domain/$agentName'"
return 1
fi
fi
$DRY_RUN_CMD install -Dm444 -T "$srcPath" "$dstPath"
$DRY_RUN_CMD launchctl bootstrap "$domain" "$dstPath"
done
if [[ ! -e "$oldDir" ]]; then
return
fi
find -L "$oldDir" -maxdepth 1 -name '*.plist' -type f -print0 \
| while IFS= read -rd "" srcPath; do
agentFile="''${srcPath##*/}"
agentName="''${agentFile%.plist}"
dstPath="$dstDir/$agentFile"
if [[ -e "$newDir/$agentFile" ]]; then
continue
fi
$DRY_RUN_CMD launchctl bootout "$domain/$agentName" || :
if [[ ! -e "$dstPath" ]]; then
continue
fi
if ! cmp --quiet "$srcPath" "$dstPath"; then
warnEcho "Skipping deletion of '$dstPath', since its contents have diverged"
continue
fi
$DRY_RUN_CMD rm -f $VERBOSE_ARG "$dstPath"
done
}
setupLaunchAgents
'';
})
];
}

@ -0,0 +1,869 @@
# launchd option type from nix-darwin
#
# Original Source:
# https://github.com/LnL7/nix-darwin/blob/a34dea2/modules/launchd/launchd.nix
# Copyright 2017 Daiderd Jordan
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ config, lib, ... }:
with lib;
{
options = {
Label = mkOption {
type = types.str;
description = "This required key uniquely identifies the job to launchd.";
};
Disabled = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key is used as a hint to <literal>launchctl(1)</literal> that it should not submit this job to launchd when
loading a job or jobs. The value of this key does NOT reflect the current state of the job on the run-ning running
ning system. If you wish to know whether a job is loaded in launchd, reading this key from a configura-tion configuration
tion file yourself is not a sufficient test. You should query launchd for the presence of the job using
the <literal>launchctl(1)</literal> list subcommand or use the ServiceManagement framework's
<literal>SMJobCopyDictionary()</literal> method.
Note that as of Mac OS X v10.6, this key's value in a configuration file conveys a default value, which
is changed with the [-w] option of the <literal>launchctl(1)</literal> load and unload subcommands. These subcommands no
longer modify the configuration file, so the value displayed in the configuration file is not necessar-ily necessarily
ily the value that <literal>launchctl(1)</literal> will apply. See <literal>launchctl(1)</literal> for more information.
Please also be mindful that you should only use this key if the provided on-demand and KeepAlive crite-ria criteria
ria are insufficient to describe the conditions under which your job needs to run. The cost to have a
job loaded in launchd is negligible, so there is no harm in loading a job which only runs once or very
rarely.
'';
};
UserName = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key specifies the user to run the job as. This key is only applicable when launchd is
running as root.
'';
};
GroupName = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key specifies the group to run the job as. This key is only applicable when launchd is
running as root. If UserName is set and GroupName is not, the the group will be set to the default
group of the user.
'';
};
inetdCompatibility = mkOption {
default = null;
example = { Wait = true; };
description = ''
The presence of this key specifies that the daemon expects to be run as if it were launched from inetd.
'';
type = types.nullOr (types.submodule {
options = {
Wait = mkOption {
type = types.nullOr (types.either types.bool types.str);
default = null;
description = ''
This flag corresponds to the "wait" or "nowait" option of inetd. If true, then the listening
socket is passed via the standard in/out/error file descriptors. If false, then <literal>accept(2)</literal> is
called on behalf of the job, and the result is passed via the standard in/out/error descriptors.
'';
};
};
});
};
LimitLoadToHosts = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
This configuration file only applies to the hosts listed with this key. Note: One should set kern.host-name kern.hostname
name in <literal>sysctl.conf(5)</literal> for this feature to work reliably.
'';
};
LimitLoadFromHosts = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
This configuration file only applies to hosts NOT listed with this key. Note: One should set kern.host-name kern.hostname
name in <literal>sysctl.conf(5)</literal> for this feature to work reliably.
'';
};
LimitLoadToSessionType = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This configuration file only applies to sessions of the type specified. This key is used in concert
with the -S flag to <command>launchctl</command>.
'';
};
Program = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
This key maps to the first argument of <literal>execvp(3)</literal>. If this key is missing, then the first element of
the array of strings provided to the ProgramArguments will be used instead. This key is required in
the absence of the ProgramArguments key.
'';
};
ProgramArguments = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
This key maps to the second argument of <literal>execvp(3)</literal>. This key is required in the absence of the Program
key. Please note: many people are confused by this key. Please read <literal>execvp(3)</literal> very carefully!
'';
};
EnableGlobbing = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This flag causes launchd to use the <literal>glob(3)</literal> mechanism to update the program arguments before invoca-tion. invocation.
tion.
'';
};
EnableTransactions = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This flag instructs launchd that the job promises to use <literal>vproc_transaction_begin(3)</literal> and
<literal>vproc_transaction_end(3)</literal> to track outstanding transactions that need to be reconciled before the
process can safely terminate. If no outstanding transactions are in progress, then launchd is free to
send the SIGKILL signal.
'';
};
OnDemand = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This key was used in Mac OS X 10.4 to control whether a job was kept alive or not. The default was
true. This key has been deprecated and replaced in Mac OS X 10.5 and later with the more powerful
KeepAlive option.
'';
};
KeepAlive = mkOption {
type = types.nullOr (types.either types.bool (types.submodule {
options = {
SuccessfulExit = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
If true, the job will be restarted as long as the program exits and with an exit status of zero.
If false, the job will be restarted in the inverse condition. This key implies that "RunAtLoad"
is set to true, since the job needs to run at least once before we can get an exit status.
'';
};
NetworkState = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
If true, the job will be kept alive as long as the network is up, where up is defined as at least
one non-loopback interface being up and having IPv4 or IPv6 addresses assigned to them. If
false, the job will be kept alive in the inverse condition.
'';
};
PathState = mkOption {
type = types.nullOr (types.attrsOf types.bool);
default = null;
description = ''
Each key in this dictionary is a file-system path. If the value of the key is true, then the job
will be kept alive as long as the path exists. If false, the job will be kept alive in the
inverse condition. The intent of this feature is that two or more jobs may create semaphores in
the file-system namespace.
'';
};
OtherJobEnabled = mkOption {
type = types.nullOr (types.attrsOf types.bool);
default = null;
description = ''
Each key in this dictionary is the label of another job. If the value of the key is true, then
this job is kept alive as long as that other job is enabled. Otherwise, if the value is false,
then this job is kept alive as long as the other job is disabled. This feature should not be
considered a substitute for the use of IPC.
'';
};
# NOTE: this was missing in the original source at the time of writing
Crashed = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
If true, the the job will be restarted as long as it exited due to a signal which is typically
associated with a crash (SIGILL, SIGSEGV, etc.). If false, the job will be restarted in the inverse
condition.
'';
};
};
}));
default = null;
description = ''
This optional key is used to control whether your job is to be kept continuously running or to let
demand and conditions control the invocation. The default is false and therefore only demand will start
the job. The value may be set to true to unconditionally keep the job alive. Alternatively, a dictio-nary dictionary
nary of conditions may be specified to selectively control whether launchd keeps a job alive or not. If
multiple keys are provided, launchd ORs them, thus providing maximum flexibility to the job to refine
the logic and stall if necessary. If launchd finds no reason to restart the job, it falls back on
demand based invocation. Jobs that exit quickly and frequently when configured to be kept alive will
be throttled to converve system resources.
'';
};
RunAtLoad = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key is used to control whether your job is launched once at the time the job is loaded.
The default is false.
'';
};
RootDirectory = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key is used to specify a directory to <literal>chroot(2)</literal> to before running the job.
'';
};
WorkingDirectory = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key is used to specify a directory to <literal>chdir(2)</literal> to before running the job.
'';
};
EnvironmentVariables = mkOption {
type = types.nullOr (types.attrsOf types.str);
default = null;
description = ''
This optional key is used to specify additional environment variables to be set before running the
job.
'';
};
Umask = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
This optional key specifies what value should be passed to <literal>umask(2)</literal> before running the job. Known bug:
Property lists don't support octal, so please convert the value to decimal.
'';
};
TimeOut = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The recommended idle time out (in seconds) to pass to the job. If no value is specified, a default time
out will be supplied by launchd for use by the job at check in time.
'';
};
ExitTimeOut = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The amount of time launchd waits before sending a SIGKILL signal. The default value is 20 seconds. The
value zero is interpreted as infinity.
'';
};
ThrottleInterval = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
This key lets one override the default throttling policy imposed on jobs by launchd. The value is in
seconds, and by default, jobs will not be spawned more than once every 10 seconds. The principle
behind this is that jobs should linger around just in case they are needed again in the near future.
This not only reduces the latency of responses, but it encourages developers to amortize the cost of
program invocation.
'';
};
InitGroups = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether <literal>initgroups(3)</literal> should be called before running the job. The default
is true in 10.5 and false in 10.4. This key will be ignored if the UserName key is not set.
'';
};
WatchPaths = mkOption {
type = types.nullOr (types.listOf types.path);
default = null;
description = ''
This optional key causes the job to be started if any one of the listed paths are modified.
'';
};
QueueDirectories = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
Much like the WatchPaths option, this key will watch the paths for modifications. The difference being
that the job will only be started if the path is a directory and the directory is not empty.
'';
};
StartOnMount = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key causes the job to be started every time a filesystem is mounted.
'';
};
StartInterval = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
This optional key causes the job to be started every N seconds. If the system is asleep, the job will
be started the next time the computer wakes up. If multiple intervals transpire before the computer is
woken, those events will be coalesced into one event upon wake from sleep.
'';
};
StartCalendarInterval = mkOption {
default = null;
example = { Hour = 2; Minute = 30; };
description = ''
This optional key causes the job to be started every calendar interval as specified. Missing arguments
are considered to be wildcard. The semantics are much like <literal>crontab(5)</literal>. Unlike cron which skips job
invocations when the computer is asleep, launchd will start the job the next time the computer wakes
up. If multiple intervals transpire before the computer is woken, those events will be coalesced into
one event upon wake from sleep.
'';
type = types.nullOr (types.listOf (types.submodule {
options = {
Minute = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The minute on which this job will be run.
'';
};
Hour = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The hour on which this job will be run.
'';
};
Day = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The day on which this job will be run.
'';
};
Weekday = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The weekday on which this job will be run (0 and 7 are Sunday).
'';
};
Month = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The month on which this job will be run.
'';
};
};
}));
};
StandardInPath = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
This optional key specifies what file should be used for data being supplied to stdin when using
<literal>stdio(3)</literal>.
'';
};
StandardOutPath = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
This optional key specifies what file should be used for data being sent to stdout when using <literal>stdio(3)</literal>.
'';
};
StandardErrorPath = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
This optional key specifies what file should be used for data being sent to stderr when using <literal>stdio(3)</literal>.
'';
};
Debug = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies that launchd should adjust its log mask temporarily to LOG_DEBUG while
dealing with this job.
'';
};
WaitForDebugger = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies that launchd should instruct the kernel to have the job wait for a debugger
to attach before any code in the job is executed.
'';
};
SoftResourceLimits = mkOption {
default = null;
description = ''
Resource limits to be imposed on the job. These adjust variables set with <literal>setrlimit(2)</literal>. The following
keys apply:
'';
type = types.nullOr (types.submodule {
options = {
Core = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The largest size (in bytes) core file that may be created.
'';
};
CPU = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum amount of cpu time (in seconds) to be used by each process.
'';
};
Data = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) of the data segment for a process; this defines how far a program may
extend its break with the <literal>sbrk(2)</literal> system call.
'';
};
FileSize = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The largest size (in bytes) file that may be created.
'';
};
MemoryLock = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) which a process may lock into memory using the mlock(2) function.
'';
};
NumberOfFiles = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum number of open files for this process. Setting this value in a system wide daemon
will set the <literal>sysctl(3)</literal> kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResource-Limits) (HardResourceLimits)
Limits) value in addition to the <literal>setrlimit(2)</literal> values.
'';
};
NumberOfProcesses = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum number of simultaneous processes for this user id. Setting this value in a system
wide daemon will set the <literal>sysctl(3)</literal> kern.maxproc (SoftResourceLimits) or kern.maxprocperuid
(HardResourceLimits) value in addition to the <literal>setrlimit(2)</literal> values.
'';
};
ResidentSetSize = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) to which a process's resident set size may grow. This imposes a
limit on the amount of physical memory to be given to a process; if memory is tight, the system
will prefer to take memory from processes that are exceeding their declared resident set size.
'';
};
Stack = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) of the stack segment for a process; this defines how far a program's
stack segment may be extended. Stack extension is performed automatically by the system.
'';
};
};
});
};
HardResourceLimits = mkOption {
default = null;
example = { NumberOfFiles = 4096; };
description = ''
Resource limits to be imposed on the job. These adjust variables set with <literal>setrlimit(2)</literal>. The following
keys apply:
'';
type = types.nullOr (types.submodule {
options = {
Core = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The largest size (in bytes) core file that may be created.
'';
};
CPU = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum amount of cpu time (in seconds) to be used by each process.
'';
};
Data = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) of the data segment for a process; this defines how far a program may
extend its break with the <literal>sbrk(2)</literal> system call.
'';
};
FileSize = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The largest size (in bytes) file that may be created.
'';
};
MemoryLock = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) which a process may lock into memory using the <literal>mlock(2)</literal> function.
'';
};
NumberOfFiles = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum number of open files for this process. Setting this value in a system wide daemon
will set the <literal>sysctl(3)</literal> kern.maxfiles (SoftResourceLimits) or kern.maxfilesperproc (HardResource-Limits) (HardResourceLimits)
Limits) value in addition to the <literal>setrlimit(2)</literal> values.
'';
};
NumberOfProcesses = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum number of simultaneous processes for this user id. Setting this value in a system
wide daemon will set the <literal>sysctl(3)</literal> kern.maxproc (SoftResourceLimits) or kern.maxprocperuid
(HardResourceLimits) value in addition to the <literal>setrlimit(2)</literal> values.
'';
};
ResidentSetSize = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) to which a process's resident set size may grow. This imposes a
limit on the amount of physical memory to be given to a process; if memory is tight, the system
will prefer to take memory from processes that are exceeding their declared resident set size.
'';
};
Stack = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
The maximum size (in bytes) of the stack segment for a process; this defines how far a program's
stack segment may be extended. Stack extension is performed automatically by the system.
'';
};
};
});
};
Nice = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
This optional key specifies what nice(3) value should be applied to the daemon.
'';
};
ProcessType = mkOption {
type = types.nullOr (types.enum [ "Background" "Standard" "Adaptive" "Interactive" ]);
default = null;
example = "Background";
description = ''
This optional key describes, at a high level, the intended purpose of the job. The system will apply
resource limits based on what kind of job it is. If left unspecified, the system will apply light
resource limits to the job, throttling its CPU usage and I/O bandwidth. The following are valid values:
Background
Background jobs are generally processes that do work that was not directly requested by the user.
The resource limits applied to Background jobs are intended to prevent them from disrupting the
user experience.
Standard
Standard jobs are equivalent to no ProcessType being set.
Adaptive
Adaptive jobs move between the Background and Interactive classifications based on activity over
XPC connections. See <literal>xpc_transaction_begin(3)</literal> for details.
Interactive
Interactive jobs run with the same resource limitations as apps, that is to say, none. Interac-tive Interactive
tive jobs are critical to maintaining a responsive user experience, and this key should only be
used if an app's ability to be responsive depends on it, and cannot be made Adaptive.
'';
};
AbandonProcessGroup = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
When a job dies, launchd kills any remaining processes with the same process group ID as the job. Set-ting Setting
ting this key to true disables that behavior.
'';
};
LowPriorityIO = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether the kernel should consider this daemon to be low priority when
doing file system I/O.
'';
};
LaunchOnlyOnce = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether the job can only be run once and only once. In other words, if the
job cannot be safely respawned without a full machine reboot, then set this key to be true.
'';
};
MachServices = mkOption {
default = null;
example = { ResetAtClose = true; };
description = ''
This optional key is used to specify Mach services to be registered with the Mach bootstrap sub-system.
Each key in this dictionary should be the name of service to be advertised. The value of the key must
be a boolean and set to true. Alternatively, a dictionary can be used instead of a simple true value.
Finally, for the job itself, the values will be replaced with Mach ports at the time of check-in with
launchd.
'';
type = types.nullOr (types.submodule {
options = {
ResetAtClose = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
If this boolean is false, the port is recycled, thus leaving clients to remain oblivious to the
demand nature of job. If the value is set to true, clients receive port death notifications when
the job lets go of the receive right. The port will be recreated atomically with respect to boot-strap_look_up() bootstrap_look_up()
strap_look_up() calls, so that clients can trust that after receiving a port death notification,
the new port will have already been recreated. Setting the value to true should be done with
care. Not all clients may be able to handle this behavior. The default value is false.
'';
};
HideUntilCheckIn = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Reserve the name in the namespace, but cause bootstrap_look_up() to fail until the job has
checked in with launchd.
'';
};
};
});
};
Sockets = mkOption {
default = null;
description = ''
This optional key is used to specify launch on demand sockets that can be used to let launchd know when
to run the job. The job must check-in to get a copy of the file descriptors using APIs outlined in
launch(3). The keys of the top level Sockets dictionary can be anything. They are meant for the appli-cation application
cation developer to use to differentiate which descriptors correspond to which application level proto-cols protocols
cols (e.g. http vs. ftp vs. DNS...). At check-in time, the value of each Sockets dictionary key will
be an array of descriptors. Daemon/Agent writers should consider all descriptors of a given key to be
to be effectively equivalent, even though each file descriptor likely represents a different networking
protocol which conforms to the criteria specified in the job configuration file.
The parameters below are used as inputs to call <literal>getaddrinfo(3)</literal>.
'';
type = types.nullOr (types.attrsOf (types.submodule {
options = {
SockType = mkOption {
type = types.nullOr (types.enum [ "stream" "dgram" "seqpacket" ]);
default = null;
description = ''
This optional key tells launchctl what type of socket to create. The default is "stream" and
other valid values for this key are "dgram" and "seqpacket" respectively.
'';
};
SockPassive = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
This optional key specifies whether <literal>listen(2)</literal> or <literal>connect(2)</literal> should be called on the created file
descriptor. The default is true ("to listen").
'';
};
SockNodeName = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key specifies the node to <literal>connect(2)</literal> or <literal>bind(2)</literal> to.
'';
};
SockServiceName = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key specifies the service on the node to <literal>connect(2)</literal> or <literal>bind(2)</literal> to.
'';
};
SockFamily = mkOption {
type = types.nullOr (types.enum [ "IPv4" "IPv6" ]);
default = null;
description = ''
This optional key can be used to specifically request that "IPv4" or "IPv6" socket(s) be created.
'';
};
SockProtocol = mkOption {
type = types.nullOr (types.enum [ "TCP" ]);
default = null;
description = ''
This optional key specifies the protocol to be passed to <literal>socket(2)</literal>. The only value understood by
this key at the moment is "TCP".
'';
};
SockPathName = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
This optional key implies SockFamily is set to "Unix". It specifies the path to <literal>connect(2)</literal> or
<literal>bind(2)</literal> to.
'';
};
SecureSocketWithKey = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key is a variant of SockPathName. Instead of binding to a known path, a securely
generated socket is created and the path is assigned to the environment variable that is inher-ited inherited
ited by all jobs spawned by launchd.
'';
};
SockPathMode = mkOption {
type = types.nullOr types.int;
default = null;
description = ''
This optional key specifies the mode of the socket. Known bug: Property lists don't support
octal, so please convert the value to decimal.
'';
};
Bonjour = mkOption {
type = types.nullOr (types.either types.bool (types.listOf types.str));
default = null;
description = ''
This optional key can be used to request that the service be registered with the
<literal>mDNSResponder(8)</literal>. If the value is boolean, the service name is inferred from the SockService-Name. SockServiceName.
Name.
'';
};
MulticastGroup = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
This optional key can be used to request that the datagram socket join a multicast group. If the
value is a hostname, then <literal>getaddrinfo(3)</literal> will be used to join the correct multicast address for a
given socket family. If an explicit IPv4 or IPv6 address is given, it is required that the Sock-Family SockFamily
Family family also be set, otherwise the results are undefined.
'';
};
};
}));
};
};
config = {
};
}

@ -0,0 +1,83 @@
#!/usr/bin/env bash
function setupVars() {
local nixStateDir="${NIX_STATE_DIR:-/nix/var/nix}"
local profilesPath="$nixStateDir/profiles/per-user/$USER"
local gcPath="$nixStateDir/gcroots/per-user/$USER"
declare -gr nixProfilePath="$profilesPath/profile"
declare -gr genProfilePath="$profilesPath/home-manager"
declare -gr newGenPath="@GENERATION_DIR@";
declare -gr newGenGcPath="$gcPath/current-home"
local greatestGenNum
greatestGenNum=$( \
nix-env --list-generations --profile "$genProfilePath" \
| tail -1 \
| sed -E 's/ *([[:digit:]]+) .*/\1/')
if [[ -n $greatestGenNum ]] ; then
declare -gr oldGenNum=$greatestGenNum
declare -gr newGenNum=$((oldGenNum + 1))
else
declare -gr newGenNum=1
fi
if [[ -e $profilesPath/home-manager ]] ; then
oldGenPath="$(readlink -e "$profilesPath/home-manager")"
declare -gr oldGenPath
fi
$VERBOSE_RUN _i "Sanity checking oldGenNum and oldGenPath"
if [[ -v oldGenNum && ! -v oldGenPath
|| ! -v oldGenNum && -v oldGenPath ]]; then
_i $'The previous generation number and path are in conflict! These\nmust be either both empty or both set but are now set to\n\n \'%s\' and \'%s\'\n\nIf you don\'t mind losing previous profile generations then\nthe easiest solution is probably to run\n\n rm %s/home-manager*\n rm %s/current-home\n\nand trying home-manager switch again. Good luck!' \
"${oldGenNum:-}" "${oldGenPath:-}" \
"$profilesPath" "$gcPath"
exit 1
fi
}
if [[ -v VERBOSE ]]; then
export VERBOSE_ECHO=echo
export VERBOSE_ARG="--verbose"
export VERBOSE_RUN=""
else
export VERBOSE_ECHO=true
export VERBOSE_ARG=""
export VERBOSE_RUN=true
fi
_i "Starting Home Manager activation"
# Verify that we can connect to the Nix store and/or daemon. This will
# also create the necessary directories in profiles and gcroots.
$VERBOSE_RUN _i "Sanity checking Nix"
nix-build --expr '{}' --no-out-link
setupVars
if [[ -v DRY_RUN ]] ; then
_i "This is a dry run"
export DRY_RUN_CMD=echo
else
$VERBOSE_RUN _i "This is a live run"
export DRY_RUN_CMD=""
fi
if [[ -v VERBOSE ]]; then
_i 'Using Nix version: %s' "$(nix-env --version)"
fi
$VERBOSE_RUN _i "Activation variables:"
if [[ -v oldGenNum ]] ; then
$VERBOSE_ECHO " oldGenNum=$oldGenNum"
$VERBOSE_ECHO " oldGenPath=$oldGenPath"
else
$VERBOSE_ECHO " oldGenNum undefined (first run?)"
$VERBOSE_ECHO " oldGenPath undefined (first run?)"
fi
$VERBOSE_ECHO " newGenPath=$newGenPath"
$VERBOSE_ECHO " newGenNum=$newGenNum"
$VERBOSE_ECHO " newGenGcPath=$newGenGcPath"
$VERBOSE_ECHO " genProfilePath=$genProfilePath"

@ -0,0 +1,39 @@
# The check for terminal output and color support is heavily inspired
# by https://unix.stackexchange.com/a/10065.
#
# Allow opt out by respecting the `NO_COLOR` environment variable.
function setupColors() {
normalColor=""
errorColor=""
warnColor=""
noteColor=""
# Enable colors for terminals, and allow opting out.
if [[ ! -v NO_COLOR && -t 1 ]]; then
# See if it supports colors.
local ncolors
ncolors=$(tput colors)
if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then
normalColor="$(tput sgr0)"
errorColor="$(tput bold)$(tput setaf 1)"
warnColor="$(tput setaf 3)"
noteColor="$(tput bold)$(tput setaf 6)"
fi
fi
}
setupColors
function errorEcho() {
echo "${errorColor}$*${normalColor}"
}
function warnEcho() {
echo "${warnColor}$*${normalColor}"
}
function noteEcho() {
echo "${noteColor}$*${normalColor}"
}

@ -0,0 +1,14 @@
{ lib }:
{
assertPlatform = module: pkgs: platforms: {
assertion = lib.elem pkgs.stdenv.hostPlatform.system platforms;
message = let
platformsStr = lib.concatStringsSep "\n"
(map (p: " - ${p}") (lib.sort (a: b: a < b) platforms));
in ''
The module ${module} does not support your platform. It only supports
${platformsStr}'';
};
}

@ -0,0 +1,5 @@
{ lib }: {
# Converts a boolean to a yes/no string. This is used in lots of
# configuration formats.
yesNo = value: if value then "yes" else "no";
}

@ -0,0 +1,116 @@
# A generalization of Nixpkgs's `strings-with-deps.nix`.
#
# The main differences from the Nixpkgs version are
#
# - not specific to strings, i.e., any payload is OK,
#
# - the addition of the function `dagEntryBefore` indicating a
# "wanted by" relationship.
{ lib }:
let inherit (lib) all any filterAttrs mapAttrs mapAttrsToList toposort;
in rec {
emptyDag = { };
isDag = dag:
let isEntry = e: (e ? data) && (e ? after) && (e ? before);
in builtins.isAttrs dag && all (x: x) (mapAttrsToList (n: isEntry) dag);
# Takes an attribute set containing entries built by
# dagEntryAnywhere, dagEntryAfter, and dagEntryBefore to a
# topologically sorted list of entries.
#
# Internally this function uses the `toposort` function in
# `<nixpkgs/lib/lists.nix>` and its value is accordingly.
#
# Specifically, the result on success is
#
# { result = [{name = ?; data = ?;} …] }
#
# For example
#
# nix-repl> dagTopoSort {
# a = dagEntryAnywhere "1";
# b = dagEntryAfter ["a" "c"] "2";
# c = dagEntryBefore ["d"] "3";
# d = dagEntryBefore ["e"] "4";
# e = dagEntryAnywhere "5";
# } == {
# result = [
# { data = "1"; name = "a"; }
# { data = "3"; name = "c"; }
# { data = "2"; name = "b"; }
# { data = "4"; name = "d"; }
# { data = "5"; name = "e"; }
# ];
# }
# true
#
# And the result on error is
#
# {
# cycle = [ {after = ?; name = ?; data = ?} … ];
# loops = [ {after = ?; name = ?; data = ?} … ];
# }
#
# For example
#
# nix-repl> dagTopoSort {
# a = dagEntryAnywhere "1";
# b = dagEntryAfter ["a" "c"] "2";
# c = dagEntryAfter ["d"] "3";
# d = dagEntryAfter ["b"] "4";
# e = dagEntryAnywhere "5";
# } == {
# cycle = [
# { after = ["a" "c"]; data = "2"; name = "b"; }
# { after = ["d"]; data = "3"; name = "c"; }
# { after = ["b"]; data = "4"; name = "d"; }
# ];
# loops = [
# { after = ["a" "c"]; data = "2"; name = "b"; }
# ];
# } == {}
# true
dagTopoSort = dag:
let
dagBefore = dag: name:
mapAttrsToList (n: v: n)
(filterAttrs (n: v: any (a: a == name) v.before) dag);
normalizedDag = mapAttrs (n: v: {
name = n;
data = v.data;
after = v.after ++ dagBefore dag n;
}) dag;
before = a: b: any (c: a.name == c) b.after;
sorted = toposort before (mapAttrsToList (n: v: v) normalizedDag);
in if sorted ? result then {
result = map (v: { inherit (v) name data; }) sorted.result;
} else
sorted;
# Applies a function to each element of the given DAG.
dagMap = f: dag: mapAttrs (n: v: v // { data = f n v.data; }) dag;
# Create a DAG entry with no particular dependency information.
dagEntryAnywhere = data: {
inherit data;
before = [ ];
after = [ ];
};
dagEntryBetween = before: after: data: { inherit data before after; };
dagEntryAfter = after: data: {
inherit data after;
before = [ ];
};
dagEntryBefore = before: data: {
inherit data before;
after = [ ];
};
}

@ -0,0 +1,29 @@
{ lib }:
rec {
dag =
let
d = import ./dag.nix { inherit lib; };
in
{
empty = d.emptyDag;
isDag = d.isDag;
topoSort = d.dagTopoSort;
map = d.dagMap;
entryAnywhere = d.dagEntryAnywhere;
entryBetween = d.dagEntryBetween;
entryAfter = d.dagEntryAfter;
entryBefore = d.dagEntryBefore;
};
assertions = import ./assertions.nix { inherit lib; };
booleans = import ./booleans.nix { inherit lib; };
gvariant = import ./gvariant.nix { inherit lib; };
maintainers = import ./maintainers.nix;
strings = import ./strings.nix { inherit lib; };
types = import ./types.nix { inherit dag gvariant lib; };
shell = import ./shell.nix { inherit lib; };
zsh = import ./zsh.nix { inherit lib; };
}

@ -0,0 +1,116 @@
{ homeDirectory, lib, pkgs }:
let
inherit (lib) hasPrefix hm literalExpression mkDefault mkIf mkOption removePrefix types;
in
{
# Constructs a type suitable for a `home.file` like option. The
# target path may be either absolute or relative, in which case it
# is relative the `basePath` argument (which itself must be an
# absolute path).
#
# Arguments:
# - basePathDesc docbook compatible description of the base path
# - basePath the file base path
fileType = basePathDesc: basePath: types.attrsOf (types.submodule (
{ name, config, ... }: {
options = {
target = mkOption {
type = types.str;
apply = p:
let
absPath = if hasPrefix "/" p then p else "${basePath}/${p}";
in
removePrefix (homeDirectory + "/") absPath;
defaultText = literalExpression "<name>";
description = ''
Path to target file relative to ${basePathDesc}.
'';
};
text = mkOption {
default = null;
type = types.nullOr types.lines;
description = ''
Text of the file. If this option is null then
<link linkend="opt-home.file._name_.source">home.file.&lt;name?&gt;.source</link>
must be set.
'';
};
source = mkOption {
type = types.path;
description = ''
Path of the source file or directory. If
<link linkend="opt-home.file._name_.text">home.file.&lt;name?&gt;.text</link>
is non-null then this option will automatically point to a file
containing that text.
'';
};
executable = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Set the execute bit. If <literal>null</literal>, defaults to the mode
of the <varname>source</varname> file or to <literal>false</literal>
for files created through the <varname>text</varname> option.
'';
};
recursive = mkOption {
type = types.bool;
default = false;
description = ''
If the file source is a directory, then this option
determines whether the directory should be recursively
linked to the target location. This option has no effect
if the source is a file.
</para><para>
If <literal>false</literal> (the default) then the target
will be a symbolic link to the source directory. If
<literal>true</literal> then the target will be a
directory structure matching the source's but whose leafs
are symbolic links to the files of the source directory.
'';
};
onChange = mkOption {
type = types.lines;
default = "";
description = ''
Shell commands to run when file has changed between
generations. The script will be run
<emphasis>after</emphasis> the new files have been linked
into place.
</para><para>
Note, this code is always run when <literal>recursive</literal> is
enabled.
'';
};
force = mkOption {
type = types.bool;
default = false;
visible = false;
description = ''
Whether the target path should be unconditionally replaced
by the managed file source. Warning, this will silently
delete the target regardless of whether it is a file or
link.
'';
};
};
config = {
target = mkDefault name;
source = mkIf (config.text != null) (
mkDefault (pkgs.writeTextFile {
inherit (config) executable text;
name = hm.strings.storeFileName name;
})
);
};
}
));
}

@ -0,0 +1,159 @@
# A partial and basic implementation of GVariant formatted strings.
#
# Note, this API is not considered fully stable and it might therefore
# change in backwards incompatible ways without prior notice.
{ lib }:
let
inherit (lib)
concatMapStringsSep concatStrings escape hasPrefix head replaceStrings;
mkPrimitive = t: v: {
_type = "gvariant";
type = t;
value = v;
__toString = self: "@${self.type} ${toString self.value}";
};
type = {
arrayOf = t: "a${t}";
maybeOf = t: "m${t}";
tupleOf = ts: "(${concatStrings ts})";
string = "s";
boolean = "b";
uchar = "y";
int16 = "n";
uint16 = "q";
int32 = "i";
uint32 = "u";
int64 = "x";
uint64 = "t";
double = "d";
};
# Returns the GVariant type of a given Nix value. If no type can be
# found for the value then the empty string is returned.
typeOf = v:
with type;
if builtins.isBool v then
boolean
else if builtins.isInt v then
int32
else if builtins.isFloat v then
double
else if builtins.isString v then
string
else if builtins.isList v then
let elemType = elemTypeOf v;
in if elemType == "" then "" else arrayOf elemType
else if builtins.isAttrs v && v ? type then
v.type
else
"";
elemTypeOf = vs:
if builtins.isList vs then
if vs == [ ] then "" else typeOf (head vs)
else
"";
mkMaybe = elemType: elem:
mkPrimitive (type.maybeOf elemType) elem // {
__toString = self:
if self.value == null then
"@${self.type} nothing"
else
"just ${toString self.value}";
};
in rec {
inherit type typeOf;
isGVariant = v: v._type or "" == "gvariant";
isArray = hasPrefix "a";
isMaybe = hasPrefix "m";
isTuple = hasPrefix "(";
# Returns the GVariant value that most closely matches the given Nix
# value. If no GVariant value can be found then `null` is returned.
#
# No support for dictionaries, maybe types, or variants.
mkValue = v:
if builtins.isBool v then
mkBoolean v
else if builtins.isInt v then
mkInt32 v
else if builtins.isFloat v then
mkDouble v
else if builtins.isString v then
mkString v
else if builtins.isList v then
if v == [ ] then mkArray type.string [ ] else mkArray (elemTypeOf v) v
else if builtins.isAttrs v && (v._type or "") == "gvariant" then
v
else
null;
mkArray = elemType: elems:
mkPrimitive (type.arrayOf elemType) (map mkValue elems) // {
__toString = self:
"@${self.type} [${concatMapStringsSep "," toString self.value}]";
};
mkEmptyArray = elemType: mkArray elemType [ ];
mkNothing = elemType: mkMaybe elemType null;
mkJust = elem: let gvarElem = mkValue elem; in mkMaybe gvarElem.type gvarElem;
mkTuple = elems:
let
gvarElems = map mkValue elems;
tupleType = type.tupleOf (map (e: e.type) gvarElems);
in mkPrimitive tupleType gvarElems // {
__toString = self:
"@${self.type} (${concatMapStringsSep "," toString self.value})";
};
mkBoolean = v:
mkPrimitive type.boolean v // {
__toString = self: if self.value then "true" else "false";
};
mkString = v:
let sanitize = s: replaceStrings [ "\n" ] [ "\\n" ] (escape [ "'" "\\" ] s);
in mkPrimitive type.string v // {
__toString = self: "'${sanitize self.value}'";
};
mkObjectpath = v:
mkPrimitive type.string v // {
__toString = self: "objectpath '${escape [ "'" ] self.value}'";
};
mkUchar = mkPrimitive type.uchar;
mkInt16 = mkPrimitive type.int16;
mkUint16 = mkPrimitive type.uint16;
mkInt32 = v:
mkPrimitive type.int32 v // {
__toString = self: toString self.value;
};
mkUint32 = mkPrimitive type.uint32;
mkInt64 = mkPrimitive type.int64;
mkUint64 = mkPrimitive type.uint64;
mkDouble = v:
mkPrimitive type.double v // {
__toString = self: toString self.value;
};
}

@ -0,0 +1,274 @@
# Home Manager maintainers.
#
# This attribute set contains Home Manager module maintainers that do
# not have an entry in the Nixpkgs maintainer list [1]. Entries here
# are expected to be follow the same format as described in [1].
#
# [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1
{
amesgen = {
name = "amesgen";
email = "amesgen@amesgen.de";
github = "amesgen";
githubId = 15369874;
};
austreelis = {
email = "github@accounts.austreelis.net";
github = "Austreelis";
githubId = 56743515;
name = "Morgane Austreelis";
};
CarlosLoboxyz = {
name = "Carlos Lobo";
email = "86011416+CarlosLoboxyz@users.noreply.github.com";
github = "CarlosLoboxyz";
githubId = 86011416;
};
dwagenk = {
email = "dwagenk@mailbox.org";
github = "dwagenk";
githubId = 32838899;
name = "Daniel Wagenknecht";
};
justinlovinger = {
name = "Justin Lovinger";
email = "git@justinlovinger.com";
github = "JustinLovinger";
githubId = 7183441;
};
owm111 = {
email = "7798336+owm111@users.noreply.github.com";
name = "Owen McGrath";
github = "owm111";
githubId = 7798336;
};
cwyc = {
email = "cwyc@users.noreply.github.com";
name = "cwyc";
github = "cwyc";
githubId = 16950437;
};
chisui = {
name = "Philipp Dargel";
email = "chisui@users.noreply.github.com";
github = "chisui";
githubId = 4526429;
};
foo-dogsquared = {
name = "Gabriel Arazas";
email = "foo.dogsquared@gmail.com";
github = "foo-dogsquared";
githubId = 34962634;
};
olmokramer = {
name = "Olmo Kramer";
email = "olmokramer@users.noreply.github.com";
github = "olmokramer";
githubId = 3612514;
};
iosmanthus = {
name = "iosmanthus";
email = "myosmanthustree@gmail.com";
github = "iosmanthus";
githubId = 16307070;
};
kalhauge = {
name = "Christian Gram Kalhauge";
email = "kalhauge@users.noreply.github.com";
github = "kalhauge";
githubId = 1182166;
};
kamadorueda = {
name = "Kevin Amado";
email = "kamadorueda@gmail.com";
github = "kamadorueda";
githubId = 47480384;
keys = [{
longkeyid = "rsa4096/0x04D0CEAF916A9A40";
fingerprint = "2BE3 BAFD 793E A349 ED1F F00F 04D0 CEAF 916A 9A40";
}];
};
kubukoz = {
name = "Jakub Kozłowski";
email = "kubukoz@users.noreply.github.com";
github = "kubukoz";
githubId = 894884;
};
loicreynier = {
name = "Loïc Reynier";
email = "loic@loireynier.fr";
github = "loicreynier";
githubId = 88983487;
};
matrss = {
name = "Matthias Riße";
email = "matrss@users.noreply.github.com";
github = "matrss";
githubId = 9308656;
};
mifom = {
name = "mifom";
email = "mifom@users.noreply.github.com";
github = "mifom";
githubId = 23462908;
};
seylerius = {
email = "sable@seyleri.us";
name = "Sable Seyler";
github = "seylerius";
githubId = 1145981;
keys = [{
logkeyid = "rsa4096/0x68BF2EAE6D91CAFF";
fingerprint = "F0E0 0311 126A CD72 4392 25E6 68BF 2EAE 6D91 CAFF";
}];
};
fendse = {
email = "46252070+Fendse@users.noreply.github.com";
github = "Fendse";
githubId = 46252070;
name = "Sara Johnsson";
};
florpe = {
email = "jens.krewald@gmail.com";
github = "florpe";
githubId = 53856373;
name = "Jens Krewald";
};
maximsmol = {
email = "maximsmol@gmail.com";
github = "maximsmol";
githubId = 1472826;
name = "Max Smolin";
};
msfjarvis = {
email = "me@msfjarvis.dev";
github = "msfjarvis";
githubId = "13348378";
name = "Harsh Shandilya";
keys = [{
longkeyid = "rsa4096/0xB7843F823355E9B9";
fingerprint = "8F87 050B 0F9C B841 1515 7399 B784 3F82 3355 E9B9";
}];
};
ambroisie = {
email = "bruno.home-manager@belanyi.fr";
github = "ambroisie";
githubId = 12465195;
name = "Bruno BELANYI";
};
malvo = {
email = "malte@malvo.org";
github = "malte-v";
githubId = 34393802;
name = "Malte Voos";
};
kranzes = {
email = "personal@ilanjoselevich.com";
github = "Kranzes";
githubId = 56614642;
name = "Ilan Joselevich";
};
mager = {
email = "andreas@mager.eu";
github = "AndreasMager";
githubId = 5646732;
name = "Andreas Mager";
};
bjpbakker = {
email = "bart@thesoftwarecraft.com";
github = "bjpbakker";
githubId = 605641;
name = "Bart Bakker";
};
jrobsonchase = {
email = "josh@robsonchase.com";
github = "jrobsonchase";
githubId = 1553581;
name = "Josh Robson Chase";
};
hawkw = {
name = "Eliza Weisman";
email = "eliza@elizas.website";
github = "hawkw";
githubId = 2796466;
};
pamplemousse = {
name = "Xavier Maso";
email = "xav.maso@gmail.com";
github = "pamplemousse";
githubId = 2647236;
};
onny = {
name = "onny";
email = "onny@project-insanity.org";
github = "onny";
githubId = 757752;
};
aheaume = {
name = "aheaume";
email = "aheaume@users.noreply.github.com";
github = "aheaume";
githubId = 13830042;
};
t4ccer = {
name = "t4ccer";
email = "t4ccer@users.noreply.github.com";
github = "t4ccer";
githubId = 64430288;
};
nurelin = {
name = "nurelin";
email = "nurelin@users.noreply.github.com";
github = "nurelin";
githubId = 5276274;
};
pltanton = {
name = "pltanton";
email = "plotnikovanton@gmail.com";
github = "pltanton";
githubId = 4561823;
};
Philipp-M = {
email = "philipp@mildenberger.me";
github = "Philipp-M";
githubId = 9267430;
name = "Philipp Mildenberger";
};
pinage404 = {
name = "pinage404";
email = "pinage404@gmail.com";
github = "pinage404";
githubId = 6325757;
};
podocarp = {
name = "Jia Xiaodong";
email = "xdjiaxd@gmail.com";
github = "podocarp";
githubId = 10473184;
};
mainrs = {
name = "mainrs";
email = "5113257+mainrs@users.noreply.github.com";
github = "mainrs";
githubId = 5113257;
};
kmaasrud = {
name = "Knut Magnus Aasrud";
email = "km@aasrud.com";
github = "kmaasrud";
githubId = 54394333;
};
sebtm = {
name = "Sebastian Sellmeier";
email = "sebtm@users.noreply.github.com";
github = "sebtm";
githubId = 17243347;
};
rszamszur = {
name = "Radosław Szamszur";
email = "radoslawszamszur@gmail.com";
github = "rszamszur";
githubId = 10353018;
};
}

@ -0,0 +1,11 @@
{ lib }:
rec {
# Produces a Bourne shell like variable export statement.
export = n: v: ''export ${n}="${toString v}"'';
# Given an attribute set containing shell variable names and their
# assignment, this function produces a string containing an export
# statement for each set entry.
exportAll = vars: lib.concatStringsSep "\n" (lib.mapAttrsToList export vars);
}

@ -0,0 +1,13 @@
# Just a convenience function that returns the given Nixpkgs standard
# library extended with the HM library.
nixpkgsLib:
let mkHmLib = import ./.;
in nixpkgsLib.extend (self: super: {
hm = mkHmLib { lib = self; };
# For forward compatibility.
literalExpression = super.literalExpression or super.literalExample;
literalDocBook = super.literalDocBook or super.literalExample;
})

@ -0,0 +1,23 @@
{ lib }:
let
inherit (lib)
genList length lowerChars replaceStrings stringToCharacters upperChars;
in {
# Figures out a valid Nix store name for the given path.
storeFileName = path:
let
# All characters that are considered safe. Note "-" is not
# included to avoid "-" followed by digit being interpreted as a
# version.
safeChars = [ "+" "." "_" "?" "=" ] ++ lowerChars ++ upperChars
++ stringToCharacters "0123456789";
empties = l: genList (x: "") (length l);
unsafeInName =
stringToCharacters (replaceStrings safeChars (empties safeChars) path);
safeName = replaceStrings unsafeInName (empties unsafeInName) path;
in "hm_" + safeName;
}

@ -0,0 +1,106 @@
{ dag, lib }:
let
inherit (lib)
concatStringsSep defaultFunctor fixedWidthNumber imap1 isAttrs isList length
listToAttrs mapAttrs mkIf mkOption mkOptionType nameValuePair stringLength
types warn;
isDagEntry = e: isAttrs e && (e ? data) && (e ? after) && (e ? before);
dagEntryOf = elemType:
let
submoduleType = types.submodule ({ name, ... }: {
options = {
data = mkOption { type = elemType; };
after = mkOption { type = with types; uniq (listOf str); };
before = mkOption { type = with types; uniq (listOf str); };
};
config = mkIf (elemType.name == "submodule") {
data._module.args.dagName = name;
};
});
maybeConvert = v: if isDagEntry v then v else dag.entryAnywhere v;
in mkOptionType {
name = "dagEntryOf";
description = "DAG entry of ${elemType.description}";
# leave the checking to the submodule type
merge = loc: defs:
submoduleType.merge loc
(map (def: def // { value = maybeConvert def.value; }) defs);
};
in rec {
# A directed acyclic graph of some inner type.
#
# Note, if the element type is a submodule then the `name` argument
# will always be set to the string "data" since it picks up the
# internal structure of the DAG values. To give access to the
# "actual" attribute name a new submodule argument is provided with
# the name `dagName`.
dagOf = elemType:
let attrEquivalent = types.attrsOf (dagEntryOf elemType);
in mkOptionType rec {
name = "dagOf";
description = "DAG of ${elemType.description}s";
inherit (attrEquivalent) check merge emptyValue;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<name>" ]);
getSubModules = elemType.getSubModules;
substSubModules = m: dagOf (elemType.substSubModules m);
functor = (defaultFunctor name) // { wrapped = elemType; };
nestedTypes.elemType = elemType;
};
# A directed acyclic graph of some inner type OR a list of that
# inner type. This is a temporary hack for use by the
# `programs.ssh.matchBlocks` and is only guaranteed to be vaguely
# correct!
#
# In particular, adding a dependency on one of the "unnamed-N-M"
# entries generated by a list value is almost guaranteed to destroy
# the list's order.
#
# This function will be removed in version 20.09.
listOrDagOf = elemType:
let
paddedIndexStr = list: i:
let padWidth = stringLength (toString (length list));
in fixedWidthNumber padWidth i;
convertAll = loc: defs:
let
convertListValue = namePrefix: def:
let
vs = def.value;
pad = paddedIndexStr vs;
makeEntry = i: v: nameValuePair "${namePrefix}.${pad i}" v;
warning = ''
In file ${def.file}
a list is being assigned to the option '${
concatStringsSep "." loc
}'.
This will soon be an error due to the list form being deprecated.
Please use the attribute set form instead with DAG functions to
express the desired order of entries.
'';
in warn warning (listToAttrs (imap1 makeEntry vs));
convertValue = i: def:
if isList def.value then
convertListValue "unnamed-${paddedIndexStr defs i}" def
else
def.value;
in imap1 (i: def: def // { value = convertValue i def; }) defs;
dagType = dagOf elemType;
in mkOptionType rec {
name = "listOrDagOf";
description = "list or DAG of ${elemType.description}s";
check = x: isList x || dagType.check x;
merge = loc: defs: dagType.merge loc (convertAll loc defs);
getSubOptions = dagType.getSubOptions;
getSubModules = dagType.getSubModules;
substSubModules = m: listOrDagOf (elemType.substSubModules m);
functor = (defaultFunctor name) // { wrapped = elemType; };
};
}

@ -0,0 +1,107 @@
{ lib, dag ? import ./dag.nix { inherit lib; }
, gvariant ? import ./gvariant.nix { inherit lib; } }:
let
inherit (lib)
all concatMap foldl' getFiles getValues head isFunction literalExpression
mergeAttrs mergeDefaultOption mergeOneOption mergeOptions mkOption
mkOptionType showFiles showOption types;
typesDag = import ./types-dag.nix { inherit dag lib; };
# Needed since the type is called gvariant and its merge attribute
# must refer back to the type.
gvar = gvariant;
in rec {
inherit (typesDag) dagOf listOrDagOf;
selectorFunction = mkOptionType {
name = "selectorFunction";
description = "Function that takes an attribute set and returns a list"
+ " containing a selection of the values of the input set";
check = isFunction;
merge = _loc: defs: as: concatMap (select: select as) (getValues defs);
};
overlayFunction = mkOptionType {
name = "overlayFunction";
description = "An overlay function, takes self and super and returns"
+ " an attribute set overriding the desired attributes.";
check = isFunction;
merge = _loc: defs: self: super:
foldl' (res: def: mergeAttrs res (def.value self super)) { } defs;
};
fontType = types.submodule {
options = {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExpression "pkgs.dejavu_fonts";
description = ''
Package providing the font. This package will be installed
to your profile. If <literal>null</literal> then the font
is assumed to already be available in your profile.
'';
};
name = mkOption {
type = types.str;
example = "DejaVu Sans";
description = ''
The family name of the font within the package.
'';
};
size = mkOption {
type = types.nullOr types.int;
default = null;
example = "8";
description = ''
The size of the font.
'';
};
};
};
gvariant = mkOptionType rec {
name = "gvariant";
description = "GVariant value";
check = v: gvar.mkValue v != null;
merge = loc: defs:
let
vdefs = map (d:
d // {
value =
if gvar.isGVariant d.value then d.value else gvar.mkValue d.value;
}) defs;
vals = map (d: d.value) vdefs;
defTypes = map (x: x.type) vals;
sameOrNull = x: y: if x == y then y else null;
# A bit naive to just check the first entry…
sharedDefType = foldl' sameOrNull (head defTypes) defTypes;
allChecked = all (x: check x) vals;
in if sharedDefType == null then
throw ("Cannot merge definitions of `${showOption loc}' with"
+ " mismatched GVariant types given in"
+ " ${showFiles (getFiles defs)}.")
else if gvar.isArray sharedDefType && allChecked then
gvar.mkValue ((types.listOf gvariant).merge loc
(map (d: d // { value = d.value.value; }) vdefs)) // {
type = sharedDefType;
}
else if gvar.isTuple sharedDefType && allChecked then
mergeOneOption loc defs
else if gvar.isMaybe sharedDefType && allChecked then
mergeOneOption loc defs
else if gvar.type.string == sharedDefType && allChecked then
types.str.merge loc defs
else if gvar.type.double == sharedDefType && allChecked then
types.float.merge loc defs
else
mergeDefaultOption loc defs;
};
}

@ -0,0 +1,30 @@
{ lib }:
rec {
# Produces a Zsh shell like value
toZshValue = v:
if builtins.isBool v then
if v then "true" else "false"
else if builtins.isString v then
''"${v}"''
else if builtins.isList v then
"(${lib.concatStringsSep " " (map toZshValue v)})"
else
''"${toString v}"'';
# Produces a Zsh shell like definition statement
define = n: v: "${n}=${toZshValue v}";
# Given an attribute set containing shell variable names and their
# assignments, this function produces a string containing a definition
# statement for each set entry.
defineAll = vars: lib.concatStringsSep "\n" (lib.mapAttrsToList define vars);
# Produces a Zsh shell like export statement
export = n: v: "export ${define n v}";
# Given an attribute set containing shell variable names and their
# assignments, this function produces a string containing an export
# statement for each set entry.
exportAll = vars: lib.concatStringsSep "\n" (lib.mapAttrsToList export vars);
}

@ -0,0 +1,68 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.manual;
docs = import ../docs { inherit lib pkgs; };
in
{
options = {
manual.html.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to install the HTML manual. This also installs the
<command>home-manager-help</command> tool, which opens a local
copy of the Home Manager manual in the system web browser.
'';
};
manual.manpages.enable = mkOption {
type = types.bool;
default = true;
example = false;
description = ''
Whether to install the configuration manual page. The manual can
be reached by <command>man home-configuration.nix</command>.
</para><para>
When looking at the manual page pretend that all references to
NixOS stuff are actually references to Home Manager stuff.
Thanks!
'';
};
manual.json.enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether to install a JSON formatted list of all Home Manager
options. This can be located at
<filename>&lt;profile directory&gt;/share/doc/home-manager/options.json</filename>,
and may be used for navigating definitions, auto-completing,
and other miscellaneous tasks.
'';
};
};
config = {
home.packages = mkMerge [
(mkIf cfg.html.enable [ docs.manual.html docs.manual.htmlOpenTool ])
(mkIf cfg.manpages.enable [ docs.manPages ])
(mkIf cfg.json.enable [ docs.options.json ])
];
# Whether a dependency on nmd should be introduced.
home.extraBuilderCommands =
mkIf (cfg.html.enable || cfg.manpages.enable || cfg.json.enable) ''
mkdir $out/lib
ln -s ${docs.nmdSrc} $out/lib/nmd
'';
};
}

@ -0,0 +1,75 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.dconf;
toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
mkIniKeyValue = key: value: "${key}=${toString (hm.gvariant.mkValue value)}";
in {
meta.maintainers = [ maintainers.rycee ];
options = {
dconf = {
enable = mkOption {
type = types.bool;
default = true;
visible = false;
description = ''
Whether to enable dconf settings.
</para><para>
Note, if you use NixOS then you must add
<code>programs.dconf.enable = true</code>
to your system configuration. Otherwise you will see a systemd error
message when your configuration is activated.
'';
};
settings = mkOption {
type = with types; attrsOf (attrsOf hm.types.gvariant);
default = { };
example = literalExpression ''
{
"org/gnome/calculator" = {
button-mode = "programming";
show-thousands = true;
base = 10;
word-size = 64;
window-position = lib.hm.gvariant.mkTuple [100 100];
};
}
'';
description = ''
Settings to write to the dconf configuration system.
'';
};
};
};
config = mkIf (cfg.enable && cfg.settings != { }) {
# Make sure the dconf directory exists.
xdg.configFile."dconf/.keep".source = builtins.toFile "keep" "";
home.activation.dconfSettings = hm.dag.entryAfter [ "installPackages" ]
(let iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
in ''
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
DCONF_DBUS_RUN_SESSION=""
else
DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session"
fi
if [[ -v DRY_RUN ]]; then
echo $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / "<" ${iniFile}
else
$DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
fi
unset DCONF_DBUS_RUN_SESSION
'');
};
}

@ -0,0 +1,26 @@
{ config, pkgs, lib, ... }:
with lib;
{
options.home = {
enableDebugInfo = mkEnableOption "" // {
description = ''
Some Nix-packages provide debug symbols for
<command>gdb</command> in the <literal>debug</literal>-output.
This option ensures that those are automatically fetched from
the binary cache if available and <command>gdb</command> is
configured to find those symbols.
'';
};
};
config = mkIf config.home.enableDebugInfo {
home.extraOutputsToInstall = [ "debug" ];
home.sessionVariables = {
NIX_DEBUG_INFO_DIRS =
"$NIX_DEBUG_INFO_DIRS\${NIX_DEBUG_INFO_DIRS:+:}${config.home.profileDirectory}/lib/debug";
};
};
}

@ -0,0 +1,95 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.fonts.fontconfig;
profileDirectory = config.home.profileDirectory;
in {
meta.maintainers = [ maintainers.rycee ];
imports = [
(mkRenamedOptionModule [ "fonts" "fontconfig" "enableProfileFonts" ] [
"fonts"
"fontconfig"
"enable"
])
];
options = {
fonts.fontconfig = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable fontconfig configuration. This will, for
example, allow fontconfig to discover fonts and
configurations installed through
<varname>home.packages</varname> and
<command>nix-env</command>.
'';
};
};
};
config = mkIf cfg.enable {
home.packages = [
# Make sure that buildEnv creates a real directory path so that we avoid
# trying to write to a read-only location.
(pkgs.runCommandLocal "dummy-fc-dir1" { } "mkdir -p $out/lib/fontconfig")
(pkgs.runCommandLocal "dummy-fc-dir2" { } "mkdir -p $out/lib/fontconfig")
];
home.extraProfileCommands = ''
if [[ -d $out/lib/X11/fonts || -d $out/share/fonts ]]; then
export FONTCONFIG_FILE="$(pwd)/fonts.conf"
cat > $FONTCONFIG_FILE << EOF
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>$out/lib/X11/fonts</dir>
<dir>$out/share/fonts</dir>
<cachedir>$out/lib/fontconfig/cache</cachedir>
</fontconfig>
EOF
${getBin pkgs.fontconfig}/bin/fc-cache -f
rm -f $out/lib/fontconfig/cache/CACHEDIR.TAG
rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig/cache
rm "$FONTCONFIG_FILE"
unset FONTCONFIG_FILE
fi
# Remove the fontconfig directory if no files were available.
if [[ -d $out/lib/fontconfig ]] ; then
rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig
fi
'';
xdg.configFile = {
"fontconfig/conf.d/10-hm-fonts.conf".text = ''
<?xml version='1.0'?>
<!-- Generated by Home Manager. -->
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<include ignore_missing="yes">${config.home.path}/etc/fonts/conf.d</include>
<include ignore_missing="yes">${config.home.path}/etc/fonts/fonts.conf</include>
<dir>${config.home.path}/lib/X11/fonts</dir>
<dir>${config.home.path}/share/fonts</dir>
<dir>${profileDirectory}/lib/X11/fonts</dir>
<dir>${profileDirectory}/share/fonts</dir>
<cachedir>${config.home.path}/lib/fontconfig/cache</cachedir>
</fontconfig>
'';
};
};
}

@ -0,0 +1,273 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.gtk;
cfg2 = config.gtk.gtk2;
cfg3 = config.gtk.gtk3;
cfg4 = config.gtk.gtk4;
toGtk3Ini = generators.toINI {
mkKeyValue = key: value:
let value' = if isBool value then boolToString value else toString value;
in "${escape [ "=" ] key}=${value'}";
};
formatGtk2Option = n: v:
let
v' = if isBool v then
boolToString value
else if isString v then
''"${v}"''
else
toString v;
in "${escape [ "=" ] n} = ${v'}";
themeType = types.submodule {
options = {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExpression "pkgs.gnome.gnome-themes-extra";
description = ''
Package providing the theme. This package will be installed
to your profile. If <literal>null</literal> then the theme
is assumed to already be available in your profile.
'';
};
name = mkOption {
type = types.str;
example = "Adwaita";
description = "The name of the theme within the package.";
};
};
};
iconThemeType = types.submodule {
options = {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExpression "pkgs.gnome.adwaita-icon-theme";
description = ''
Package providing the icon theme. This package will be installed
to your profile. If <literal>null</literal> then the theme
is assumed to already be available in your profile.
'';
};
name = mkOption {
type = types.str;
example = "Adwaita";
description = "The name of the icon theme within the package.";
};
};
};
cursorThemeType = types.submodule {
options = {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExpression "pkgs.vanilla-dmz";
description = ''
Package providing the cursor theme. This package will be installed
to your profile. If <literal>null</literal> then the theme
is assumed to already be available in your profile.
'';
};
name = mkOption {
type = types.str;
example = "Vanilla-DMZ";
description = "The name of the cursor theme within the package.";
};
size = mkOption {
type = types.nullOr types.int;
default = null;
example = 16;
description = ''
The size of the cursor.
'';
};
};
};
in {
meta.maintainers = [ maintainers.rycee ];
imports = [
(mkRemovedOptionModule [ "gtk" "gtk3" "waylandSupport" ] ''
This options is not longer needed and can be removed.
'')
];
options = {
gtk = {
enable = mkEnableOption "GTK 2/3 configuration";
font = mkOption {
type = types.nullOr hm.types.fontType;
default = null;
description = ''
The font to use in GTK+ 2/3 applications.
'';
};
cursorTheme = mkOption {
type = types.nullOr cursorThemeType;
default = null;
description = "The cursor theme to use.";
};
iconTheme = mkOption {
type = types.nullOr iconThemeType;
default = null;
description = "The icon theme to use.";
};
theme = mkOption {
type = types.nullOr themeType;
default = null;
description = "The GTK+2/3 theme to use.";
};
gtk2 = {
extraConfig = mkOption {
type = types.lines;
default = "";
example = "gtk-can-change-accels = 1";
description = ''
Extra configuration lines to add verbatim to
<filename>~/.gtkrc-2.0</filename>.
'';
};
configLocation = mkOption {
type = types.path;
default = "${config.home.homeDirectory}/.gtkrc-2.0";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/.gtkrc-2.0"'';
example =
literalExpression ''"''${config.xdg.configHome}/gtk-2.0/gtkrc"'';
description = ''
The location to put the GTK configuration file.
'';
};
};
gtk3 = {
bookmarks = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "file:///home/jane/Documents" ];
description = "Bookmarks in the sidebar of the GTK file browser";
};
extraConfig = mkOption {
type = with types; attrsOf (oneOf [ bool int str ]);
default = { };
example = {
gtk-cursor-blink = false;
gtk-recent-files-limit = 20;
};
description = ''
Extra configuration options to add to
<filename>$XDG_CONFIG_HOME/gtk-3.0/settings.ini</filename>.
'';
};
extraCss = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration lines to add verbatim to
<filename>$XDG_CONFIG_HOME/gtk-3.0/gtk.css</filename>.
'';
};
};
gtk4 = {
extraConfig = mkOption {
type = with types; attrsOf (either bool (either int str));
default = { };
example = {
gtk-cursor-blink = false;
gtk-recent-files-limit = 20;
};
description = ''
Extra configuration options to add to
<filename>$XDG_CONFIG_HOME/gtk-4.0/settings.ini</filename>.
'';
};
};
};
};
config = mkIf cfg.enable (let
gtkIni = optionalAttrs (cfg.font != null) {
gtk-font-name = let
fontSize =
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
in "${cfg.font.name}" + fontSize;
} // optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; }
// optionalAttrs (cfg.iconTheme != null) {
gtk-icon-theme-name = cfg.iconTheme.name;
} // optionalAttrs (cfg.cursorTheme != null) {
gtk-cursor-theme-name = cfg.cursorTheme.name;
} // optionalAttrs
(cfg.cursorTheme != null && cfg.cursorTheme.size != null) {
gtk-cursor-theme-size = cfg.cursorTheme.size;
};
dconfIni = optionalAttrs (cfg.font != null) {
font-name = let
fontSize =
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
in "${cfg.font.name}" + fontSize;
} // optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
// optionalAttrs (cfg.iconTheme != null) {
icon-theme = cfg.iconTheme.name;
} // optionalAttrs (cfg.cursorTheme != null) {
cursor-theme = cfg.cursorTheme.name;
} // optionalAttrs
(cfg.cursorTheme != null && cfg.cursorTheme.size != null) {
cursor-size = cfg.cursorTheme.size;
};
optionalPackage = opt:
optional (opt != null && opt.package != null) opt.package;
in {
home.packages = concatMap optionalPackage [
cfg.font
cfg.theme
cfg.iconTheme
cfg.cursorTheme
];
home.file.${cfg2.configLocation}.text =
concatMapStrings (l: l + "\n") (mapAttrsToList formatGtk2Option gtkIni)
+ cfg2.extraConfig + "\n";
home.sessionVariables.GTK2_RC_FILES = cfg2.configLocation;
xdg.configFile."gtk-3.0/settings.ini".text =
toGtk3Ini { Settings = gtkIni // cfg3.extraConfig; };
xdg.configFile."gtk-3.0/gtk.css" =
mkIf (cfg3.extraCss != "") { text = cfg3.extraCss; };
xdg.configFile."gtk-3.0/bookmarks" = mkIf (cfg3.bookmarks != [ ]) {
text = concatMapStrings (l: l + "\n") cfg3.bookmarks;
};
xdg.configFile."gtk-4.0/settings.ini".text =
toGtk3Ini { Settings = gtkIni // cfg4.extraConfig; };
dconf.settings."org/gnome/desktop/interface" = dconfIni;
});
}

@ -0,0 +1,14 @@
{ lib, ... }:
{
options = {
lib = lib.mkOption {
type = lib.types.attrsOf lib.types.attrs;
default = { };
description = ''
This option allows modules to define helper functions,
constants, etc.
'';
};
};
}

@ -0,0 +1,559 @@
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.news;
hostPlatform = pkgs.stdenv.hostPlatform;
entryModule = types.submodule ({ config, ... }: {
options = {
id = mkOption {
internal = true;
type = types.str;
description = ''
A unique entry identifier. By default it is a base16
formatted hash of the entry message.
'';
};
time = mkOption {
internal = true;
type = types.str;
example = "2017-07-10T21:55:04+00:00";
description = ''
News entry time stamp in ISO-8601 format. Must be in UTC
(ending in '+00:00').
'';
};
condition = mkOption {
internal = true;
default = true;
description = "Whether the news entry should be active.";
};
message = mkOption {
internal = true;
type = types.str;
description = "The news entry content.";
};
};
config = {
id = mkDefault (builtins.hashString "sha256" config.message);
};
});
in
{
meta.maintainers = [ maintainers.rycee ];
options = {
news = {
display = mkOption {
type = types.enum [ "silent" "notify" "show" ];
default = "notify";
description = ''
How unread and relevant news should be presented when
running <command>home-manager build</command> and
<command>home-manager switch</command>.
</para><para>
The options are
<variablelist>
<varlistentry>
<term><literal>silent</literal></term>
<listitem>
<para>
Do not print anything during build or switch. The
<command>home-manager news</command> command still
works for viewing the entries.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>notify</literal></term>
<listitem>
<para>
The number of unread and relevant news entries will be
printed to standard output. The <command>home-manager
news</command> command can later be used to view the
entries.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>show</literal></term>
<listitem>
<para>
A pager showing unread news entries is opened.
</para>
</listitem>
</varlistentry>
</variablelist>
'';
};
entries = mkOption {
internal = true;
type = types.listOf entryModule;
default = [];
description = "News entries.";
};
};
};
config = {
# Add news entries in chronological order (i.e., latest time
# should be at the bottom of the list). The time should be
# formatted as given in the output of
#
# date --iso-8601=second --universal
#
# On darwin (or BSD like systems) use
#
# date -u +'%Y-%m-%dT%H:%M:%S+00:00'
news.entries = [
{
time = "2021-06-02T04:24:10+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.xidlehook'.
'';
}
{
time = "2021-06-07T20:44:00+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.pantalaimon'.
'';
}
{
time = "2021-06-12T05:00:22+00:00";
message = ''
A new module is available: 'programs.mangohud'.
'';
}
{
time = "2021-06-16T01:26:16+00:00";
condition = hostPlatform.isLinux;
message = ''
The xmonad module now compiles the configuration before
linking the binary to the place xmonad expects to find
the compiled configuration (the binary).
This breaks recompilation of xmonad (i.e. the 'q' binding or
'xmonad --recompile').
If this behavior is undesirable, do not use the
'xsession.windowManager.xmonad.config' option. Instead, set the
contents of the configuration file with
'home.file.".xmonad/config.hs".text = "content of the file"'
or 'home.file.".xmonad/config.hs".source = ./path-to-config'.
'';
}
{
time = "2021-06-24T22:36:11+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'i18n.inputMethod'.
'';
}
{
time = "2021-06-22T14:43:53+00:00";
message = ''
A new module is available: 'programs.himalaya'.
'';
}
{
time = "2021-07-11T17:45:56+00:00";
message = ''
A new module is available: 'programs.sm64ex'.
'';
}
{
time = "2021-07-15T13:38:32+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.xsettingsd'.
'';
}
{
time = "2021-07-14T20:06:18+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.volnoti'.
'';
}
{
time = "2021-07-23T22:22:31+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.trayer'.
'';
}
{
time = "2021-07-19T01:30:46+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.notify-osd'.
'';
}
{
time = "2021-08-10T21:28:40+00:00";
message = ''
A new module is available: 'programs.java'.
'';
}
{
time = "2021-08-11T13:55:51+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.easyeffects'.
'';
}
{
time = "2021-08-16T21:59:02+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.git-sync'.
'';
}
{
time = "2021-08-26T06:40:59+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.fnott'.
'';
}
{
time = "2021-08-31T18:44:26+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.betterlockscreen'.
'';
}
{
time = "2021-09-14T21:31:03+00:00";
message = ''
A new module is available: 'programs.bottom'.
'';
}
{
time = "2021-09-23T17:04:48+00:00";
condition = hostPlatform.isLinux && config.services.screen-locker.enable;
message = ''
'xautolock' is now optional in 'services.screen-locker', and the
'services.screen-locker' options have been reorganized for clarity.
See the 'xautolock' and 'xss-lock' options modules in
'services.screen-locker'.
'';
}
{
time = "2021-10-05T20:55:07+00:00";
message = ''
A new module is available: 'programs.atuin'.
'';
}
{
time = "2021-10-05T22:15:00+00:00";
message = ''
A new module is available: 'programs.nnn'.
'';
}
{
time = "2021-10-08T22:16:50+00:00";
condition = hostPlatform.isLinux && config.programs.rofi.enable;
message = ''
Rofi version '1.7.0' removed many options that were used by the module
and replaced them with custom themes, which are more flexible and
powerful.
You can replicate your old configuration by moving those options to
'programs.rofi.theme'. Keep in mind that the syntax is different so
you may need to do some changes.
'';
}
{
time = "2021-10-23T17:12:22+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'programs.hexchat'.
'';
}
{
time = "2021-11-21T17:21:04+00:00";
condition = config.wayland.windowManager.sway.enable;
message = ''
A new module is available: 'wayland.windowManager.sway.swaynag'.
'';
}
{
time = "2021-11-23T20:26:37+00:00";
condition = config.programs.taskwarrior.enable;
message = ''
Taskwarrior version 2.6.0 respects XDG Specification for the config
file now. Option 'programs.taskwarrior.config' and friends now
generate the config file at '$XDG_CONFIG_HOME/task/taskrc' instead of
'~/.taskrc'.
'';
}
{
time = "2021-11-30T22:28:12+00:00";
message = ''
A new module is available: 'programs.less'.
'';
}
{
time = "2021-11-29T15:15:59+00:00";
condition = hostPlatform.isDarwin;
message = ''
The option 'targets.darwin.defaults."com.apple.menuextra.battery".ShowPercent'
has been deprecated since it no longer works on the latest version of
macOS.
'';
}
{
time = "2021-12-02T02:59:59+00:00";
condition = config.programs.waybar.enable;
message = ''
The Waybar module now allows defining modules directly under the 'settings'
option instead of nesting the modules under 'settings.modules'.
The Waybar module will also stop reporting errors about unused or misnamed
modules.
'';
}
{
time = "2021-12-08T10:23:42+00:00";
condition = config.programs.less.enable;
message = ''
The 'lesskey' configuration file is now stored under
'$XDG_CONFIG_HOME/lesskey' since it is fully supported upstream
starting from v596.
'';
}
{
time = "2021-12-10T23:19:57+00:00";
message = ''
A new module is available: 'programs.sqls'.
'';
}
{
time = "2021-12-11T11:55:12+00:00";
message = ''
A new module is available: 'programs.navi'.
'';
}
{
time = "2021-12-11T16:07:00+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.gromit-mpx'.
'';
}
{
time = "2021-12-12T17:09:38+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.opensnitch-ui'.
'';
}
{
time = "2021-12-21T22:17:30+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.systembus-notify'.
'';
}
{
time = "2021-12-31T09:39:20+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'xsession.windowManager.herbstluftwm'.
'';
}
{
time = "2022-01-03T10:34:45+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.swayidle'.
'';
}
{
time = "2022-01-11T12:26:43+00:00";
message = ''
A new module is available: 'programs.sagemath'.
'';
}
{
time = "2022-01-22T14:36:25+00:00";
message = ''
A new module is available: 'programs.helix'.
'';
}
{
time = "2022-01-22T15:12:20+00:00";
message = ''
A new module is available: 'programs.watson'.
'';
}
{
time = "2022-01-22T15:33:42+00:00";
message = ''
A new module is available: 'programs.timidity'.
'';
}
{
time = "2022-01-22T16:54:31+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'programs.tint2'.
'';
}
{
time = "2022-01-22T17:39:20+00:00";
message = ''
A new module is available: 'programs.pandoc'.
'';
}
{
time = "2022-01-26T22:08:29+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'programs.kodi'.
'';
}
{
time = "2022-02-03T23:23:49+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.twmn'.
'';
}
{
time = "2022-02-16T23:50:35+00:00";
message = ''
A new module is available: 'programs.zellij'.
'';
}
{
time = "2022-02-17T17:12:46+00:00";
message = ''
A new module is available: 'programs.eww'.
'';
}
{
time = "2022-02-17T23:11:13+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.espanso'.
'';
}
{
time = "2022-02-24T22:35:22+00:00";
message = ''
A new module is available: 'programs.gitui'.
'';
}
{
time = "2022-02-26T09:28:57+00:00";
condition = hostPlatform.isDarwin;
message = ''
A new module is available: 'launchd.agents'
Use this to enable services based on macOS LaunchAgents.
'';
}
{
time = "2022-03-06T08:50:32+00:00";
message = ''
A new module is available: 'programs.just'.
'';
}
{
time = "2022-03-06T09:40:17+00:00";
message = ''
A new module is available: 'programs.pubs'.
'';
}
{
time = "2022-03-13T20:59:38+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.fusuma'.
'';
}
{
time = "2022-05-02T20:55:46+00:00";
message = ''
A new module is available: 'programs.tealdeer'.
'';
}
{
time = "2022-05-18T22:09:45+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.mopidy'.
'';
}
];
};
}

@ -0,0 +1,240 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.nix;
nixPackage = cfg.package;
isNixAtLeast = versionAtLeast (getVersion nixPackage);
nixConf = assert isNixAtLeast "2.2";
let
mkValueString = v:
if v == null then
""
else if isInt v then
toString v
else if isBool v then
boolToString v
else if isFloat v then
floatToString v
else if isList v then
toString v
else if isDerivation v then
toString v
else if builtins.isPath v then
toString v
else if isString v then
v
else if isCoercibleToString v then
toString v
else
abort "The nix conf value: ${toPretty { } v} can not be encoded";
mkKeyValue = k: v: "${escape [ "=" ] k} = ${mkValueString v}";
mkKeyValuePairs = attrs:
concatStringsSep "\n" (mapAttrsToList mkKeyValue attrs);
in pkgs.writeTextFile {
name = "nix.conf";
text = ''
# WARNING: this file is generated from the nix.settings option in
# your Home Manager configuration at $XDG_CONFIG_HOME/nix/nix.conf.
# Do not edit it!
${mkKeyValuePairs cfg.settings}
${cfg.extraOptions}
'';
checkPhase =
if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then ''
echo "Ignoring validation for cross-compilation"
'' else ''
echo "Validating generated nix.conf"
ln -s $out ./nix.conf
set -e
set +o pipefail
NIX_CONF_DIR=$PWD \
${cfg.package}/bin/nix show-config ${
optionalString (isNixAtLeast "2.3pre")
"--no-net --option experimental-features nix-command"
} \
|& sed -e 's/^warning:/error:/' \
| (! grep '${
if cfg.checkConfig then "^error:" else "^error: unknown setting"
}')
set -o pipefail
'';
};
semanticConfType = with types;
let
confAtom = nullOr (oneOf [ bool int float str path package ]) // {
description =
"Nix config atom (null, bool, int, float, str, path or package)";
};
in attrsOf (either confAtom (listOf confAtom));
jsonFormat = pkgs.formats.json { };
in {
options.nix = {
enable = mkEnableOption ''
the Nix configuration module
'' // {
default = true;
visible = false;
};
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExpression "pkgs.nix";
description = ''
The Nix package that the configuration should be generated for.
'';
};
registry = mkOption {
type = types.attrsOf (types.submodule (let
inputAttrs = types.attrsOf
(types.oneOf [ types.str types.int types.bool types.package ]);
in { config, name, ... }: {
options = {
from = mkOption {
type = inputAttrs;
example = {
type = "indirect";
id = "nixpkgs";
};
description = "The flake reference to be rewritten.";
};
to = mkOption {
type = inputAttrs;
example = {
type = "github";
owner = "my-org";
repo = "my-nixpkgs";
};
description =
"The flake reference to which <option>from></option> is to be rewritten.";
};
flake = mkOption {
type = types.nullOr types.attrs;
default = null;
example = literalExpression "nixpkgs";
description = ''
The flake input to which <option>from></option> is to be rewritten.
'';
};
exact = mkOption {
type = types.bool;
default = true;
description = ''
Whether the <option>from</option> reference needs to match exactly. If set,
a <option>from</option> reference like <literal>nixpkgs</literal> does not
match with a reference like <literal>nixpkgs/nixos-20.03</literal>.
'';
};
};
config = {
from = mkDefault {
type = "indirect";
id = name;
};
to = mkIf (config.flake != null) ({
type = "path";
path = config.flake.outPath;
} // lib.filterAttrs (n: v:
n == "lastModified" || n == "rev" || n == "revCount" || n
== "narHash") config.flake);
};
}));
default = { };
description = ''
User level flake registry.
'';
};
registryVersion = mkOption {
type = types.int;
default = 2;
internal = true;
description = "The flake registry format version.";
};
checkConfig = mkOption {
type = types.bool;
default = true;
description = ''
If enabled (the default), checks for data type mismatches and that Nix
can parse the generated nix.conf.
'';
};
extraOptions = mkOption {
type = types.lines;
default = "";
example = ''
keep-outputs = true
keep-derivations = true
'';
description =
"Additional text appended to <filename>nix.conf</filename>.";
};
settings = mkOption {
type = types.submodule { freeformType = semanticConfType; };
default = { };
example = literalExpression ''
{
use-sandbox = true;
show-trace = true;
system-features = [ "big-parallel" "kvm" "recursive-nix" ];
}
'';
description = ''
Configuration for Nix, see
<link xlink:href="https://nixos.org/manual/nix/stable/#sec-conf-file"/> or
<citerefentry>
<refentrytitle>nix.conf</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry> for avalaible options.
The value declared here will be translated directly to the key-value pairs Nix expects.
</para>
<para>
Configuration specified in <option>nix.extraOptions</option> which will be appended
verbatim to the resulting config file.
'';
};
};
config = mkIf cfg.enable {
assertions = [{
assertion = cfg.settings == { } || cfg.package != null;
message = ''
A corresponding Nix package must be specified via `nix.package` for generating
nix.conf.
'';
}];
xdg.configFile = {
"nix/registry.json" = mkIf (cfg.registry != { }) {
source = jsonFormat.generate "registry.json" {
version = cfg.registryVersion;
flakes =
mapAttrsToList (n: v: { inherit (v) from to exact; }) cfg.registry;
};
};
"nix/nix.conf" = mkIf (cfg.settings != { } || cfg.extraOptions != "") {
source = nixConf;
};
};
};
meta.maintainers = [ maintainers.polykernel ];
}

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

Loading…
Cancel
Save