`hostname -f` could fail depending on the resolver. Discard any stderr
and test for the exit status before using the value for flake attribute
lookup.
I was unable to repro the exact bad exit status in #5665.
With
- nscd disabled,
- nsswitch.conf pointing to 'files',
- hostname entry removed from /etc/hosts
`hostname -f` from inetutils-2.5 fell back to showing just the nodename
from `uname(2)`. Injecting an empty string into the
`(struct utsname).nodename` field of `uname(2)` using strace still
exited with empty output and 0 exit-status.
Fixes#5665
Adds support for Firefox forks by introducing methods that create
generic configs and options. Additional configs and options can be
added in separate modules.
The `pkgs.gnome.gnome-terminal` package was moved to
`pkgs.gnome-terminal`. The former is now a deprecated alias that
throws a warning whenever a configuration enabling the module is used:
```
The ‘gnome.gnome-terminal’ was moved to top-level. Please use
‘pkgs.gnome-terminal’ directly.
```
Related: https://github.com/NixOS/nixpkgs/pull/319659
Related: https://github.com/nix-community/home-manager/pull/5611
Should fix an issue where swayosd.service would stop without starting
again after restarting too quickly.
Triggered by ending a Hyprland session and logging in with tuigreet.
Related: https://github.com/nix-community/home-manager/pull/4316
Add an extra option,
accounts.contact.accounts.<name>.khard.defaultCollection
to hardcode a subdirectory for khard to function as intended. Khard
expects to be given a collection directory directly, from which there
can be multiple of in a vdir. This contrasts khal or vdirsyncer which
support recursive search.
Fixes#4531
Previously, type check of `programs.starship.settings` fails for some
valid settings, such as `c.commands = [["cc" "--version"]]`.
The commit fix the `type` argument passed to `mkOption`, so
`programs.starship.settings` can accept all valid values (of toml
type).
Sometimes services can fail. Failed services will generally not be
restarted by systemd. To start previously failed services we can
just reset their failed state before starting our session target.
GNOME and Plasma do the same thing.
See: https://github.com/alebastr/sway-systemd/pull/11
"lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct."
Rename happened in nixpkgs commit `228621e42dc43f936b66e0ed042c90c511aa0535`.
rbw expects a protocol for its base_url setting[1]. Otherwise fails
with `rbw unlock: failed to parse base url: relative URL without a
base`.
[1] 741a72cf0d/README.md (configuration)
If the user has template services in their systemd configuration, these
can't be restarted, and will produces warnings during the activation
phase. Avoid those warnings by skipping any uninstantiated templates
when looking for services to start or stop.
After update to sd-switch 0.5.0, `home-manager switch` failed with the
following error message:
> Error: Error switching
>
> Caused by:
> 0: Failed to build switch plan
> 1: No such file or directory (os error 2)
This was caused by a non-existing target unit directory due to no user
services being managed by home-manager. This change makes sd-switch
run with pkgs.emptyDirectory as the target in such cases.
Closes: https://github.com/nix-community/home-manager/issues/5552
The program shell wrappers have been renamed from `ya` to `yy`
following the introduction of the new CLI tool named `ya`.
With this in mind, the `shellWrapperName` option has been introduced
to provide users with more flexibility in choosing the name they're
most accustomed to (ra, lf, ...).
Co-authored-by: XYenon <register@xyenon.bid>
Co-authored-by: 三咲雅 · Misaki Masa <sxyazi@gmail.com>
- Always append suffix `.yazi` to plugin's and flavor's attribute names.
- Warn if the attribute names already have the suffix.
- Assert that plugin's and flavor's values point to directories
containing an `init.lua` file.
- Append suffix `.yazi` to symlink targets of yazi plugins, if needed
- Improve some docs, especially links to upstream docs.
- Update tests to make use of this feature.
Currently translated at 5.4% (2 of 37 strings)
Add translation using Weblate (Hungarian)
Co-authored-by: Balint Barna Kovari <balint+weblate@kovari.cc>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hu/
Translation: Home Manager/Home Manager CLI
* nix: add options 'nixPath' and 'keepOldNixPath'
By default, the system value for $NIX_PATH is kept as a fallback.
To completely override the system value for $NIX_PATH:
nix.keepOldNixPath = false;
* nix: add more tests
* nix: add a declarative alternative to Nix channels
This adds a new option, 'nix.channels'. It's the Nix channels equivalent
of the 'nix.registry' option, and compatible with pre-Flake Nix tooling
including nix-env and nix-shell. Like 'nix.registry', this option is
useful for pinning Nix channels.
Channels defined in the new option can coexist with channels introduced
through the nix-channel command. If the same channel exists in both, the
one from Home Manager will be prioritized.
* nix: add news entry
* nix: make channels respect use-xdg-base-directories
* nix: remove 'with lib;'
---------
Co-authored-by: Michael Hoang <enzime@users.noreply.github.com>
Some prefer to handle modules-* imperatively for more flexibility, e.g.,
via waybar "includes" (https://github.com/Alexays/Waybar/wiki/Configuration).
Current HM defaults modules-* to `[]` instead of null for most other
settings, so they get written to ~/.config/waybar/config even though
no explicit configuration has been made.
And they take precedence over the imperative ones because of how
waybar's includes work:
====
Paths to additional configuration files.
Each file can contain a single object with any of the bar configuration options. In case of duplicate options, the first defined value takes precedence, i.e. including file -> first included file -> etc. Nested includes are permitted, but make sure to avoid circular imports.
For a multi-bar config, the include directive affects only current bar configuration object.
====
After migrating to nixos-render-docs, the extension move to .xtml.
Unfortunately, this broke links to the previous Options Page.
This patch provides a basic redirect support to the new Options Page.
To avoid this kind of message:
swayidle[181123]: - [Line 1054] Unable to connect to the compositor. If your compositor is running, check or set the WAYLAND_DISPLAY environment variable.
MacOS doesn't support the long-style `--fqdn` option to `hostname` that
was added by 1b589257f7.
Switch to short style `-f` that should be supported on every platform.
The 24.05 update for KDE Connect moved the kdeconnectd binary from
`/libexec` to `/bin`, so this fix will check the version of the
package used and set the path accordingly.
Since nixpkgs commit 993baa587c4b82e791686f6ce711bcd4ee8ef933,
`networking.hostName` is not allowed to be a FQDN.
Add `hostname --fqdn` to the default flake attribute names that are
searched.
If
netorking.hostname = "hostname";
networking.domain = "example.com";
is set in the system NixOS configuration, this allows defining
homeConfigurations."username@hostname.example.com" = ...
and still use
home-manager switch --flake .
instead of having to type out
home-manager switch --flake .#$(whoami)@$(hostname --fqdn)
`splitString "" "some string"` would throw exception `error: invalid
regular expression` on Darwin (or accurately, on Nix built against
libc++). Refer to https://github.com/NixOS/nix/issues/7208 for
details.
Before Nix handles that issue correctly, we should refrain from using
`splitString ""`, and luckliy `lib.stringAsChars` can do the same thing.
Currently translated at 100.0% (37 of 37 strings)
Co-authored-by: TANIGUCHI Kohei <a.d.xvii.kal.mai@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/
Translation: Home Manager/Home Manager CLI
Currently translated at 94.5% (35 of 37 strings)
Co-authored-by: Narazaki Shuji <shujinarazaki@protonmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/
Translation: Home Manager/Home Manager CLI
Using the option
wayland.windowManager.hyprland.systemd.enableXdgAutostart
users can now choose to start applications present in
`$XDG_CONFIG_HOME/autostart` when starting their sway session.
See 0144ac418e and
https://github.com/nix-community/home-manager/pull/3747
We currently have no way of specifying the sender's name inside the
From field, making a patch sent through `git send-email` appear as
coming from "xxx@domain.com".
In this commit we make this field follow the standard
realName <email>
format.
In the generated neomutt configuration, source the optional
`vim-keys.rc` before applying the `binds` configuration, to allow the
user to override keybindings from `vim-keys.rc`.
Adapt the test files to account for the empty space left by the unset
`vimKeys` option.
Currently translated at 100.0% (37 of 37 strings)
Co-authored-by: Michael Thomas <michaelhthomas@outlook.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fr/
Translation: Home Manager/Home Manager CLI
This enables a module system feature documented here:
https://nixos.org/manual/nixpkgs/stable/index.html#module-system-lib-evalModules-param-class
For example, it allows a mistake to be caught, which is loading a
NixOS module into home-manager. This only works when the offending
module declares what it's for with a `_class` attribute.
It is not expected that users declare the `_type`, because the payoff
is small. It is only expected to be set by generic code, such as
functions or libraries that help with the "publishing" of modules
(e.g. flake-parts, flake-utils).
The class feature has been available in the module system since
https://github.com/NixOS/nixpkgs/pull/197547, merged May 6, 2023. It
has been part of all releases since 23.05-beta. The last NixOS release
that did _not_ support it has been end-of-life for close to a year
now.
Example:
(lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [{ _class = "nixos"; imports = [ ./foo.nix ]; }];
}).activation-script
Corresponding error:
error: The module <unknown-file> was imported into homeManager instead of nixos.
(`<unknown-file>` can be improved by also setting `_file`, if known; a
much older feature)
PR #5339
Specifically, avoid duplicate remove duplicate slashes in the
`news-read-ids` file path.
Also quote the use of `newsReadIdsFile` to reduce problems with
potential spaces.
Currently translated at 13.5% (5 of 37 strings)
Add translation using Weblate (Icelandic)
Co-authored-by: Bjarki Gunnarsson <bjarkihg@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/is/
Translation: Home Manager/Home Manager CLI
To configure zsh's autosuggest "highlight style" we use ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE but it's currently set to AUTOSUGGESTION_HIGHLIGHT_COLOR (via autosuggestion.highlight). This change was apparently made back in 2016 or earlier.
This PR fixes two issues that cause rebuild to fail, see #5222.
The first was caused when sync.target and sync.interval were not set,
this was fixed by changing the default values from null to "undefined"
and filtering these out later.
The second error occurred when the .config/joplin-desktop directory
didn't exist (e.g. when installing Joplin for the first time) which
caused the touch command to fail. This was fixed using mkdir to ensure
that .config/joplin-desktop exists.
The PR #5299[0] actually adds the requirement on "tray.target" for the
kdeconnect service, when kdeconnect-indicator is set to true. What it
should do is add the requirement directly to the latter. This commit
fixes it.
[0]: https://github.com/nix-community/home-manager/pull/5299#issue-2252834123
Helps avoid successful build but Sway failing to start.
To meaningfully test this, I had to actually use `pkgs.sway` in the
test rather than the stub, but left all other tests using the stub and
changed them to skipping the test.
We need to pass `--unsupported-gpu` as Sway checks for `nvidia` in
`/proc/modules`, and the Nix sandbox has `/proc/modules` available.
Adds a module to enable managing Remmina, an RDP client, with a Home
Manager module, providing a systemd service and mimetype integration
that can be disabled if so desired.
The `postHook` option was being processed and reset to a string, even if
the user set it to null, causing issues under certain conditions (see
Using `if-then-else` instead of `optionalString` keeps the option as
null, instead of setting it to an empty string.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
Instead of an error
line 958: $1: unbound variable
we now emit an error such as
missing argument for --cores
Note, this is not perfect. In many cases you still get sub-optimal
error messages.
Support alternate configuration files for k9s in darwin where XDG is
not mandated and k9s expects configuration files in
`~/Library/Application Support/k9s/`.
* neovim: add extraWrapperArgs option
pass external arguments to neovim-unwrapper
this gives users more flexibility in managing neovim configuration
* neovim: add test for `extraWrapperArgs`
Firefox, upon exit, creates the default containers.json file in place of
the one that home-manager created. This leads to errors when switching
to a new profile, as home-manager is careful with overwriting existing
files. The added option toggles that behaviour.
Closes: https://github.com/nix-community/home-manager/issues/4989
Currently translated at 100.0% (36 of 36 strings)
Co-authored-by: Petr Portnov | PROgrm_JARvis <mrJARVIScraft@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ru/
Translation: Home Manager/Home Manager CLI
The `home-manager` package was being passed a `path` string pointing a
store path while the string didn't have context. As a result the
`home-manager` derivation was created without this path as an input
source allowing it to be garbage collected even though it it being
used by the `home-manager` script. This in turn caused certain
warnings and errors to occur.
The current module constrains to values in enum but khal supports RGB
colors as well
khal.readthedocs.io/en/latest/configure.html#the-calendars-section !
(be careful when setting an RGB value, it has to be quoted else it is ignored, got bitten by it with a manual config )
NB: It's also not possible to set addresses khal.readthedocs.io/en/latest/configure.html#the-calendars-section
Currently translated at 5.5% (1 of 18 strings)
Translate using Weblate (Vietnamese)
Currently translated at 33.3% (12 of 36 strings)
Translate using Weblate (Vietnamese)
Currently translated at 11.1% (4 of 36 strings)
Co-authored-by: Nguyen Khanh <nguynkhan479@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/vi/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
Nixpkgs has recently made a few major changes to its
xdg-desktop-portal package, which silently breaks our module here:
- The NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR variable patch has been
removed (in favor of putting portal configurations in /etc or
XDG_CONFIG_HOME).
- A new variable, NIX_XDG_DESKTOP_PORTAL_DIR, was introduced in a
patch to avoid setting XDG_DESKTOP_PORTAL_DIR (which also affected
portal configuration reading, not only portal definitions)
I updated our module to match the changes, but this breakage also made
me revisit this module and look into some improvements.
Long story short, I think it's worth it to make it more similar to the
NixOS one, as it will make behavior more predictable and consistent.
The main change is relying on the upstream linked systemd
unit (instead of using systemd.user.services), and setting the
environment variables globally instead of scoping it to the unit, as
it's a very global thing anyway.
The systemd.time documentation defines the shorthands `daily` and
`minutely` which are currently not included in the nix-gc module.
This commit adds the `daily` option, but omits `minutely` since it's not
a timescale that would make sense to run a gc for.
https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html
The documentation for the option says...
> If you want a default binding to be passed through to the website,
> bind it to null.
but if you actually try to set a key to `null`, it causes an error.
> A definition for option
> `programs.qutebrowser.keyBindings."<Ctrl+Shift+Tab>".normal' is not
> of type `strings concatenated with " ;; "'.
So this commit implements unbinding as it is documented.
The beets package no longer has the "enableCheck" option so this was
confusing. Also the word override was used to mean two different
things so I modified the FAQ to use the word "change" and linked to
documentation regarding package overrides.
Currently translated at 8.3% (3 of 36 strings)
Co-authored-by: RepentantKnight121 <repentantknight121@outlook.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/
Translation: Home Manager/Home Manager CLI
Using `mkDefault` for the individual aliases makes it easier to
override or replace individual entries by the user, without having to
use `mkForce` which is often confusing for new users.
Adding unmailboxes option to neomutt, which adds the `unmailboxes`
option it to every account.email with neomutt enabled.
See https://www.mutt.org/doc/manual/#mailboxes for more.
Fixes warnings about the non-existent `~/.nix-defexpr` folder when
using `use-xdg-base-directories = true`.
Example:
warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
replacing old 'home-manager-path'
installing 'home-manager-path'
Activating dconfSettings
Activating linkDesktopApplications
Activating linkGeneration
Cleaning up orphan links from /home/user
No change so reusing latest profile generation 13
Creating home file links in /home/user
Activating onFilesChange
Activating reloadSystemd
warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring
Borgmatic has support for Borg's pattern matching. It is mutually
exclusive with the existing `sourceDirectories` option, so assertions
have been added to make sure that both are not set at the same
time (but also that at least one of them is). Additionally, tests have
been added to test the following configurations: `patterns` instead of
`sourceDirectories`, both at the same time, and neither.
In Nix 2.3, all GC roots must be stored under `/nix/var/nix/gcroots`,
unless `--indirect` is specified. In Nix 2.4 and above, this flag is
ignored, because all GC roots created by `--add-root` are indirect.
Change-Id: I3eb3d7bc774af2ff336a2cdf312d30a99cdcb928
In most cases where this function is used, suppressing only the standard
output is more appropriate. Culling diagnostic output hides error
messages and makes debugging more difficult and confusing.
`$DRY_RUN_NULL`, which the `--silence` flag replaced, was used both for
suppressing standard output on its own, and for doing so along with
diagnostic output; however, when the `run` function was added this
distinction was lost, and both outputs would be discarded.
This reintroduces the needed functionality, and changes usages of
`--silence` to `--quiet` where previously only standard output was
suppressed, or where this should have probably been the case anyway.
Change-Id: Ifb1b52a1d1eea0117261c782d686ad7c71b43162
When a non-directory, such as a file or a dead symlink, already exists,
mkdir -p fails with "cannot create directory ‘...’: File exists".
This is a problem when, for example, a symlink points to a directory on
a filesystem that isn't mounted yet.
This commit changes the way aliases are rendered, adding the "no more
flags" flag `--`, which means that, for example, the alias `"-" = "cd
-";` will work as expected. (I was getting a syntax error before this
change.)
Additionally, now the alias key is shell escaped, which may help some
edge cases. I'm honestly not sure if this part is necessary since I
assume an alias can't contain spaces anyway, but it definitely
shouldn't break anything.
* vdirsyncer: change verify to type path
accounts.<calendar/contacts>.accounts.<name>.vdirsyncer.verify should not be a bool, it should be a path.
* vdirsyncer: Add example of verify use
Currently translated at 100.0% (36 of 36 strings)
Co-authored-by: Alexis Rossfelder <rossfelderalexis@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fr/
Translation: Home Manager/Home Manager CLI
* programs.khal: fix build failure due to null value
* calendar: allow null value for primaryCollection
* calendar / programs.khal: set default values to avoid common errors
* khal: fix contact integration
- Add tests for contact+khal
- Make options `color`/`priority` available for contact accounts
* khal: add separate calendar for each contact collection
A contact account may have multiple VCARD collections, but Khal doesn't
search recursively. Collection folder names must be hardcoded, and each
has its own calendar.
- Add khal.collections option for contact accounts
- Default to previous setup for accounts with a single collection
- Add tests
* khal: specify how priority is defined by Khal
See https://khal.readthedocs.io/en/latest/configure.html
The `exec` command does not do any shell parsing and does not
understand the `&&` which is how the extraCommands are added after
dbus activation. There doesn't seem to be a reason for `exec` here
anyway so just remove it and allow shell parsing.
* Skip font installation if the derivation hasn't changed.
* Use `rsync` instead of `install` to copy font files, to avoid useless
copying of pre-existent identical files.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
This introduces some rudimentary integration tests using the NixOS
test framework. The intent is to better catch regressions when doing
more elaborate changes that may affect overall Home Manager behavior.
Note, the tests are currently not run automatically.
When using the `init` sub-command, it is now possible to set the Home
Manager and Nixpkgs input URLs. Note, for now these options are
considered experimental.
neomutt: Updated options and added tests
neomutt: Added test for individual mailbox type
neomutt: Formatted code
neomutt: Enable ssl_force_tls based on IMAP instead of SMTP
neomutt: Applied suggestions from @chayleaf
neomutt: fix breaking tests
* imapnotify: enable STARTTLS if enabled in email account config
Since version 2.3.10 goimapnotify supports starttls. In version 2.3.11 a
typo in the settings was fixed, using tlsOptions.starttls to enable it.
This commit enables starttls in the goimapnotify config file if it is
enabled in the email account's imap settings.
* imapnotify: test generated config file
Compare the generated service config file with a manually verified
sample.
workspace 10 is part of upstream's default config, but was missing in home-manager.
The initial "sway: add module" PR (02d6040003) went through multiple iterations and had workspace 10 included for a brief moment.
Until the author removed it in a force-push commenting
> Have removed the last change which added bound ${modifer}+0 to workspace number 10 as this messed up workspace numbering in sway.
The reason might have been, that sway used to sort the workspaces in the order they appeared in the config.
Attribute sets in nix are sorted, but not "naturally sorted", meaning `bindsym Mod1+0 workspace number 10` comes before `bindsym Mod1+0 workspace number 1`.
It's unclear if that's what really happened. A workaround would have been to use `lib.lists.naturalSort` in `keybindingsStr`.
But I cannot reproduce this anymore in any way.
I assume this has been fixed many years ago by now.
upstream config: 020a572ed6/config.in (L113-L134)
In order to manage the extensions and configs from openvscode-server,
the only additional requirement was some mapping missing between the
name of the package and the default configDir/extensionDir
This ensures that `KITTY_SHELL_INTEGRATION` is manually set to the
user's `shellIntegration.mode`. This is necessary because sometimes
the variable is not set in subshells or splits.
`shellIntegration.mode` is also now ensured to always contain `no-rc`.
Since the module system doesn't allow specifying order on types.lines
users can't specify anything to run after what modules have put into
shellInitInteractive since it runs last. This implements a fourth field
that runs after all others, not to be used by HM modules, but regular
users.
Co-authored-by: Carl Hjerpe <git@hjerpe.xyz>
The `run` function export was removed in #4965. This broke the
expectation in this module that `run` would be available outside of
main activation script, as `$DRY_RUN_CMD` once was.
Fixes#4980
Farm links from the selected firefox package,
programs.firefox.nativeMessagingHosts and a package with a .keep file
for always creating the ~/.mozilla/native-messaging-hosts folder as a
regular folder with links in it.
Fixes#4959
The `home-manager.lib.homeManagerConfiguration` function now has an
additional attribute that can be used to extend a Home Manager
configuration with additional modules outside the project tree.
It works similar to the result of `lib.nixosSystem` from Nixpkgs
This removes the services.keepassx module and all options related to it.
This is because KeePassX has been unmaintaned for a long time, and the
migration path to KeePassXC is not clear.
Note, this package probably hasn't worked for nearly a year since the
package was removed from Nixpkgs:
https://github.com/NixOS/nixpkgs/pull/216748Closes#4949
Signed-off-by: Sumner Evans <me@sumnerevans.com>
Since nushell 0.89, automatically spreading lists is deprecated. This
commit introduces a string replace for the zoxide init script to replace
the deprecated code.
See: https://github.com/ajeetdsouza/zoxide/issues/662Fixes: #4916
The previous syntax (`plugin:name { ...settings}`) is not working with
more than one plugin. There is no documentation for this, just the
source code [1].
With this update the plugins paths aren't generated together with the
full config (so the "plugin" field is not "important" anymore) and the
plugins settings are generated like the other fields.
[1] 4d403dac32/src/config/ConfigManager.cpp (L1574)
The plugin setting in the Hyprland config is used both for defining
plugin paths and configuring the plugins. This fix removes the
silent override of the plugins settings converting them to the
`plugin:<name> { ...settings }` syntax.
Turns out pulling nmt and nmd from Nixpkgs causes an IFD, even when
the packages are fixed-output derivations.
Thus, since Sourcehut is up and well, we can revert to simply fetching
nmd and nmt directly.
See discussion in <https://github.com/nix-community/home-manager/pull/4884>.
DBus activated services such as mako use the XCURSOR_THEME and
XCURSOR_SIZE environment variables to decide how to show the cursor,
so without these, the cursor may not match the rest of the desktop
when hovering over (in this example) mako notification surfaces.
The gradle package from nixpkgs will install a default Java version and
pass it to the gradle executable without polluting the global env.
Users can customize this by overriding the gradle package like so:
programs.gradle = {
package = (pkgs.gradle.override {
java = pkgs.jdk21;
});
}
This commit makes it possible to specify Firefox' extraPolicies
through:
programs.firefox.package = pkgs.firefox.override {
extraPolicies = {... }
}
This was possible in the past but was broken by:
3feeb77155
firefox: add support for specifying policies (#4626)
This adds a Boolean option `uninstall`. When enabled this option will
reset side-effecting configurations to their "empty" state. The intent
is that this will cause the activation script to remove all managed
files and packages.
Doing it this way should hopefully be more robust than the previous
solution. It also allows a somewhat more convenient uninstall process
when using Flakes; put `uninstall = true` in your existing
configuration and then do a switch.
Also add simple uninstall test in CI test job.
The identity's signature will be configured according to signature.text
and signature.showSignature. Signature commands are not supported by
Thunderbird.
> -e file
> True if file exists.
> -f file
> True if file exists and is a regular file.
> [...]
> -L file
> True if file exists and is a symbolic link.
>
> (Source: bash(1))
Minor fix in documentation. The example in
`programs.zsh.prezto.pmoduleDirs` is not compatible with shell
environment variables like `$HOME`, must be replaced with nix
compatible variables eg: `home.homeDirectory`.
Fixes#4452
Osmscout-server includes a setting in its UI to create a systemd user
service and socket to run the server on demand. This does not function
correctly on NixOS, for two reasons:
1. It assumes that the binary path is stable (e.g.
/usr/bin/osmscout-server), which is not the case on NixOS.
2. It auto-detects the unwrapped binary path, which doesn't work.
This module allows the user to access the same functionality on NixOS.
Having the module enabled but never using gh will result in the config file
existing but no hosts.yml. In that scenario we won't have anything to
migrate, so only test for hosts.yml.
The service was never marked with a failed state with the previous
approach, which could lead broken synchronisation pair states to go
undetected.
The module now uses a timer instead of unlimited restarts, which does
not have this issue.
* aerc-accounts: support for maildirpp
aerc-accounts now is aware of the mbsync.subFolders setting
* aerc: Adds test for maildirpp format
---------
Co-authored-by: lgehr <lgehr@mailbox.org>
Commit 8cedd6 `fish: support flexible abbreviations` removed shell
escaping for fish shell abbr values. This was a dangerous breaking
change offered little value and made writing abbr expansions more
difficult. This commit restores automatic shell escaping of fish abbr
values.
In nushell, the ENV_CONVERSIONS environment variable is used to
transform the defined variables from a string to a nushell value (PATH
to a list being one of the most common uses). This commit applies
user-defined conversions to direnv-loaded variables.
This fixes binary autocompletion not being triggered for newly added
paths and makes direnv work consistently with nushell
Introduces a new program called gradle for managing files stored in
the home directory by the [Gradle Build Tool](https://gradle.org).
Gradle uses the $HOME/.gradle folder for all it's configuration.
Features of the new program module are:
- Automatically setting programs.java.enable = true to make a Java
installation available for running Gradle.
- Specifying an alternate Gradle home directory
- Setting of abitrary values for gradle.properties stored inside the
Gradle home directory.
- Defining init scripts that will be linked into the init.d inside
the Gradle home directory.
Co-authored-by: Olli Helenius <liff@iki.fi>
Co-authored-by: Robert Helgesson <robert@rycee.net>
Adds a program module for [Sapling](https://sapling-scm.com/).
Since Sapling itself is very similar in nature to Mercurial,
`modules/programs/mercurial.nix` was copied to make this module with
the ignore pieces removed (Sapling respects gitignore).
If `nix.settings.use-xdg-base-directories` is true, the
`~/.nix-profile` directory may not exist, and `home.profileDirectory`
should be checked instead.
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
The release notes used to be an appendix in the manual. After
converting to markdown that appendix got lost. This commit
reintroduces the release notes into the manual.
When using the previous approach I've always gotten errors that I can't
reload config on the .lock file that exists in /tmp when you run a
standard configured hyprland.
This commit improves this by using hyprctl to find instances to reload
instead.
We can remove the HYPRLAND_INSTANCE_SIGNATURE bogus assignment once
https://github.com/hyprwm/Hyprland/issues/4088 is resolved.
Co-authored-by: Carl Hjerpe <git@hjerpe.xyz>
The example is missing a `;` which causes this error when you attempt
a `darwin-rebuild switch`.
```
error: syntax error, unexpected '=', expecting ';'
at /Users/968713/.nixpkgs/darwin-configuration.nix:17:30:
16| }
17| home-manager.users.eve = { pkgs, ... }: {
| ^
18| home.packages = [
```
Add the option sourceFirst to the hyprland module. When this option is
enabled source entries will be put near the top of the file, so that
the variables declared in other files can be used by the other
configuration entries.
Add "source" to the list of important prefixes when the former option
is enabled.
Resolves#4729
This resolves the long-standing deprecation warning by migrating the
documentation to using the nixos-render-docs tool. As part of this,
the documentation markup language is migrated to Markdown.
See pull-request #4673 for more.
The `nixos-render-docs` tool outputs XHTML formatted content. In
order to convince browsers like `firefox` to treat the data as XHTML
the extension must be `.xhtml` and not `.html`.
Using the XHTML-formatted content as HTML is mainly an issue with
self-closing `<a />` tags.
`document-highlighter` now outputs a `<code>` block inside the
pre-formatted `<pre>` tag. This changes the required CSS for
rendering code snippets. Moreover, this commit uses the highlightjs
as provided by the `document-highlighter` package instead of the
version packaged in `nmd`.
The `man home-configuration.nix` is configured to left
align the text similar to `man configuration.nix`. This
commit updates the `man home-manager` page to be consitent
with the two manpages mentioned above.
This commit removes the `home-manager-render-docs` package in favor
of upstream `nixos-render-docs` where the manpage generator has been
updated to take a `--header` and a `--footer` flag specifying static
content around the content derived from the options.json file.
This commit extracts the htmlOpenTool from `nmd` into a module
in the home-manager docs directory. This is done to provide feature
parity with the documentation generated using the docbook .xml files.
The `optionsDocBook` function is deprecated in nixpkgs since
nixos-23.11. This commit updates the manual and manpages to
use commonmark formatted documentation instead of the deprecated
docbook format.
Previously, users cannot enable boolean flags like `--show-all` in bat's
config since all options were expected to be either a string, or a list
of strings. With this commit boolean flags are simply appended to the
end of the config if they are set to `true`, and discarded otherwise.
For example, the config
{
theme = "TwoDark";
show-all = true;
lessopen = false;
}
would produce a config file that looks like
--theme='TwoDark'
--show-all
Fixes#4657
Currently translated at 100.0% (35 of 35 strings)
Co-authored-by: Julien H. Gibson <julienhgibson@protonmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fr/
Translation: Home Manager/Home Manager CLI
Currently translated at 94.2% (33 of 35 strings)
Co-authored-by: Julien H. Gibson <julienhgibson@protonmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fr/
Translation: Home Manager/Home Manager CLI
Occasionally, swayidle crashes with a failure to connect to the
Wayland session. Ideally, swayidle should automatically restart
instead of leaving the system in a vulnerable state.
When a user references config.programs.firefox.package in her/his
configuration, s·he will get a different path than what is in the
$PATH variable. To make it possible to get the same path, this commit
introduces the finalPackage read-only option.
Due to the defaults in `systemd.user.settings`, the default value when
there are no settings explicitly set is `{ Manager = { }; }`. This
means an empty file is created even when `systemd.user.settings` is
never used in home-manager configuration. Since user’s `user.conf` is
preferred to the global `/etc/systemd/user.conf`, this can cause any
values set in the latter to be discarded.
The `systemd.user.extraConfig` provides a way to generate a
`systemd-user.conf(5)` file for the user.
This is the home-manager equivalent of NixOS’s option of the same
name, with the difference that NixOS’s option generates a `user.conf`
file that is shared between all users.
This commit fixes a typo in XDG data directory link location in the
`home.pointerCursor` module where the link is placed at
$XDG_DATA_HOME/.icons instead of the correct location
$XDG_DATA_HOME/icons.
Fixes#4638
This commit changes the config format of repositories to the
soon-be-expected `{ "path": "repository-path", }`. The Home Manager
configuration allows a simple string (which will get translated), the
new format by directly using the path attribute, and the one with the
optional label attribute. More information about the background can be
found here https://torsion.org/borgmatic/docs/reference/configuration/
* k9s: add hotkey option
This PR adds an option to customise k9s hotkeys.
The keyword `hotKey` must be in camel case on the user config.
* Update modules/programs/k9s.nix
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
* fix formatting
---------
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
When xdg.enable is set, aerc uses the $XDG_CONFIG_HOME variable instead
of the default $HOME/Library/Preferences. home-manager needs to check
this to make sure aerc can find the proper file in both cases.
Closes#2923 based on how arnarg solves this in his personal config.
With review suggestions from musjj.
Co-authored-by: Arnar Gauti Ingason <arnarg@fastmail.com>
Co-authored-by: musjj <72612857+musjj@users.noreply.github.com>
When a process inside the sxhkd scope is OOM killed, if the OOM policy
is set to `stop` then the sxhkd scope itself will exit, terminating
every process launched from the keyboard.
This is undesirable, set it to `continue` instead to keep other
processes running.
For devices with more than one battery, cbatticon allows to set the
battery ID as optional positional argument. If this argument is not
given, it default to the first battery it would list with `cbatticon
-p`. This commit adds support for the batteryId option to the cbatticon
module.
Includes the following changes:
- Remove unused reference definition.
- Sort reference definitions.
- Internally reference "Words of warning" section.
- Consistently reference.
- Fix typo.
- Format HTML code.
- Link only to first occurence per section.
- Simplify list formatting.
- Adapt 'Installation' section to manual.
- Fix punctuation.
- Wrap text at 80 characters.
- Simplify link phrasing.
- Add missing punctuation.
PR #4363
Since fzf 0.43.0, the fzf_key_bindings function is only defined when
fish is running interactively, see [1].
This caused errors when entering non-interactive fish shells since we
called fzf_key_bindings during startup.
[1]: 7e89458a3b
The configuration file format of borgmatic has changed in version
1.8.0:
https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/main/NEWS
This commit makes Home Manager generate borgmatic's configuration file
using the new format.
Even though the NEWS file indicates that old configuration files are
compatible, this is not 100% the case: empty sections work fine in old
borgmatic but stop working in new ones. I've reported the bug upstream
by email as I couldn't create an account on the forge.
Specifically, allow variable expansion for the key codes by switching
from single to double quotes.
This also adds a helpful suggestion to descriptions. Taken from the
project's README, see
4abed97b6e/README.md?plain=1#L71-L74)
Allows users to customize which environment variables to import in DBus
and SystemD user environments, and to specify which commands will be run
after the environment activation.
The way the `bat` module is currently written makes it essentially
impossible to use themes and syntaxes without IFD, since you must
provide the contents as string, instead of just giving a path to be
linked.
With this change, setting themes/syntaxes by-string will start issuing
warnings, and a new attribute model is added, lightly inspired by how
`programs.zsh.plugins` avoided this issue.
For some reason, Firefox completely discards the ADD_DATE and
LAST_MODIFIED attributes if they are set to 0. This has been
confirmed by exporting a sample set of bookmarks generated by
Nix using home-manager and comparing it to the same sample of
bookmarks set manually and then exported.
Missing these attributes can cause problems for extensions and
other tools that try to read bookmarks. A known example is the
Tridactyl extension.
Currently translated at 94.4% (17 of 18 strings)
Translate using Weblate (Indonesian)
Currently translated at 68.5% (24 of 35 strings)
Translate using Weblate (Indonesian)
Currently translated at 61.1% (11 of 18 strings)
Translate using Weblate (Indonesian)
Currently translated at 42.8% (15 of 35 strings)
Co-authored-by: Reza Almanda <rezaalmanda27@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/id/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/id/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
We only need the Home Manager path variables when performing a few
operations, so only set the variables for those operations.
This avoids problems on fresh installations, where no profile
directory exists.
Fixes#4403
- If the parse does not match/returns an empty list, transpose does
not transform it into a record and thus load-env fails.
- The parsing assumes keychain to emit bash-style completions, so set
SHELL=bash to ensure keychain output is in the expected format.
PR #4459
Make the `finalPackage` option public, but still read-only. The final
package option is quite useful for users.
For example, to integrate `lazy.nvim` with Nix there are three things
that must be done:
1. `lazy.nvim` resets packpath, which should be managed by Nix; it has
to be turned off with `performance.reset_packpath = false` option in
`lazy.nvim`
2. Same thing applies to rtp, the relevant option is
`performance.rtp.reset = false`
3. `dev.path` must be specified as the folder that contains the plugins.
This folder is the path to Nix store path with Neovim plugins, and
the plugins that are managed by Nix must be marked as `dev = true`
The third condition can not be fulfilled without this PR, as the final
package that Home Manager produces is not exposed, therefore it is
impossible to extract the Nix store path. This PR makes it more
accessible via
${
pkgs.vimUtils.packDir config.programs.neovim.finalPackage.passthru.packpathDirs
}/pack/myNeovimPackages/start
With nushell `0.85.0` this is no longer valid syntax. This change fixes
the syntax error with `0.85.0` while still remaining valid for `0.84.0`
and earlier.
Fixesnix-community/home-manager#4488
The default config for sway generates a bar block with tray_output primary. But wayland (or sway, take your pick?) has no concept of a primary display so this just results in no tray anywhere.
A better default is "*" which puts the tray on every monitor, since sway can do so without issue.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Currently translated at 2.8% (1 of 35 strings)
Add translation using Weblate (Thai)
Co-authored-by: Kamontat Chantrachirathumrong <uein2@users.noreply.hosted.weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/th/
Translation: Home Manager/Home Manager CLI
Adds a programs.rio module to control Rio installation and configuration, a gpu accelerated terminal
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
I'm experiencing timeouts for home-manager-$USER.service in my NixOS VM
tests. The NixOS testing framework increases the default timeout from
1m30 to 5m, but since home-manager specifies a timeout, that value wins.
There's no point in having a tight timeout value, so increase it to 5m.
Currently translated at 25.7% (9 of 35 strings)
Add translation using Weblate (Czech)
Co-authored-by: Karel Kremel <charles@alembiq.net>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/cs/
Translation: Home Manager/Home Manager CLI
Currently translated at 100.0% (35 of 35 strings)
Translate using Weblate (Polish)
Currently translated at 94.2% (33 of 35 strings)
Co-authored-by: Marcin Kaczorek <hostedweblateorgmk@karek.pl>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pl/
Translation: Home Manager/Home Manager CLI
Fixes a regression of GitHub issue #594. Before this commit,
attempting to dynamically configure Home Manager with contents of
nixos's users.users when using the nixos module would result in
infinite recursion.
PR #4368
An IFD was introduced in bdb5bcad01 from
reading the top-level directories of the `home.pointerCursor.package`
at instantiation time.
This commit removes the IFD introduced when linking icon directories
by linking only the icon directory matching `home.pointerCursor.name`
in `home.pointerCursor.package`. This should be functionally
equivalent to linking all top-level directories of the supplied icon
package as the module only generates cursor configurations pertaining
to the cursor identified by `home.pointerCursor.name`. Deviations in
behavior caused by additional files linked in $HOME/.icons as of the
status quo should be treated as impurities.
The current cursor configuration poorly accomodate applications not
following the XDG icon theme spec. As a result, some applications fail
to locate user defined icons and themes.
To address this, symlinks from icon directories in the provided cursor
package was to $HOME/.icons were added added for greater compatibility
with applications using hardcoded icons directories. This approach was
chosen to allow for coexistence of declarative and non-declarative
icon files in the icons directory. In addition, symlinks of icon
directories were mirrored in $XDG_DATA_HOME/.icons for backwards
compatibility. As per the XDG icon theme spec, applications are to
search in $HOME/.icons first for icons and themes so the existing
behavior should not break for XDG compliant applications[1].
[1] https://specifications.freedesktop.org/icon-theme-spec/latest/ar01s03.html
Remove xwayland.hidpi option, since we're dropping HiDPI XWayland
patches support, opting to use the builtin xwayland:force_zero_scaling
option instead. It is described in more detail in
https://wiki.hyprland.org/ Configuring/XWayland.
Don't try to validate a limited set of hardcoded options, instead just
convert them as-is. Now, users can keep all their options in a single
attribute set, including arbitrary `user_{option}`s which was impossible
to express with a hard-coded submodule. As a plus, there is also less
maintainence burden.
While the locale options were declared, the weren't used in the
generation of the config file, because the locale submodule missed a
default, which failed the tests. I added an empty attribute set as a
default, which fixes the test, and works with the defaults in the
submodule options as expected.
Currently translated at 2.8% (1 of 35 strings)
Co-authored-by: HeartBlin913861820c094e37 <heartblin@proton.me>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ro/
Translation: Home Manager/Home Manager CLI
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
* gh: option to enable helper for additional hosts
`gh` can also be used with github enterprise
hosts, for which there exists no easy option
to enable the credential helper except for
directly working with `programs.git.extraConfig`.
Not sure if this is a needed addition since it's
somewhat niche, at the same time it's not very
complex and makes the life of github enterprise
a little easier.
* gh: update credential-helper tests
* gh: refactor credential helper option
this moves from `enableGitCredentialHelper` to
`gitCredentialHelper.enable` and
`gitCredentialHelper.hosts`.
* gh: lib.mkIf -> mkIf
- On darwin, creates a launch agent to run git-sync on an interval and
when the `path` changes.
- The `uri` option is not used on Darwin. The auto-creation of the
local git directory from the `uri` is a feature of the
git-sync-on-inotify [1] wrapper (which won't work on Darwin afaik)
and not `git-sync` itself.
[1] https://github.com/simonthum/git-sync/blob/master/contrib/git-sync-on-inotify
* hyprland: prioritize variables and beziers
The `settings` key now handles `$variables` and `bezier`s differently,
putting them at the top of the file.
Also, proper indentation has been implemented.
* Update modules/services/window-managers/hyprland.nix
Co-authored-by: Naïm Favier <n@monade.li>
* hyprland: add animations & beziers test
---------
Co-authored-by: Naïm Favier <n@monade.li>
These (and the `*MD` functions apart from `literalMD`) are now no-ops
in nixpkgs and serve no purpose other than to add additional noise and
potentially mislead people into thinking unmarked DocBook documentation
will still be accepted.
Note that if backporting changes including documentation to 23.05,
the `mdDoc` calls will need to be re-added.
To reproduce this commit, run:
$ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \
nix shell nixpkgs#coreutils \
-c find . -name '*.nix' \
-exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \
--strip {} +
$ ./format
This process was automated by [my fork of `nix-doc-munge`]. All
conversions were automatically checked to produce the same DocBook
result when converted back, modulo minor typographical/formatting
differences on the acceptable-to-desirable spectrum.
To reproduce this commit, run:
$ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \
nix shell nixpkgs#coreutils \
-c find . -name '*.nix' \
-exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \
{} +
$ ./format
[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge/tree/home-manager
The NixOS variant of Markdown doesn't make a distinction between
`<code>` and `<literal>` or `<quote>` and... quotes, and doesn't
support `<parameter>` or `<replaceable>`. These are infrequently used
(apart from `<code>`) and don't add much, so just convert them to
simpler forms to allow the options containing them to be converted
to Markdown automatically.
A few minor syntactic adjustments were also made to make
`nix-doc-munge`'s job easier.
The Markdown options processor cannot handle rendering tables
to DocBook. This could be fixed, but as we won't be using the
DocBook output for long I just removed them for now in the interest
of expediency; they were all well-suited to being description lists
showing option types anyway, apart from one awkward case in the form
of trayer, which also had ad-hoc syntax for enumerating acceptable
values in the documentation. Since the types aren't actually used for
option processing anyway, I changed them to use `enum` and similar to
give a single description of the acceptable values without a big table.
`nix-doc-munge` can't handle these, which is understandable as I can
barely handle them either. There are a few infelicities here: the
current processor can't handle multiple terms to one description in
a description list so they get comma-separated in one case, and one
case that should ideally render as a `<figure>` with a `<figcaption>`
in HTML is reduced to a paragraph with some `<strong>` text. (Which, in
fairness, is how it rendered in practice with the DocBook anyway.) The
docs generator has since been updated to handle figures, but we can't
use it until moving off DocBook output.
These files all have options that trip up the `nix-doc-munge`
conversion tool for one reason or another (syntax that clashes with
Markdown, options that were already using Markdown syntax despite not
being marked that way, output that differs slightly after conversion,
syntax too elaborate to convert with some cheap regular expressions,
...). Translate them manually and do a little copyediting to options
in the vicinity while we're at it.
Output is mostly unchanged aside from some minor typographical and
formatting changes, along with better source links.
We temporarily export `options.docBookForMigration` to allow
`nix-doc-munge` to check its conversions.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
This removes the hard-coded fallback Home Manager paths. Specifically
${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home-manager
and
"$HOME/.nixpkgs/home-manager"
Use `@HOME_MANAGER_PATH@` if it has been provided and points to
something that exists. Warn the user if it does not point to
something.
If we have not been provided with a `@HOME_MANAGER_PATH@` that exists,
then for both hard-coded paths show a warning if something exists
where the paths are pointing.
This no longer attempts to use either of the hard-coded paths as
fallback for the Home Manager path.
Prior to this change, it was impossible to nest attrsets in
accounts.email.accounts.<name>.imapnotify.extraConfig. However,
goimapnotify's configuration is JSON-based, and the recommended
configuration has:
```
"tlsOptions": {
"rejectUnauthorized": true
},
```
This change changes the type from an attrset of str/int/bool to the
JSON type provided by nixpkg's `pkgs.formats.json`.
Previously, lines in .zshrc were added with quotes in keys
(e.g. ZSH_HIGHLIGHT_STYLES['comment']='fg=#6c6c6c'). However, zsh
considered these quotes to be part of the key, so the "comment" key
remained unchanged.
* home-cursor.nix: enable gtk module when enabling gtk config generation
The gtk configurations are not generated unless config.gtk is enabled.
This is a point of confusion because config.home.pointerCursor.gtk can essentially be disabled,
despite having it enabled.
* home-cursor.nix: Add note to gtk config generation description instead of enabling gtk module
* home-cursor.nix: Add note about applying pointerCursor configs to main submodule desc
* home-cursor.nix: Change tabs to spaces
* aerc: fix per-account extraConfig section names
The aerc configuration file `aerc.conf` can contain 10 different
sections, but only the UI section supports what the aerc manual calls
contextual configuration. This works by appending to the section heading
either `:account=name` or `:folder=bar`.
The aerc-accounts module, however, applied `mkAccountConfig` to each
section heading declared in
`config.accounts.email.accounts.<name>.aerc.extraConfig.*`. This means
home-manager will generate files with `[general:account=default]` and
the options will not be recognized by aerc.
To address this, and since it doesn't make sense for other sections to
only be under a single account's scope, an assertion has been added
to confirm that only sectons that support contextual config (i.e.,
only the UI section) is declared.
This also addresses confusions like declaring
`accounts.email.accounts.*.aerc.extraConfig.general.unsafe-accounts-conf
= true` and triggering a warning message because
`programs.aerc.extraConfig.general.unsafe-accounts-conf` was unset.
This commit also updated documentation throughout the aerc modules to
be in line with this change, and fixed minor typos/formatting therein.
Co-authored-by: Genevieve <genevieve@sunlashed.garden>
* aerc: make assertion plaintext and add test case
This commit adds a test case to check both the warning on unset
`unsafe-accounts-conf = true` when aerc accounts are configured
with Nix, and the new assertion when per-account configuration
contains unsupported subsections (i.e. general).
It also fixes minor formatting issues and typos.
As pointed out in #3291, using the XDG symlink means the agent/unit
files don’t change when the contents of the config changes, and so the
service will not be restarted.
Nushell has the option to source from the login.nu file in the case
that nushell is used as a login shell. This commit adds the login file
alongside the existing config and env files as another configuration
option.
Previously, IMAP was preferred over notmuch, even if notmuch was
configured, causing problems with setting account flavor (which
automatically sets IMAP settings). The new backend order is:
notmuch > IMAP > maildir
This also fixes the notmuch DB path being set to the wrong location.
The notmuch DB is located at the maildir base path, not in each
account's maildir.
Unison supports the same option to be given several times as a command
line argument (e.g. unison -path xxx -path yyy).
This commit adds Home Manager support for this by allowing a list of
strings to be given to services.unison.pairs.<name>.commandOptions values.
# Veuillez saisir le message de validation pour vos modifications. Les lignes
* imapnotify: expose package (and exe) options
There are multiple packages that provide an imapnotify interface. Those
packages have differently named executables. This can now be customized.
This change also means test configurations can use stub packages.
* imapnotify: use/create config in configHome
Exposing the configuration file makes testing imapnotify configurations much
easier. It also allows for golden tests in home-manager.
* imapnotify: extend with launchd agent
Now that home-manager supports launchd agents, the imapnotify service
can be configured (and enabled) for darwin. The configuration matches
that of the linux/systemd version. In particular, by not setting a
`UserName`, this runs as the user whose configuration includes the
module.
Due to the launchd `Program` implementation (it must take an absolute
path) it is not possible to use that for the program and stub the path
in tests. Instead, this uses `ProgramArguments` for the program name.
The `ThrottleInterval` is equivalent to `RestartSec`. `KeepAlive` is
equivalent to `Restart`.
The `ExitTimeOut` default is 20 seconds, but goimapnotify should not
time out — this is achieved by setting the `ExitTimeout` to 0.
* imapnotify: add launchd plist test
This only tests the generated plist (which is new), not the original
systemd implementation, nor the json config file.
(Note the lack of a newline at the end of the plist file.)
This will reduce the system closure size by about 200MB under NixOS by
sharing the glibcLocales package.
When home-manager is installed on Linux without the NixOS module, all
glibc locales are installed, as before.
Resolves: #2333
Nix interprets a path-like URI as a git repository if any of the path's
parents is a git repository. Since home-manager uses a default flake URI
of ~/.config/nixpkgs/flake.nix, if you have a git repository as your
home directory and a '*' .gitignore it leads to the following problems:
evaluating derivation 'git+file:///Users/dongcarl?dir=.config%2fnixpkgs#homeConfigurations."dongcarl".activationPackage'
The following paths are ignored by one of your .gitignore files:
.config
This is solved by explicitly specifying the `path:` URI type prefix for
the default flake URI argument.
This removes the Nix Pills reference, because they are not a good
introduction to the Nix ecosystem, but rather a thorough explanation
of many disparate things. Reading through them might give some light
bulb moments for an intermediate reader, but that does not mean that
they're good for a beginner.
I've also removed the mention of infinite recursion without source
location. That's an old meme for a problem that has been mostly
solved. Mentioning it here has two effects:
- Propagate the outdated meme.
- Make users insensitive to bad errors. Learned helplessness. That
kind of thing. What we really want is for them to report bad error
messages, so that they can be fixed. And they can be fixed; just
report them at `NixOS/nix`.
The current `lla` alias, together with the `total-size` option try to get
the size of the `..` directory, and for this has to recursively open all
sibling folders. This may be super slow if some of those siblings
contain too many files, and raise a ton of useless errors if some of
those siblings contains non-readable files.
I'm suggesting to use `-A` instead, which will skip the obvious `.` and
`..` folders.
While here, I think we could also add `llt`.
* format: improve argument handling
For now, fail if the user tries to format a specific file/directory,
or runs the formatter from within a subdirectory.
Handling these situations is slightly tricky because `find -path` is
not very flexible.
* flake: add formatter
This allows running the formatter with `nix fmt`, added in Nix 2.8.
* format: use git ls-files
This is cleaner than `find` and allows us to restrict formatting to
particular files or subdirectories.
We can't test for the whole contents of the config file because that is
out of our control and may change unexpectedly. Only check for the
settings we know should be set.
Currently translated at 24.2% (8 of 33 strings)
Add translation using Weblate (Indonesian)
Co-authored-by: Abdul V Vahry <cyberaioff@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/id/
Translation: Home Manager/Home Manager CLI
Many of the terminals supported inside emacs work perfectly fine with STARSHIP.
The TERM=dumb case already handles the tramp and eterm cases, so as far as I can
tell, this is basically just a check for the benefit of OLD versions of
term-mode (see
emacswiki.org/emacs/AnsiTerm#:~:text=Historically%2C%20'M%2Dx%20ansi%2Dterm,the%20older%20'C%2Dc'%20binding.,
which indicates that it also now handles colors).
PR #3747 renamed the option wayland.windowManager.sway.systemdIntegration
to wayland.windowManager.sway.systemd.enable.
This commit simply updates documentation to reference the new format.
Starship has an advanced, experimental feature where fancy stuff in the
prompt can be replaced with something more simple after the command is
ran. This is very helpful for copy and pasting shell history somewhere
else.
docs: https://starship.rs/advanced-config/#transientprompt-and-transientrightprompt-in-fish
Fish is currently the only shell as far as I can tell that both
home-manager and starship support for this feature. Since the function
has to be called after starship is loaded, this seems like the best
place to put it.
format
In 176e455 the order between the action of `-I` parameters getting
added to `EXTRA_NIX_PATH` and the action of a static path getting
added to `EXTRA_NIX_PATH` was reversed, also reversing the order of
`-I` parameters and the static `-I home-manager=...` leading to the
static `-I home-manager=...` to always come before any of the `-I`
parameters to later calls to Nix commands.
This made it impossible to override the static Home Manager path when
calling the home-manager tool with `-I home-manager=...`. This was
previously possible.
* qt: always apply qt.style.package
Before this commit this was only being applied if `qt.platformName` was
set to "gnome". With this change we will always apply the package.
* qt: only set ~/config/Trolltech.conf in GTK or GNOME
* qt: add qtstyleplugin-kvantum-qt4 and qt6Packages.qtstyleplugin-kvantum
qt: add qtstyleplugin-kvantum-qt4
* news: add news entry about the qt module refactors
* qt: add thiagokokada as maintainer
* qt: add "qtct" to qt.platformTheme
This allows usage of qt5ct/qt6ct tool to configure Qt theme/icons/fonts
in non-KDE platforms.
* qt: add missing relatedPackages for qt.platformTheme = "kde"
* qt: add "kvantum" for qt.styles.name
This allow you to configure Qt integration using KDE instead of
qgnomeplatform or qtstyleplugins. Useful if your theme supports both GTK
and KDE, for example Nordic.
To use this properly you will need to do some manual configuration for
now. You can set the theme settings using `~/.config/kdeglobals`.
Example:
```nix
{ ... }:
{
qt = {
enable = true;
platformTheme = "kde";
};
xdg = {
configFile.kdeglobals.text = lib.generators.toINI { } {
General = {
ColorScheme = "nordicbluish";
Name = "nordic-bluish";
shadeSortColumn = true;
};
Icons = {
Theme = "Nordic-bluish";
};
KDE = {
LookAndFeelPackage = "Nordic-bluish";
contrast = 4;
};
};
dataFile = {
# For General.ColorScheme
color-schemes = {
source = "${pkgs.nordic}/share/color-schemes";
recursive = true;
};
# For KDE.LookAndFeelPackage
plasma = {
source = "${pkgs.nordic}/share/plasma";
recursive = true;
};
};
};
}
```
* aerc: add space after definitions
* aerc: only generate files, if options were set
* aerc: improve file permission warning
* aerc: remove redundant access to builtins
* aerc: allow overwriting of derived values
the order of merging the config subsets did not allow the user to specify
outgoing, source and password command values,
if they were previously derived from the SMTP, IMAP, Maildir etc config.
The values from `account.<name>.extraAccounts` now have the highest precedence.
Appropriate tests were added as well.
* aerc: write primary account first
* Add infrastructure for contacts and calendars
This also adds the modules
- programs.vdirsyncer,
- programs.khal, and
- services.vdirsyncer
that integrate with the new infrastructure.
Co-authored-by: Andrew Scott <3648487+ayyjayess@users.noreply.github.com>
Co-authored-by: Sebastian Zivota <sebastian.zivota@mailbox.org>
wip
* vdirsyncer: allow option userName, disallow userNameCommand
1. account option `userName` is now allowed by `programs.vdirsyncer`
2. The commented out account option `userNameCommand` was required to be set
by `programs.vdirsyncer` (e.g. as `null`).
It is now disallowed (commented out) by vdirsyncer.
* khal: added options 'color' and 'priority'
* Apply nixfmt
---------
Co-authored-by: Sebastian Zivota <sebastian.zivota@mailbox.org>
Co-authored-by: Johannes Rosenberger <johannes.rosenberger@jorsn.eu>
Co-authored-by: Johannes Rosenberger <johannes@jorsn.eu>
Co-authored-by: Robert Helgesson <robert@rycee.net>
* sway: add support for XDG autostart using systemd
Using the option wayland.windowManager.sway.systemd.xdgAutostart, users
can now choose to start applications present in
$XDG_CONFIG_HOME/autostart when starting their sway session.
This change also renames wayland.windowManager.sway.systemdIntegration
to wayland.windowManager.sway.systemd.enable;
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
* sway: add Scrumplex to maintainers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
---------
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
* boxxy: add module
* boxxy: added nikp123 to maintainers list
* boxxy: use mkPackageOption instead for the package
Co-authored-by: Naïm Favier <n@monade.li>
* boxxy: use yaml generator instead of json
Co-authored-by: Naïm Favier <n@monade.li>
* boxxy: various fixes
* boxxy: various fixes (part 2)
* boxxy: various fixes (part 3)
* boxxy: various fixes (part 4)
forgot to run ./format, whoops
* boxxy: use literalExpression for the rewrite example
Co-authored-by: Naïm Favier <n@monade.li>
* boxxy: add news entry
---------
Co-authored-by: Naïm Favier <n@monade.li>
* Revert "maintainers: add rasmus-kirk as a maintainer"
This reverts commit 301b364892.
* Revert "joshuto: add the joshuto file manager"
This reverts commit e7fdcb40b2.
* Fix espanso module to work with 2.x version
* espanso: fix espanso module
This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version.
This PR fixed this issue and support creating multiple files under `config` and
`match` folder.
* Espanso: fix espanso module
This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version.
This PR fixed this issue and support creating multiple files under `config` and `match` folder.
Add descriptions
* Add versionAtLeast and mkRemovedOptionModule
* Correct maintainers list
* remove config key from example
* format basic-configuration.nix
* Update modules/services/espanso.nix
Co-authored-by: Naïm Favier <n@monade.li>
* fix maintainers list
---------
Co-authored-by: Naïm Favier <n@monade.li>
Setting `outputSpecified` prevents `getOutput` from descending into
outputs, which don't have an overridden `outPath`.
Additionally, use `__spliced` to permit derivations to use the dummy as
an input.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
* home-environment: add `home.sessionVariablesPackage`
Allow the `hm-session-vars.sh` derivation to be referenced from other
modules, e.g. to translate it to fish with babelfish at build time.
* fish: use babelfish for `hm-session-vars.sh`
Translate `hm-session-vars.sh` to fish at system build time,
significantly decreasing shell startup time.
Based on https://github.com/NixOS/nixpkgs/pull/108947 by @kevingriffin.
This is backwards compatible and allows for more flexibility(eg.
allows for defining custom waybar modules in separate nixos modules,
before merging them together)
Co-authored-by: mae <git@badat.dev>
Make use of the recently added nullable `mkPackageOption` feature
to disable installing an SSH client by default: most people should use
the client provided by their system.
The generation activation script should be run by the user specified
in `home.username` and `home.homeDirectory`. If some other user runs
the activation script, then files may end up in the wrong place or
with the wrong owner.
This commits adds a check early in the activation script that verifies
that the running user match the user in the configuration.
Fixes#4019
Before this commit, running the hasFlakeSupport function causes an
error message
error: experimental Nix feature 'nix-command' is disabled; use
'--extra-experimental-features nix-command' to override
when the Nix installation does not support the nix tool. The error
message should not be visible to the user since its just part of the
Flake support check.
* PR_TEMPLATE: Note nix3 test method in checklist
Allows for running with the `nixpkgs` from the lock file, as well as
using a more familiar interface for users of the experimental CLI, which
would've avoided me opening #3971.
Also updates the corresponding note in `docs/contributing.adoc` to have
the correct invocation path.
* PR_TEMPLATE: `the experimental CLI` -> `Flakes`
Kitty provides integrations for bash, fish and zsh. The new
programs.kitty.shellIntegration options allow the configuration of
these integrations.
See <https://sw.kovidgoyal.net/kitty/shell-integration> for more details.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
* zellij: adds options to integrate with zsh, bash and fish shells
* zellij: add tests for shell integration options
* zellij: eval setup auto start for fish integration
* zellij: use interactiveShellInit for fish integration
* zellij: fixes format issues
* zellij: enable shell integrations by default
* zellij: compresses shell integration test cases
* zellij: removes the disabled shell integration tests
* zellij: formats tests
* pass-secret-service: Add dbus file, assert
Add the dbus service file in the package folder to XDG_DATA_HOME, as
well as adding an assertion to ensure both it and `gnome-keyring` aren't
enabled at the same time.
* pass-secret-service: Add self to CODEOWNERS
* pass-secret-service: Call out conflicting module(s)
* pass-secret-service: Revert `storePath` change
Signed-off-by: Cynthia Fox <cyntheticfox@gh0st.sh>
* pass-secret-service: Add password-store module default changes info
* pass-secret-service: Fix default info, modularize conflict checks
Signed-off-by: Cynthia Fox <cyntheticfox@gh0st.sh>
* Revert "pass-secret-service: Fix default info, modularize conflict checks"
This reverts commit 851df4fe49.
* pass-secret-service: Fix default info
Signed-off-by: Cynthia Fox <cyntheticfox@gh0st.sh>
* pass-secret-service: Indent `storePath` description
---------
Signed-off-by: Cynthia Fox <cyntheticfox@gh0st.sh>
* himalaya: add soywod to maintainers
* himalaya: make the config safer
Also added two services and more tests.
* himalaya: fix doc + typos
* himalaya: use freeform
* himalaya: run ./format
* himalaya: make use of mkPackageOption
It's pretty common to need multiple bindings to
history-substring-search, since different terminals will send different
keys for up/down.
This does not break back-compatibility, and introduces a new test
The current zplug nixpkgs puts everything under `$out/`. It pollutes the nix
profile dir.
This is a breaking change. It depends on an change of the output path in the
nixpkgs zplug package.
This reverts commit 6f9781b1b0 to fix
errors of `nix flake check` and `nix flake show`.
The `devShells` attribute is expected to be an attrset of derivations,
not nested attrsets.
Virtual mailboxes (described by Notmuch queries) can now configured for each account in NeoMutt.
Plus, it is possible to disable Notmuch section for a specific account.
Without this, even if you configure a preference for Electron apps to
use Ozone by setting `NIXOS_OZONE_WL=1`, GUI apps launched through
systemd user services use XWayland, since the variable is not set in
their environment.
This fixes that issue by importing it, like we do other variables.
The previous implementation tried to rename the tag named "default" to
the first tag in `cfg.tags`. This was a wrong approach because if a
tag with the same name already existed, the renaming failed and the
default tag would continue to exist.
The looking up of the default tag also contained a bug because it
should have used `by-name` in the path.
Before this change, the default config provided by this module wrote
an empty file to `$HOME/.config/avizo/config.ini`, which caused a
bunch of errors, as Avizo tries to read a 'group' from the ini file,
which fails.
This commit also adds associated test cases.
PR #3871
The added extraConfig option allowes users to insert custom text at
the end of the generated profile `user.js` file. This allows the users
to import templates as part of their configuration.
The link to the Nix RFC 42 is invalid. Replace this with a valid link to the
upstream NixOS/rfcs repo, pinning it to the commit that introduced the RFC.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
The Nix profiles path may not exist right after installing Nix. In
that case, it is created on demand by the Nix CLI tools. However, Home
Manager assumes it exists and fails if it doesn't.
This change makes sure to trigger the creation of the Nix profiles
path before attempting to access it.
If the user runs a recent Nix version that places per-user profiles in
`$XDG_STATE_DIR/nix/profiles`, then migrate the home-manager profile
there.
Also clean up `setupVars` a bit.
While technically dconf on darwin could work, our activation step
requires dbus, which only *lightly* supports Darwin in general, and not
at all in the way it's packaged in nixpkgs. Because of this, we just
disable dconf for darwin hosts by default.
In the future, if someone gets dbus working, this _could_ be re-enabled,
unclear whether there's actual value in it though.
link the packpath in expected folder so that even unwrapped neovim can pick home-manager's plugins.
I sometimes need to run neovim not wrapped/configured by nix (when
developing neovim or when other projects bring their own neovim in
PATH). Currently they dont find plugins installed by home-manager in the
cases where packpath is not set to the generated nix packpath directory.
With this change, neovim can discover HM-installed plugins by itself.
Some of the email providers (like GMail and Fastmail) save Sent messages
automatically, so make the folders optional in the configuration.
Make Drafts folder optional as well, to allow it to be configured
manually in the extraConf with location outside of the maildir.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
* i3status-rust: update it to handle 0.30.x releases
0.30.0 is a major release that brings many breaking changes to the
configuration file. See:
https://github.com/greshake/i3status-rust/blob/master/NEWS.md#i3status-rust-0300
The only one that actually affects the module though is the change in
how the theme/icons are defined. Other changes are mostly on how to
specify formatting/blocks, and since we just generate the TOML as-is, it
needs changes in the user side.
So most changes in this commit are documentation updates, having
up-to-date examples from things that changed, e.g.: the new `click`
attribute that now can be applied to any block.
* i3status-rust: only use new format if i3status-rust >= 0.30.0
* news: document the i3status-rust changes
* i3status-rust: add thiagokokada as maintainer
The `XCURSOR_*` environment variables specified in libxcursor
are used by many applications and libraries to load and configure
cursor settings. Setting these variables is a no-op if ignored but
is useful as a fallback when other sources of configuration are
unreliable.
This commit sets some commonly used `XCURSOR_*` environment variables
(i.e XCURSOR_THEME, XCURSOR_SIZE) by default when `home.pointerCursor`
is enabled.
The init command is essentially the old install script but integrated
into the home-manager tool. This simplifies things slightly since we
can use the existing code infrastructure.
The init command is Nix flake aware in the sense that, if we detect
that the user's Nix setup supports flakes, then we also create an
initial `flake.nix` file.
Finally, we update the installation instructions for the Nix flakes
standalone setup to use the new init command.
Zsh completion update provided by Anund <anundm@gmail.com>.
This command adds the ability to specify lists of qutebrowser
commands as values for key bindings, which avoids the need for
concatenating commands with ` ;; `.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
This changes the default configuration location for Home Manager
configurations from
$XDG_CONFIG_HOME/nixpkgs
to
$XDG_CONFIG_HOME/home-manager
The old location is still supported but using it will trigger a
warning message.
Fixes#3640
Currently translated at 100.0% (29 of 29 strings)
Add translation using Weblate (Ukrainian)
Co-authored-by: Dan <denqwerta@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/uk/
Translation: Home Manager/Home Manager CLI
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
Added a generator for the KDL document language.
This is in order for home-manager to natively generate
the new config format for zellij, as described in nix-community#3364.
There is not a one to one mapping between KDL and nix types,
but attrset translation is heavily based on KDLs JSON-IN-KDL microsyntax.
The exception here is the `_args` and `_props` arguments, which lets you
specify arguments and properties as described in the spec.
See more here:
- https://kdl.dev/
- https://github.com/kdl-org/kdl/blob/main/SPEC.md
The generator also conforms to the interface from the nixpkgs manual:
https://nixos.org/manual/nixpkgs/stable/#sec-generators
Co-authored-by: Gaetan Lepage <gaetan@glepage.com>
Install home-manager via `nix run` rather than `nix-build` then running
the activation script out of the store manually.
Co-authored-by: Cédric Barreteau <cbarrete@users.noreply.github.com>
Specifically, if the global per-user profiles path do not exist and we
cannot create it during the activation, then place our profile in the
Home Manager data directory. We prefer to use the global location,
though, since it makes it visible to `nix-collect-garbage`.
This is intended to improve compatibility with Nix version 2.14 and
later, which no longer creates the per-user directories.
Also, use the Home Manager data directory to manage the gcroot for the
current generation. It does not have to sit in the global per-user
gcroots directory since it should never be eligible for GC.
If used inside the NixOS/nix-darwin module, we get conflicting definitions
of `name` inside the specialization: one is the user name coming from the
NixOS module definition and the other is `configuration`, the name of this
option. Thus we need to explicitly wire the former into the module arguments.
See discussion at https://github.com/nix-community/home-manager/issues/3716
* exa: add more options
* exa: use `escapeShellArgs`
* exa: don't hardcode executable path in aliases
Prevents aliases from going stale in open terminals when the system is updated.
* exa: use `command` for self-referential alias
Otherwise fish complains about the recursive call.
Drop the aliases from ion shell since it doesn't implement the POSIX
`command` built-in.
* exa: re-add ion aliases
* exa: drop `command`
Fish doesn't complain about recursion if `exa` isn't escaped.
---------
Co-authored-by: Naïm Favier <n@monade.li>
The `-X` prevents that screen is cleared when showing a diff that's
larger than my screen.
I.e. when running `git diff` and press `q`, the last thing I want to see
is the prompt with `git diff` and *not* the part of the diff I browsed,
to be clear
$ git diff
$ <cursor>
Considering that this is somewhat opinionated, I decided to build an
option which allows you to pass arbitrary commands to the less
invocation.
Xsession (and hence ~/.xsession) is executed in bash but does not set
SHELL to the full path to bash. In case the user's login shell is
something other than bash then SHELL is set to that shell. Keychain
inspects the SHELL variable to find out what shell it has to generate
code for, so in .xsession it generates code for the user's login shell
instead for bash.
This change forces SHELL to bash for keychain when invoked from
.xsession, the same way it's done when generating keychain's code for
bash integration.
Closes#3693
Currently translated at 100.0% (32 of 32 strings)
Add translation using Weblate (Portuguese)
Co-authored-by: ssantos <ssantos@web.de>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pt/
Translation: Home Manager/Home Manager CLI
* vscode: add extensions.json file in extensions dir
This change generates an 'extensions.json` file the same way that
nixpkgs' vscode-with-extensions does, and makes sure it is placed in the
directory with the extensions.
* vscode: remove leftover trace
Co-authored-by: Naïm Favier <n@monade.li>
* vscode: fix adding extensions.json with mutable extension dir
Co-authored-by: Naïm Favier <n@monade.li>
* vscode: let vscode regenerate the mutable extensions.json
* Remove nixpkgs duplication; only apply on vscodes new enough to need it
* Use lib.versionAtLeast
Co-authored-by: Naïm Favier <n@monade.li>
* Format vscode.nix
---------
Co-authored-by: Naïm Favier <n@monade.li>
Allow modules to define systemd services on macOS. It won't actually
have any effect, but it would allow modules to define both systemd
services and launchd agents without boilerplate conditionals.
As a consequence of this change, each module would have to check for
compatibility with the OS target instead.
Internally we already managed them per-profile but exposed a global
option to maintain backwards compatibility. The benefit to having
per-profile extensions is quite large though, so it is time to switch.
Users of the global extensions option will get an error message that
indicates how to edit their configuration to work again.
Firefox internally only supports bool, int, and string types for
preferences, but often stores objects, arrays and floats as strings.
This change makes it nicer to specify those type of preferences in
Nix, and it also makes it possible to merge objects & arrays across
multiple modules.
This flag is useful to force Nix to re-fetch cached flakes. Without it,
you cannot deploy from a non-local flake in quick succession, since the
caching causes the flake to not be re-fetched.
This reflects a systemd service sample file change made in borgmatic
1.7.6, commit 2e9f70d49647d47fb4ca05f428c592b0e4319544:
When backing up a machine with a monitor using logind to control
idle timeout and things like DPMS, borgmatic can block the screen
from turning on/off with systemd-inhibit. This is because by
default systemd-inhibit will block
"idle:sleep:shutdown". Borgmatic does not need to care about idle,
only about suspend and shutdown. So, add an explicit `--what` flag
for what borgmatic should inhibit.
For more information see systemd-inhibit(1).
Some JVMs pass through `home` as a derivation rather than as a string, as `openjdk` does. Since the module option for session variables expects a string, this is a type error. I suspect that this incorrect, and have changed the assignment here to coerce the `cfg.package.home` attribute to a string to be safe.
After discussing with @NobbZ, we have decided it is best to mitigate this problem in HM rather than to make potentially breaking changes to Nixpkgs.
Please do mention if you think we ought to propose a change to Nixpkgs instead.
* home-manager: edit `homeManagerConfiguration` err
This adds https://nix-community.github.io/home-manager/release-notes.html#sec-release-22.11-highlights
to the homeManagerConfiguration arguments error.
* home-manager: `homeManagerConfiguration` indent
Moved URL of the release notes for 22.11 to the same line so that
./format doesn't add extra whitespace
---------
Co-authored-by: zaporter <opensource@zackporter.com>
Allow setting the application package and storePath used by the
config. Since the `programs.password-store` Home Manager module sets
config values via global environment variables, the default behavior
of the module should continue to behave as before for the user.
Additionally,
- Adds a few tests.
- Use "escapeShellArg" function call to the path parameter call to
ensure paths with spaces work.
- Allow not setting storePath, which will cause `pass_secret_service`
to default to using `~/.password-store`.
- If `pass-secret-service` is enabled, set its store path to default
to the one defined in our password-store environment settings.
- Add myself (houstdav000) as maintainer.
Fish shell doesn't require arguments to `eval` to be double quoted
like in a bash shell. At the moment doing so gives us the following
error:
~/.config/fish/config.fish (line 12): $(...) is not supported. In fish, please use '(/nix/store/8asq…)'.
eval "$(/nix/store/8asqgnhs89wzyjvs8p1n5hvxn7lkn9wa-opam-2.1.3/bin/opam env --shell=fish)"
^
from sourcing file ~/.config/fish/config.fish
called during startup
source: Error while reading file “/home/user/.config/fish/config.fish”
This commit fixes the above error.
- Fix paragraphs in option field texts containing Markdown.
- Fix generation of documentation for options with Markdown in
multiple fields.
- Support AsciiDoc in module option documentation.
Currently translated at 84.3% (27 of 32 strings)
Co-authored-by: Kornelijus Tvarijanavičius <kornelijus@tvaria.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/lt/
Translation: Home Manager/Home Manager CLI
The default value of `programs.ncmpcpp.mpdMusicDir` is taken from
`services.mpd.musicDirectory` if the mpd module is enabled, which has
type `either path str`. `programs.ncmpcpp.mpdMusicDir` did not accept
`str` values, though, so an error was raised when the default value was
used and `services.mpd.musicDirectory` was set to a value of type `str`.
This commit changes the type of `programs.ncmpcpp.mpdMusicDir` to also
accept `str` to reflect the type of `services.mpd.musicDirectory`.
Fixes#3560
* home-environment: use `lazyAttrsOf` for `home.sessionVariables`
`attrs` has unreasonable merge semantics and is deprecated. `attrsOf`
doesn't support variables depending on each other as is recommended in
the option's description.
* home-environment: restrict `sessionVariables` type
The consumer is `toString`, but we don't want to accept e.g. lists.
Assigning to `programs.neovim.extraLuaPackages` a function taking a lua package set as input
and returning a list of packages, as described in the documentation,
threw an error because the rest of the code assumed that the value was always a plain list.
Using `lib.types.coercedTo`, we can accept such functions, as per the documentation,
as well as plain lists, which we then convert to a function ignoring its input argument.
We print a warning when a plain list is assigned, since the function
form is preferred, as it ensures that the right lua package set is used.
For the lua packages, we also get the lua package set from the
finalPackage, to make sure that we are always using the same package set
as the actual unwrapped neovim package being built.
For `programs.neovim.extraPythonPackages` I did the same.
I updated the test case so that we test both ways of setting these options.
This enables nushell integration by default for direnv, similar to
bash/zsh/fish. The slightly verbose way of setting this is to ensure
that peoples' existing nushell configuration isn't overwritten, only
appended to, as would be the case if we just used the integration
example from the nushell docs:
https://www.nushell.sh/cookbook/direnv.htmlCloses#3520
When building from a flake, `nix build` hides the build output by
default, with a `-L`/`--print-build-logs` option to show it. Pass this
option along from `home-manager` if the user provides it.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Previously the nushell module did not differentiate between Linux and
Darwin when deciding where to place config files, whereas nushell
does. This commit fixes that.
The default value for `xsession.windowManager.herbstluftwm.tags` is an
empty list, but the config file uses `builtins.head` on it, which causes
an error upon evaluation. With this change the tags configuration is
skipped if the list is empty.
Depending on DHCP settings you might end up with different output from
running `hostname`. Eg, your local hostname is `mylaptop`, and your
home router is configured with a local domain of `.hoome.arpa`. In
this case:
$ hostname
mylaptop.home.arpa
$ hostname -s
mylaptop
If you then go to cafe which has its router configured with `.lan` as
its local domain. Then, if your DHCP settings accept the local domain
from the router,
$ hostname
myalaptop.lan
$ hostname -s
mylaptop
With the pre-existing behaviour, if you had a
`"me@mylaptop.home.arpa"` entry in `outputs.homeConfigurations`,
running `home-manager switch` would fail:
$ home-manager switch
error: flake 'git+file:///home/me/.config/nixpkgs' does not provide
attribute 'packages.aarch64-darwin.homeConfigurations."me".activationPackage',
'legacyPackages.aarch64-darwin.homeConfigurations."me".activationPackage'
or 'homeConfigurations."me".activationPackage'
After this commit, you can put configuration in a `"me@mylaptop"`
entry in `outputs.homeConfigurations`, and everything will work on
either network.
The previous variant used IFD to generate the `JAVA_HOME` variable and relied on internal hooks of the `java` package, this failed for a user cross compiling their configuration.
This PR changes that and uses the `home` attribute, as documented in the very last sentence of the https://nixos.org/manual/nixpkgs/stable/#sec-language-java chapter.
The old trigger would actually never cause a restart since the path
doesn't change. With this change the trigger is now using the actual
configuration path in the Nix store, which depends on the content.
While this is created to match `himalaya`’s configuration API, this
could easly be reused for other programs that consume the email module
by concatination the strings.
The previous version linked the file into home, then sourced that. Since
nothing else expects that file to be there, this is unnecessary.
Additionally, doing so made it impossible to test a built config without
switching, e.g. using `XDG_CONFIG_HOME=… nvim` or `nvim -u`. This
remedies that, at least for this particular reference.
To test this, change from asserting contents of the config file to
actually starting nvim, outputting sentinel values, and then asserting
their values are present. This way it’s tested that nvim loaded the
config, rather than that some config is in a specific place.
This is all in one commit as the test, as written now, would not have
worked before since the previously hard-coded home path was not an
actual file in the test environment.
Specifically, inform the command about the absolute path of
dbus-daemon. Otherwise it will try running dbus-daemon from PATH,
which may not always work.
PR #3405
* ssh: add generic Match support for matchBlocks
Introduce conservative support for actual `Match`
blocks in ssh config.
"Conservative" means this PR doesn'tt try to process
the `match` expression and simply uses it as a string
provided by the user.
If set, `match` has precedence over `host` meaning
if both are set, `match` is used and `host` is ignored.
* Add news entry
* flake: Expose tests to allow running purely
The existing way to run tests with `nix-shell` relies on impure usage of
`<nixpkgs>`. This can lead to failures when the local nixpkgs is
incompatible with the locked one. I.e., where CI is passing but a
contributor may experience a failure.
So, expose tests as `devShells.tests` to use the locked nixpkgs and
allow easy invocation via `nix develop`.
* tests: Remove impure path
With Nix 2.10+ and pure evaluation mode e.g.
```
nix run nixpkgs/nixos-unstable#nixVersions.nix_2_10 -- develop -i .#tests.zplug-modules
```
this test would fail with:
> error: the path '~/.customZplugHome' can not be resolved in pure mode
Since the test only cares that it is a path, rather than anything about
its contents, use a dummy empty directory.
Rather than reject a configuration when this option is set, just
silently ignore it when the platform isn't darwin. The name makes it
obvious that it won't be applied outside of darwin, and this allows
people to use the same configuration between hosts without any special concern.
Co-authored-by: Nicholas Sielicki <git@opensource.nslick.com>
This commit allows imperative management of "urls" file. It can be
useful if "urls" file is treated as a secret.
With this change, it's possible to provision "urls" via Syncthing,
agenix, sops-nix or other means, while still managing Newsboat
declaratively.
`--experimental-backends` flag was removed in the recent released picom
v10. Using it now will result in the program exiting.
v10 also introduces its counter-part, `--legacy-backends`. However this
will be removed soon. Instead of adding this as an separate option, add
`extraArgs` option so for those that they want they can pass it manuall.
It is also more future proof.
Previously, this module was all-or-nothing with its pre-defined user
dirs. This allows e.g. `xdg.userDirs.desktop = null;` to opt-out of
some configuration while still benefiting from the rest.
Starting with state version 22.11 we completely reset the PATH
variable in the activation script. This is to avoid impurities and
unexpected results if the activation script accidentally uses a
command found in the user's PATH.
When using the new style profiles we get conflicts when trying to
replace the old `home-path` derivation. To avoid this conflict we
delete the old `home-path` before the install.
Unfortunately, `nix profile` does not yet have a equivalent for
`nix-env --set` and we have to do this hackish workaround. See
https://github.com/NixOS/nix/issues/6349
for the associated issue in Nix.
Fixes#2848
Add a new Thunderbird module that uses the configuration in
`accounts.email.accounts` to setup SMTP and IMAP accounts.
Multiple profiles are not supported at this point.
- The `XDG_SESSION_TYPE` environment variable is used by some applications and frameworks to
detect wayland sessions (i.e qt5/6, electron/chromium). It is set by wlroots since version 0.13.0 [1].
- Propagating `XDG_SESSION_TYPE` to the systemd user environment is necessary when processes launched by
services (e.g emacs) need to inherit the environment variable.
[1] - 90c8452959
Update notification popups are annoying when vscode/vscodium is
managed by Home Manager. However, as these settings also require the
configuration to be managed via `userSettings`, they are disabled by
default.
This commits adds a file `hm-version` to the generated generation
directory. This file will contain the release version, and if
available, the Git commit hash.
With this change, it's now possible to configure the default search
engine in Firefox with
programs.firefox.profiles.<name>.search.default
and add custom engines with
programs.firefox.profiles.<name>.search.engines.
It's also recommended to enable
programs.firefox.profiles.<name>.search.force = true
since Firefox will replace the symlink for the search configuration on
every launch, but note that you'll loose any existing configuration by
enabling this.
Specifically, if `tput colors` fails with an error we treat that as if
the terminal does not support colors.
Fixes#423
Suggested-by: PhotonQuantum <self@lightquantum.me>
This will cache the output of `passwordCommand` per authentication
realm.
Context: the `credentials` key in `sbt` is a `TaskKey[Seq[Credentials]]`.
In `sbt`, tasks are evaluated on-demand and their output is not cached.
This particular key is referenced by all submodules in a project. When
the command is relatively expensive (e.g.: `pass show foo`), this
results in several seconds of delay when doing basic things like
`compile` or `test` which makes this unusable without some kind of
caching.
sbt allows overriding the default repositories to use to resolve
dependencies. This is often used with proxies and/or private
repositories to host internal packages.
This change adds a `repositories` attribute to `sbt` to allow
specifying the values that will go in `~/.sbt/repositories` file.
To support the above change we also deprecate the `baseConfigPath`
option in favour of `baseUserConfigPath` which points one level higher
by default. This allows not using relative paths to refer to the
top-level configuration directory.
Also adds tests for the new option and the deprecation of the previous
one.
At commit [5666e6b9](5666e6b9fb),
broot refactored the content of the file `/resources/default-conf.hjson`
into multiple files under the directory `/resources/default-conf`, using
[`imports`](5666e6b9fb/resources/default-conf/conf.hjson (L152-L165))
to refer to other configurations.
This refactoring is effective since version 1.14.0 of broot.
After this refactoring, in `xdg.configFile.broot` (which defaults to
`~/.config/broot`):
- we need to copy all potentially referenced files (all files under
`resources/default-conf`),
- except we need to leave out `conf.hjson` which conflicts with the
`conf.toml` generated by home-manager (because broot [accepts both conf.toml and conf.hjson](https://dystroy.org/broot/conf_file/))
To implement this, we use `symlinkJoin` to create the content of
`xdg.configFile.broot` by merging multiple sources.
* broot: use freeformType for config
* broot: use defaults from upstream
closes#2395
* broot: generate shell function
* broot: add @dermetfan to CODEOWNERS
* broot: rename `config` option to `settings`
* broot: make example more idiomatic
Co-authored-by: Nicolas Berbiche <nic.berbiche@gmail.com>
Co-authored-by: Nicolas Berbiche <nic.berbiche@gmail.com>
We change the current logic: instead of writing an init.vim which loads
lua/init-home-manager.lua, we write an init.lua that sources init.vim
This commit also avoids writing any of these files if the plugins have
no config.
Some configuration options can take space separated strings; for
example `SSLVersions` can be configured with multiple allowed
versions.
SSLVersions TLSv1.3 TLSv1.2
This can now be represented in Home Manager.
SSLVersions = [ “TLSv1.3” “TLSv1.2” ];
In implementing this change, it uses oneOf for config type, as it is a
cleaner way to represent the union than the nested eithers
formulation.
Also add SSLVersions to test lists of strings in
`account.extraConfig`.
Currently translated at 100.0% (32 of 32 strings)
Add translation using Weblate (Danish)
Co-authored-by: cafkafk <christina@cafkafk.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/da/
Translation: Home Manager/Home Manager CLI
In #587, kalbasit introduce the `-i` flag so the sudo invocation would
run in an environment with `HOME` set to the correct value for the
target user. This was necessary to be able to set up multiple users
without interfering with the invoking user's `HOME`.
In #807, I switched to `-s` instead because I managed to get an
invalid shell set for my user by switching `useUserPackages` from
`true` to `false` which changes the location where packages are
installed and `~/.nix-profile/bin/<my-shell>` was no longer valid.
This was based on the assumption that `SHELL` would be set to some
sensible value by Home Manager at this point. This turned out to be
false as reported in #2900.
In 0ced6d6d (this commit's parent at this time), I explicitly set
`SHELL` to `${pkgs.bash}` so it is definitely set to a good shell when
invoking the activation script.
However, #807 broke activation for multiple users, the original
motivation for `-i`, as reported in #2856. I fixed this in #2857 by
additionally passing `--set-home`.
Further discussion with rycee in #3040 made me realize that the
activation script already has a good Nix store bash shebang. So all
the problems have been caused, not by the shell used for the
activation script but by sudo trying to use a different shell at all.
`-i` uses the shell set in the `passwd` file for the target user, but
this can become invalid as happened to me. `-s` uses either `SHELL` if
it's defined or the invoking user's shell as set in the `passwd` file.
By explicitly setting this to a shell provided by Nix we make sure
we're not trying to launch a non-existent shell. However, we're
clearly already running in an existing shell and because of
`--set-home` we can activate other users properly so there's not
actually any need to try to have sudo start a different shell first,
it just adds an extra process that then goes on to run the activation
script with a good bash because of the shebang.
Dropping `-s` altogether and keeping `--set-home` should avoid all of
these issues.
In #807 I changed the flag passed to `sudo` from `-i` to `-s` so
`sudo` wouldn't use a non-existent shell defined in the `passwd` file.
kalbasit also reported in that PR that `-i` didn't work for them
anymore on an M1 Mac, presumably because Apple changed something in
newer versions of macOS.
Some users reported that this broke the behavior for them because
`SHELL` was set to a path that didn't even exist on their system. It's
unclear how this came to be but it shows that my assumption that
`SHELL` would be set to a reasonable shell by Home Manager at this
point in the activation is false.
As a way around this problem we can explicitly set `SHELL` when
running the activation script to a value that we know will be good,
like `${pkgs.bash}`.
One change in behavior this causes is that the activation script will
always be run by bash, not the user's shell. If the script is
generated by Home Manager this is fine since it can be generated
taking into account the supported set of functions and behaviors. If
the intent is for the activation script to possibly be run by non-bash
and even non-POSIX shells, like tcsh, ksh or Xonsh, then this fix will
not suffice. Turns out this is indeed an assumption made by Home
Manager, so this is the proper behavior.
Fixes#2900
If the user has enabled the XDG user directories module then we can
use the XDG music directory in the MPD module. Otherwise we'll leave
the option undefined so that the user is forced to define the
directory to use.
This applies to state version 22.11 and above.
Fixes#3225
Instead of referencing the `HOME` environment variable, use the
`home.homeDirectory` option. This allows other modules to reference an
XDG user directory without having to support shell syntax.
Units with
Install.RequiredBy = [ target ]
set will now be linked in the
${target}.requires
directory. Similar to how `Install.WantedBy` already causes a link in
the
${target}.wants
directory.
The `tag.gpgSign` config option was added in Git 2.23.0 and seems like
it should be set in addition to `commit.gpgSign` when
`programs.git.signing.signByDefault` is enabled
The GNU Privacy Guard 2.3 man page for `gpg-agent` describes the
`--grab` and `--no-grab` options as follows:
> Tell the pinentry to grab the keyboard and mouse. This option should
> be used on X-Servers to avoid X-sniffing attacks. Any use of the
> option --grab overrides an used option --no-grab. The default is
> --no-grab.
Therefore Home Manager should explicitly output `grab` when
`cfg.grabKeyboardAndMouse` is true. Previously Home Manager emitted
`no-grab` when `cfg.grabKeyboardAndMouse` was false.
PR #3192
everything is now covered by other settings that are more user friendly
than this big opaque attrset.
Also 'configure' wont do anything with nixpkgs-unstable the way HM
configures neovim. so no need to keep it, the deprecation warning is > 1
year old.
This adds support for configuring email accounts, with automatic smtp, imap,
sendmail (msmpt) and maildir (mbsync, offlineimap) setup in aerc,
via `accounts.email`.
- Fix name of file generated by `$ nix-build -A docs.manPages`.
- Note "Capitalize the subject line" as an exception to the seven
rules. Not even the example commit message (closely below this
change) follows this rule.
The XDG Desktop Entry spec mentions that multiple values per key may be
optionally terminated by a semicolon. An example for this is the Firefox
desktop file, which has no trailing semicolon. This breaks the sed regex
used in `mimeAssociations`.
Fix the regex by matching the end of string, optionally preceded by a
semicolon, or any other semicolon. This makes it work with both
semicolon-terminated and non-semicolon-terminated desktop files.
In the scenario where some XDG user directory is a symlink defined by
`home.file`, we want the symlink to be created before we try to
`mkdir -p` that directory, as it will then silently succeed. On the
other hand, if we create the directory first, creating the symlink
will fail.
We lose nothing by doing this as `linkGeneration` creates the
directories it needs.
This patch follows a similar patch[1] in nixpkgs. With this patch,
fish can complete manpages for programs installed through
home-manager, e.g., using home.packages.
[1]: https://github.com/NixOS/nixpkgs/pull/91794
Specifically,
- directly export `modules/lib/dag.nix` instead of renaming
attributes,
- run through utilities to reuse code where possible,
- expose `lib.hm.dag.isEntry` and reuse it in
`modules/lib/types-dag.nix`,
- reuse utilities through `lib` set instead of passing imports to
functions, and
- eta reduction of `map`, `entryAnywhere`, `entryAfter` and
`entryBefore`.
bash and zsh apparently handle command substitution slightly differently
than fish. in bash/zsh:
$ export FOO=x
$ FOO=y echo $(sh -c 'echo $FOO')
x
whereas in fish:
$ export FOO=x
$ FOO=y echo $(sh -c 'echo $FOO')
y
so we have to assign $SHELL within the substitution for bash and zsh.
The `services.picom.opacityRule` option was renamed to
`services.picom.opacityRules`.
This was missed in #2939
Signed-off-by: Sumner Evans <me@sumnerevans.com>
swayidle executes commands using "sh -c" and so its PATH must contain
a shell. This adds such PATH entry to the environment of the systemd
service.
Fixes#2811.
Removes the `uniq` constraint on `after` and `before` so that we can
merge multiple definitions for the same DAG entry:
{
dag = mkMerge [
{
foo = lib.hm.dag.entryBefore [ "bar" ] {
# definition 1
};
}
{
foo = lib.hm.dag.entryBefore [ "qux" ] {
# definition 2
};
}
{
foo = {
# definition 3
};
}
];
}
In this example `foo` will come before `bar` and `qux`.
This brings a few advantages:
- Use of float instead of strings to represent float values,
- Use of structure settings, and
- Better type checking for some settings
Also add thiagokokada as codeowner of picom.
Adds option settings, which writes settings to
.config/udiskie/config.yml.
Note, the option takes precedence against other options like notify,
automount or tray if they are configured in settings.program_options.
This simplifies the code a bit and avoids using experimental Flake
functionality. If Flakes become stable before NixOS 22.11 then we can
consider having nmd and nmt as Flake inputs. Maybe could then also
avoid the need for flake-compat.
Remove `stateVersion`, `username`, and `homeDirectory` as they can be
set in the configuration directly. Together with the previous commit,
this makes setting `stateVersion` explicitly mandatory.
Also replace `configuration` by `modules`, which expects a list of
Home Manager modules.
Also remove `system` which was made useless by #3028.
Currently we're maintaining a "mock" module made of sink options,
which requires updating whenever the definitions in the
nixos/nix-darwin modules change.
Instead, set `_module.check` to false so that definitions in those
modules are simply ignored.
Per the [docs], MCFLY_FUZZY is no longer a boolean, taking now a
positive integer that controls the fuzziness factor.
[docs]: https://github.com/cantino/mcfly#fuzzy-searching
Co-authored-by: Robert Helgesson <robert@rycee.net>
mujmap is a tool that synchronizes mail between a mail server and
notmuch via JMAP. It's very similar to lieer, so I heavily based the
implementation of the notmuch module on lieer's. I did not include an
equivalent to lieer's periodic synchronization service, however,
because I plan to soon introduce a daemon mode to mujmap.
https://github.com/elizagamedev/mujmap
The user should always explicitly set the state version they wish to
use. Indeed, the configuration generated by the Home Manager install
script has set this option for a long time. This removal should
therefore not affect many users.
Add services.emacs.startWithUserSession boolean to indicate that Emacs
must be started with the systemd user session. This is true by default
unless socket activation is also true.
In the past, the user had to choose between socket activation (to get
the Emacs service started when the user uses emacsclient) and
immediate start with the user session. When choosing immediate start
over socket activation and if the Emacs service is stopped at some
point, using emacsclient would start a new Emacs daemon but the
service would still be turned off. This situation would prevent
`home-manager switch` from completing successfully because it wouldn't
be able to start the Emacs service as Emacs is already running.
This new setting makes it possible to have both socket activation and
immediate start at the same time. In this scenario, Emacs is started
with the user session and, after the Emacs service is stopped, using
emacsclient starts the service again.
This new settings also makes it possible to have neither socket
activation nor immediate start.
Currently translated at 100.0% (32 of 32 strings)
Translate using Weblate (Catalan)
Currently translated at 12.5% (4 of 32 strings)
Co-authored-by: Leix b <abone9999@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ca/
Translation: Home Manager/Home Manager CLI
Currently translated at 100.0% (14 of 14 strings)
Add translation using Weblate (Catalan)
Co-authored-by: Leix b <abone9999@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/ca/
Translation: Home Manager/Home Manager Modules
* Add flake.lock and clean up flake.nix
Add a lockfile to work around https://github.com/NixOS/nix/issues/6541
(and because it's a good idea anyway).
Also use flake-utils, and restrict ourselves to the five platforms
supported by nixpkgs. Otherwise, the IFD for nmd fails on weird
platforms. This fixes `nix flake check`.
Remove the redundant `apps` output, see https://github.com/nix-community/home-manager/pull/2442#issuecomment-1133670487
* nixos,nix-darwin: factor out into a common module
* nixos,nix-darwin: make `home-managers.users` shallowly visible
Make sure the option is included in the NixOS/nix-darwin manual (but the
HM submodule options aren't).
Also add a static description to the HM submodule type so that we don't need to
evaluate the submodules just to build the option manual. This makes
nixos-search able to index the home-manager flake.
Also clean up some TODOs.
* flake: add nmd and nmt
This avoids having to use `pkgs.fetchFromGitLab` in an IFD, which causes
issues when indexing packages with nixos-search because `pkgs` is
instantiated with every platform.
The `getmail` package will soon be removed from nixpkgs. The
`nixos-unstable` channel already has it removed and using the service
will result in:
error: getmail has been removed from nixpkgs, migrate to getmail6
Upgrade to the getmail6 package which is already available and backwards
compatible.
M_SHARE is not a valid column on Darwin. It seems that previously htop
ignored unknown columns, but the current version does not display all
subsequent columns.
This is adapted from the `services.mopidy` NixOS module. The
difference is the setting can be configured with Nix language, taking
advantage of generators from nixpkgs. The module is also suited more
for user-specific configuration, removing the `extraConfigFiles` and
`dataDir` option.
- Change the example value of `gtk.theme.package` from
`pkgs.gnome.gnome_themes_standard` was an alias that was removed on 2022-01-13,
`pkgs.gnome-themes-extra`, which references the actual package.
- Change the example value of `gtk.icon.package` from `pkgs.adwaita-icon-theme` to
`pkgs.gnome.adwaita-icon-theme`, as this package is in the `gnome` package set.
* home.pointerCursor: init
The current architecture for cursor configurations is composed of individual
options for different backends. For example, X specific settings are managed under
`xsession.pointerCursor` and gtk specific settings are managed under `gtk.cursorTheme`.
While this architecture is modular, it causes duplication of similar structures for
each component. In theory, this provides flexibility because the components are independent
of each other which can be arranged in arbitrary ways to achieve the desired result.
However in practice, users wish to have one cursor theme applied to their entire system
The duplication of options correspond to duplication of settings on the user side and it
becomes a burden to keep track of all necessary settings.
This commit is an attempt to unify cursor configurations for different window systems and
GUI toolkits based on https://github.com/nix-community/home-manager/pull/2481#issuecomment-978917480.
`home.pointerCursor` is introduced as the interface for all cursor configurations.
It contain all options relevant to cursor themes with eneral options delcared under `home.pointerCursor.*`
and backend specific options declared under `home.pointerCursor.<backend>.*`. By default, a backend
independent configuration is generated. Backend specific configurations can be toggled via the
`home.pointerCursor.<backend>.enable` option for each backend. This was decided over using a
list of enums because it allows easy access to the state of the backend. Note generating different
cursor configurations for different backends is still possible by defining only `home.pointerCursor`
and managing the respective options manually.
* xcursor: migrate options to home.pointerCursor
- Removed `xession.pointerCursor` as x11 cursor configurations are now handled in `home.pointerCursor.x11`.
- Updated `meta.maintainer` field in `home.pointerCursor` and CODEOWNERS.
This module adds basic support for configuration specializations.
These allow the user to build multiple alternative configurations that
should be part of the same generation.
In esoteric setups, automatically setting GPG_TTY to current tty is not
desired on every shell startup. This change adds configuration options
to allow user to disable that if desired.
Neomutt will run the given command (which can be a string or a path)
and take the output from stdout and use it as the signature for your
email.
Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
Without this the journal will be filled by
xscreensaver[468297]: sh: line 1: xscreensaver-command: command not found
xscreensaver-systemd: 12:29:22: exec: "xscreensaver-command -quiet -deactivate" exited with status 127
Currently translated at 12.5% (4 of 32 strings)
Add translation using Weblate (Persian)
Co-authored-by: Artin Mobasher <mobasherartin.icm@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fa/
Translation: Home Manager/Home Manager CLI
Constrain the pgrep command to only return results for the current user.
Additionally, quote the socket variables to prevent splitting.
Previously, if multiple users on a system were running `sway`, the
`pgrep` used in finding `swaySocket` would return multiple results. As a
result, reloads of sway would fail.
Fixes#2912.
This commit appends system-wide icon and pixmap directory and the icon
directory in the home-manager profile to the XCURSOR_PATH session variable
for the generic linux target. This is necessary because the default prefix
for libXcursor resolves to the Nix store which excludes the aforementioned
directories from being searched for cursor themes. [1]
[1] - https://github.com/nix-community/home-manager/pull/2891#issuecomment-1101064521.
This convenience function allows automatic assignment of a package's
associations to `xdg.mimeApps.defaultApplications`.
For example,
xdg.mimeApps.defaultApplications =
config.lib.xdg.mimeAssociations [ pkgs.gnome.evince ];
Co-authored-by: Ryan Trinkle <ryan@trinkle.org>
`modulesPath` is usually used with antiquotation
(`"${modulesPath}/some-module.nix"`). Since antiquoted paths are copied
to the Nix store, one must explicitly do `"${toString
modulesPath}/some-module.nix"` to avoid that. Ideally `modulesPath`
should be a string to avoid this. Note that `modulesPath` is already
defined as a string in <home-manager>/modules/default.nix and
<nixpkgs>/nixos/lib/eval-config.nix.
When processing `publicKeys` entries, handle entries that contain
multiple public keys (i.e. gpg --show-key returns multiple `pub`
lines) properly, setting the trust level for each key.
PR #2897
This makes it a lot easier to access the `pkgs` that would be used to
build the home configuration, e.g.
nix build ./dotfiles#homeConfigurations."user@host".pkgs.vim
This is useful as it allows access to a Nixpkgs that has been
instiantiated with config and overlays.
Removed by upstream since commit:
bcbc410c92
This commit is included since v9 release:
https://github.com/yshui/picom/releases/tag/v9https://github.com/yshui/picom/releases/tag/v9-rc1 (the actual changelog)
While this doesn't break the config per see, it results in the
following warning in the logs:
[ DD/MM/YYYY HH:MM:SS.mmm parse_config_libconfig WARN ] The
refresh-rate option has been deprecated. Please remove it from
your configuration file. If you encounter any problems without
this feature, please feel free to open a bug report
Beside the above change we also remove an old workaround and also
write the configuration file to a well-known location in the user's
home directory.
The code that is being evaled without the `--print-full-init` flag is
this:
```sh
__main() {
local major="${BASH_VERSINFO[0]}"
local minor="${BASH_VERSINFO[1]}"
if ((major > 4)) || { ((major == 4)) && ((minor >= 1)); }; then
source <(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init)
else
source /dev/stdin <<<"$(/nix/store/...-starship-1.3.0/bin/starship init bash --print-full-init)"
fi
}
__main
unset -f __main
```
This code checks for bash version >= 4.1 , which has been released in
2009. Since this version is widely unavailable in nixpkgs, we can skip
one program invocation and directly call `starship init bash
--print-full-init`.
This is achieved by generating the Home Manager configuration
file as `~/.config/task/home-manager-taskrc`, and including that
file into ~/.config/task/taskrc.
Fixes#2360
Co-authored-by: mainrs <5113257+mainrs@users.noreply.github.com>
Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
* systemd: fix creation of user service unit files
* helix: fix failing test due to file output format change
Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
It can happen in some cases that home-manager first runs before gpg
creates its homedir, and it creates it with 755 permissions which the
user then needs to change by hand.
Do this in the module instead: before linking files, make sure the
homedir exists, and if it doesn't, create it with the right permissions.
Changed option types to `either str path` to allow using path values.
The related session variable is defined for the default and the extra
user directories now.
Changing from `sudo -i` to `sudo -s` messes up activation when multiple
users are managed. `--set-home` should have similar behavior to `-i` in
that the activation script is run from the user's home directory.
Fixes#2856
Currently activation is run with `sudo -i` this defaults to the user's
login shell. This can lead to problems if the user's shell isn't set
properly.
By passing `-s` rather than `-i`, `sudo` runs `activate` in `SHELL`
instead. We assume that at this point in the activation `SHELL`
contains the path to a bash in the nix store. This should always be a
valid shell to run the `activate` script with.
From the `sudo` manual it seems like this cannot be fixed if `SHELL`
isn't set at this point or by passing a command to `-s` because that
command is then passed to the user's shell.
This makes definitions like
home.activation.foo = mkIf false "bar"
work, where previously they would complain about
`home.activation.foobar.data` being used but not defined.
The crucial part is that we don't call `convertAllToDags` in
`dagOf.merge`, because we need to process `mkIf`/`mkMerge` properties
first. So we let `attrEquivalent.merge` do its job normally, but give
it a type `dagEntryOf` that does the conversion.
Ideally this shouldn't require so much boilerplate; I'd like to
implement something like
types.changeInto dagContentType elemType dagEntryAnywhere
in Nixpkgs.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
Before enabling dconf in Home Manager, dconf must be enabled in system
config.
Otherwise it will fail like this:
```
$ home-manager switch
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
replacing old 'home-manager-path'
installing 'home-manager-path'
Activating dconfSettings
error: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit dconf.service not found.
```
This would give the error "attempt to call something which is not a
function but a list" given that `optionals a b` returns a list. `indent`
is the one taking this empty set as second argument.
2022-03-22 14:04:28 -06:00
1461 changed files with 56140 additions and 15386 deletions
@ -23,7 +23,7 @@ Also make sure to read the guidelines found at
- [ ] Code formatted with `./format`.
- [ ] Code tested through `nix-shell --pure tests -A run.all`.
- [ ] 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).
@ -35,10 +35,15 @@ Also make sure to read the guidelines found at
{long description}
```
See [CONTRIBUTING](https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
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).
- [ ] Added myself and the module files to `.github/CODEOWNERS`.
#### 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.
Contributions to Home Manager are very welcome. To make the process as smooth as possible for both you and the Home Manager maintainers we provide some guidelines that we ask you to follow. See <<sec-contrib-getting-started>> for information on how to set up a suitable development environment and <<sec-guidelines>> for the actual guidelines.
This text is mainly directed at those who would like to make code contributions to Home Manager. If you just want to report a bug then first look among the already {open-issues}[open issues], if you find one matching yours then feel free to comment on it to add any additional information you may have. If no matching issue exists then go to the {new-issue}[new issue] page and write a description of your problem. Include as much information as you can, ideally also include relevant excerpts from your Home Manager configuration.
[[sec-contrib-getting-started]]
=== Getting started
If you have not previously forked Home Manager then you need to do that first. Have a look at GitHub's {fork-a-repo}[Fork a repo] for instructions on how to do this.
Once you have a fork of Home Manager you should create a branch starting at the most recent `master` branch. Give your branch a reasonably descriptive name. Commit your changes to this branch and when you are happy with the result and it fulfills <<sec-guidelines>> then push the branch to GitHub and {create-a-pull-request}[create a pull request].
Assuming your clone is at `$HOME/devel/home-manager` then you can make the `home-manager` command use it by either
1. overriding the default path by using the `-I` command line option:
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
If you are uncertain how these rules affect the change you would like to make then feel free to start a discussion in the {irc-home-manager}[#home-manager] IRC channel, ideally before you start developing.
[[sec-guidelines-back-compat]]
==== Maintain backward compatibility
Your contribution should not cause another user's existing configuration to break unless there is a very good reason and the change should be announced to the user through an {assertions}[assertion] or similar.
Remember that Home Manager is used in many different environments and you should consider how your change may effect others. For example,
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
- Does your change work for people whose configuration is built on one system and deployed on another system?
[[sec-guidelines-forward-compat]]
==== Keep forward compatibility in mind
The master branch of Home Manager tracks the unstable channel of Nixpkgs, which may update package versions at any time. It is therefore important to consider how a package update may affect your code and try to reduce the risk of breakage.
The most effective way to reduce this risk is to follow the advice in <<sec-guidelines-valuable-options>>.
[[sec-guidelines-valuable-options]]
==== Add only valuable options
When creating a new module it is tempting to include every option supported by the software. This is _strongly_ discouraged. Providing many options increases maintenance burden and risk of breakage considerably. This is why only the most {valuable-options}[important software options] should be modeled explicitly. Less important options should be expressible through an `extraConfig` escape hatch.
A good rule of thumb for the first implementation of a module is to only add explicit options for those settings that absolutely must be set for the software to function correctly. It follows that a module for software that provides sensible default values for all settings would require no explicit options at all.
If the software uses a structured configuration format like a JSON, YAML, INI, TOML, or even a plain list of key/value pairs then consider using a `settings` option as described in {rfc-42}[Nix RFC 42].
[[sec-guidelines-add-tests]]
==== Add relevant tests
If at all possible, make sure to add new tests and expand existing tests so that your change will keep working in the future. See <<sec-tests>> for more information about the Home Manager test suite.
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
The HTML version of the manual containing both the module option descriptions and the documentation of Home Manager can be generated and opened by typing the following in a shell within a clone of the Home Manager Git repository:
When you have made changes to a module, it is a good idea to check that the man page version of the module options looks good:
[source,console]
$ nix-build -A docs.manPages
$ man ./result/share/man/man5/home-configuration.nix.5
==== Add yourself as a module maintainer
Every new module _must_ include a named maintainer using the `meta.maintainers` attribute. If you are a user of a module that currently lacks a maintainer then please consider adopting it.
If you are present in the NixOS maintainer list then you can use that entry. If you are not then you can add yourself to `modules/lib/maintainers.nix` in the Home Manager project.
Also add yourself to `.github/CODEOWNERS` as owner of the associated module files, including the test files. You will then be automatically added as a reviewer on any new pull request that touches your files.
Maintainers are encouraged to join the IRC channel and participate when they have opportunity.
[[sec-guidelines-code-style]]
==== Format your code
Make sure your code is formatted as described in <<sec-code-style>>. To maintain consistency throughout the project you are encouraged to browse through existing code and adopt its style also in new code.
[[sec-guidelines-commit-message-style]]
==== Format your commit messages
Similar to <<sec-guidelines-code-style>> we encourage a consistent commit message format as described in <<sec-commit-style>>.
[[sec-guidelines-news-style]]
==== Format your news entries
If your contribution includes a change that should be communicated to users of Home Manager then you can add a news entry. The entry must be formatted as described in <<sec-news>>.
When new modules are added a news entry should be included but you do not need to create this entry manually. The merging maintainer will create the entry for you. This is to reduce the risk of merge conflicts.
[[sec-guidelines-conditional-modules]]
==== Use conditional modules and news
Home Manager includes a number of modules that are only usable on some of the supported platforms. The most common example of platform specific modules are those that define systemd user services, which only works on Linux systems.
If you add a module that is platform specific then make sure to include a condition in the `loadModule` function call. This will make the module accessible only on systems where the condition evaluates to `true`.
Similarly, if you are adding a news entry then it should be shown only to users that may find it relevant, see <<sec-news>> for a description of conditional news.
[[sec-guidelines-licensing]]
==== Mind the license
The Home Manager project is covered by the MIT license and we can only accept contributions that fall under this license, or are licensed in a compatible way. When you contribute self written code and documentation it is assumed that you are doing so under the MIT license.
A potential gotcha with respect to licensing are option descriptions. Often it is convenient to copy from the upstream software documentation. When this is done it is important to verify that the license of the upstream documentation allows redistribution under the terms of the MIT license.
[[sec-commit-style]]
=== Commits
The commits in your pull request should be reasonably self-contained, that is, each commit should make sense in isolation. In particular, you will be asked to amend any commit that introduces syntax errors or similar problems even if they are fixed in a later commit.
The commit messages should follow the {seven-rules}[seven rules]. We also ask you to include the affected code component or module in the first line. That is, a commit message should follow the template
----
{component}: {description}
{long description}
----
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
Finally, when adding a new module, say `programs/foo.nix`, we use the fixed commit format `foo: add module`. You can, of course, still include a long description if you wish.
[[sec-code-style]]
=== Code Style
The code in Home Manager is formatted by the {nixfmt}[nixfmt] tool and the formatting is checked in the pull request tests. Run the `format` tool inside the project repository before submitting your pull request.
Keep lines at a reasonable width, ideally 80 characters or less. This also applies to string literals.
We prefer `lowerCamelCase` for variable and attribute names with the accepted exception of variables directly referencing packages in Nixpkgs which use a hyphenated style. For example, the Home Manager option `services.gpg-agent.enableSshSupport` references the `gpg-agent` package in Nixpkgs.
[[sec-news]]
=== News
Home Manager includes a system for presenting news to the user. When making a change you, therefore, have the option to also include an associated news entry. In general, a news entry should only be added for truly noteworthy news. For example, a bug fix or new option does generally not need a news entry.
If you do have a change worthy of a news entry then please add one in {news-nix}[`news.nix`] but you should follow some basic guidelines:
- The entry timestamp should be in ISO-8601 format having "+00:00" as time zone. For example, "2017-09-13T17:10:14+00:00". A suitable timestamp can be produced by the command
+
[source,console]
$ date --iso-8601=second --universal
- The entry condition should be as specific as possible. For example, if you are changing or deprecating a specific option then you could restrict the news to those users who actually use this option.
- Wrap the news message so that it will fit in the typical terminal, that is, at most 80 characters wide. Ideally a bit less.
- Unlike commit messages, news will be read without any connection to the Home Manager source code. It is therefore important to make the message understandable in isolation and to those who do not have knowledge of the Home Manager internals. To this end it should be written in more descriptive, prose like way.
- If you refer to an option then write its full attribute path. That is, instead of writing
+
----
The option 'foo' has been deprecated, please use 'bar' instead.
----
+
it should read
+
----
The option 'services.myservice.foo' has been deprecated, please
use 'services.myservice.bar' instead.
----
- A new module, say `foo.nix`, should always include a news entry that has a message along the lines of
+
----
A new module is available: 'services.foo'.
----
+
If the module is platform specific, e.g., a service module using systemd, then a condition like
+
[source,nix]
condition = hostPlatform.isLinux;
+
should be added. If you contribute a module then you don't need to add this entry, the merger will create an entry for you.
[[sec-tests]]
=== Tests
Home Manager includes a basic test suite and it is highly recommended to include at least one test when adding a module. Tests are typically in the form of "golden tests" where, for example, a generated configuration file is compared to a known correct file.
It is relatively easy to create tests by modeling the existing tests, found in the `tests` project directory.
The full Home Manager test suite can be run by executing
[source,console]
$ nix-shell --pure tests -A run.all
in the project root. List all test cases through
[source,console]
$ nix-shell --pure tests -A list
and run an individual test, for example `alacritty-empty-settings`, through
[source,console]
$ nix-shell --pure tests -A run.alacritty-empty-settings
=== Why is there a collision error when switching generation?
Home Manager currently installs packages into the user environment, precisely as if the packages were installed through `nix-env--install`. This means that you will get a collision error if your Home Manager configuration attempts to install a package that you already have installed manually, that is, packages that shows up when you run `nix-env--query`.
For example, imagine you have the `hello` package installed in your environment
[source,console]
----
$ nix-env --query
hello-2.10
----
and your Home Manager configuration contains
[source,nix]
----
home.packages = [ pkgs.hello ];
----
Then attempting to switch to this configuration will result in an error similar to
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'*'`.
Home Manager is only able to set session variables automatically if it manages your Bash, Z shell, or fish shell configuration. To enable such management you use <<opt-programs.bash.enable>>, <<opt-programs.zsh.enable>>, or <<opt-programs.fish.enable>>.
If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells. For fish shell, it is possible to source it using {foreign-env}[the foreign-env plugin]
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
For example, if you have two machines, called "kronos" and "rhea" on which you want to configure your user "jane" then you could create the files
- `kronos-jane.nix`,
- `rhea-jane.nix`, and
- `common.nix`
in your repository. On the kronos and rhea machines you can then make `~jane/.config/nixpkgs/home.nix` be a symbolic link to the corresponding file in your configuration repository.
The `kronos-jane.nix` and `rhea-jane.nix` files follow the format
[source,nix]
----
{ ... }:
{
imports = [ ./common.nix ];
# Various options that are specific for this machine/user.
}
----
while the `common.nix` file contains configuration shared across the two logins. Of course, instead of just a single `common.nix` file you can have multiple ones, even one per program or service.
You can get some inspiration from the {post-your-homenix}[Post your home-manager home.nix file!] Reddit thread.
=== Why do I get an error message about `ca.desrt.dconf`?
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
[source,nix]
programs.dconf.enable = true;
to your system configuration.
=== How do I install packages from Nixpkgs unstable?
If you are using a stable version of Nixpkgs but would like to install some particular packages from Nixpkgs unstable – or some other channel – then you can import the unstable Nixpkgs and refer to its packages within your configuration. Something like
[source,nix]
----
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
home.packages = [
pkgsUnstable.foo
];
# …
}
----
should work provided you have a Nix channel called `nixpkgs-unstable`.
You can add the `nixpkgs-unstable` channel by running
By default Home Manager will install the package provided by your chosen `nixpkgs` channel but occasionally you might end up needing to change this package. This can typically be done in two ways.
1. If the module provides a `package` option, such as `programs.beets.package`, then this is the recommended way to perform the override. For example,
.\" disable justification (adjust text to left margin only)
.adl
.\" enable line breaks after slashes
.cflags4/
.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\&.
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
.ItCmFlbArextension
.RS4
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
.ifn\{\
.RS4
.\}
.nf
$ \fBhome\-manager \-b bck switch\fR
.fi
.ifn\{\
.RE
.\}
.sp
will cause a colliding file
~/\&.config/foo\&.conf
to be moved to
~/\&.config/foo\&.conf\&.bck\&.
.RE
.Pp
.ItCmFlfArpath,Fl-fileArpath
.RS4
Indicates the path to the Home Manager configuration file. If not given,
$XDG_CONFIG_HOME/home-manager/home.nix
is used.
.RE
.Pp
.ItCmFlh,Fl-help
.RS4
Prints usage information for the
\fBhome\-manager\fR
tool.
.RE
.Pp
.ItCmFl-version
.RS4
Prints the version number of the
\fBhome\-manager\fR
tool.
.RE
.Pp
.ItCmFln,Fl-dry-run
.RS4
Perform a dry-run of the given operation, only prints what actions would be taken.
.RE
.Pp
.ItCmFl-optionArnameArvalue
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFl-coresArnumber
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFljArnumber,Fl-max-jobsArnumber
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.\" TODO
.Pp
.ItCmFl-debug
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFl-impure
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFl-keep-failed
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFl-keep-going
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFlL,Fl-print-build-logs
.RS4
Passed on to
\fBnix build\fR()
when building from a flake\&.
.RE
.Pp
.ItCmFl-show-trace
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFl-(no-)substitute
.RS4
Passed on to
\fBnix-build\fR(1)\&.
.RE
.Pp
.ItCmFl-no-out-link
.RS4
Passed on to
\fBnix-build\fR(1)
when running
\fBhome\-manager build\fR\&.
.RE
.Pp
.ItCmFl-refresh
.RS4
Passed on to
\fBnix-build\fR(1)
.RE
.Pp
.ItCmFlv,Fl-verbose
.RS4
Activates verbose output\&.
.RE
.El
.ShFILES
.Pp
$XDG_DATA_HOME/home\-manager/news\-read\-ids
.RS4
Identifiers of news items that have been shown\&. Can be deleted to reset the read news indicator\&.
.RE
.ShBUGS
.Pp
Please report any bugs on the
\m[blue]\fBproject issue tracker\fR\m[]\&.
.ShSEEALSO
.Pp
\fBhome-configuration.nix\fR(5)
.ShAUTHOR
.Pp
\fBHome Manager contributors\fR
.RS4
Author.
.RE
.ShCOPYRIGHT
.br
Copyright \(co 2017\(en2022 Home Manager contributors
# 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.
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
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).
The 20.09 release branch became the stable branch in late September, 2020.
[[sec-release-20.09-highlights]]
=== Highlights
This release has the following notable changes:
* Nothing has happened.
[[sec-release-20.09-state-version-changes]]
=== State Version Changes
The state version in this release includes the changes below. These
changes are only active if the `home.stateVersion` option is set to
"20.09" or later.
* The options <<opt-home.homeDirectory>> and <<opt-home.username>> no
longer have default values and must therefore be provided in your
configuration. Previously their values would default to the content of
the environment variables `HOME` and `USER`, respectively.
+
--
Further, the options <<opt-xdg.cacheHome>>, <<opt-xdg.configHome>>,
and <<opt-xdg.dataHome>> will no longer be affected by the
`XDG_CACHE_HOME`, `XDG_CONFIG_HOME`, and `XDG_DATA_HOME` environment
variables. They now unconditionally default to
- `"${config.home.homeDirectory}/.cache"`,
- `"${config.home.homeDirectory}/.config"`, and
- `"${config.home.homeDirectory}/.local/share"`.
If you choose to switch to state version 20.09 then you must set these
options if you use non-default XDG base directory paths.
The initial configuration generated by
[source,console]
$ nix-shell '<home-manager>' -A install
will automatically include these options, when necessary.
--
* Git's `smtpEncryption` option is now set to `tls` only if both <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> and <<opt-accounts.email.accounts.\_name_.smtp.tls.useStartTls>> are `true`. If only <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> is `true`, `ssl` is used instead.
* The `nixpkgs` module no longer references `<nixpkgs>`. Before it would do so when building the `pkgs` module argument. Starting with state version 20.09, the `pkgs` argument is instead built from the same Nixpkgs that was used to initialize the Home Manager modules. This is useful, for example, when using Home Manager within a Nix Flake. If you want to keep using `<nixpkgs>` with state version ≥ 20.09 then add
+
[source,nix]
_module.args.pkgsPath = <nixpkgs>;
+
to your Home Manager configuration.
* The options `wayland.windowManager.sway.config.bars` and `opt-xsession.windowManager.i3.config.bars` have been changed so that most of the suboptions are now nullable and default to `null`. The default for these two options has been changed to manually set the old defaults for each suboption. The overall effect is that if the `bars` options is not set, then the default remains the same. On the other hand, something like:
* Rofi version 1.7.0 removed many options that were used by the module and replaced them with custom themes, which are more flexible and powerful.
+
You can replicate your old configuration by moving those options to <<opt-programs.rofi.theme>>. Keep in mind that the syntax is different so you may need to do some changes.
* Taskwarrior version 2.6.0 respects XDG Specification for the config file now.
Option <<opt-programs.taskwarrior.config>> and friends now generate the config file at
`$XDG_CONFIG_HOME/task/taskrc` instead of `~/.taskrc`.
[[sec-release-21.11-state-version-changes]]
=== State Version Changes
The state version in this release includes the changes below. These
changes are only active if the `home.stateVersion` option is set to
"21.11" or later.
* The <<opt-home.keyboard>> option now defaults to `null`, meaning that Home Manager won't do any keyboard layout management. For example, `setxkbmap` won't be run in X sessions.
* The <<opt-programs.pet.settings>> option no longer place its value inside a `General` attribute.
For example,
+
[source,nix]
programs.pet.settings.editor = "nvim";
+
becomes
+
[source,nix]
programs.pet.settings.General.editor = "nvim";
* The <<opt-programs.waybar.settings>> option now allows defining modules directly under <<opt-programs.waybar.settings>>.
Your use of Home Manager is centered around the configuration file, which is typically found at `~/.config/nixpkgs/home.nix`.
This configuration file can be _built_ and _activated_.
Building a configuration produces a directory in the Nix store that contains all files and programs that should be available in your home directory and Nix user profile, respectively. The build step also checks that the configuration is valid and it will fail with an error if you, for example, assign a value to an option that does not exist or assign a value of the wrong type. Some modules also have custom assertions that perform more detailed, module specific, checks.
Concretely, if your configuration contains
[source,nix]
programs.emacs.enable = "yes";
then building it, for example using `home-manager build`, will result in an error message saying something like
[source,console]
----
$ home-manager build
error: A definition for option `programs.emacs.enable' is not of type `boolean'. Definition values:
- In `/home/jdoe/.config/nixpkgs/home.nix': "yes"
(use '--show-trace' to show detailed location information)
----
The message indicates that you must provide a Boolean value for this option, that is, either `true` or `false`. The documentation of each option will state the expected type, for <<opt-programs.emacs.enable>> you will see ``Type: boolean''. You there also find information about the default value and a description of the option. You can find the complete option documentation in <<ch-options>> or directly in the terminal by running
[source,console]
man home-configuration.nix
Once a configuration is successfully built, it can be activated. The activation performs the steps necessary to make the files, programs, and services available in your user environment. The `home-manager switch` command performs a combined build and activation.
[[sec-usage-configuration]]
=== Configuration Example
A fresh install of Home Manager will generate a minimal `~/.config/nixpkgs/home.nix` file containing something like
[source,nix]
----
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "jdoe";
home.homeDirectory = "/home/jdoe";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
----
You can use this as a base for your further configurations.
[NOTE]
If you are not very familiar with the Nix language and NixOS modules then it is encouraged to start with small and simple changes. As you learn you can gradually grow the configuration with confidence.
As an example, let us expand the initial configuration file to also install the htop and fortune packages, install Emacs with a few extra packages available, and enable the user gpg-agent service.
To satisfy the above setup we should elaborate the `home.nix` file as follows:
[source,nix]
----
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "jdoe";
home.homeDirectory = "/home/jdoe";
# Packages that should be installed to the user profile.
home.packages = [ <1>
pkgs.htop
pkgs.fortune
];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.emacs = { <2>
enable = true;
extraPackages = epkgs: [
epkgs.nix-mode
epkgs.magit
];
};
services.gpg-agent = { <3>
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
}
----
<1> Nixpkgs packages can be installed to the user profile using <<opt-home.packages>>.
<2> The option names of a program module typically start with `programs.<package name>`.
<3> Similarly, for a service module, the names start with `services.<package name>`. Note in some cases a package has both programs _and_ service options – Emacs is such an example.
To activate this configuration you can run
[source,console]
home-manager switch
or if you are not feeling so lucky,
[source,console]
home-manager build
which will create a `result` link to a directory containing an
activation script and the generated home directory files.
[[sec-usage-rollbacks]]
=== Rollbacks
While the `home-manager` tool does not explicitly support rollbacks at the moment it is relatively easy to perform one manually. The steps to do so are
1. Run `home-manager generations` to determine which generation you wish to rollback to:
+
[source,console]
----
$ home-manager generations
2018-01-04 11:56 : id 765 -> /nix/store/kahm1rxk77mnvd2l8pfvd4jkkffk5ijk-home-manager-generation
2018-01-03 10:29 : id 764 -> /nix/store/2wsmsliqr5yynqkdyjzb1y57pr5q2lsj-home-manager-generation
2018-01-01 12:21 : id 763 -> /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation
2017-12-29 21:03 : id 762 -> /nix/store/6c0k1r03fxckql4vgqcn9ccb616ynb94-home-manager-generation
2017-12-25 18:51 : id 761 -> /nix/store/czc5y6vi1rvnkfv83cs3rn84jarcgsgh-home-manager-generation
…
----
2. Copy the Nix store path of the generation you chose, e.g.,
To configure programs and services Home Manager must write various things to your home directory. To prevent overwriting any existing files when switching to a new generation, Home Manager will attempt to detect collisions between existing files and generated files. If any such collision is detected the activation will terminate before changing anything on your computer.
For example, suppose you have a wonderful, painstakingly created `~/.config/git/config` and add
[source,nix]
----
{
# …
programs.git = {
enable = true;
userName = "Jane Doe";
userEmail = "jane.doe@example.org";
};
# …
}
----
to your configuration. Attempting to switch to the generation will then result in
[source,console]
----
$ home-manager switch
…
Activating checkLinkTargets
Existing file '/home/jdoe/.config/git/config' is in the way
Please move the above files and try again
----
[[sec-usage-graphical]]
=== Graphical services
Home Manager includes a number of services intended to run in a graphical session, for example `xscreensaver` and `dunst`. Unfortunately, such services will not be started automatically unless you let Home Manager start your X session. That is, you have something like
[source,nix]
----
{
# …
services.xserver.enable = true;
# …
}
----
in your system configuration and
[source,nix]
----
{
# …
xsession.enable = true;
xsession.windowManager.command = "…";
# …
}
----
in your Home Manager configuration.
[[sec-updating]]
=== Updating
If you have installed Home Manager using the Nix channel method
then updating Home Manager is done by first updating the channel.
You can then switch to the updated Home Manager environment.
The module system in Home Manager is based entirely on the NixOS module system so we will here only highlight aspects that are specific for Home Manager. For information about the module system as such please refer to the {writing-nixos-modules}[Writing NixOS Modules] chapter of the NixOS manual.
Overall the basic option types are the same in Home Manager as NixOS. A few Home Manager options, however, make use of custom types that are worth describing in more detail. These are the option types `dagOf` and `gvariant` that are used, for example, by <<opt-programs.ssh.matchBlocks>> and <<opt-dconf.settings>>.
`hm.types.dagOf`::
Options of this type have attribute sets as values where each member is a node in a {wikipedia-dag}[directed acyclic graph] (DAG). This allows the attribute set entries to express dependency relations among themselves. This can, for example, be used to control the order of match blocks in a OpenSSH client configuration or the order of activation script blocks in <<opt-home.activation>>.
+
A number of functions are provided to create DAG nodes. The functions are shown below with examples using an option `foo.bar` of type `hm.types.dagOf types.int`.
+
`hm.dag.entryAnywhere (value: T)`:::
Indicates that `value` can be placed anywhere within the DAG. This is also the default for plain attribute set entries, that is
+
[source,nix]
----
foo.bar = {
a = hm.dag.entryAnywhere 0;
}
----
+
and
+
[source,nix]
----
foo.bar = {
a = 0;
}
----
+
are equivalent.
+
`hm.dag.entryAfter (afters: list string) (value: T)`:::
Indicates that `value` must be placed _after_ each of the attribute names in the given list. For example
+
[source,nix]
----
foo.bar = {
a = 0;
b = hm.dag.entryAfter [ "a" ] 1;
}
----
+
would place `b` after `a` in the graph.
+
`hm.dag.entryBefore (befores: list string) (value: T)`:::
Indicates that `value` must be placed _before_ each of the attribute names in the given list. For example
+
[source,nix]
----
foo.bar = {
b = hm.dag.entryBefore [ "a" ] 1;
a = 0;
}
----
+
would place `b` before `a` in the graph.
+
`hm.dag.entryBetween (befores: list string) (afters: list string) (value: T)`:::
Indicates that `value` must be placed _before_ the attribute names in the first list and _after_ the attribute names in the second list. For example
+
[source,nix]
----
foo.bar = {
a = 0;
c = hm.dag.entryBetween [ "b" ] [ "a" ] 2;
b = 1;
}
----
+
would place `c` before `b` and after `a` in the graph.
`hm.types.gvariant`::
This type is useful for options representing {gvariant-description}[GVariant] values. The type accepts all primitive GVariant types as well as arrays and tuples. Dictionaries are not currently supported.
+
To create a GVariant value you can use a number of provided functions. Examples assume an option `foo.bar` of type `hm.types.gvariant`.
+
`hm.gvariant.mkBoolean (v: bool)`:::
Takes a Nix value `v` to a GVariant `boolean` value. Note, Nix booleans are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkBoolean true;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = true;
----
`hm.gvariant.mkString (v: string)`:::
Takes a Nix value `v` to a GVariant `string` value. Note, Nix strings are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkString "a string";
----
+
is equivalent to
+
[source,nix]
----
foo.bar = "a string";
----
`hm.gvariant.mkObjectpath (v: string)`:::
Takes a Nix value `v` to a GVariant `objectpath` value.
`hm.gvariant.mkUchar (v: string)`:::
Takes a Nix value `v` to a GVariant `uchar` value.
`hm.gvariant.mkInt16 (v: int)`:::
Takes a Nix value `v` to a GVariant `int16` value.
`hm.gvariant.mkUint16 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint16` value.
`hm.gvariant.mkInt32 (v: int)`:::
Takes a Nix value `v` to a GVariant `int32` value. Note, Nix integers are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkInt32 7;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = 7;
----
`hm.gvariant.mkUint32 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint32` value.
`hm.gvariant.mkInt64 (v: int)`:::
Takes a Nix value `v` to a GVariant `int64` value.
`hm.gvariant.mkUint64 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint64` value.
`hm.gvariant.mkDouble (v: double)`:::
Takes a Nix value `v` to a GVariant `double` value. Note, Nix floats are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkDouble 3.14;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = 3.14;
----
+
`hm.gvariant.mkArray type elements`:::
Builds a GVariant array containing the given list of elements, where each element is a GVariant value of the given type. The `type` value can be constructed using
+
--
- `hm.gvariant.type.string`
- `hm.gvariant.type.boolean`
- `hm.gvariant.type.uchar`
- `hm.gvariant.type.int16`
- `hm.gvariant.type.uint16`
- `hm.gvariant.type.int32`
- `hm.gvariant.type.uint32`
- `hm.gvariant.type.int64`
- `hm.gvariant.type.uint64`
- `hm.gvariant.type.double`
- `hm.gvariant.type.arrayOf type`
- `hm.gvariant.type.maybeOf type`
- `hm.gvariant.type.tupleOf types`
--
+
where `type` and `types` are themselves a type and list of types, respectively.
+
`hm.gvariant.mkEmptyArray type`:::
An alias of `hm.gvariant.mkArray type []`.
+
`hm.gvariant.mkNothing type`:::
Builds a GVariant maybe value whose (non-existent) element is of the given type. The `type` value is constructed as described for the `mkArray` function above.
+
`hm.gvariant.mkJust element`:::
Builds a GVariant maybe value containing the given GVariant element.
+
`hm.gvariant.mkTuple elements`:::
Builds a GVariant tuple containing the given list of elements, where each element is a GVariant value.
Some files were not shown because too many files have changed in this diff
Show more