From 20e693ff6bccc5e905e22604c8a44690899a1336 Mon Sep 17 00:00:00 2001 From: rycee Date: Wed, 31 May 2023 18:22:51 +0000 Subject: [PATCH] deploy: f1490b8caf2ef6f59205c78cf1a8b68e776214a3 --- index.html | 85 ++++++++-------------------------------------- options.html | 2 +- release-notes.html | 45 +++++++++++++----------- 3 files changed, 40 insertions(+), 92 deletions(-) diff --git a/index.html b/index.html index 449110bb..f3efbc9e 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ -Home Manager Manual

Home Manager Manual


Preface
1. Installing Home Manager
1.1. Standalone installation
1.2. NixOS module
1.3. nix-darwin module
2. Using Home Manager
2.1. Configuration Example
2.2. Rollbacks
2.3. Keeping your ~ safe from harm
2.4. Graphical services
2.5. Updating
3. Nix Flakes
3.1. Prerequisites
3.2. Standalone setup
3.2.1. Unstable Version
3.2.2. Version 22.11
3.3. NixOS module
3.4. nix-darwin module
4. Writing Home Manager Modules
4.1. Option Types
5. Contributing
5.1. Getting started
5.2. Guidelines
5.2.1. Maintain backward compatibility
5.2.2. Keep forward compatibility in mind
5.2.3. Add only valuable options
5.2.4. Add relevant tests
5.2.5. Add relevant documentation
5.2.6. Add yourself as a module maintainer
5.2.7. Format your code
5.2.8. Format your commit messages
5.2.9. Format your news entries
5.2.10. Use conditional modules and news
5.2.11. Mind the license
5.3. Commits
5.4. Code Style
5.5. News
5.6. Tests
6. Third-Party Tools and Extensions
6.1. Module Collections
7. Frequently Asked Questions (FAQ)
7.1. Why is there a collision error when switching generation?
7.2. Why are the session variables not set?
7.3. How to set up a configuration for multiple users/machines?
7.4. Why do I get an error message about ca.desrt.dconf or dconf.service?
7.5. How do I install packages from Nixpkgs unstable?
7.6. How do I override the package used by a module?
A. Configuration Options
B. NixOS Module Options
C. nix-darwin Module Options
D. Tools
home-manager - — reconfigure a user environment
E. Release Notes
E.1. Release 23.05
E.1.1. Highlights
E.1.2. State Version Changes
E.2. Release 22.11
E.2.1. Highlights
E.2.2. State Version Changes
E.3. Release 22.05
E.3.1. Highlights
E.3.2. State Version Changes
E.4. Release 21.11
E.4.1. Highlights
E.4.2. State Version Changes
E.5. Release 21.05
E.5.1. Highlights
E.5.2. State Version Changes
E.6. Release 20.09
E.6.1. Highlights
E.6.2. State Version Changes
E.7. Release 20.03
E.7.1. Highlights
E.7.2. State Version Changes
E.8. Release 19.09
E.8.1. Highlights
E.8.2. State Version Changes
E.9. Release 19.03
E.9.1. Highlights
E.9.2. State Version Changes
E.10. Release 18.09

Preface

+Home Manager Manual

Home Manager Manual


Preface
1. Installing Home Manager
1.1. Standalone installation
1.2. NixOS module
1.3. nix-darwin module
2. Using Home Manager
2.1. Configuration Example
2.2. Rollbacks
2.3. Keeping your ~ safe from harm
2.4. Graphical services
2.5. Updating
3. Nix Flakes
3.1. Prerequisites
3.2. Standalone setup
3.3. NixOS module
3.4. nix-darwin module
4. Writing Home Manager Modules
4.1. Option Types
5. Contributing
5.1. Getting started
5.2. Guidelines
5.2.1. Maintain backward compatibility
5.2.2. Keep forward compatibility in mind
5.2.3. Add only valuable options
5.2.4. Add relevant tests
5.2.5. Add relevant documentation
5.2.6. Add yourself as a module maintainer
5.2.7. Format your code
5.2.8. Format your commit messages
5.2.9. Format your news entries
5.2.10. Use conditional modules and news
5.2.11. Mind the license
5.3. Commits
5.4. Code Style
5.5. News
5.6. Tests
6. Third-Party Tools and Extensions
6.1. Module Collections
7. Frequently Asked Questions (FAQ)
7.1. Why is there a collision error when switching generation?
7.2. Why are the session variables not set?
7.3. How to set up a configuration for multiple users/machines?
7.4. Why do I get an error message about ca.desrt.dconf or dconf.service?
7.5. How do I install packages from Nixpkgs unstable?
7.6. How do I override the package used by a module?
A. Configuration Options
B. NixOS Module Options
C. nix-darwin Module Options
D. Tools
home-manager + — reconfigure a user environment
E. Release Notes
E.1. Release 23.11
E.1.1. Highlights
E.1.2. State Version Changes
E.2. Release 23.05
E.2.1. Highlights
E.2.2. State Version Changes
E.3. Release 22.11
E.3.1. Highlights
E.3.2. State Version Changes
E.4. Release 22.05
E.4.1. Highlights
E.4.2. State Version Changes
E.5. Release 21.11
E.5.1. Highlights
E.5.2. State Version Changes
E.6. Release 21.05
E.6.1. Highlights
E.6.2. State Version Changes
E.7. Release 20.09
E.7.1. Highlights
E.7.2. State Version Changes
E.8. Release 20.03
E.8.1. Highlights
E.8.2. State Version Changes
E.9. Release 19.09
E.9.1. Highlights
E.9.2. State Version Changes
E.10. Release 19.03
E.10.1. Highlights
E.10.2. State Version Changes
E.11. Release 18.09

Preface

This manual will eventually describe how to install, use, and extend Home Manager.

@@ -49,7 +49,7 @@ option. On NixOS you can control this option using the Add the appropriate Home Manager channel. If you are following Nixpkgs master or an unstable channel you can run

$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
-$ nix-channel --update

and if you follow a Nixpkgs version 22.11 channel you can run

$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
+$ nix-channel --update

and if you follow a Nixpkgs version 23.05 channel you can run

$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager
 $ nix-channel --update
  • Run the Home Manager installation command and create the first Home Manager generation: @@ -72,7 +72,7 @@ deployed through NixOps.

    To make the NixOS module available for use you mu 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

    $ 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 22.11 channel, you can run

    $ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
    +$ sudo nix-channel --update

    and if you follow a Nixpkgs version 23.05 channel, you can run

    $ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager
     $ sudo nix-channel --update

    It is then possible to add

    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

    users.users.eve.isNormalUser = true;
    @@ -102,7 +102,7 @@ tool.

    To make the NixOS module available for use you must $ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager -$ nix-channel --update

    and if you follow a Nixpkgs version 22.11 channel, you can run

    $ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
    +$ nix-channel --update

    and if you follow a Nixpkgs version 23.05 channel, you can run

    $ nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager
     $ nix-channel --update

    It is then possible to add

    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

    users.users.eve = {
    @@ -151,7 +151,7 @@ error: A definition for option `programs.emacs.enable' is not of type `boolean'.
       # You can update Home Manager without changing this value. See
       # the Home Manager release notes for a list of state version
       # changes in each release.
    -  home.stateVersion = "22.11";
    +  home.stateVersion = "23.05";
     
       # Let Home Manager install and manage itself.
       programs.home-manager.enable = true;
    @@ -177,7 +177,7 @@ error: A definition for option `programs.emacs.enable' is not of type `boolean'.
       # You can update Home Manager without changing this value. See
       # the Home Manager release notes for a list of state version
       # changes in each release.
    -  home.stateVersion = "22.11";
    +  home.stateVersion = "23.05";
     
       # Let Home Manager install and manage itself.
       programs.home-manager.enable = true;
    @@ -289,19 +289,15 @@ Prepare your Home Manager configuration (home.nix).
     home.nix will be evaluated when the flake is built,
     so it must be present before bootstrap of Home Manager from the flake.
     See Section 2.1, “Configuration Example” for introduction about
    -writing a Home Manager configuration.

  • 3.2. Standalone setup

    The installation procedure for the standalone version of Home Manager -is currently different for the unstable and stable branch. -Therefore, if you are tracking the Nixpkgs or NixOS unstable please go to -Section 3.2.1, “Unstable Version”, -and if you track Nixpkgs or NixOS version 22.11 please go to -Section 3.2.2, “Version 22.11”.

    3.2.1. Unstable Version

    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, to generate and activate a basic configuration run the command

    $ nix run home-manager/master -- init --switch

    This will generate a flake.nix and a home.nix file in +writing a Home Manager configuration.

    3.2. Standalone setup

    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

    $ nix run home-manager/master -- init --switch

    For Nixpkgs or NixOS version 23.05 run

    $ nix run home-manager/release-23.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.

    $ nix run home-manager/master -- init
    +This is useful if you want to inspect and edit the configuration before activating it.

    $ nix run home-manager/$branch -- init
     $ # Edit files in ~/.config/home-manager
    -$ nix run home-manager/master -- init --switch

    After the initial activation has completed successfully then building +$ nix run home-manager/$branch -- init --switch

    Where $branch is one of master or release-23.05.

    After the initial activation has completed successfully then building and activating your flake-based configuration is as simple as

    $ home-manager switch

    It is possible to override the default configuration directory, if you want. -For example,

    $ nix run home-manager/master -- init --switch ~/hmconf
    +For example,

    $ 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, @@ -309,60 +305,7 @@ then the command nix flake lock --update-input <inp 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 for details.

    3.2.2. Version 22.11

    1. -Set up a flake with a flake.nix as follows: -

      {
      -  description = "Home Manager configuration of Jane Doe";
      -
      -  inputs = {
      -    # Specify the source of Home Manager and Nixpkgs.
      -    nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
      -    home-manager = {
      -      url = "github:nix-community/home-manager/release-22.11";
      -      inputs.nixpkgs.follows = "nixpkgs";
      -    };
      -  };
      -
      -  outputs = { nixpkgs, home-manager, ... }:
      -    let
      -      system = "x86_64-linux";
      -      pkgs = nixpkgs.legacyPackages.${system};
      -    in {
      -      homeConfigurations.jdoe = home-manager.lib.homeManagerConfiguration {
      -        inherit pkgs;
      -
      -        # Specify your home configuration modules here, for example,
      -        # the path to your home.nix.
      -        modules = [
      -          ./home.nix
      -        ];
      -
      -        # Optionally use extraSpecialArgs
      -        # to pass through arguments to home.nix
      -      };
      -    };
      -}

      Note

      • -The Home Manager library is exported by the flake under lib.hm. -
      • -You can use the above flake.nix as a template in ~/.config/home-manager by -

        $ nix flake new ~/.config/home-manager -t github:nix-community/home-manager
    2. -Install Home Manager and apply the configuration by -

      $ nix run <flake-uri>#homeConfigurations.jdoe.activationPackage

      Substitute <flake-uri> with the flake URI of the configuration flake. -If flake.nix resides in ~/.config/home-manager, -<flake-uri> may be ~/.config/home-manager -as a Git tree or path:~/.config/home-manager if not.

    3. -Since the release 21.05, -building a flake-based configuration is as simple as -

      $ home-manager switch --flake '<flake-uri>#jdoe'

      once home-manager is installed.

      Here, jdoe is a configuration specified in the flake file, -and <flake-uri>#jdoe will be expanded to -<flake-uri>#homeConfigurations.jdoe.activationPackage -and be built by Nix.

    Note

    The flake inputs are not upgraded automatically when switching. -The analogy to the command home-manager --update ... is nix flake update.

    If updating more than one input is undesirable, -the command nix flake lock --update-input <input-name> can be used.

    You can also pass flake-related options -such as --recreate-lock-file or --update-input [input] -to home-manager when building/switching, -and these options will be forwarded to nix build. -See the NixOS Wiki page for detail.

    3.3. NixOS module

    To use Home Manager as a NixOS module, +See the NixOS Wiki page for details.

    3.3. NixOS module

    To use Home Manager as a NixOS module, a bare-minimum flake.nix would be as follows:

    {
       description = "NixOS configuration";
     
    diff --git a/options.html b/options.html
    index 98b2d1bf..ceb12f94 100644
    --- a/options.html
    +++ b/options.html
    @@ -989,7 +989,7 @@ The state version indicates which default
     settings are in effect and will therefore help avoid breaking
     program configurations. Switching to a higher state version
     typically requires performing some manual steps, such as data
    -conversion or moving files.

    Type: one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11", "22.05", "22.11", "23.05"

    Declared by:

    +conversion or moving files.

    Type: one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11", "22.05", "22.11", "23.05", "23.11"

    Declared by:

    <home-manager/modules/misc/version.nix>
    home.username

    The user's username.

    Type: string

    Default:

    "$USER"   for state version < 20.09,
     undefined for state version ≥ 20.09
    diff --git a/release-notes.html b/release-notes.html
    index a9d467e3..ddf5304e 100644
    --- a/release-notes.html
    +++ b/release-notes.html
    @@ -1,5 +1,10 @@
     
    -Appendix E. Release Notes

    Appendix E. Release Notes

    This section lists the release notes for stable versions of Home Manager and the current unstable version.

    E.1. Release 23.05

    This is the current unstable branch and the information in this section is therefore not final.

    E.1.1. Highlights

    This release has the following notable changes:

    E.2.2. 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.

    E.2. Release 22.11

    This is the current unstable branch and the information in this section is therefore not final.

    E.2.1. Highlights

    This release has the following notable changes:

    • +those options used by i3 and sway.

    E.3. Release 22.11

    The 22.11 release branch became the stable branch in November, 2022.

    E.3.1. Highlights

    This release has the following notable changes:

    • The 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 @@ -84,7 +89,7 @@ You can migrate the blur settings to use services.picom.settings instead.

    • The services.compton module has been removed. It was deprecated in release 20.03. Use services.picom instead. -

    E.2.2. State Version Changes

    The state version in this release includes the changes below. +

    E.3.2. 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 option now defaults to the value of xdg.userDirs.music if xdg.userDirs.enable is @@ -100,7 +105,7 @@ activation script to commands that are explicitly specified. 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.

    E.3. Release 22.05

    The 22.05 release branch became the stable branch in May, 2022.

    E.3.1. Highlights

    This release has the following notable changes:

    • +${pkgs.hello}/bin/hello.

    E.4. Release 22.05

    The 22.05 release branch became the stable branch in May, 2022.

    E.4.1. 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.
    • @@ -112,12 +117,12 @@ such as the home-manager command line tool and the then you can do so through the Home Manager Weblate project.

    • A new module, launchd.agents was added. Use this to enable services based on macOS LaunchAgents. -

    E.3.2. State Version Changes

    The state version in this release includes the changes below. +

    E.4.2. 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 option now allows defining modules directly under programs.waybar.settings. Defining modules under programs.waybar.settings.modules will now be an error. For example, -

      programs.waybar.settings.modules."custom/my-module" = { };

      becomes

      programs.waybar.settings."custom/my-module" = { };

    E.4. Release 21.11

    The 21.11 release branch became the stable branch in November, 2021.

    E.4.1. Highlights

    This release has the following notable changes:

    • +

      programs.waybar.settings.modules."custom/my-module" = { };

      becomes

      programs.waybar.settings."custom/my-module" = { };

    E.5. Release 21.11

    The 21.11 release branch became the stable branch in November, 2021.

    E.5.1. 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. @@ -141,7 +146,7 @@ Rofi version 1.7.0 removed many options that were used by the module and replace Taskwarrior version 2.6.0 respects XDG Specification for the config file now. Option programs.taskwarrior.config and friends now generate the config file at $XDG_CONFIG_HOME/task/taskrc instead of ~/.taskrc. -

    E.4.2. State Version Changes

    The state version in this release includes the changes below. These +

    E.5.2. 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 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. @@ -151,7 +156,7 @@ For example,

      programs.pet.settings.editor = "nvim";

      becomes

      programs.pet.settings.General.editor = "nvim";
    • The programs.waybar.settings option now allows defining modules directly under programs.waybar.settings. For example, -

      programs.waybar.settings.modules."custom/my-module" = { };

      becomes

      programs.waybar.settings."custom/my-module" = { };

    E.5. Release 21.05

    The 21.05 release branch became the stable branch in May, 2021.

    E.5.1. Highlights

    This release has the following notable changes:

    • +

      programs.waybar.settings.modules."custom/my-module" = { };

      becomes

      programs.waybar.settings."custom/my-module" = { };

    E.6. Release 21.05

    The 21.05 release branch became the stable branch in May, 2021.

    E.6.1. 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, @@ -268,14 +273,14 @@ options in programs.htop. To migrate, set the htop highlight_megabytes = 1; highlight_threads = 1; }; -};

    E.5.2. State Version Changes

    The state version in this release includes the changes below. These +};

    E.6.2. 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. -

    E.6. Release 20.09

    The 20.09 release branch became the stable branch in late September, 2020.

    E.6.1. Highlights

    This release has the following notable changes:

    • +

    E.7. Release 20.09

    The 20.09 release branch became the stable branch in late September, 2020.

    E.7.1. Highlights

    This release has the following notable changes:

    • Nothing has happened. -

    E.6.2. State Version Changes

    The state version in this release includes the changes below. These +

    E.7.2. 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 and home.username no @@ -324,7 +329,7 @@ The options wayland.windowManager.sway.config.bars binding_mode #2f343a #900000 #ffffff } -}

    E.7. Release 20.03

    The 20.03 release branch became the stable branch in April, 2020.

    E.7.1. Highlights

    This release has the following notable changes:

    • +}

    E.8. Release 20.03

    The 20.03 release branch became the stable branch in April, 2020.

    E.8.1. Highlights

    This release has the following notable changes:

    • Assigning a list to the home.file, xdg.configFile, and xdg.dataFile options is now deprecated and will produce a warning message if used. Specifically, if your configuration currently @@ -380,7 +385,7 @@ configuration user = "jd"; } };

      Support for the list form will be removed in Home Manager version -20.09.

    E.7.2. State Version Changes

    The state version in this release includes the changes below. These +20.09.

    E.8.2. 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.

    E.8. Release 19.09

    The 19.09 release branch became the stable branch in October, 2019.

    E.8.1. Highlights

    This release has the following notable changes:

    • +

    E.9. Release 19.09

    The 19.09 release branch became the stable branch in October, 2019.

    E.9.1. 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. @@ -400,7 +405,7 @@ The programs.firefox.enableGoogleTalk and 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. -

    E.8.2. State Version Changes

    The state version in this release includes the changes below. These +

    E.9.2. 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.

    E.9. Release 19.03

    The 19.03 release branch became the stable branch in April, 2019.

    E.9.1. Highlights

    This release has the following notable changes:

    • +

    E.10. Release 19.03

    The 19.03 release branch became the stable branch in April, 2019.

    E.10.1. Highlights

    This release has the following notable changes:

    • The 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 @@ -426,10 +431,10 @@ encounter errors. “defined multiple times” then you need to use the mkForce function. For example,

      systemd.user.services.foo.Service.ExecStart = "/foo/bar";

      becomes

      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.

    E.9.2. State Version Changes

    The state version in this release includes the changes below. These +many confusing situations for people.

    E.10.2. 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.03” or later.

    E.10. Release 18.09

    The 18.09 release branch became the stable branch in September, 2018.

    \ No newline at end of file +

    E.11. Release 18.09

    The 18.09 release branch became the stable branch in September, 2018.

    \ No newline at end of file