Compare commits

..

121 commits

Author SHA1 Message Date
Robert Helgesson 9a61b83445
news: add entry about support stopping as of May 1 2019-04-23 21:28:17 +02:00
ash lea 2ccbf43e46
browserpass: update app id
(cherry picked from commit cb93316fed)
2019-04-14 17:25:37 +02:00
Robert Helgesson 5c1d10497d
modules: register the base modules path
This is needed, for example, to support relative paths when disabling
modules.

(cherry picked from commit f8b03f5750)
2019-04-14 17:23:40 +02:00
Robert Helgesson 69851e4c35
home-environment: make home.keyboard optional
When set to `null` then the `xsession` module will not attempt to
manage the keyboard settings.

(cherry picked from commit b6e1d82685)
2019-04-11 01:18:13 +02:00
Tadeo Kondrak 9d23f09790
qt: use xdg.configHome instead of hard-coding
(cherry picked from commit bc2b7d4f09)
2019-04-04 23:43:08 +02:00
Robert Helgesson 2fa6dd4cf5
taffybar: restart the service on failure
(cherry picked from commit f77d6b7a2d)
2019-04-04 23:43:08 +02:00
Robert Helgesson d5f6e84862
systemd: add some basic tests
(cherry picked from commit 6ebf14143a)
2019-04-04 23:42:28 +02:00
Robert Helgesson 0312d450e2
random-background: minor documentation improvements
(cherry picked from commit cf5dac9563)
2019-04-04 23:39:56 +02:00
Robert Helgesson 15ef36a7f4
readme: expand contact section slightly
In particular, mention that the channel is hosted by freenode and the
channel logs are hosted by samueldr.

(cherry picked from commit 2e1c825b90)
2019-04-04 23:39:56 +02:00
Robert Helgesson 78ce79e57d
readme: add contact section with the IRC channel
(cherry picked from commit a974ce6257)
2019-04-04 23:39:56 +02:00
Robert Helgesson b8eb7a03c5
manual: use writeShellScriptBin
(cherry picked from commit 5d81cb6ac7)
2019-04-04 23:39:56 +02:00
Robert Helgesson deb2868d57
polybar: use writeShellScriptBin
(cherry picked from commit 41356ac267)
2019-04-04 23:39:56 +02:00
Robert Helgesson 6fcaef5235
firefox: make the extensions option visible
Also change the example to use the firefox-addons available on NUR.

(cherry picked from commit 86af599a18)
2019-04-04 23:39:56 +02:00
Robert Helgesson 6bc07d4f53
ssh: add some basic tests
(cherry picked from commit 989e636d98)
2019-04-04 23:37:05 +02:00
Robert Helgesson c40fa72cde
ssh: support multiple identity files in a match block
Fixes #625

(cherry picked from commit eec78fbd1e)
2019-04-04 23:36:18 +02:00
Robert Helgesson 594294e2ca
Remove some use of mkDerivation
Instead use `runCommand`, which by default uses `stdenvNoCC` resulting
in a reduced dependency footprint.

Fixes #612

(cherry picked from commit 70d4cf2cd9)
2019-04-04 23:36:02 +02:00
arcnmx 2b19f15be3
git: make userName and userEmail options optional
(cherry picked from commit 52692e299d)
2019-04-04 23:35:34 +02:00
Robert Helgesson 9901509ef8
faq: add entry about missing ca.desrt.dconf
(cherry picked from commit fd2bc150d8)
2019-04-04 23:35:34 +02:00
Robert Helgesson 5d5bc3dc5a
firefox: add support for add-on packages
Since no official source of packages exist the option is hidden for
now. For adventurous people there is an overlay of a few selected
add-ons available at

    https://rycee.gitlab.io/nixpkgs-firefox-addons/overlay.tar.gz

This overlay is automatically built daily using the REST API available
on https://addons.mozilla.org/.

(cherry picked from commit 267afa5a3b)
2019-04-04 23:35:34 +02:00
Wael M. Nasreddine ec05213a41
nix-darwin: login as the user when activating
(cherry picked from commit 7ec153889c)
2019-04-04 23:35:34 +02:00
Wael M. Nasreddine 9b82a37d28
nix-darwin: support package install through user packages
(cherry picked from commit efc795920b)
2019-04-04 23:35:33 +02:00
Wael M. Nasreddine 0ac92c6a42
nix-darwin: activate home-manager through postActivation
(cherry picked from commit d3fd287efb)
2019-04-04 23:35:33 +02:00
Robert Helgesson 5342c9479b
docs: add NixOS module installation instructions
(cherry picked from commit 52fdf5b7ec)
2019-04-04 23:35:09 +02:00
Robert Helgesson d99f0cbe62
docs: add language attribute to program listings
(cherry picked from commit a09196c4ae)
2019-04-04 23:35:09 +02:00
Robert Helgesson 87a897e0c9
docs: use <screen> for terminal interaction
(cherry picked from commit 1d8997633c)
2019-04-04 23:35:09 +02:00
Mario Rodas fdda547e9e
git: allow contents in git.includes
(cherry picked from commit 6da88339f5)
2019-04-04 23:34:35 +02:00
Maximilian Bosch da31e466a1
nixos module: evaluate assertions from Home Manager modules
(cherry picked from commit 0898b6b482)
2019-04-04 23:32:34 +02:00
Olli Helenius fa19c18343
pam: enclose session variable values in quotes
(cherry picked from commit 848b8b983e)
2019-04-04 23:32:34 +02:00
Maximilian Bosch 3c2823e3cd
programs/zsh: properly escape shell aliases
Otherwise all aliases break that use single quotes inside.

Already fixed in the nixpkgs module in 1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.

(cherry picked from commit 465d08d99f)
2019-04-04 23:32:34 +02:00
Robert Helgesson dd94a849df
tests: remove tests attribute from root default.nix
Having it there prevented, e.g., `nix-env -qaP` from working in some
cases.

Fixes #509

(cherry picked from commit b8b391ad18)
2019-02-23 22:59:15 +01:00
Douglas Wilson ee1bfa0d92
systemd: sanitize unit derivation names
To allow a few special characters such as "@".

This is taken from

    c414e5bd08/nixos/modules/system/boot/systemd-lib.nix (L14)

(cherry picked from commit 74811679b7)
2019-02-23 22:59:08 +01:00
Robert Helgesson 8980e08240
msmtp: use <parameter> for CLI options in description
(cherry picked from commit 93f5fcae1e)
2019-02-23 22:59:01 +01:00
Robert Helgesson afd2d0fb84
fontconfig: make fonts accessible when in NixOS module
(cherry picked from commit 799a90ecfa)
2019-02-23 22:58:47 +01:00
Robert Helgesson 2bdaf4ae98
nixos module: support NixOS user packages install
When using the NixOS module we cannot guarantee that the Nix store
will be writable during startup. Installing the user packages through
`nix-env -i` will fail in these cases.

This commit adds a NixOS option `home-manager.useUserPackages` that,
when enabled, installs user packages through the NixOS

    users.users.<name?>.packages

option.

Note, when submodule support and external package install is enabled
then the installed packages are not available in `~/.nix-profile`. We
therefore set `home.profileDirectory` directly to the HM profile
packages.

(cherry picked from commit ef168979bf)
2019-02-23 22:58:47 +01:00
Robert Helgesson 1ade5cad80
Revert "fish: use global for abbr"
This reverts commit 7d6a6cbbe3.

The version of fish in Nixpkgs 18.09 is not compatible with this
option. See #581.
2019-02-13 17:25:03 +01:00
Olli Helenius cf5b16b45f
msmtp: use XDG config directory
(cherry picked from commit a3462daeb1)
2019-02-11 01:23:50 +01:00
Robert Helgesson 45057f353c
tests: bump to latest nmt version
(cherry picked from commit a334a941c4)
2019-02-11 01:22:02 +01:00
Robert Helgesson ee7631fbe3
git: add basic support for LFS
Fixes #542

(cherry picked from commit 1cdb8abf30)
2019-02-11 01:22:02 +01:00
Ingolf Wanger fdb81a7ea0
nixos: use correct username for systemd service
(cherry picked from commit fbdb5beb59)
2019-02-11 01:22:02 +01:00
Robert Helgesson 1c3614cbc8
Clean up support code for Home Manager as a submodule
This removes the `nixosSubmodule` option in favor of a new option
`submoduleSupport.enable`. This name better indicates that the
submodule mode applies to both NixOS and nix-darwin.

(cherry picked from commit 2f372ab4d6)
2019-02-11 01:22:02 +01:00
Lorenzo Manacorda 75538973db
doc: add "See also" section to manpages
Pointing to each other.

(cherry picked from commit 524ce43e23)
2019-02-11 01:22:02 +01:00
Lorenzo Manacorda 37760ed934
doc: remove extraneous contrib element
`contrib` is "A summary of the contributions made to a document by a
credited source", which we don't need in this case.

(cherry picked from commit 7f8e139413)
2019-02-11 01:22:01 +01:00
Robert Helgesson 6924761aaf
doc: move home-manager man page to section 1
This is not really a system administration tool so 8 is unsuitable.

(cherry picked from commit 99d79d0a80)
2019-02-11 01:22:01 +01:00
Jonas Holst Damtoft 5ccc2298de
emacs: add service module
(cherry picked from commit 0ca1bf3cfd)
2019-02-11 01:22:01 +01:00
Matthieu Coudron 0f4c798c81
neovim: allow to override package
If you want to run a development version for instance, it is easier to
set neovim.package rather than work around the wrapping mechanism etc.

(cherry picked from commit c18984c452)
2019-02-11 01:22:01 +01:00
Robert Helgesson f89522362f
git: use attrsOf instead of attrs
This makes sure that values added to

    programs.git.aliases

or

    programs.git.extraConfig

are merged as expected.

Also add a few option examples.

(cherry picked from commit 445c0b1482)
2019-02-11 01:22:01 +01:00
Robert Helgesson 7772158ac4
mbsync: add basic test of result configuration
(cherry picked from commit 0590c2a4f6)
2019-02-11 01:22:01 +01:00
Nadrieril fb96af9b9d
mbsync: add some required assertions
(cherry picked from commit 81ec856a0f)
2019-02-11 01:22:01 +01:00
Yurii Rashkovskii c73685ec74
nixpkgs: fix installation on non-x86
On non-x86 architectures (for example, aarch64) the installation of
home-manager fails indicating that it is attempting to select i686
packages for Linux and those aren't available.

Solution: make the condition for choosing these packages stricter
(cherry picked from commit 2410bc603b)
2019-02-11 01:22:00 +01:00
Robert Helgesson de2d6a5d95
git: quote sendemail section header
This will allow, e.g., the character `@` in the email identity.

Also adds a test case.

Fixes #557

(cherry picked from commit 45cadbd4f3)
2019-02-11 01:22:00 +01:00
Amarandus 3bef871dac
irssi: add module
irssi is a cli IRC client.

(cherry picked from commit 02a5a678f6)
2019-02-11 01:22:00 +01:00
Robert Helgesson 27042d1050
flameshot: add bars to systemd After
Fixes #544

(cherry picked from commit 98f534e172)
2019-02-11 01:22:00 +01:00
Matthieu Coudron a6475e3e60
git: generate identities from mail accounts
(cherry picked from commit a68c8cf5f1)
2019-02-11 01:22:00 +01:00
wedens 17aaf04f72
polybar: add /run/wrappers/bin to PATH
Without this the network module in polybar is unable to check
connection as it invokes 'ping' command directly.

(cherry picked from commit 604fc92943)
2019-02-11 01:21:05 +01:00
Robert Helgesson 708de1ac8d
xembed-sni-proxy: add module
(cherry picked from commit 008d93928f)
2019-02-11 01:21:04 +01:00
Jonas Holst Damtoft 7d6a6cbbe3
fish: use global for abbr
Makes fish use global scope for abbreviations.
This makes it so that they don't stick across config changes.
Before, an abbreviation would still exist even if removed from the config.

(cherry picked from commit 601619660d)
2019-02-11 01:21:04 +01:00
Robert Helgesson 016005a3a3
doc: bump copyright year to 2019 in man pages
(cherry picked from commit 4aa07c3547)
2019-02-11 01:21:04 +01:00
Robert Helgesson 966b790859
doc: reformat XML files
(cherry picked from commit f3f7c5cc57)
2019-02-11 01:21:04 +01:00
Robert Helgesson bceb74a78c
doc: add basic release notes
(cherry picked from commit c035046999)
2019-02-11 01:21:04 +01:00
Robert Helgesson bde13d0482
Update LICENSE file for 2019
(cherry picked from commit e15cd64ac9)
2019-02-11 01:21:04 +01:00
Robert Helgesson 6c30decf8d
i3: replace use of types.string by types.str
(cherry picked from commit 59a4ac71f9)
2019-02-11 01:21:04 +01:00
Robert Helgesson 4bed99c71c
files: allow a wider range of source file names
In particular support source files whose name start with `.` or
contain characters not allowed in the nix store, such as spaces.

Also add some test cases for `home.file`.

(cherry picked from commit 7c04351a57)
2019-02-11 01:21:04 +01:00
Robert Helgesson f174f90fdf
tests: bump nmt version
(cherry picked from commit 46f787950a)
2019-02-11 01:21:03 +01:00
Adam Washington a9e218dddd
matplotlib: add module
(cherry picked from commit 6a244b3a8d)
2019-02-11 01:21:03 +01:00
John Wiegley 3656bf1ad7
ssh: add proxyJump option
(cherry picked from commit 3cf8b9ea86)
2019-02-11 01:20:30 +01:00
Nadrieril 47450371d9
i3: add bar.extraConfig option
(cherry picked from commit df8a14e12a)
2019-02-11 01:20:30 +01:00
Robert Helgesson 4bb40ac42d
tests: simplify test names
(cherry picked from commit f6ec26075d)
2019-02-11 01:20:29 +01:00
Robert Helgesson 4c311835a7
i3: add test of keybinding merge logic
(cherry picked from commit c42206db02)
2019-02-11 01:20:29 +01:00
Robert Helgesson e9942375ce
tests: bump nmt to latest
(cherry picked from commit bb64012914)
2019-02-11 01:20:29 +01:00
Nadrieril e6bc17e7fb
i3: reallow using null to disable a keybinding
(cherry picked from commit d5cc53a4e1)
2019-02-11 01:20:29 +01:00
Robert Helgesson 9f013a8fb8
dunst: avoid error on missing dunst process
(cherry picked from commit 55100918cc)
2019-01-14 18:40:51 +01:00
Robert Helgesson 3c429c2462
dunst: kill daemon on configuration change
Since Dunst is DBus activated it is OK to simply kill it since DBus
will restart it when necessary.

(cherry picked from commit faee571850)
2019-01-14 18:40:51 +01:00
hyperfekt f60f0c647f
fish: autogenerate completions from man pages
(cherry picked from commit 6f422785c3)
2019-01-14 18:40:51 +01:00
David Guibert 6d8a296625
msmtp: add extraConfig account option
This patch allow to define custom msmtp options per email account. For
example: to change the "auth" method from "on" to "login", add
`msmtp.extraConfig.auth="login"`.

(cherry picked from commit a7affc93ba)
2019-01-14 18:40:51 +01:00
Marcial Gaißert 2d77421d7c
programs.zsh: option localVariables
Add option "extraLocalVars" for additional local variable definitions
in .zshrc, at the top of the file.

Some zsh plugins/themes expect configuration in local variables before they
are loaded (example: https://github.com/bhilburn/powerlevel9k). Exporting
those clutters the environment and is unnecessary.

(cherry picked from commit 9052131aef)
2019-01-14 18:40:51 +01:00
Marcial Gaißert 257dcbcd8a
programs.zsh: generate export statements in zsh syntax
Use the new module lib.zsh to generate export statements in zsh syntax, using
zsh arrays for lists.

Being a zsh script, this seems more intuitive for .zshrc

(cherry picked from commit 6b5e0efd1e)
2019-01-14 18:40:50 +01:00
Marcial Gaißert f221e4935d
lib.zsh: add module
Added utilities to generate export statements and definitions for zsh scripts.

Currently, there is only lib.shell which generates export statements in bash
syntax. However, this does not allow to generate export statements for zsh
arrays (syntax: NAME=(elem1 elem2 ...) ), which would be the natural
representation of lists in the nix language.

(cherry picked from commit 62eb7ebeba)
2019-01-14 18:40:50 +01:00
Wael M. Nasreddine 29161b6e21
autorandr: add support for xrandr transformation
(cherry picked from commit c48fd9d842)
2019-01-14 18:40:50 +01:00
Robert Helgesson 9e913a9a30
texlive: always require at least one extra package
Fixes #526

(cherry picked from commit e150dd4a66)
2019-01-14 18:40:50 +01:00
Olli Helenius e57e34f799
gnome-terminal: enable VTE OSC7 support for bash and zsh
(cherry picked from commit b3d73e0aff)
2019-01-14 18:40:50 +01:00
Olli Helenius af94896ba1
Address review comments
(cherry picked from commit 16946a6f00)
2019-01-14 18:40:50 +01:00
Olli Helenius 8026e4ff6f
zsh: add default keymap configuration
(cherry picked from commit a4383075af)
2019-01-14 18:40:50 +01:00
Robert Helgesson ad0b33387d
emacs: make finalPackage option more accessible
Instead of "internal" mark it as "invisible".

(cherry picked from commit 20a60be550)
2019-01-14 18:40:49 +01:00
Mario Rodas c67d2a916f
opam: add module
(cherry picked from commit 7afefcf75d)
2019-01-14 18:40:49 +01:00
Robert Helgesson 82ed4dae2a
dconf: add some information of use under NixOS
(cherry picked from commit 40b3443c8f)
2019-01-14 18:37:51 +01:00
Robert Helgesson 7e65605d8f
gtk: remove option gtk.gtk3.waylandSupport
(cherry picked from commit cc964b4609)
2019-01-14 18:37:51 +01:00
Robert Helgesson be7017b9c8
gtk: make gtk.gtk2 and gtk.gtk3 not submodules
(cherry picked from commit 370a84192e)
2019-01-14 18:37:51 +01:00
Robert Helgesson 5b66b89d6e
gtk: use dconf module for settings
(cherry picked from commit 4104ff2b6a)
2019-01-14 18:37:50 +01:00
Robert Helgesson 1e7fbde1be
gnome-terminal: use dconf module for settings
(cherry picked from commit a0162dacf6)
2019-01-14 18:37:50 +01:00
Robert Helgesson 54fc5f778b
dconf: add module
This module allows unified configuration of dconf settings.

(cherry picked from commit b2cc186d22)
2019-01-14 18:37:46 +01:00
Robert Helgesson f60f9c4bb6
readme: add notice that relog may be needed
Also add instructions for non-NixOS users to add the user channel
directory to `NIX_PATH`.

(cherry picked from commit 235a6617c4)
2019-01-14 18:36:50 +01:00
Robert Helgesson 944c12dbbb
modules: support conditional module inclusion
Also make use of this functionality for the `programs.chromium`
module.

See #501

(cherry picked from commit 218a8c4d90)
2019-01-14 18:36:50 +01:00
hyperfekt 17fd9cbbd0
vscode: add module
(cherry picked from commit 6ab6488e5a)
2019-01-07 18:35:39 +01:00
Robert Helgesson dc9be1eee6
emacs: add overrides option
This option enables overriding packages within the generated Emacs
package set.

Fixes #486

(cherry picked from commit e68d6e7924)
2018-12-24 11:20:25 +01:00
Olli Helenius c2cff13f15
jq: add module
(cherry picked from commit dc72aa2305)
2018-12-24 11:20:08 +01:00
Lorenzo e267dfea2d
readme: fix .gitconfig example
The example was referencing `~/.gitconfig`, which isn't being checked
anymore since 356c0bf751.

(cherry picked from commit 93b10bcf3c)
2018-12-12 00:56:40 +01:00
Lorenzo Manacorda 461869b438
readme: clarify bash/zsh compatibility
Makes it clearer that the compatibility mentioned only relates to the
manual loading approach.

(cherry picked from commit 4971e3735e)
2018-12-12 00:56:40 +01:00
Robert Helgesson 1484b1d48b
tests: add initial test framework
(cherry picked from commit 6d56abcec1)
2018-12-12 00:56:40 +01:00
Nikita Uvarov d5e21feebb
i3: fix default keybindings override
All default keybindings should have a default priority attached to them.
This will allow users to redefine some of the default keybindings
without using mkForce. Fixes #485.

(cherry picked from commit 5d63abb473)
2018-12-12 00:56:40 +01:00
Robert Helgesson cb29a29055
doc: add installation instructions to manual
Also minor cleanups in README.

(cherry picked from commit 6e67bb7ae6)
2018-12-12 00:56:40 +01:00
Nikita Uvarov c2646f9f2b
polybar: switch from attrs to attrsOf
(cherry picked from commit d67835260d)
2018-12-06 00:32:53 +01:00
Nikita Uvarov 48ba1010ab
dunst: switch from attrs to attrsOf
(cherry picked from commit b085344b91)
2018-12-06 00:32:53 +01:00
Nikita Uvarov b837f8ae41
i3: switch from attrs to attrsOf
(cherry picked from commit c108eaba42)
2018-12-06 00:32:52 +01:00
dsx 0312cb611e
ssh: add addressFamily option
(cherry picked from commit 6ce3ce69b9)
2018-12-06 00:32:52 +01:00
Robert Helgesson 3b7f74ab87
ssh: add certificateFile option
(cherry picked from commit 6826521ec5)
2018-12-06 00:32:52 +01:00
Robert Helgesson c9945550de
ssh: realign options
(cherry picked from commit 5fe62660aa)
2018-12-06 00:32:52 +01:00
dsx a471c62bf2
dunst: use 'icon_path' instead of 'icon_folders'
The 'icon_folders' option is deprecated.

(cherry picked from commit 7a28f68ad0)
2018-12-06 00:32:52 +01:00
Robert Helgesson 1e2d80a583
rofi: switch from types.string to types.str
(cherry picked from commit ea9d44bede)
2018-12-06 00:32:52 +01:00
Robert Helgesson 159ee7a269
newsboat: switch from types.string to types.str
(cherry picked from commit fd3692b36f)
2018-12-06 00:32:52 +01:00
Robert Helgesson ab562d4c2a
autorandr: switch from types.string to types.str
(cherry picked from commit cd7b6fdbc1)
2018-12-06 00:32:52 +01:00
zimbatm 3646088248
home-manager: add edit command
With this change, running

    home-manager edit

opens `$HOME_MANAGER_CONFIG` in `$EDITOR`.

This is mainly for convenience. Users should not have to remember the
exact location of the Home Manager configuration.

(cherry picked from commit 571e17410a)
2018-12-06 00:32:51 +01:00
Robert Helgesson 371715a51c
beets: add enable option
(cherry picked from commit 797fbbf826)
2018-12-06 00:32:47 +01:00
Robert Helgesson c4a9546831
Change installation instructions to use nix-channel
This avoids the uncontrollable nature of fetching the tarball as part
of the evaluation. Instead the user can decide when to update and also
perform rollbacks, if necessary.

(cherry picked from commit a37b5c9c61)
2018-12-06 00:31:54 +01:00
Wael M. Nasreddine 88c681606b
home-manager: import modules using relative path
(cherry picked from commit 30f3baabaf)
2018-12-06 00:31:54 +01:00
Robert Helgesson 63668b2172
readme: switch stable channel to 18.09
(cherry picked from commit ef29f321e0)
2018-12-06 00:31:54 +01:00
dsx 0686063f62
i3: support for workspace_layout option
(cherry picked from commit 15bca92b2c)
2018-12-06 00:31:53 +01:00
dsx 4a574ca544
i3: support for bar tray_output option
(cherry picked from commit 71f6bc41eb)
2018-12-06 00:31:53 +01:00
Robert Helgesson f4af8151de
pasystray: add paprefs and pavucontrol
This enables the "volume control" and "control local sound server"
menu options.

Fixes #461

(cherry picked from commit 6d2f16a7ae)
2018-12-06 00:31:53 +01:00
zimbatm b535770bd4
ssh: tweak default controlPath
Instead of using the hostname `%h`, which can be changed by the
~/.ssh/config file, use the commandline-given hostname `%n`.

This allows to alias a host with different hostnames, which then point
to different configurations. A common use-case for this is if you have
multiple accounts on github with each access to different private repos:

    Host github.com
      IdentitiesOnly yes
      User git
      IdentityFile ~/.ssh/id_rsa

    Host customer.github.com
      IdentitiesOnly yes
      User git
      IdentityFile ~/.ssh/customer
      HostName github.com

Without this change, if a connection was established with the first
github.com alias, then the user would try to pull a repo from the second
account, ssh would re-use the SSH connection which doesn't have access
to that repository.

(cherry picked from commit 40b279e3a3)
2018-12-06 00:31:53 +01:00
Wael M. Nasreddine 7ab6441ab7
keybase: install the keybase package
(cherry picked from commit 9686d93ff6)
2018-12-06 00:31:13 +01:00
zimbatm 2297450ec8
termite: setup the shell hook
This fixes Ctrl+Shift+T not working.

(cherry picked from commit 67ebe16b40)
2018-12-06 00:31:13 +01:00
1813 changed files with 9540 additions and 98094 deletions

View file

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

View file

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

View file

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

View file

@ -1,55 +0,0 @@
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: Are you following the right branch?
description: |
You should follow the branch of Home Manager that corresponds to your
version of Nixpkgs; see [the README](https://github.com/nix-community/home-manager#releases) for details.
options:
- label: My Nixpkgs and Home Manager versions are in sync
required: true
- type: checkboxes
attributes:
label: Is there an existing issue for this?
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

View file

@ -1,49 +0,0 @@
### 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://nix-community.github.io/home-manager/#sec-guidelines
-->
- [ ] Change is backwards compatible.
- [ ] Code formatted with `./format`.
- [ ] Code tested through `nix-shell --pure tests -A run.all` or `nix develop --ignore-environment .#all` using Flakes.
- [ ] 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://nix-community.github.io/home-manager/#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
- 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).
#### Maintainer CC
<!--
If you are updating a module, please @ people who are in its `meta.maintainers` list.
If in doubt, check `git blame` for whoever last touched something.
-->

View file

@ -1,25 +0,0 @@
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-23.11"
schedule:
interval: "weekly"
commit-message:
prefix: "ci:"
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-24.05"
schedule:
interval: "weekly"
commit-message:
prefix: "ci:"

46
.github/labeler.yml vendored
View file

@ -1,46 +0,0 @@
"mail":
- changed-files:
- any-glob-to-any-file:
- modules/programs/aerc*.nix
- modules/programs/alot*.nix
- tests/modules/programs/aerc/*
- tests/modules/programs/alot/*
- modules/programs/mujmap.nix
- tests/modules/programs/mujmap/*
- modules/programs/notmuch.nix
- modules/programs/neomutt*
- tests/modules/programs/neomutt/*
- modules/programs/getmail*
- modules/*/mbsync*
- tests/modules/programs/mbsync/*
- modules/programs/himalaya.nix
- tests/modules/programs/himalaya/*
- modules/programs/thunderbird.nix
- tests/modules/programs/thunderbird/*
- modules/services/imapnotify.nix
"neovim":
- changed-files:
- any-glob-to-any-file:
- modules/programs/neovim.nix
- tests/modules/programs/neovim/**/*
"shell":
- changed-files:
- any-glob-to-any-file:
- modules/lib/zsh.nix
- modules/programs/zsh*
- modules/programs/bash*
- tests/modules/programs/zsh/**/*
"calendar":
- changed-files:
- any-glob-to-any-file:
- modules/programs/khal*
- modules/*/vdirsyncer*
- modules/accounts/calendar.nix
"contacts":
- changed-files:
- any-glob-to-any-file:
- modules/accounts/contacts.nix

71
.github/stale.yml vendored
View file

@ -1,71 +0,0 @@
# 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>

View file

@ -1,28 +0,0 @@
name: GitHub Pages
on:
push:
branches:
- master
jobs:
publish:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix-build -A docs.html
cp -r result/share/doc/home-manager public
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

View file

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

View file

@ -1,27 +0,0 @@
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@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- 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 --show-trace -A docs.jsonModuleMaintainers
- run: ./format -c
- run: nix-shell --show-trace . -A install
- run: yes | home-manager -I home-manager=. uninstall
- run: nix-shell --show-trace --arg enableBig false --pure tests -A run.all

View file

@ -1,20 +0,0 @@
name: Update flake inputs
on:
schedule:
# Update every Sunday and Wednesday
- cron: "51 3 * * 0,3"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v23
with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
pr-labels: dependencies

View file

@ -1,32 +1,14 @@
image: nixos/nix:latest image: nixos/nix:latest
variables:
NIX_PATH: "nixpkgs=channel:nixos-unstable"
stages:
- deploy
pages: pages:
stage: deploy
script: script:
- nix-build -A docs.html - mkdir -p ~/.config/nixpkgs
- echo '{ manual.html.enable = true; }' > ~/.config/nixpkgs/home.nix
- nix-shell . -A install
- mkdir public - mkdir public
- cp -r ./result/share/doc/home-manager/* public/ - cp -r ~/.nix-profile/share/doc/home-manager/* public/
artifacts: artifacts:
paths: paths:
- public - public
rules: only:
- if: $CI_COMMIT_BRANCH == "master" - 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

12
.travis.yml Normal file
View file

@ -0,0 +1,12 @@
language: nix
os:
- linux
- osx
before_script:
- mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
script:
- nix-shell . -A install
- nix-shell tests -A run.all

158
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,158 @@
Contributing
============
Thanks for wanting to contribute to Home Manager! These are some
guidelines to make the process as smooth as possible for both you and
the Home Manager developers.
If you are only looking to report a problem then it is sufficient to
read through the following section on reporting issues. If you instead
want to directly contribute improvements and additions then please
have a look at everything here.
Reporting an issue
------------------
If you notice a problem with Home Manager and want to report it then
have a look among the already [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][] 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.
Contributing code
-----------------
If you want to contribute code to improve Home Manager then please
follow these guidelines.
### Fork and create a pull request ###
If you have not previously forked Home Manager then you need to do
that first. Have a look at GitHub's "[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`. Give your branch a reasonably
descriptive name. Perform your changes on this branch and when you are
happy with the result push the branch to GitHub and
[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:
home-manager -I home-manager=$HOME/devel/home-manager
or
2. changing the default path by ensuring your configuration includes
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.
### 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 format
{component}: {description}
{long description}
where `{component}` refers to the code component (or module) your
change affects, `{description}` is a brief description of your change,
and `{long description}` is an optional clarifying description. Note,
`{description}` should start with a lower case letter. As a rare
exception, if there is no clear component, or your change affects many
components, then the `{component}` part is optional.
When adding a new module, say `foo.nix`, we use the fixed commit
format `foo: add module`. You can, of course, still include a long
description if you wish.
In addition to the above commit message guidelines, try to follow the
[seven rules][] as much as possible.
### Style guidelines ###
The code in Home Manager should follow the [Nixpkgs syntax
guidelines][]. Note, 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.
### 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`][] 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
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
(without any condition) that has a message along the lines of
> A new service is available: 'services.foo'.
or
> A new program configuration is available: 'program.foo'.
depending on the type of module.
[open issues]: https://github.com/rycee/home-manager/issues
[new issue]: https://github.com/rycee/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/rycee/home-manager/blob/master/modules/misc/news.nix
[Nixpkgs syntax guidelines]: https://nixos.org/nixpkgs/manual/#sec-syntax

121
FAQ.md Normal file
View file

@ -0,0 +1,121 @@
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
```console
$ nix-env --query
hello-2.10
```
and your Home Manager configuration contains
home.packages = [ pkgs.hello ];
Then attempting to switch to this configuration will result in an
error similar to
```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.
Why are the session variables not set?
--------------------------------------
Home Manager is only able to set session variables automatically if it
manages your Bash or Z shell configuration. 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
```sh
. "$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.
How do set up a configuration for multiple users/machines?
----------------------------------------------------------
A typical way to prepare a repository of configurations for multiple
logins and machines is to prepare one "top-level" file for each unique
combination.
For example, if you have two machines, called "kronos" and "rhea" on
which you want to configure your user "jane" then you could create the
files
- `kronos-jane.nix`,
- `rhea-jane.nix`, and
- `common.nix`
in your repository. On the kronos and rhea machines you can then make
`~jane/.config/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
```nix
{ ... }:
{
imports = [ ./common.nix ];
# Various options that are specific for this machine/user.
}
```
while the `common.nix` file contains configuration shared across the
two logins. Of course, instead of just a single `common.nix` file you
can have multiple ones, even one per program or service.
You can get some inspiration from the [Post your home-manager home.nix
file!][1] Reddit thread.
[1]: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
Why do I get an error message about `ca.desrt.dconf`?
-----------------------------------------------------
You are most likely trying to configure the GTK or Gnome Terminal 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
The solution on NixOS is to add
services.dbus.packages = with pkgs; [ gnome3.dconf ];
to your system configuration.

View file

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

View file

@ -1,20 +0,0 @@
.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

382
README.md
View file

@ -1,128 +1,314 @@
Home Manager using Nix Home Manager using Nix
====================== ======================
This project provides a basic system for managing a user environment using the This project provides a basic system for managing a user environment
[Nix][] package manager together with the Nix libraries found in [Nixpkgs][]. It using the [Nix][] package manager together with the Nix libraries
allows declarative configuration of user specific (non-global) packages and found in [Nixpkgs][]. Before attempting to use Home Manager please
dotfiles. read the warning below.
Usage
-----
Before attempting to use Home Manager please read [the warning
below](#words-of-warning).
For a systematic overview of Home Manager and its available options, please see:
- [Home Manager manual][manual]
- [Home Manager configuration options][configuration options]
- [3rd party Home Manager option
search](https://home-manager-options.extranix.com/)
If you would like to contribute to Home Manager, then please have a look at
["Contributing" in the manual][contributing].
Releases
--------
Home Manager is developed against `nixpkgs-unstable` branch, which often causes
it to contain tweaks for changes/packages not yet released in stable [NixOS][].
To avoid breaking users' configurations, Home Manager is released in branches
corresponding to NixOS releases (e.g. `release-24.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.
Words of warning Words of warning
---------------- ----------------
Unfortunately, it is quite possible to get difficult to understand errors when This project is under development. I personally use it to manage
working with Home Manager. You should therefore be comfortable using the [Nix][] several user configurations but it may fail catastrophically for you.
language and the various tools in the Nix ecosystem. So beware!
If you are not very familiar with Nix but still want to use Home Manager then In some cases Home Manager cannot detect whether it will overwrite a
you are strongly encouraged to start with a small and very simple configuration previous manual configuration. For example, the Gnome Terminal module
and gradually make it more elaborate as you learn. will write to your dconf store and cannot tell whether a configuration
that it is about to be overwrite was from a previous Home Manager
generation or from manual configuration.
In some cases Home Manager cannot detect whether it will overwrite a previous Home Manager targets [NixOS][] unstable and NixOS version 18.09 (the
manual configuration. For example, the Gnome Terminal module will write to your current stable version), it may or may not work on other Linux
dconf store and cannot tell whether a configuration that it is about to be distributions and NixOS versions.
overwritten was from a previous Home Manager generation or from manual
configuration.
Home Manager targets [NixOS][] unstable and NixOS version 24.05 (the current Also, the `home-manager` tool does not explicitly support rollbacks at
stable version), it may or may not work on other Linux distributions and NixOS the moment so if your home directory gets messed up you'll have to fix
versions. it yourself. See the [rollbacks](#rollbacks) section for instructions
on how to manually perform a rollback.
Also, the `home-manager` tool does not explicitly support rollbacks at the Now when your expectations have been built up and you are eager to try
moment so if your home directory gets messed up you'll have to fix it yourself. all this out you can go ahead and read the rest of this text.
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 Contact
------- -------
You can chat with us on IRC in the channel [#home-manager][] on [OFTC][]. There You can chat with us on IRC in the channel [#home-manager][] on
is also a [Matrix room](https://matrix.to/#/#hm:rycee.net), which is bridged to [freenode][]. The [channel logs][] are hosted courtesy of
the IRC channel. [samueldr][].
Installation Installation
------------ ------------
Home Manager can be used in three primary ways: Currently the easiest way to install Home Manager is as follows:
1. Using the standalone `home-manager` tool. For platforms other than NixOS and 1. Make sure you have a working Nix installation. If you are not
Darwin, this is the only available choice. It is also recommended for people using NixOS then you may here have to run
on [NixOS][] or Darwin that want to manage their home directory independently
of the system as a whole. See ["Standalone installation" in the
manual][manual standalone install] for instructions on how to perform this
installation.
1. As a module within a NixOS system configuration. This allows the user ```console
profiles to be built together with the system when running `nixos-rebuild`. $ mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
See ["NixOS module" in the manual][manual nixos install] for a description of ```
this setup.
1. As a module within a [nix-darwin] system configuration. This allows the user since Home Manager uses these directories to manage your profile
profiles to be built together with the system when running `darwin-rebuild`. generations. On NixOS these should already be available.
See ["nix-darwin module" in the manual][manual nix-darwin install] for a
description of this setup.
Home Manager provides both the channel-based setup and the flake-based one. See Also make sure that your user is able to build and install Nix
[Nix Flakes][manual nix flakes] for a description of the flake-based setup. packages. For example, you should be able to successfully run a
command like `nix-instantiate '<nixpkgs>' -A hello` without having
to switch to the root user. For a multi-user install of Nix this
means that your user must be covered by the
[`allowed-users`][nixAllowedUsers] Nix option. On NixOS you can
control this option using the
[`nix.allowedUsers`][nixosAllowedUsers] system option.
Translations 2. Add the appropriate Home Manager channel. Typically this is
------------
Home Manager has basic support for internationalization through ```console
[gettext](https://www.gnu.org/software/gettext/). The translations are hosted by $ nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager
[Weblate](https://weblate.org/). If you would like to contribute to the $ nix-channel --update
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/"> if you are following Nixpkgs master or an unstable channel and
<img src="https://hosted.weblate.org/widgets/home-manager/-/multi-auto.svg" alt="Translation status" />
</a>
License ```console
------- $ nix-channel --add https://github.com/rycee/home-manager/archive/release-18.09.tar.gz home-manager
$ nix-channel --update
```
This project is licensed under the terms of the [MIT license](LICENSE). if you follow a Nixpkgs version 18.09 channel.
[#home-manager]: https://webchat.oftc.net/?channels=home-manager On NixOS you may need to log out and back in for the channel to
[Nix Flakes]: https://wiki.nixos.org/wiki/Flakes become available. On non-NixOS you may have to add
```shell
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
```
to your shell (see [nix#2033](https://github.com/NixOS/nix/issues/2033)).
3. Install Home Manager and create the first Home Manager generation:
```console
$ nix-shell '<home-manager>' -A install
```
Once finished, Home Manager should be active and available in your
user environment.
3. If you do not plan on having Home Manager manage your shell
configuration then you must source the
```
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
```
file in your shell configuration. Unfortunately, in this specific
case we currently only support POSIX.2-like shells such as
[Bash][] or [Z shell][].
For example, if you use Bash then add
```bash
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
```
to your `~/.profile` file.
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the
`programs.home-manager.path` option to specify the absolute path to
the repository.
Usage
-----
Home Manager is typically managed through the `home-manager` tool.
This tool can, for example, apply configurations to your home
directory, list user packages installed by the tool, and list the
configuration generations.
As an example, let us expand the initial configuration file from the
installation above to install the htop and fortune packages, install
Emacs with a few extra packages enabled, install Firefox with the
IcedTea plugin enabled, and enable the user gpg-agent service.
To satisfy the above setup we should elaborate the
`~/.config/nixpkgs/home.nix` file as follows:
```nix
{ pkgs, ... }:
{
home.packages = [
pkgs.htop
pkgs.fortune
];
programs.emacs = {
enable = true;
extraPackages = epkgs: [
epkgs.nix-mode
epkgs.magit
];
};
programs.firefox = {
enable = true;
enableIcedTea = true;
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
programs.home-manager = {
enable = true;
path = "…";
};
}
```
To activate this configuration you can then run
```console
$ home-manager switch
```
or if you are not feeling so lucky,
```console
$ home-manager build
```
which will create a `result` link to a directory containing an
activation script and the generated home directory files.
Documentation of available configuration options, including
descriptions and usage examples, is available in the [Home Manager
manual][configuration options] or offline by running
```console
$ man home-configuration.nix
```
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:
```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:
```console
$ /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation/activate
Starting home manager activation
```
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
```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
```console
$ home-manager switch
Activating checkLinkTargets
Existing file '/home/jdoe/.gitconfig' is in the way
Please move the above files and try again
```
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
```nix
{
# …
services.xserver.enable = true;
# …
}
```
in your system configuration and
```nix
{
# …
xsession.enable = true;
xsession.windowManager.command = "…";
# …
}
```
in your Home Manager configuration.
[Bash]: https://www.gnu.org/software/bash/
[Nix]: https://nixos.org/nix/
[NixOS]: https://nixos.org/ [NixOS]: https://nixos.org/
[Nix]: https://nixos.org/explore.html [Nixpkgs]: https://nixos.org/nixpkgs/
[Nixpkgs]: https://github.com/NixOS/nixpkgs [nixAllowedUsers]: https://nixos.org/nix/manual/#conf-allowed-users
[OFTC]: https://oftc.net/ [nixosAllowedUsers]: https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers
[configuration options]: https://nix-community.github.io/home-manager/options.xhtml [Z shell]: http://zsh.sourceforge.net/
[contributing]: https://nix-community.github.io/home-manager/#ch-contributing [configuration options]: https://rycee.gitlab.io/home-manager/options.html
[manual nix flakes]: https://nix-community.github.io/home-manager/#ch-nix-flakes [#home-manager]: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager
[manual nix-darwin install]: https://nix-community.github.io/home-manager/#sec-install-nix-darwin-module [freenode]: https://freenode.net/
[manual nixos install]: https://nix-community.github.io/home-manager/#sec-install-nixos-module [channel logs]: https://logs.nix.samueldr.com/home-manager/
[manual standalone install]: https://nix-community.github.io/home-manager/#sec-install-standalone [samueldr]: https://github.com/samueldr/
[manual]: https://nix-community.github.io/home-manager/
[nix-darwin]: https://github.com/LnL7/nix-darwin
[rollbacks]: https://nix-community.github.io/home-manager/index.xhtml#sec-usage-rollbacks

View file

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

328
doc/default.nix Normal file
View file

@ -0,0 +1,328 @@
{ pkgs, options, config, version, revision, extraSources ? [] }:
with pkgs;
let
lib = pkgs.lib;
# Remove invisible and internal options.
optionsListVisible = lib.filter (opt: opt.visible && !opt.internal) (lib.optionAttrSetToDocList options);
# Replace functions by the string <function>
substFunction = x:
if builtins.isAttrs x then lib.mapAttrs (name: substFunction) x
else if builtins.isList x then map substFunction x
else if lib.isFunction x then "<function>"
else x;
# Generate DocBook documentation for a list of packages. This is
# what `relatedPackages` option of `mkOption` from
# ../../../lib/options.nix influences.
#
# Each element of `relatedPackages` can be either
# - a string: that will be interpreted as an attribute name from `pkgs`,
# - a list: that will be interpreted as an attribute path from `pkgs`,
# - an attrset: that can specify `name`, `path`, `package`, `comment`
# (either of `name`, `path` is required, the rest are optional).
genRelatedPackages = packages:
let
unpack = p: if lib.isString p then { name = p; }
else if lib.isList p then { path = p; }
else p;
describe = args:
let
name = args.name or (lib.concatStringsSep "." args.path);
path = args.path or [ args.name ];
package = args.package or (lib.attrByPath path (throw "Invalid package attribute path `${toString path}'") pkgs);
in "<listitem>"
+ "<para><literal>pkgs.${name} (${package.meta.name})</literal>"
+ lib.optionalString (!package.meta.available) " <emphasis>[UNAVAILABLE]</emphasis>"
+ ": ${package.meta.description or "???"}.</para>"
+ lib.optionalString (args ? comment) "\n<para>${args.comment}</para>"
# Lots of `longDescription's break DocBook, so we just wrap them into <programlisting>
+ lib.optionalString (package.meta ? longDescription) "\n<programlisting>${package.meta.longDescription}</programlisting>"
+ "</listitem>";
in "<itemizedlist>${lib.concatStringsSep "\n" (map (p: describe (unpack p)) packages)}</itemizedlist>";
optionsListDesc = lib.flip map optionsListVisible (opt: opt // {
# Clean up declaration sites to not refer to the NixOS source tree.
declarations = map stripAnyPrefixes opt.declarations;
}
// lib.optionalAttrs (opt ? example) { example = substFunction opt.example; }
// lib.optionalAttrs (opt ? default) { default = substFunction opt.default; }
// lib.optionalAttrs (opt ? type) { type = substFunction opt.type; }
// lib.optionalAttrs (opt ? relatedPackages) { relatedPackages = genRelatedPackages opt.relatedPackages; });
# We need to strip references to /nix/store/* from options,
# including any `extraSources` if some modules came from elsewhere,
# or else the build will fail.
#
# E.g. if some `options` came from modules in ${pkgs.customModules}/nix,
# you'd need to include `extraSources = [ pkgs.customModules ]`
prefixesToStrip = map (p: "${toString p}/") ([ ./.. ] ++ extraSources);
stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) prefixesToStrip;
# Custom "less" that pushes up all the things ending in ".enable*"
# and ".package*"
optionLess = a: b:
let
ise = lib.hasPrefix "enable";
isp = lib.hasPrefix "package";
cmp = lib.splitByAndCompare ise lib.compare
(lib.splitByAndCompare isp lib.compare lib.compare);
in lib.compareLists cmp a.loc b.loc < 0;
# Customly sort option list for the man page.
optionsList = lib.sort optionLess optionsListDesc;
# Convert the list of options into an XML file.
optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList);
optionsDocBook = runCommand "options-db.xml"
{
nativeBuildInputs = [ buildPackages.libxslt.bin ];
}
''
optionsXML=${optionsXML}
xsltproc \
--stringparam program 'home-manager' \
--stringparam revision '${revision}' \
-o $out ${./options-to-docbook.xsl} $optionsXML
'';
sources = lib.sourceFilesBySuffices ./. [".xml"];
modulesDoc = builtins.toFile "modules.xml" ''
<section xmlns:xi="http://www.w3.org/2001/XInclude" id="modules">
${(lib.concatMapStrings (path: ''
<xi:include href="${path}" />
'') (lib.catAttrs "value" config.meta.doc))}
</section>
'';
generatedSources = runCommand "generated-docbook" {} ''
mkdir $out
ln -s ${modulesDoc} $out/modules.xml
ln -s ${optionsDocBook} $out/options-db.xml
printf "%s" "${version}" > $out/version
'';
copySources =
''
cp -prd $sources/* . # */
ln -s ${generatedSources} ./generated
chmod -R u+w .
'';
toc = builtins.toFile "toc.xml"
''
<toc role="chunk-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-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
</d:tocentry>
</toc>
'';
manualXsltprocOptions = toString [
"--param section.autolabel 1"
"--param section.label.includes.component.label 1"
"--stringparam html.stylesheet 'style.css overrides.css highlightjs/mono-blue.css'"
"--stringparam html.script './highlightjs/highlight.pack.js ./highlightjs/loader.js'"
"--param xref.with.number.and.title 1"
"--param toc.section.depth 3"
"--stringparam admon.style ''"
"--stringparam callout.graphics.extension .svg"
"--stringparam current.docid manual"
"--param chunk.section.depth 0"
"--param chunk.first.sections 1"
"--param use.id.as.filename 1"
"--stringparam generate.toc 'book toc appendix toc'"
"--stringparam chunk.toc ${toc}"
];
manual-combined = runCommand "home-manager-manual-combined"
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
meta.description = "The Home Manager manual as plain docbook XML";
}
''
${copySources}
xmllint --xinclude --output ./manual-combined.xml ./manual.xml
xmllint --xinclude --noxincludenode \
--output ./man-pages-combined.xml ./man-pages.xml
# outputs the context of an xmllint error output
# LEN lines around the failing line are printed
function context {
# length of context
local LEN=6
# lines to print before error line
local BEFORE=4
# xmllint output lines are:
# file.xml:1234: there was an error on line 1234
while IFS=':' read -r file line rest; do
echo
if [[ -n "$rest" ]]; then
echo "$file:$line:$rest"
local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
# number lines & filter context
nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
else
if [[ -n "$line" ]]; then
echo "$file:$line"
else
echo "$file"
fi
fi
done
}
function lintrng {
xmllint --debug --noout --nonet \
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
"$1" \
2>&1 | context 1>&2
# ^ redirect assumes xmllint doesnt print to stdout
}
lintrng manual-combined.xml
lintrng man-pages-combined.xml
mkdir $out
cp manual-combined.xml $out/
cp man-pages-combined.xml $out/
'';
olinkDB = runCommand "manual-olinkdb"
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
}
''
xsltproc \
${manualXsltprocOptions} \
--stringparam collect.xref.targets only \
--stringparam targets.filename "$out/manual.db" \
--nonet \
${docbook5_xsl}/xml/xsl/docbook/xhtml/chunktoc.xsl \
${manual-combined}/manual-combined.xml
cat > "$out/olinkdb.xml" <<EOF
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE targetset SYSTEM
"file://${docbook5_xsl}/xml/xsl/docbook/common/targetdatabase.dtd" [
<!ENTITY manualtargets SYSTEM "file://$out/manual.db">
]>
<targetset>
<targetsetinfo>
Allows for cross-referencing olinks between the manpages
and manual.
</targetsetinfo>
<document targetdoc="manual">&manualtargets;</document>
</targetset>
EOF
'';
in rec {
inherit generatedSources;
# The Home Manager options in JSON format.
optionsJSON = runCommand "options-json"
{ meta.description = "List of Home Manager options in JSON format";
}
''
# Export list of options in different format.
dst=$out/share/doc/home-manager
mkdir -p $dst
cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON
(builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList))))
} $dst/options.json
mkdir -p $out/nix-support
echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
''; # */
# Generate the Home Manager manual.
manual = runCommand "home-manager-manual"
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
meta.description = "The Home Manager manual in HTML format";
allowedReferences = ["out"];
}
''
# Generate the HTML manual.
dst=$out/share/doc/home-manager
mkdir -p $dst
xsltproc \
${manualXsltprocOptions} \
--stringparam target.database.document "${olinkDB}/olinkdb.xml" \
--nonet --output $dst/ \
${docbook5_xsl}/xml/xsl/docbook/xhtml/chunktoc.xsl \
${manual-combined}/manual-combined.xml
mkdir -p $dst/images/callouts
cp ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.svg $dst/images/callouts/
cp ${./style.css} $dst/style.css
cp ${./overrides.css} $dst/overrides.css
cp -r ${pkgs.documentation-highlighter} $dst/highlightjs
mkdir -p $out/nix-support
echo "nix-build out $out" >> $out/nix-support/hydra-build-products
echo "doc manual $dst" >> $out/nix-support/hydra-build-products
''; # */
manualEpub = runCommand "home-manager-manual-epub"
{ inherit sources;
buildInputs = [ libxml2.bin libxslt.bin zip ];
}
''
# Generate the epub manual.
dst=$out/share/doc/home-manager
xsltproc \
${manualXsltprocOptions} \
--stringparam target.database.document "${olinkDB}/olinkdb.xml" \
--nonet --xinclude --output $dst/epub/ \
${docbook5_xsl}/xml/xsl/docbook/epub/docbook.xsl \
${manual-combined}/manual-combined.xml
mkdir -p $dst/epub/OEBPS/images/callouts
cp -r ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.svg $dst/epub/OEBPS/images/callouts # */
echo "application/epub+zip" > mimetype
manual="$dst/home-manager-manual.epub"
zip -0Xq "$manual" mimetype
cd $dst/epub && zip -Xr9D "$manual" *
rm -rf $dst/epub
mkdir -p $out/nix-support
echo "doc-epub manual $manual" >> $out/nix-support/hydra-build-products
'';
# Generate the Home Manager manpages.
manpages = runCommand "home-manager-manpages"
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
allowedReferences = ["out"];
}
''
# Generate manpages.
mkdir -p $out/share/man
xsltproc --nonet \
--param man.output.in.separate.dir 1 \
--param man.output.base.dir "'$out/share/man/'" \
--param man.endnotes.are.numbered 0 \
--param man.break.after.slash 1 \
--stringparam target.database.document "${olinkDB}/olinkdb.xml" \
${docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
${manual-combined}/man-pages-combined.xml
'';
}

236
doc/installation.xml Normal file
View file

@ -0,0 +1,236 @@
<chapter 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="ch-installation">
<title>Installing Home Manager</title>
<para>
Home Manager can be used in three primary ways:
<orderedlist>
<listitem>
<para>
Using the standalone <command>home-manager</command> 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 independent of the system as a whole. See
<xref linkend="sec-install-standalone"/> for instructions on how to
perform this installation.
</para>
</listitem>
<listitem>
<para>
As a module within a NixOS system configuration. This allows the user
profiles to be built together with the system when running
<command>nixos-rebuild</command>. See
<xref linkend="sec-install-nixos-module"/> for a description of this
setup.
</para>
</listitem>
<listitem>
<para>
As a module within a
<link xlink:href="https://github.com/LnL7/nix-darwin/">nix-darwin</link>
system configuration. This allows the user profiles to be built together
with the system when running <command>darwin-rebuild</command>. See
<xref linkend="sec-install-nix-darwin-module"/> for a description of this
setup.
</para>
</listitem>
</orderedlist>
</para>
<section xml:id="sec-install-standalone">
<title>Standalone installation</title>
<orderedlist>
<listitem>
<para>
Make sure you have a working Nix installation. If you are not using NixOS
then it may be necessary to run
</para>
<screen>
<prompt>$</prompt> <userinput>mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER</userinput>
</screen>
<para>
since Home Manager uses these directories to manage your profile
generations. On NixOS these should already be available.
</para>
<para>
Also 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
<literal>nix-instantiate '&lt;nixpkgs&gt;' -A hello</literal> 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
<link xlink:href="https://nixos.org/nix/manual/#conf-allowed-users"><literal>allowed-users</literal></link>
Nix option. On NixOS you can control this option using the
<link xlink:href="https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers"><literal>nix.allowedUsers</literal></link>
system option.
</para>
</listitem>
<listitem>
<para>
Add the Home Manager channel that you wish to follow. This is done by
running
</para>
<screen>
<prompt>$</prompt> <userinput>nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager</userinput>
<prompt>$</prompt> <userinput>nix-channel --update</userinput>
</screen>
<para>
if you are following Nixpkgs master or an unstable channel and
</para>
<screen>
<prompt>$</prompt> <userinput>nix-channel --add https://github.com/rycee/home-manager/archive/release-18.09.tar.gz home-manager</userinput>
<prompt>$</prompt> <userinput>nix-channel --update</userinput>
</screen>
<para>
if you follow a Nixpkgs version 18.09 channel.
</para>
<para>
On NixOS you may need to log out and back in for the channel to become
available. On non-NixOS you may have to add
<programlisting language="bash">
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
</programlisting>
to your shell (see
<link xlink:href="https://github.com/NixOS/nix/issues/2033">nix#2033</link>).
</para>
</listitem>
<listitem>
<para>
Run the Home Manager installation command and create the first Home
Manager generation:
</para>
<screen>
<prompt>$</prompt> <userinput>nix-shell '&lt;home-manager&gt;' -A install</userinput>
</screen>
<para>
Once finished, Home Manager should be active and available in your user
environment.
</para>
</listitem>
<listitem>
<para>
If you do not plan on having Home Manager manage your shell configuration
then you must source the
</para>
<programlisting language="bash">
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
</programlisting>
<para>
file in your shell configuration. Unfortunately, we currently only support
POSIX.2-like shells such as
<link xlink:href="https://www.gnu.org/software/bash/">Bash</link> or
<link xlink:href="http://zsh.sourceforge.net/">Z shell</link>.
</para>
<para>
For example, if you use Bash then add
</para>
<programlisting language="bash">
. &quot;$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh&quot;
</programlisting>
<para>
to your <literal>~/.profile</literal> file.
</para>
</listitem>
</orderedlist>
<para>
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the
<literal>programs.home-manager.path</literal> option to specify the absolute
path to the repository.
</para>
</section>
<section xml:id="sec-install-nixos-module">
<title>NixOS module</title>
<para>
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 <command>home-manager</command> tool. It also
opens up additional possibilities, for example, to automatically configure
user environments in NixOS declarative containers or on systems deployed
through NixOps.
</para>
<para>
To make the NixOS module available for use you must <option>import</option>
it into your system configuration. This is most conveniently done by adding
a Home Manager channel, for example
</para>
<screen>
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager</userinput>
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
</screen>
<para>
if you are following Nixpkgs master or an unstable channel and
</para>
<screen>
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/rycee/home-manager/archive/release-18.09.tar.gz home-manager</userinput>
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
</screen>
<para>
if you follow a Nixpkgs version 18.09 channel.
</para>
<para>
It is then possible to add
</para>
<programlisting language="nix">
imports = [ &lt;home-manager/nixos&gt; ];
</programlisting>
<para>
to your system <filename>configuration.nix</filename> file, which will
introduce a new NixOS option called <option>home-manager.users</option>
whose type is an attribute set that maps user names to Home Manager
configurations.
</para>
<para>
For example, a NixOS configuration may include the lines
</para>
<programlisting language="nix">
users.users.eve.isNormalUser = true;
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
};
</programlisting>
<para>
and after a <command>nixos-rebuild switch</command> the user eve's
environment should include a basic Bash configuration and the packages atool
and httpie.
</para>
<note>
<para>
By default packages will be installed to
<filename>$HOME/.nix-profile</filename> but they can be installed to
<filename>/etc/profiles</filename> if
</para>
<programlisting language="nix">
home-manager.useUserPackages = true;
</programlisting>
<para>
is added to the system configuration. This is necessary if, for example,
you wish to use <command>nixos-rebuild build-vm</command>. This option may
become the default value in the future.
</para>
</note>
</section>
<section xml:id="sec-install-nix-darwin-module">
<title>nix-darwin module</title>
<para>
To be done.
</para>
</section>
</chapter>

40
doc/man-configuration.xml Normal file
View file

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

88
doc/man-home-manager.xml Normal file
View file

@ -0,0 +1,88 @@
<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>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></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">
<option>help</option>
</arg>
<arg choice="plain">
<option>build</option>
</arg>
<arg choice="plain">
<option>switch</option>
</arg>
<arg choice="plain">
<option>generations</option>
</arg>
<arg choice="plain">
<option>remove-generations</option>
</arg>
<arg choice="plain">
<option>packages</option>
</arg>
<arg choice="plain">
<option>news</option>
</arg>
</group>
</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>.
</para>
</refsection>
<refsection>
<title>Files</title>
<variablelist>
<varlistentry>
<term>
<filename>~/.local/share/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/rycee/home-manager/issues">project
issue tracker</link>.
</para>
</refsection>
<refsection>
<title>See also</title>
<para>
<citerefentry>
<refentrytitle>home-configuration.nix</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry>
</para>
</refsection>
</refentry>

12
doc/man-pages.xml Normal file
View file

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

34
doc/manual.xml Normal file
View file

@ -0,0 +1,34 @@
<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 describes how to install, use, and extend Home
Manager.
</para>
<para>
If you encounter problems or bugs then please report them on the
<link xlink:href="https://github.com/rycee/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" />
<appendix xml:id="ch-options">
<title>Configuration Options</title>
<xi:include href="./generated/options-db.xml" xpointer="configuration-variable-list" />
</appendix>
<xi:include href="./release-notes/release-notes.xml" />
</book>

239
doc/options-to-docbook.xsl Normal file
View file

@ -0,0 +1,239 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://docbook.org/ns/docbook"
extension-element-prefixes="str"
>
<xsl:output method='xml' encoding="UTF-8" />
<xsl:param name="revision" />
<xsl:param name="program" />
<xsl:template match="/expr/list">
<appendix>
<title>Configuration Options</title>
<variablelist xml:id="configuration-variable-list">
<xsl:for-each select="attrs">
<xsl:variable name="id" select="concat('opt-', str:replace(str:replace(str:replace(str:replace(attr[@name = 'name']/string/@value, '*', '_'), '&lt;', '_'), '>', '_'), '?', '_'))" />
<varlistentry>
<term xlink:href="#{$id}">
<xsl:attribute name="xml:id"><xsl:value-of select="$id"/></xsl:attribute>
<option>
<xsl:value-of select="attr[@name = 'name']/string/@value" />
</option>
</term>
<listitem>
<para>
<xsl:value-of disable-output-escaping="yes"
select="attr[@name = 'description']/string/@value" />
</para>
<xsl:if test="attr[@name = 'type']">
<para>
<emphasis>Type:</emphasis>
<xsl:text> </xsl:text>
<xsl:value-of select="attr[@name = 'type']/string/@value"/>
<xsl:if test="attr[@name = 'readOnly']/bool/@value = 'true'">
<xsl:text> </xsl:text>
<emphasis>(read only)</emphasis>
</xsl:if>
</para>
</xsl:if>
<xsl:if test="attr[@name = 'default']">
<para>
<emphasis>Default:</emphasis>
<xsl:text> </xsl:text>
<xsl:apply-templates select="attr[@name = 'default']" mode="top" />
</para>
</xsl:if>
<xsl:if test="attr[@name = 'example']">
<para>
<emphasis>Example:</emphasis>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="attr[@name = 'example']/attrs[attr[@name = '_type' and string[@value = 'literalExample']]]">
<programlisting><xsl:value-of select="attr[@name = 'example']/attrs/attr[@name = 'text']/string/@value" /></programlisting>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="attr[@name = 'example']" mode="top" />
</xsl:otherwise>
</xsl:choose>
</para>
</xsl:if>
<xsl:if test="attr[@name = 'relatedPackages']">
<para>
<emphasis>Related packages:</emphasis>
<xsl:text> </xsl:text>
<xsl:value-of disable-output-escaping="yes"
select="attr[@name = 'relatedPackages']/string/@value" />
</para>
</xsl:if>
<xsl:if test="count(attr[@name = 'declarations']/list/*) != 0">
<para>
<emphasis>Declared by:</emphasis>
</para>
<xsl:apply-templates select="attr[@name = 'declarations']" />
</xsl:if>
<xsl:if test="count(attr[@name = 'definitions']/list/*) != 0">
<para>
<emphasis>Defined by:</emphasis>
</para>
<xsl:apply-templates select="attr[@name = 'definitions']" />
</xsl:if>
</listitem>
</varlistentry>
</xsl:for-each>
</variablelist>
</appendix>
</xsl:template>
<xsl:template match="*" mode="top">
<xsl:choose>
<xsl:when test="string[contains(@value, '&#010;')]">
<programlisting>
<xsl:text>''
</xsl:text><xsl:value-of select='str:replace(string/@value, "${", "&apos;&apos;${")' /><xsl:text>''</xsl:text></programlisting>
</xsl:when>
<xsl:otherwise>
<literal><xsl:apply-templates /></literal>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="null">
<xsl:text>null</xsl:text>
</xsl:template>
<xsl:template match="string">
<xsl:choose>
<xsl:when test="(contains(@value, '&quot;') or contains(@value, '\')) and not(contains(@value, '&#010;'))">
<xsl:text>''</xsl:text><xsl:value-of select='str:replace(@value, "${", "&apos;&apos;${")' /><xsl:text>''</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>"</xsl:text><xsl:value-of select="str:replace(str:replace(str:replace(str:replace(@value, '\', '\\'), '&quot;', '\&quot;'), '&#010;', '\n'), '$', '\$')" /><xsl:text>"</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="int">
<xsl:value-of select="@value" />
</xsl:template>
<xsl:template match="bool[@value = 'true']">
<xsl:text>true</xsl:text>
</xsl:template>
<xsl:template match="bool[@value = 'false']">
<xsl:text>false</xsl:text>
</xsl:template>
<xsl:template match="list">
[
<xsl:for-each select="*">
<xsl:apply-templates select="." />
<xsl:text> </xsl:text>
</xsl:for-each>
]
</xsl:template>
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExample']]]">
<xsl:value-of select="attr[@name = 'text']/string/@value" />
</xsl:template>
<xsl:template match="attrs">
{
<xsl:for-each select="attr">
<xsl:value-of select="@name" />
<xsl:text> = </xsl:text>
<xsl:apply-templates select="*" /><xsl:text>; </xsl:text>
</xsl:for-each>
}
</xsl:template>
<xsl:template match="derivation">
<replaceable>(build of <xsl:value-of select="attr[@name = 'name']/string/@value" />)</replaceable>
</xsl:template>
<xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
<simplelist>
<xsl:for-each select="list/string">
<member><filename>
<!-- Hyperlink the filename either to the NixOS Subversion
repository (if its a module and we have a revision number),
or to the local filesystem. -->
<xsl:choose>
<xsl:when test="not(starts-with(@value, '/'))">
<xsl:choose>
<xsl:when test="$program = 'home-manager'">
<xsl:attribute name="xlink:href">https://github.com/rycee/home-manager/blob/<xsl:value-of select="$revision"/>/<xsl:value-of select="@value"/>#blob-path</xsl:attribute>
</xsl:when>
<xsl:when test="$revision = 'local'">
<xsl:attribute name="xlink:href">https://github.com/NixOS/nixpkgs/blob/master/<xsl:value-of select="@value"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xlink:href">https://github.com/NixOS/nixpkgs/blob/<xsl:value-of select="$revision"/>/<xsl:value-of select="@value"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$revision != 'local' and $program = 'nixops' and contains(@value, '/nix/')">
<xsl:attribute name="xlink:href">https://github.com/NixOS/nixops/blob/<xsl:value-of select="$revision"/>/nix/<xsl:value-of select="substring-after(@value, '/nix/')"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xlink:href">file://<xsl:value-of select="@value"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<!-- Print the filename and make it user-friendly by replacing the
/nix/store/<hash> prefix by the default location of nixos
sources. -->
<xsl:choose>
<xsl:when test="$program = 'home-manager'">
&lt;home-manager/<xsl:value-of select="@value"/>&gt;
</xsl:when>
<xsl:when test="not(starts-with(@value, '/'))">
&lt;nixpkgs/<xsl:value-of select="@value"/>&gt;
</xsl:when>
<xsl:when test="contains(@value, 'nixops') and contains(@value, '/nix/')">
&lt;nixops/<xsl:value-of select="substring-after(@value, '/nix/')"/>&gt;
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@value" />
</xsl:otherwise>
</xsl:choose>
</filename></member>
</xsl:for-each>
</simplelist>
</xsl:template>
<xsl:template match="function">
<xsl:text>λ</xsl:text>
</xsl:template>
</xsl:stylesheet>

9
doc/overrides.css Normal file
View file

@ -0,0 +1,9 @@
.docbook .xref img[src^=images\/callouts\/],
.screen img,
.programlisting img {
width: 1em;
}
.calloutlist img {
width: 1.5em;
}

View file

@ -0,0 +1,13 @@
<appendix 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="ch-release-notes">
<title>Release Notes</title>
<para>
This section lists the release notes for stable versions of Home Manager and
the current unstable version.
</para>
<xi:include href="rl-1903.xml" />
<xi:include href="rl-1809.xml" />
</appendix>

View file

@ -0,0 +1,11 @@
<section 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="sec-release-18.09">
<title>Release 18.09</title>
<para>
The 18.09 release branch became the stable branch in September, 2018.
</para>
</section>

View file

@ -0,0 +1,67 @@
<section 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="sec-release-19.03">
<title>Release 19.03 (unstable)</title>
<para>
This is the current unstable branch and the information in this section is
therefore not final.
</para>
<para>
Scheduled released is March, 2019.
</para>
<section 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="sec-release-19.03-highlights">
<title>Highlights</title>
<para>
This release has the following notable changes:
</para>
<itemizedlist>
<listitem>
<para>
The <option>home.file.&lt;name?&gt;.source</option> now allows source
files to be hidden, that is, having a name starting with the
<literal>.</literal> 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
<programlisting>
home.file."my file".source = ./. + "/file with spaces!";
</programlisting>
</para>
</listitem>
</itemizedlist>
</section>
<section 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="sec-release-19.03-state-version-changes">
<title>State Version Changes</title>
<para>
The state version in this release includes the changes below. These changes
are only active if the <option>home.stateVersion</option> option is set to
"19.03" or later.
</para>
<itemizedlist>
<listitem>
<para>
There is now an option <option>programs.beets.enable</option> that
defaults to <literal>false</literal>. Before the module would be active if
the <option>programs.beets.settings</option> option was non-empty.
</para>
</listitem>
</itemizedlist>
</section>
</section>

271
doc/style.css Normal file
View file

@ -0,0 +1,271 @@
/* Copied from http://bakefile.sourceforge.net/, which appears
licensed under the GNU GPL. */
/***************************************************************************
Basic headers and text:
***************************************************************************/
body
{
font-family: "Nimbus Sans L", sans-serif;
background: white;
margin: 2em 1em 2em 1em;
}
h1, h2, h3, h4
{
color: #005aa0;
}
h1 /* title */
{
font-size: 200%;
}
h2 /* chapters, appendices, subtitle */
{
font-size: 180%;
}
/* Extra space between chapters, appendices. */
div.chapter > div.titlepage h2, div.appendix > div.titlepage h2
{
margin-top: 1.5em;
}
div.section > div.titlepage h2 /* sections */
{
font-size: 150%;
margin-top: 1.5em;
}
h3 /* subsections */
{
font-size: 125%;
}
div.simplesect h2
{
font-size: 110%;
}
div.appendix h3
{
font-size: 150%;
margin-top: 1.5em;
}
div.refnamediv h2, div.refsynopsisdiv h2, div.refsection h2 /* refentry parts */
{
margin-top: 1.4em;
font-size: 125%;
}
div.refsection h3
{
font-size: 110%;
}
/***************************************************************************
Examples:
***************************************************************************/
div.example
{
border: 1px solid #b0b0b0;
padding: 6px 6px;
margin-left: 1.5em;
margin-right: 1.5em;
background: #f4f4f8;
border-radius: 0.4em;
box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
}
div.example p.title
{
margin-top: 0em;
}
div.example pre
{
box-shadow: none;
}
/***************************************************************************
Screen dumps:
***************************************************************************/
pre.screen, pre.programlisting
{
border: 1px solid #b0b0b0;
padding: 3px 3px;
margin-left: 1.5em;
margin-right: 1.5em;
background: #f4f4f8;
font-family: monospace;
border-radius: 0.4em;
box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
}
div.example pre.programlisting
{
border: 0px;
padding: 0 0;
margin: 0 0 0 0;
}
/***************************************************************************
Notes, warnings etc:
***************************************************************************/
.note, .warning
{
border: 1px solid #b0b0b0;
padding: 3px 3px;
margin-left: 1.5em;
margin-right: 1.5em;
margin-bottom: 1em;
padding: 0.3em 0.3em 0.3em 0.3em;
background: #fffff5;
border-radius: 0.4em;
box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
}
div.note, div.warning
{
font-style: italic;
}
div.note h3, div.warning h3
{
color: red;
font-size: 100%;
padding-right: 0.5em;
display: inline;
}
div.note p, div.warning p
{
margin-bottom: 0em;
}
div.note h3 + p, div.warning h3 + p
{
display: inline;
}
div.note h3
{
color: blue;
font-size: 100%;
}
div.navfooter *
{
font-size: 90%;
}
/***************************************************************************
Links colors and highlighting:
***************************************************************************/
a { text-decoration: none; }
a:hover { text-decoration: underline; }
a:link { color: #0048b3; }
a:visited { color: #002a6a; }
/***************************************************************************
Table of contents:
***************************************************************************/
div.toc
{
font-size: 90%;
}
div.toc dl
{
margin-top: 0em;
margin-bottom: 0em;
}
/***************************************************************************
Special elements:
***************************************************************************/
tt, code
{
color: #400000;
}
.term
{
font-weight: bold;
}
div.variablelist dd p, div.glosslist dd p
{
margin-top: 0em;
}
div.variablelist dd, div.glosslist dd
{
margin-left: 1.5em;
}
div.glosslist dt
{
font-style: italic;
}
.varname
{
color: #400000;
}
span.command strong
{
font-weight: normal;
color: #400000;
}
div.calloutlist table
{
box-shadow: none;
}
table
{
border-collapse: collapse;
box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
}
table.simplelist
{
text-align: left;
color: #005aa0;
border: 0;
padding: 5px;
background: #fffff5;
font-weight: normal;
font-style: italic;
box-shadow: none;
margin-bottom: 1em;
}
div.navheader table, div.navfooter table {
box-shadow: none;
}
div.affiliation
{
font-style: italic;
}

View file

@ -1,170 +0,0 @@
{ pkgs
# Note, this should be "the standard library" + HM extensions.
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib
, release, isReleaseBranch }:
let
# Recursively replace each derivation in the given attribute set
# with the same derivation but with the `outPath` attribute set to
# the string `"\${pkgs.attribute.path}"`. This allows the
# documentation to refer to derivations through their values without
# establishing an actual dependency on the derivation output.
#
# This is not perfect, but it seems to cover a vast majority of use
# cases.
#
# Caveat: even if the package is reached by a different means, the
# path above will be shown and not e.g.
# `${config.services.foo.package}`.
scrubDerivations = prefixPath: attrs:
let
scrubDerivation = name: value:
let pkgAttrName = prefixPath + "." + name;
in if lib.isAttrs value then
scrubDerivations pkgAttrName value
// lib.optionalAttrs (lib.isDerivation value) {
outPath = "\${${pkgAttrName}}";
}
else
value;
in lib.mapAttrs scrubDerivation attrs;
# Make sure the used package is scrubbed to avoid actually
# instantiating derivations.
scrubbedPkgsModule = {
imports = [{
_module.args = {
pkgs = lib.mkForce (scrubDerivations "pkgs" pkgs);
pkgs_i686 = lib.mkForce { };
};
}];
};
dontCheckDefinitions = { _module.check = false; };
gitHubDeclaration = user: repo: subpath:
let urlRef = if isReleaseBranch then "release-${release}" else "master";
in {
url = "https://github.com/${user}/${repo}/blob/${urlRef}/${subpath}";
name = "<${repo}/${subpath}>";
};
hmPath = toString ./..;
buildOptionsDocs = args@{ modules, includeModuleSystemOptions ? true, ... }:
let
options = (lib.evalModules {
inherit modules;
class = "homeManager";
}).options;
in pkgs.buildPackages.nixosOptionsDoc ({
options = if includeModuleSystemOptions then
options
else
builtins.removeAttrs options [ "_module" ];
transformOptions = opt:
opt // {
# Clean up declaration sites to not refer to the Home Manager
# source tree.
declarations = map (decl:
if lib.hasPrefix hmPath (toString decl) then
gitHubDeclaration "nix-community" "home-manager"
(lib.removePrefix "/" (lib.removePrefix hmPath (toString decl)))
else if decl == "lib/modules.nix" then
# TODO: handle this in a better way (may require upstream
# changes to nixpkgs)
gitHubDeclaration "NixOS" "nixpkgs" decl
else
decl) opt.declarations;
};
} // builtins.removeAttrs args [ "modules" "includeModuleSystemOptions" ]);
hmOptionsDocs = buildOptionsDocs {
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [ scrubbedPkgsModule ];
variablelistId = "home-manager-options";
};
nixosOptionsDocs = buildOptionsDocs {
modules = [ ../nixos scrubbedPkgsModule dontCheckDefinitions ];
includeModuleSystemOptions = false;
variablelistId = "nixos-options";
optionIdPrefix = "nixos-opt-";
};
nixDarwinOptionsDocs = buildOptionsDocs {
modules = [ ../nix-darwin scrubbedPkgsModule dontCheckDefinitions ];
includeModuleSystemOptions = false;
variablelistId = "nix-darwin-options";
optionIdPrefix = "nix-darwin-opt-";
};
release-config = builtins.fromJSON (builtins.readFile ../release.json);
revision = "release-${release-config.release}";
# Generate the `man home-configuration.nix` package
home-configuration-manual =
pkgs.runCommand "home-configuration-reference-manpage" {
nativeBuildInputs =
[ pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs ];
allowedReferences = [ "out" ];
} ''
# Generate manpages.
mkdir -p $out/share/man/man5
mkdir -p $out/share/man/man1
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
--revision ${revision} \
--header ${./home-configuration-nix-header.5} \
--footer ${./home-configuration-nix-footer.5} \
${hmOptionsDocs.optionsJSON}/share/doc/nixos/options.json \
$out/share/man/man5/home-configuration.nix.5
cp ${./home-manager.1} $out/share/man/man1/home-manager.1
'';
# Generate the HTML manual pages
home-manager-manual = pkgs.callPackage ./home-manager-manual.nix {
home-manager-options = {
home-manager = hmOptionsDocs.optionsJSON;
nixos = nixosOptionsDocs.optionsJSON;
nix-darwin = nixDarwinOptionsDocs.optionsJSON;
};
inherit revision;
};
html = home-manager-manual;
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix { } { inherit html; };
in {
options = {
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
# `nixosOptionsDoc` is more customizable.
json = pkgs.runCommand "options.json" {
meta.description = "List of Home Manager options in JSON format";
} ''
mkdir -p $out/{share/doc,nix-support}
cp -a ${hmOptionsDocs.optionsJSON}/share/doc/nixos $out/share/doc/home-manager
substitute \
${hmOptionsDocs.optionsJSON}/nix-support/hydra-build-products \
$out/nix-support/hydra-build-products \
--replace \
'${hmOptionsDocs.optionsJSON}/share/doc/nixos' \
"$out/share/doc/home-manager"
'';
};
manPages = home-configuration-manual;
manual = { inherit html htmlOpenTool; };
# Unstable, mainly for CI.
jsonModuleMaintainers = pkgs.writeText "hm-module-maintainers.json" (let
result = lib.evalModules {
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [ scrubbedPkgsModule ];
class = "homeManager";
};
in builtins.toJSON result.config.meta.maintainers);
}

View file

@ -1,45 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1706683685,
"narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"scss-reset": "scss-reset"
}
},
"scss-reset": {
"flake": false,
"locked": {
"lastModified": 1683906868,
"narHash": "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE=",
"owner": "andreymatin",
"repo": "scss-reset",
"rev": "5a7bd491ac82441e6283fb0d5d54644b913b30c7",
"type": "github"
},
"original": {
"owner": "andreymatin",
"ref": "1.4.2",
"repo": "scss-reset",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,54 +0,0 @@
{
description = "Support developing Home Manager documentation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
scss-reset = {
url = "github:andreymatin/scss-reset/1.4.2";
flake = false;
};
};
outputs = { self, nixpkgs, scss-reset }:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
lib = nixpkgs.lib;
forAllSystems = lib.genAttrs supportedSystems;
flakePkgs = pkgs: {
p-build = pkgs.writeShellScriptBin "p-build" ''
set -euo pipefail
export PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.rsass ]}
tmpfile=$(mktemp -d)
trap "rm -r $tmpfile" EXIT
ln -s "${scss-reset}/build" "$tmpfile/scss-reset"
rsass --load-path="$tmpfile" --style compressed \
./static/style.scss > ./static/style.css
echo "Generated ./static/style.css"
'';
};
in {
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
fpkgs = flakePkgs pkgs;
in {
default = pkgs.mkShell {
name = "hm-docs";
packages = [ fpkgs.p-build ];
};
});
};
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,57 +0,0 @@
# News {#sec-news}
Home Manager includes a system for presenting news to the user. When
making a change you, therefore, have the option to also include an
associated news entry. In general, a news entry should only be added for
truly noteworthy news. For example, a bug fix or new option does
generally not need a news entry.
If you do have a change worthy of a news entry then please add one in
[`news.nix`](https://github.com/nix-community/home-manager/blob/master/modules/misc/news.nix)
but you should follow some basic guidelines:
- 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
``` shell
$ 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
``` nix
condition = hostPlatform.isLinux;
```
should be added. If you contribute a module then you don't need to
add this entry, the merger will create an entry for you.

View file

@ -1,38 +0,0 @@
# Tests {#sec-tests}
Home Manager includes a basic test suite and it is highly recommended to
include at least one test when adding a module. Tests are typically in
the form of \"golden tests\" where, for example, a generated
configuration file is compared to a known correct file.
It is relatively easy to create tests by modeling the existing tests,
found in the `tests` project directory. For a full reference to the
functions available in test scripts, you can look at NMT's
[bash-lib](https://git.sr.ht/~rycee/nmt/tree/master/item/bash-lib).
The full Home Manager test suite can be run by executing
``` shell
$ nix-shell --pure tests -A run.all
```
in the project root. List all test cases through
``` shell
$ nix-shell --pure tests -A list
```
and run an individual test, for example `alacritty-empty-settings`,
through
``` shell
$ nix-shell --pure tests -A run.alacritty-empty-settings
```
However, those invocations will impurely source the system's nixpkgs,
and may cause failures. To run against the nixpkgs from the flake.lock,
use instead e.g.
``` shell
$ nix develop --ignore-environment .#all
```

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,47 +0,0 @@
# nix-darwin module {#sec-flakes-nix-darwin-module}
The flake-based setup of the Home Manager nix-darwin module is similar
to that of NixOS. The `flake.nix` would be:
``` nix
{
description = "Darwin configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
darwin.url = "github: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, darwin, ... }: {
darwinConfigurations = {
hostname = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
./configuration.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = 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>`.
You can use the above `flake.nix` as a template in `~/.config/darwin` by
``` shell
$ nix flake new ~/.config/darwin -t github:nix-community/home-manager#nix-darwin
```

View file

@ -1,47 +0,0 @@
# NixOS module {#sec-flakes-nixos-module}
To use Home Manager as a NixOS module, a bare-minimum `flake.nix` would
be as follows:
``` nix
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, ... }: {
nixosConfigurations = {
hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = 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>`.
You can use the above `flake.nix` as a template in `/etc/nixos` by
``` shell
$ nix flake new /etc/nixos -t github:nix-community/home-manager#nixos
```

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,112 +0,0 @@
# Configuration Example {#sec-usage-configuration}
A fresh install of Home Manager will generate a minimal
`~/.config/home-manager/home.nix` file containing something like
``` nix
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "jdoe";
home.homeDirectory = "/home/jdoe";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "24.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:
``` nix
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "jdoe";
home.homeDirectory = "/home/jdoe";
# Packages that should be installed to the user profile.
home.packages = [
pkgs.htop
pkgs.fortune
];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "24.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.emacs = {
enable = true;
extraPackages = epkgs: [
epkgs.nix-mode
epkgs.magit
];
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
}
```
- Nixpkgs packages can be installed to the user profile using
[home.packages](#opt-home.packages).
- The option names of a program module typically start with
`programs.<package name>`.
- Similarly, for a service module, the names start with
`services.<package name>`. Note in some cases a package has both
programs *and* service options -- Emacs is such an example.
To activate this configuration you can run
``` shell
home-manager switch
```
or if you are not feeling so lucky,
``` shell
home-manager build
```
which will create a `result` link to a directory containing an
activation script and the generated home directory files.

View file

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

View file

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

View file

@ -1,32 +0,0 @@
# Rollbacks {#sec-usage-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:
``` shell
$ 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:
``` shell
$ /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation/activate
Starting home manager activation
```

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,112 +0,0 @@
# Release 20.09 {#sec-release-20.09}
The 20.09 release branch became the stable branch in late September,
2020.
## Highlights {#sec-release-20.09-highlights}
This release has the following notable changes:
- Nothing has happened.
## State Version Changes {#sec-release-20.09-state-version-changes}
The state version in this release includes the changes below. These
changes are only active if the `home.stateVersion` option is set to
\"20.09\" or later.
- The options [home.homeDirectory](#opt-home.homeDirectory) and
[home.username](#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 [xdg.cacheHome](#opt-xdg.cacheHome),
[xdg.dataHome](#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
``` 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
[accounts.email.accounts._name_.smtp.tls.enable](#opt-accounts.email.accounts._name_.smtp.tls.enable) and
[accounts.email.accounts._name_.smtp.tls.useStartTls](#opt-accounts.email.accounts._name_.smtp.tls.useStartTls) are
`true`. If only
[accounts.email.accounts._name_.smtp.tls.enable](#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
``` 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:
``` 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
}
}

View file

@ -1,194 +0,0 @@
# Release 21.05 {#sec-release-21.05}
The 21.05 release branch became the stable branch in May, 2021.
## Highlights {#sec-release-21.05-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,
``` nix
programs.broot.verbs = {
"p" = { execution = ":parent"; };
};
```
becomes
``` nix
programs.broot.verbs = [
{
invocation = "p";
execution = ":parent";
}
];
```
- The [programs.mpv.package](#opt-programs.mpv.package) option has been changed to
allow custom derivations. The following configuration is now
possible:
``` 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, [programs.mpv.package](#opt-programs.mpv.package) is no
longer the resulting derivation. Use the newly introduced
`programs.mpv.finalPackage` instead.
- The [programs.rofi.extraConfig](#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,
``` nix
programs.rofi.extraConfig = ''
rofi.show-icons: true
rofi.modi: drun,emoji,ssh
'';
```
becomes
``` nix
programs.rofi.extraConfig = {
show-icons = true;
modi = "drun,emoji,ssh";
};
```
- The [programs.rofi.theme](#opt-programs.rofi.theme) option now supports defining a
theme using an attribute set, the following configuration is now
possible:
``` 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
[services.redshift.settings](#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:
``` 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
[redshift.conf.sample](https://github.com/jonls/redshift/blob/master/redshift.conf.sample)
or
[gammastep.conf.sample](https://gitlab.com/chinstrap/gammastep/-/blob/master/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:
``` 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 [qt.style.name](#opt-qt.style.name) to specify a theme
name and [qt.style.package](#opt-qt.style.package) to specify a theme package. If
you have set [qt.platformTheme](#opt-qt.platformTheme) to `gnome`, a
[qt.style.package](#opt-qt.style.package) compatible with both Qt and Gtk is now
required to be set. For instance:
``` 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:
``` nix
font = {
name = "DejaVu Sans";
size = 8;
};
```
- The [programs.htop.settings](#opt-programs.htop.settings) option is introduced to
replace individual options in `programs.htop`. To migrate, set the
htop options directly in [programs.htop.settings](#opt-programs.htop.settings). For
example:
``` nix
programs.htop = {
enabled = true;
settings = {
color_scheme = 5;
delay = 15;
highlight_base_name = 1;
highlight_megabytes = 1;
highlight_threads = 1;
};
};
```
## State Version Changes {#sec-release-21.05-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`.

View file

@ -1,81 +0,0 @@
# Release 21.11 {#sec-release-21.11}
The 21.11 release branch became the stable branch in November, 2021.
## Highlights {#sec-release-21.11-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
[systemd](https://systemd.io/) 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 [public
documentation](https://nix-community.github.io/home-manager/) 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
[issue #1906](https://github.com/nix-community/home-manager/issues/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
[programs.rofi.theme](#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 [programs.taskwarrior.config](#opt-programs.taskwarrior.config) and friends
now generate the config file at `$XDG_CONFIG_HOME/task/taskrc`
instead of `~/.taskrc`.
## State Version Changes {#sec-release-21.11-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 [home.keyboard](#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 [programs.pet.settings](#opt-programs.pet.settings) option no longer place its
value inside a `General` attribute. For example,
``` nix
programs.pet.settings.editor = "nvim";
```
becomes
``` nix
programs.pet.settings.General.editor = "nvim";
```
- The [programs.waybar.settings](#opt-programs.waybar.settings) option now allows defining
modules directly under [programs.waybar.settings](#opt-programs.waybar.settings). For
example,
``` nix
programs.waybar.settings.modules."custom/my-module" = { };
```
becomes
``` nix
programs.waybar.settings."custom/my-module" = { };
```

View file

@ -1,45 +0,0 @@
# Release 22.05 {#sec-release-22.05}
The 22.05 release branch became the stable branch in May, 2022.
## Highlights {#sec-release-22.05-highlights}
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 [Home Manager Weblate
project](https://hosted.weblate.org/projects/home-manager/).
- A new module, `launchd.agents` was added. Use this to enable
services based on macOS LaunchAgents.
## State Version Changes {#sec-release-22.05-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 [programs.waybar.settings](#opt-programs.waybar.settings) option now allows defining
modules directly under [programs.waybar.settings](#opt-programs.waybar.settings).
Defining modules under `programs.waybar.settings.modules` will now
be an error. For example,
``` nix
programs.waybar.settings.modules."custom/my-module" = { };
```
becomes
``` nix
programs.waybar.settings."custom/my-module" = { };
```

View file

@ -1,113 +0,0 @@
# Release 22.11 {#sec-release-22.11}
The 22.11 release branch became the stable branch in November, 2022.
## Highlights {#sec-release-22.11-highlights}
This release has the following notable changes:
- The [home.stateVersion](#opt-home.stateVersion) option no longer has a default
value. It used to default to "18.09", which was the Home Manager
version that introduced the option. If your configuration does not
explicitly set this option then you need to add
``` nix
home.stateVersion = "18.09";
```
to your configuration.
- The Flake function `homeManagerConfiguration` has been simplified.
Specifically, the arguments
- `configuration`,
- `username`,
- `homeDirectory`,
- `stateVersion`,
- `extraModules`, and
- `system`
have been removed. Instead use the new `modules` argument, which
accepts a list of NixOS modules.
Further, the `pkgs` argument is now mandatory and should be set to
`nixpkgs.legacyPackages.${system}` where `nixpkgs` is the Nixpkgs
input of your choice.
For example, if your Flake currently contains
``` nix
homeManagerConfiguration {
configuration = import ./home.nix;
system = "x86_64-linux";
username = "jdoe";
homeDirectory = "/home/jdoe";
stateVersion = "22.05";
extraModules = [ ./some-extra-module.nix ];
}
```
then you can change it to
``` nix
homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
./home.nix
./some-extra-module.nix
{
home = {
username = "jdoe";
homeDirectory = "/home/jdoe";
stateVersion = "22.05";
};
}
];
}
```
Of course, you can move the assignment of [home.username](#opt-home.username),
[home.stateVersion](#opt-home.stateVersion) to
some other file or simply place them in your `home.nix`.
- The `services.picom` module has been refactored to use structural
settings.
As a result `services.picom.extraOptions` has been removed in favor
of [services.picom.settings](#opt-services.picom.settings). Also, `services.picom.blur*`
were removed since upstream changed the blur settings to be more
flexible. You can migrate the blur settings to use
[services.picom.settings](#opt-services.picom.settings) instead.
- The `services.compton` module has been removed. It was deprecated in
release 20.03. Use `services.picom` instead.
## State Version Changes {#sec-release-22.11-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.11\" or later.
- The [services.mpd.musicDirectory](#opt-services.mpd.musicDirectory) option now defaults to
the value of [xdg.userDirs.music](#opt-xdg.userDirs.music) if
[xdg.userDirs.enable](#opt-xdg.userDirs.enable) is enabled. Otherwise it is
undefined and must be specified in the user configuration.
- The activation script now resets `PATH` before running. Before, the
user's `PATH` environment variable would be used in the script and
this made it possible for commands in the activation script to run
arbitrary commands accessible to the user. We now restrict the
activation script to commands that are explicitly specified.
There is no official way to restore the old behavior. We attempt to
make the activation script as reproducible as possible and honoring
the user's `PATH` reduces reproducibility.
If you need to run a command in an activation script block then
refer to the command by its absolute command path, such as
`${pkgs.hello}/bin/hello`.

View file

@ -1,59 +0,0 @@
# Release 23.05 {#sec-release-23.05}
The 23.05 release branch became the stable branch in May, 2023.
## Highlights {#sec-release-23.05-highlights}
This release has the following notable changes:
- Firefox add-ons are now managed per-profile. That is, if you are
currently having
``` nix
programs.firefox.extensions = [ foo bar ];
```
in your configuration then you must change it to
``` nix
programs.firefox.profiles.myprofile.extensions = [ foo bar ];
```
- The default configuration location has been changed from
`~/.config/nixpkgs/home.nix` to `~/.config/home-manager/home.nix`.
Similarly, if you are using a Nix flake based setup then the default
flake file location has changed from `~/.config/nixpkgs/flake.nix`
to `~/.config/home-manager/flake.nix`.
The old location will continue to work but using it will trigger a
warning message. We changed the default configuration location to
avoid confusion about which files belong to Home Manager and which
belong to Nixpkgs.
- The `home-manager` tool now offers an `init` command. This command
can be used to generate an initial Home Manager configuration, and
optionally also activate it. The recommended installation method for
a standalone Home Manager setup with Nix flakes uses this new
command. The standard installation method remains the same but uses
the new command internally. See [sec-flakes-standalone](#sec-flakes-standalone) for
more.
## State Version Changes {#sec-release-23.05-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
\"23.05\" or later.
- The options
- [xsession.windowManager.i3.config.window.titlebar](#opt-xsession.windowManager.i3.config.window.titlebar)
- [xsession.windowManager.i3.config.floating.titlebar](#opt-xsession.windowManager.i3.config.floating.titlebar)
- [wayland.windowManager.sway.config.window.titlebar](#opt-wayland.windowManager.sway.config.window.titlebar)
- [wayland.windowManager.sway.config.floating.titlebar](#opt-wayland.windowManager.sway.config.floating.titlebar)
now default to `true` which is consistent with the default values
for those options used by `i3` and `sway`.

View file

@ -1,37 +0,0 @@
# Release 23.11 {#sec-release-23.11}
The 23.11 release branch became stable in November, 2023.
## Highlights {#sec-release-23.11-highlights}
This release has the following notable changes:
- When using [programs.fish.enable](#opt-programs.fish.enable), the setup code for
[home.sessionVariables](#opt-home.sessionVariables) is now translated with
[babelfish](https://github.com/bouk/babelfish). This should result
in significantly faster shell startup times but could theoretically
break if you have very complex bash expressions in a session
variable. Please report any issues you experience.
- The `.release` file in the Home Manager source tree has been
supplanted by `release.json`, which contains more information about
the branch. If you have any external code reading this file, please
switch to consuming `release.json` instead. The `.release` file will
be removed in 24.05.
- Home Manager has migrated to using the upstream Nixpkgs
`lib.nixosOptionsDoc` processor for option documentation. If you
have any external Home Manager modules, their option descriptions
and literal examples should be translated to [Nixpkgs-flavoured
Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup).
- The `services.password-store-sync` module has been removed. Use
`services.git-sync` instead.
## State Version Changes {#sec-release-23.11-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
\"23.11\" or later.
- Nothing, yet.

View file

@ -1,91 +0,0 @@
# Release 24.05 {#sec-release-24.05}
The 24.05 release branch became stable in May, 2024.
## Highlights {#sec-release-24.05-highlights}
This release has the following notable changes:
- The `.release` file in the Home Manager project root has been
removed. Please use the `release.json` file instead.
- The {command}`home-manager uninstall` command has been reworked to,
hopefully, be more robust. The new implementation makes use of a new
Boolean configuration option [uninstall](#opt-uninstall) that can
also be used in a pure Nix Flake setup.
Specifically, if you are using a Flake only installation, then you
can clean up a Home Manager installation by adding
``` nix
uninstall = true;
```
to your existing configuration and then build and activate. This
will override any other configuration and cause, for example, the
removal of all managed files.
Please be very careful when enabling this option since activating
the built configuration will not only remove the managed files but
_all_ Home Manager state from your user environment. This includes
removing all your historic Home Manager generations!
- The use of `$DRY_RUN_CMD` and `$DRY_RUN_NULL` in activation script
blocks is now deprecated. Instead use the new shell function
{command}`run`. In most cases it is sufficient to replace
`$DRY_RUN_CMD` by {command}`run`. For example, if your configuration
currently contains
```nix
home.activation.reportChanges = config.lib.dag.entryAnywhere ''
if [[ -v oldGenPath ]]; then
$DRY_RUN_CMD nix store diff-closures $oldGenPath $newGenPath
fi
'';
```
then you are now encouraged to change to
```nix
home.activation.reportChanges = config.lib.dag.entryAnywhere ''
if [[ -v oldGenPath ]]; then
run nix store diff-closures $oldGenPath $newGenPath
fi
'';
```
See the description of [home.activation](#opt-home.activation) for
more. The deprecated variables will continue to work for now but
their use may in the future trigger a warning message and eventually
they may be removed entirely.
- Similarly, the use of `$VERBOSE_ECHO` in activation script blocks is
deprecated. Instead use the new shell function
{command}`verboseEcho`. That is,
```nix
home.activation.doThing = config.lib.dag.entryAnywhere ''
$VERBOSE_ECHO "Doing the thing"
''
```
should now be expressed
```nix
home.activation.doThing = config.lib.dag.entryAnywhere ''
verboseEcho "Doing the thing"
''
```
See the description of [home.activation](#opt-home.activation) for
more. The deprecated variable will continue to work for now but its
use may in the future trigger a warning message and eventually it
may be removed entirely.
## State Version Changes {#sec-release-24.05-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
\"24.05\" or later.
- There was no state version change in this release.

View file

@ -1,18 +0,0 @@
# Release 24.11 {#sec-release-24.11}
This is the current unstable branch and the information in this section
is therefore not final.
## Highlights {#sec-release-24.11-highlights}
This release has the following notable changes:
- No changes.
## State Version Changes {#sec-release-24.11-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
\"24.11\" or later.
- No changes.

File diff suppressed because one or more lines are too long

310
docs/static/style.scss vendored
View file

@ -1,310 +0,0 @@
:root {
--nmd-color0: #0A3E68;
--nmd-color1: #268598;
--nmd-color2: #B8D09E;
--nmd-color3: #F6CF5E;
--nmd-color4: #EC733B;
--nmd-color-info: #167cb9;
--nmd-color-warn: #ff6700;
}
// Copied from Tailwind CSS.
$color-gray-50: #F9FAFB;
$color-gray-100: #F3F4F6;
$color-gray-200: #E5E7EB;
$color-gray-300: #D1D5DB;
$color-gray-400: #9CA3AF;
$color-gray-500: #6B7280;
$color-gray-600: #4B5563;
$color-gray-700: #374151;
$color-gray-800: #1F2937;
$color-gray-900: #111827;
$color-blue-50: #EFF6FF;
$color-blue-100: #DBEAFE;
$color-blue-200: #BFDBFE;
$color-blue-300: #93C5FD;
$color-blue-400: #60A5FA;
$color-blue-500: #3B82F6;
$color-blue-600: #2563EB;
$color-blue-700: #1D4ED8;
$color-blue-800: #1E40AF;
$color-blue-900: #1E3A8A;
@use 'scss-reset/reset';
@mixin boxed {
background: $color-gray-50;
margin: 2rem 16px;
padding: 10px;
border: 1px solid $color-gray-200;
border-radius: 4px;
box-shadow: 4px 4px 8px $color-gray-200;
@media (prefers-color-scheme: dark) {
background: $color-gray-800;
border-color: black;
box-shadow: 4px 4px 8px black;
}
}
@mixin margined {
margin: 0.9rem 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
body {
background: white;
color: $color-gray-900;
max-width: min(100ch, 1024px);
margin: 0 auto;
padding: 10px;
font-family: 'Lucida Sans', Arial, sans-serif;
font-size: 16px;
line-height: 1.4em;
@media (prefers-color-scheme: dark) {
background: $color-gray-900;
color: $color-gray-50;
}
}
h1, h2, h3 {
color: var(--nmd-color0);
font-family: "Lato", sans-serif;
font-weight: 300;
line-height: 1.125;
@media (prefers-color-scheme: dark) {
color: var(--nmd-color4);
}
}
h1 {
font-size: 48px;
font-weight: 300;
margin: 4rem 0 1.5rem;
}
h2 {
font-size: 32px;
font-weight: 300;
margin: 2rem 0 1rem;
}
h3 {
font-size: 20px;
font-weight: 400;
margin: 0.5rem 0.25rem;
}
p {
@include margined;
}
a {
color: var(--nmd-color0); //$color-secondary-1-3;
text-decoration: underline;
text-underline-offset: 3px;
&:visited {
color: var(--nmd-color1);
}
&:hover {
color: var(--nmd-color1);
}
@media (prefers-color-scheme: dark) {
color: var(--nmd-color3);
&:visited {
color: var(--nmd-color2);
}
&:hover {
color: var(--nmd-color4);
}
}
}
code {
font-size: 90%;
}
span.command {
font-size: 90%;
font-family: monospace;
}
em {
font-style: italic;
}
strong {
font-weight: bold;
}
pre {
@include boxed;
font-size: 90%;
margin-bottom: 1.5rem;
padding: 6px;
overflow: auto;
// The callout markers should not be selectable.
span img {
user-select: none;
}
}
pre:has(code) {
padding: 0;
}
td, th {
padding: 2px 5px;
&:first-child {
padding-left: 0;
}
&:last-child {
padding-right: 0;
}
}
dt {
margin: 1.2rem 0 0.8rem;
}
dd {
margin-left: 2rem;
}
div.book {
}
ul {
@include margined;
padding-left: 30px;
list-style: disc;
}
ol {
@include margined;
padding-left: 30px;
list-style: decimal;
}
li {
@include margined;
padding-left: 5px;
}
.navheader, .navfooter {
hr {
margin: 1rem 0;
background: $color-gray-200;
@media (prefers-color-scheme: dark) {
background: $color-gray-600;
}
}
a {
text-decoration: none;
}
}
div.titlepage {
margin: 40px 0;
hr {
display: none;
}
}
div.toc {
@include boxed;
a {
text-decoration: none;
}
}
div.note, div.warning {
@include boxed;
font-style: italic;
h3 {
float: right;
margin: 0 0 1rem 1rem;
width: 42px;
height: 42px;
content: url();
}
h3 + p {
margin-top: 0;
}
}
div.note {
h3 {
background-color: var(--nmd-color-info);
// From https://tabler-icons.io/i/info-square-rounded
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");
}
}
div.warning {
h3 {
background-color: var(--nmd-color-warn);
// From https://tabler-icons.io/i/alert-triangle
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");
}
}
.term {
font-weight: 300;
}
.docbook .xref img[src^=images\/callouts\/],
.screen img,
.programlisting img {
width: 1em;
}
.calloutlist img {
width: 1.3em;
}
/** The console prompt, e.g., `$` and `#` should not be selectable. */
.programlisting.language-shell .hljs-meta.prompt_ {
user-select: none;
}
@import 'tomorrow.min.css';
@media (prefers-color-scheme: dark) {
@import 'tomorrow-night.min.css';
}

View file

@ -1,7 +0,0 @@
/*!
Theme: Tomorrow Night
Author: Chris Kempson (http://chriskempson.com)
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.09.0
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}

View file

@ -1,7 +0,0 @@
/*!
Theme: Tomorrow
Author: Chris Kempson (http://chriskempson.com)
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.09.0
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#4d4d4c;background:#fff}.hljs ::selection,.hljs::selection{background-color:#d6d6d6;color:#4d4d4c}.hljs-comment{color:#8e908c}.hljs-tag{color:#969896}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#4d4d4c}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c82829}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f5871f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#eab700}.hljs-strong{font-weight:700;color:#eab700}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#718c00}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3e999f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4271ae}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#8959a8}.hljs-emphasis{color:#8959a8;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}

View file

@ -1,27 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722185531,
"narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

136
flake.nix
View file

@ -1,136 +0,0 @@
{
description = "Home Manager for Nix";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, ... }:
{
nixosModules = rec {
home-manager = import ./nixos;
default = home-manager;
};
# deprecated in Nix 2.8
nixosModule = self.nixosModules.default;
darwinModules = rec {
home-manager = import ./nix-darwin;
default = home-manager;
};
# unofficial; deprecated in Nix 2.8
darwinModule = self.darwinModules.default;
templates = {
standalone = {
path = ./templates/standalone;
description = "Standalone setup";
};
nixos = {
path = ./templates/nixos;
description = "Home Manager as a NixOS module,";
};
nix-darwin = {
path = ./templates/nix-darwin;
description = "Home Manager as a nix-darwin module,";
};
};
defaultTemplate = self.templates.standalone;
lib = {
hm = (import ./modules/lib/stdlib-extended.nix nixpkgs.lib).hm;
homeManagerConfiguration = { modules ? [ ], pkgs, lib ? pkgs.lib
, extraSpecialArgs ? { }, check ? true
# Deprecated:
, configuration ? null, extraModules ? null, stateVersion ? null
, username ? null, homeDirectory ? null, system ? null }@args:
let
msgForRemovedArg = ''
The 'homeManagerConfiguration' arguments
- 'configuration',
- 'username',
- 'homeDirectory'
- 'stateVersion',
- 'extraModules', and
- 'system'
have been removed. Instead use the arguments 'pkgs' and
'modules'. See the 22.11 release notes for more: https://nix-community.github.io/home-manager/release-notes.xhtml#sec-release-22.11-highlights
'';
throwForRemovedArgs = v:
let
used = builtins.filter (n: (args.${n} or null) != null) [
"configuration"
"username"
"homeDirectory"
"stateVersion"
"extraModules"
"system"
];
msg = msgForRemovedArg + ''
Deprecated args passed: ''
+ builtins.concatStringsSep " " used;
in lib.throwIf (used != [ ]) msg v;
in throwForRemovedArgs (import ./modules {
inherit pkgs lib check extraSpecialArgs;
configuration = { ... }: {
imports = modules ++ [{ programs.home-manager.path = "${./.}"; }];
nixpkgs = {
config = nixpkgs.lib.mkDefault pkgs.config;
inherit (pkgs) overlays;
};
};
});
};
} // (let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
tests = import ./tests { inherit pkgs; };
in tests.run);
formatter = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in pkgs.linkFarm "format" [{
name = "bin/format";
path = ./format;
}]);
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
releaseInfo = nixpkgs.lib.importJSON ./release.json;
docs = import ./docs {
inherit pkgs;
inherit (releaseInfo) release isReleaseBranch;
};
hmPkg = pkgs.callPackage ./home-manager { path = "${./.}"; };
testPackages = let
tests = import ./tests { inherit pkgs; };
renameTestPkg = n: lib.nameValuePair "test-${n}";
in lib.mapAttrs' renameTestPkg tests.build;
integrationTestPackages = let
tests = import ./tests/integration { inherit pkgs; };
renameTestPkg = n: lib.nameValuePair "integration-test-${n}";
in lib.mapAttrs' renameTestPkg tests;
in {
default = hmPkg;
home-manager = hmPkg;
docs-html = docs.manual.html;
docs-json = docs.options.json;
docs-manpages = docs.manPages;
} // testPackages // integrationTestPackages);
defaultPackage = forAllSystems (system: self.packages.${system}.default);
});
}

45
format
View file

@ -1,45 +0,0 @@
#! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6616de389ed55fba6eeba60377fc04732d5a207c.tar.gz -i bash -p git gnugrep gnused findutils nixfmt
nixfmt_args=()
files=()
for arg do
case $arg in
-h)
echo "$0 [-c]"
exit
;;
-c)
nixfmt_args+=("$arg")
;;
-*)
echo "unrecognised flag: $arg" >&2
exit 1
;;
*)
files+=("$arg")
;;
esac
done
# The excludes are for files touched by open pull requests and we want
# to avoid merge conflicts.
excludes=(
modules/files.nix
modules/home-environment.nix
modules/programs/zsh.nix
)
exclude_args=()
for e in "${excludes[@]}"; do
exclude_args+=(-e "$e")
done
git_root=$(git rev-parse --show-toplevel)
git ls-files -z --cached --others --full-name -- "${files[@]}" |
grep -z '\.nix$' |
grep -z -v "${exclude_args[@]}" |
sed -z "s|^|$git_root/|" |
xargs -0 nixfmt "${nixfmt_args[@]}"

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