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>
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 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).
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.
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
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
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.
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.
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.
* 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.
`--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.
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.
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.
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`.
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
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
This adds support for configuring email accounts, with automatic smtp, imap,
sendmail (msmpt) and maildir (mbsync, offlineimap) setup in aerc,
via `accounts.email`.
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.
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.
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.
* 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.
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.
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.
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>
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.
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>
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.
The conversion from `concatMapStrings` to `concatStringsSep` introduced in https://github.com/nix-community/home-manager/pull/2481
creates an unintended behavior change where the formatted config does not end in a newline.[1]
This is problematic for manipulation at the Nix level. In particular, this cause a regression in
the generation of gtk2 settings due to concatenated of the formatted config and `gtk2.extraConfig`
without a newline in between.
This commit restores `concatMapStrings` to match the previous behavior and adds a newline to
the final string for the generated gtk2 config. The test case for gtk2-basic-config
was also updated to check behavior at concatenation boundaries.
[1] - https://github.com/nix-community/home-manager/pull/2481#discussion_r830648706
If set to true, desktops configured in `monitors` will be reset every time
the config is run.
If set to false, desktops will only be configured the first time the config is run.
This is useful if you want to dynamically add desktops and you don't want them
to be destroyed if you re-run `bspwmrc`.
Nix permits user level configurations through ~/.config/nix/nix.conf that allow
customization of system-wide settings and behavior. This is beneficial in chroot
environments and for per-user configurations. System level Nix configurations in the
form of /etc/nix/nix.conf can be specified declaratively via the NixOS nix module but as
of currently no counter part exists in home-manager.
This PR is a port of the RFC42 implementation for the NixOS nix module[1]
to home-manager. Non-applicable options have been excluded and the config generation
backends have been tweaked to the backends offered by home-manager. A notable change
from the NixOS module is a mandatory option to specify the Nix binary corresponding
to the version "nix.conf" should be generated against. This is necessary because
the validation phase is dependent on the `nix show-config` subcommand on the host platform.
While it is possible to avoid validation entirely, the lack of type checking was deemed too significant.
In NixOs, the version information can be retrieved from the `package` option itself which
declares the Nix binary system-wide. However in home-manager, there is no pure way to
detect the system Nix version and what state version the "nix.conf" should be generated
against. Thus an option is used to overcome this limitation by forcing the user to
specify the Nix package. Note this interaction can still be automated by forwarding
the system-wide Nix package to the home-manager module if needed.
Three unit tests were added to test the module behavior for the empty settings, the example
settings and the example registry configurations respectively.
[1] - NixOS/nixpkgs#139075
* gtk: add cursor theme configuration
- Added the `cursorTheme` under the gtk module.
- Added tests for the gtk3 settings file generation, and renamed
the gtk2 unit test expected file for clarity.
- Added guard against generating a blank `gtk.css` when `cfg.extraCss`
is empty.
- Replaced `concatMapStrings` calls with `concatStringsSep`. The library function
`concatMapStrings` generates an intemediate list which is then passed to
`concatStringsSep`, As we are not performing other transformation except
the addition of newlines, a direct call to `concatStringsSep` is sufficient.
- Updated description of examples to be more general "~/.config" -> "$XDG_CONFIG_HOME".
- Update helper functions `toGtk3Ini` and `formatGtk2Option` to use the library
function `boolToString` and escape the separator in the key name.
* xcursor: delegate GTK cursor settings to gtk.cursorTheme
- Added deprecation warning for GTK settings in the `xsession.cursorTheme` module.
- Modified config section to use `gtk.cursorTheme` for GTK cursor settings.
This has no effect if the user does not have any aliases defined for
any accounts.
This will also only add `--my-address=` to only accounts that are
enabled to be tracked by mu.
Note, the pubs configuration file uses ConfigObj syntax, which is
similar to the INI files syntax but with extra functionalities like
nested sections. This prevents it from using Nix's INI format
generator. Here is an example of pubs configuration that cannot be
generated using Nix's INI format generator:
[plugins]
[[git]]
manual=False
For this reason, we opted for a stringly-typed configuration since the
use of a structured `settings` option would require a custom parser.
Previously, if a process inside a foot client triggered the OOM killer,
systemd would also kill the parent unit, namely the foot server.
This is not ideal if a user has a lot of clients attached, and it's
usually not the terminal emulator's fault that a process inside it has
ended up using all the available memory.
There seems to be some changes on how wrapped binaries are implemented
on nixpkgs. This broke the nnn tests since the tests were coupled with
the old implementation.
This commit fix the tests, and also make it less coupled by just testing
if the bookmarks/plugins/environment variables are available.
This patch moves both home.sessionVariables and
programs.zsh.sessionVariables from .zshrc to .zshenv. Additionally,
these two kinds of session variables will not be sourced more than
once to allow user-customized ones to take effect.
Before, session variables are in .zshrc, which causes non-interactive
shells to not be able to get those variables. For example, running a
command through SSH is in a non-interactive and non-login shell, which
suffers from this. With this patch, all kinds of shells can get
session variables.
The reason why these session variables are not moved to .zprofile is
that programs started by systemd user instances are not able to get
variables defined in that file. For example, GNOME
Terminal (gnome-terminal-server.service) is one of these programs and
doesn't get variables defined in .zprofile. As a result, the shells it
starts, which are interactive and non-login, do not get those
variables.
Fixes#2445
Related NixOS/nixpkgs#33219
Related NixOS/nixpkgs#45784
This file is not formatted before and is excluded by ./format, so I don't format it.
When an hook is defined, a side effect was the creation of the
${notmuchIni.database.path}/.notmuch/ directory by home-manager. If
the Xapian database does not exist yet but this .notmuch directory
exists, Notmuch is confused and throws an error when `notmuch new` is
run (while this should create the database the first time).
This commit changes the hooks paths to $XDG_CONFIG_HOME where Notmuch
expects them (see notmuch-config(1)) instead of inside the maildir
database directory.
It also moves the configuration where Notmuch expects it, but the
$NOTMUCH_CONFIG environment variable is kept for backward
compatibility.
Watson is a CLI for tracking your time.
Two unit tests were added to validate the module behavior for an empty
configuration and the example configuration.
Based on nixpkgs commit c4b3aa62608d592d8a983be685f7e82000f4de30
stringBool is not needed because makeDesktopItem handles converting boolean parameters to string,
and noDisplay and prefersNonDefaultGPU parameters have been added.
Swayidle is an idle management daemon for Wayland. This modules adds support for
running swayidle as a SystemD user unit and makes it configurable through
home-manager.
The empty configuration test for the bottom module introduced as of https://github.com/nix-community/home-manager/pull/2323
is not cross platform. Specifically, it silently fails under a darwin environment due to
the configuration file not being generated at $XDG_CONFIG_HOME. This PR add cross platform support
by specifying the platform-dependent configuration directories to check. The expected unit test data
was also extracted to a separate file to differentiate between test data changes and
changes to the test itself.
Write YubiKey token IDs in the format yubico_pam expects. See
https://developers.yubico.com/yubico-pam/ for details. Also refer to
the NixOS option security.pam.services.<name>.yubicoAuth.
Closes#2502
The `style` option now also accepts a path instead of a text
configuration.
Keeping up with new Waybar options is annoying, so make the module a
freeform module.
The `modules` option will be removed in release 22.05.
The logic to generate warnings for modules and everything was
removed. I don't want to maintain the code that generates these
warnings anymore.
Since Rofi 1.7.1 (specifically davatorium/rofi@0e70d8a), the deprecated
`theme` option in the `configuration` section no longer works. For 1.7.0
and up, `@theme "name"` is supposed to be used *after* the
`configuration` block.
Swaynag is a replacement of i3-nag for sway. Swaynag is embedded in
Sway's build process albeit it is not an integral part of Sway,
therefore it has been added under `wayland.windowManager.sway` instead
of `programs`. It can be moved at a later time if necessary.
Two unit tests were added validate the module behavior for an empty
configuration and the example configuration.
Add an option to set custom `$ZPLUG_HOME`. Changing it with
`home.sessionVariables` doesnt work, since it has to be exported
before Zplug is initialised
Rationale:
As of release 1.1.2[1], the configuration ini file supports
declaration of the `[main]` header as an alternative to global
properties by enumerating all sections and mapping each to the
respective parsing function. Global properties will still be parsed
correctly by fnott however generation adds unnecessary complexity to
the module. This commit removes the need for global properties
generation.
Changes:
- Fixed the FIXME at L118.
- Cleaned up unneeded let bindings.
- Changed the generation method to use the `pkgs.formats.ini` from
pkgs-lib instead of the raw `generators` library. This was done for
consistency and clarity as the `pkgs.formats.ini` is still required
for type declaration and uses `generators` internally.
- Removed `global-properties` testcase.
- Updated `example-settings` testcase.
[1] - https://codeberg.org/dnkl/fnott/releases/tag/1.1.2
nnn is a terminal file manager.
It is configured mostly using environment variables, so the way I
found it to avoid needing to write either shell specific code or
using `home.sessionVariables` (that would need to make the user
relogin at every configuration change) is to wrap the program using
`wrapProgram`.
This commit adds a module for configuring atuin, a replacement shell
history program.
The module adds options for generating atuin's `config.toml` from Nix,
and options to enable atuin's integration for bash and zsh
(which will rebind history keys to open the atuin history).