Compare commits

..

1294 Commits

Author SHA1 Message Date
Robert Helgesson
8a1297444b files: clean up
Specifically, replace the `link` and `clean` scripts by inline Bash
functions. This avoids a number of Bash invocations and simplifies the
code a little. This should also make it slightly easier to implement
support for arbitrary file locations.
2021-07-27 00:14:05 +02:00
Kritnich
f6f6990fc8 barrier: remove tray option (#2215)
barrier's --no-tray CLI parameter is non-functional and so the option has been removed.
2021-07-26 09:16:00 -06:00
t4ccer
addc78bea0 neovim: Add coc support (#2154)
This adds two new options: 'programs.neovim.coc.{enable,settings}`.

These settings offer a simple interface over `xdg.configFile."nvim/coc-settings.json`,
using the standard Nix' syntax instead of a multiline string.
2021-07-25 22:40:07 -04:00
Kid
0423a7b40c fish: fix home-manager completion path 2021-07-25 00:32:20 +08:00
Robert Helgesson
996b439739 volnoti: add platform assert 2021-07-24 00:37:06 +02:00
Andreas Mager
cc6909d407 trayer: add module (#2177) 2021-07-24 00:29:49 +02:00
Nicolas Berbiche
784da32958 meta: github: fix issue template assignees 2021-07-23 23:45:37 +02:00
Bjørn Forsman
6c984bd675 taskwarrior: don't create dataLocation with home.file
With

  programs.taskwarrior.dataLocation = /absolute/path

(outside of $HOME) the current implementation wrongly creates
$HOME/absolute/path (due to how home.file is implemented).

Since taskwarrior creates the dataLocation automatically on first run,
there is actually no need for HM to create that directory.

Additional benefit, the .keep symlink that HM creates as a side-effect
no longer appears in the taskwarrior data directory.

Fixes #2207.
2021-07-23 23:22:32 +02:00
Robert Helgesson
ddeeb031fd nixos: add nix package to activation script path
Fixes #2178
2021-07-23 23:18:15 +02:00
Ivan Malison
41101d0e62 volnoti: add module (#2183) 2021-07-21 00:17:27 -04:00
Alexander
fa483b82ab xcape: run xcape after setxkbmap (#2198) (#2199)
Co-authored-by: Alexander Khodyrev <a@akho.name>
2021-07-19 21:16:14 -04:00
Robert Helgesson
d7e089699a syncthing: restrict service slightly 2021-07-19 22:41:51 +02:00
Nicolas Berbiche
2b75633b2c meta: github: update issue template
Also add feature request template.
2021-07-18 23:54:23 +02:00
Robert Helgesson
41903a14b0 Remove a few format exceptions 2021-07-18 23:34:50 +02:00
axion
82b06103ae home-manager: add fish completion 2021-07-18 23:13:06 +02:00
Robert Helgesson
5f433eb164 Move platform check into modules
Before, loading a module would be guarded by an optional platform
condition. This made it possible to avoid loading and evaluating a
module if it did not support the host platform.

Unfortunately, this made it impossible to share a single configuration
between GNU/Linux and Darwin hosts, which some wish to do.

This removes the conditional load and instead inserts host platform
assertions in the modules that are platform specific.

Fixes #1906
2021-07-18 20:43:22 +02:00
Robert Helgesson
1617e56c2f firefox: fix tests 2021-07-18 20:29:00 +02:00
Ivan Malison
c476cc61b2 xsettingsd: add service module 2021-07-15 15:47:42 +02:00
Sumner Evans
f56a087cbc sway: add propagate --to-code for modes (#2176)
Propagates the bindkeysToCode setting which adds --to-code to the keybindings in mode configs.

Closes #2174
2021-07-15 07:09:54 -06:00
IvarWithoutBones
775cb20bd4 sm64ex: add module 2021-07-12 08:57:35 +02:00
Colin Summers
9e3c402972 brave: fix config dir path (#2173)
Changes install path for extensions from `~/.config/brave` to
`~/.config/BraveSoftware/Brave-Browser` on Linux.
2021-07-11 21:19:10 -04:00
Naïm Favier
4971b9cad0 setxkbmap: reset options before setting new ones (#2160) 2021-07-11 21:15:18 -04:00
Gabriel Fontes
3ab254aff4 qutebrowser: add onChange ipc reloading 2021-07-11 22:46:06 +02:00
Jörg Thalheim
9ed7a73ae2 home-manager: fix nixos-option fallback 2021-07-10 11:38:33 +02:00
Jörg Thalheim
ae636c09f4 Revert "Revert "home-manager: use nixos-option from pkgs""
This reverts commit 2c9fe368c1.
2021-07-10 11:21:04 +02:00
Jörg Thalheim
2c9fe368c1 Revert "home-manager: use nixos-option from pkgs"
This reverts commit d7d7bbbf20.
2021-07-10 11:17:32 +02:00
Robert Helgesson
d7d7bbbf20 home-manager: use nixos-option from pkgs
Fixes #2170
2021-07-10 09:34:55 +02:00
Robert Helgesson
06ee8ec8df xmobar: use dummy package in test 2021-07-07 23:46:53 +02:00
dawidsowa
97d183e2e4 devilspie2: add module (#1477)
Co-authored-by: Sumner Evans <me@sumnerevans.com>
Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
2021-07-05 16:29:34 -04:00
Robert Helgesson
ac319fd314 home-environment: add Nixpkgs release version check
This adds a warning when a release version mismatch is detected
between Home Manager and Nixpkgs.
2021-07-04 09:40:40 +02:00
Rosario Pulella
7df6656b11 foot: revert always create config file (#2091) (#2157)
This reverts commit 666eee4f72 (#2091).

As of NixOS/nixpkgs#128121, which incorporated changes from:
https://codeberg.org/dnkl/foot/pulls/588/, foot no longer
errors if there is no config file.
2021-07-01 12:05:37 -06:00
Mario Rodas
9ad0024d4d rbw: use pientry.binaryPath when available (#2153)
`pinentry_mac` does not use bin/pientry as path to its binary, instead
it sets `binaryPath` pointing to the binary.
2021-06-29 21:27:19 -04:00
t4ccer
3f6cb409ca xmobar: add module (#2120)
* xmobar: Add module

* xmobar: Add test case

xmobar: Add test default.nix

* xmobar: Order lists alphabetically

* xmobar: Change colon to comma in description

* xmobar: Fix macos tests

* xmobar: Remove extra line

* xmobar: Add literalExample

Co-authored-by: Sumner Evans <me@sumnerevans.com>

* xmobar: Update extraConfig description

Co-authored-by: Sumner Evans <me@sumnerevans.com>
2021-06-29 13:02:43 -06:00
t4ccer
5b08b33e8f rofi: add "plugins" option (#2117)
* rofi: add support to plugins

* rofi: update package example

Co-authored-by: Sumner Evans <me@sumnerevans.com>

* rofi: Format package example

* rofi: Fix tests

Rofi will not try to install plugins using override when tests overlay
actual rofi package with empty scirpt

* rofi: Refactor

Co-authored-by: Sumner Evans <me@sumnerevans.com>
2021-06-29 11:13:01 -06:00
Robert Helgesson
9b7a90daa1 files: minor cleanup 2021-06-28 23:17:00 +02:00
Lava
85d67b0a6e xsession: Add profilePath configuration option (#2140)
This allows the user to move .xprofile somewhere else, which can help
with decluttering their home directory.
2021-06-28 09:11:15 -06:00
Lava
dc4337d9fe xresources: Add path configuration option (#2141)
* xresources: Add path configuration option

This allows the user to move .Xresources somewhere else, which can help
with decluttering the home directory.

* xresources: Update xresources.path docs

* xresources: Fix formatting
2021-06-28 00:50:40 -06:00
DG
a17bc3217f zsh: add enableSyntaxHighlighting option (#2144)
Add a simple way to enable syntax highlighting for zsh using https://github.com/zsh-users/zsh-syntax-highlighting
2021-06-28 00:04:38 -06:00
Robert Helgesson
2aeaf65e8f files: assert that target files are unique
Fixes #1807
2021-06-27 17:10:45 +02:00
Robert Helgesson
f4998f0adc tests: bump nmt 2021-06-27 14:20:13 +02:00
Bruno BELANYI
8d3b273afe himalaya: add module
A very simple TUI mail client.
2021-06-26 18:29:42 -04:00
j-k
8eee5f5272 obs-studio: use wrapobs and the new plugin layout (#2142)
The packaging in nixpkgs for obs plugins has changed and there's a
wrapOBS function.
The name of the plugins has also changed so the example needed updating
to reflect that.

Related: https://github.com/NixOS/nixpkgs/pull/125308
2021-06-26 17:29:50 -04:00
Kaligule
0ada50fc9c docs: document how to reset the nix-env 2021-06-25 11:18:26 +02:00
Ilan Joselevich
7e2b1a42aa i18n.inputMethod: add module 2021-06-25 00:58:50 +02:00
Robert Helgesson
ab0e6c3e0e tests: bump nmt 2021-06-24 22:47:21 +02:00
Robert Helgesson
21ac4c499b xmonad: restrict news entry to Linux 2021-06-24 08:42:28 +02:00
Sergey Vlasov
b42fce7aaa i3,sway: add bar color options for the focused output (#2135)
Both i3bar and swaybar can use different colors for the bar on the
currently focused monitor output; add color options for this feature.
2021-06-22 20:56:41 -06:00
Nicolas Berbiche
49864a4370 xmonad: document breakage of recompilation (#2024)
Co-authored-by: Markus Scherer <markus.f.scherer@gmail.com>
2021-06-22 20:36:47 -04:00
Robert Helgesson
762f860cfb tests: prevent some unnecessary downloads 2021-06-23 00:37:25 +02:00
Kid
04955ca970 README: fix outdated description (#2131)
* README: fix outdated description
2021-06-22 16:20:13 +02:00
Sandro Jäckel
cd11c02c28 command-not-found: update from nixpkgs 2021-06-20 20:40:37 +02:00
Robert Helgesson
a73e619377 tests: update nmt
Allows running, e.g.,

    nix-build --pure tests -A build.all
2021-06-20 09:52:58 +02:00
Naïm Favier
dc1b6b8349 bspwm: re-add support for lists as config option values (#2125)
Removed by mistake in e70524c, but ignore_ewmh_fullscreen still needs it.
2021-06-20 00:57:40 -04:00
Naïm Favier
e70524cd2b bspwm: various improvements (#2095)
* bspwm: various improvements

- fixes shell escaping issues and general style issues
- allow reloading the config on-the-fly by exposing bspwmrc to the user

* bspwm: add configuration test
2021-06-19 18:40:17 -04:00
Josh Holland
2f6d5c90f4 fzf: also use custom package for shell integrations (#2119) 2021-06-17 23:57:25 +02:00
Christopher League
6d9bff77ed rsibreak: add package when enabled; fixes #2092 (#2118)
Otherwise rsibreak cannot find its icon and is a blank gap on the
notification tray.
2021-06-17 09:08:10 -06:00
Philipp Dargel
d04e52b0c0 terminator: add module (#2063)
added configuration for terminator
2021-06-17 09:06:47 -06:00
Naïm Favier
3aa479d551 dunst: make icon_path extensible (#2097) 2021-06-16 21:06:16 -04:00
Robert Helgesson
a01fe9f81e sxhkd: fix service test
Before it generated a nonsense test script.
2021-06-17 00:16:17 +02:00
Robert Helgesson
6cd92c643a sxhkd: minor formatting in test 2021-06-16 23:57:58 +02:00
Nicolas Berbiche
5a19e0ea9c home-manager: fix nixos-option evaluation (#2115) 2021-06-16 16:39:02 -04:00
Dusk Banks
63af2d3e4c home-manager: add home-manager option
This adds functionality much like that provided by `nixos-option`.
2021-06-15 23:46:45 +02:00
Kevin Amado
e92f5bb79e programs.gnome-terminal: terminal options (#2042)
- Add support for showing bold as bright colors
- Add support to configure the background transparency
- Fix the scrollOnOutput, it was not being dumped to the config
- Add tests!
- Add myself as maintainer
2021-06-15 23:39:56 +02:00
Naïm Favier
1e8d0beae4 xresources: load .Xresources in xsession.initExtra 2021-06-15 23:01:13 +02:00
Dmitry Kulikov
9b39fd7eb4 sxhkd: stop scope before creating (#2086) 2021-06-15 13:27:35 -04:00
Ivar
be0e73a308 qutebrowser: add quickmark support (#2059)
Closes: https://github.com/nix-community/home-manager/issues/1230
2021-06-15 12:22:21 -04:00
Josh Holland
e0f2949c98 direnv: add enableFlakes option for enableNixDirenvIntegration (#2089)
NixOS/nixpkgs@03310df843 disabled flake
support by default, so we now need to build a custom package and use it
if the user wants to `use flake` successfully.  This should fix #2087.
2021-06-15 12:11:26 -04:00
bb010g
1375fd4a03 systemd: add automounts option 2021-06-14 23:10:21 +02:00
bb010g
b6613a8544 systemd: bring more in line with upstream 2021-06-14 23:10:20 +02:00
bb010g
c982c19f53 files: properly escape shell arguments 2021-06-14 23:10:19 +02:00
Naïm Favier
4ed6705b0f nixos: set stopIfChanged to false (#2105)
There is no ExecStop so we can just restart the service.
2021-06-14 20:49:38 +03:00
Sumner Evans
25bf3d7953 password-store: add environment variables to xsession.importedVariables (#2103)
This ensures that any systemd services that need pass will have the
correct environment variables.
2021-06-13 16:27:31 -06:00
ZerataX
fb50102daf mangohud: add module 2021-06-12 09:55:58 +02:00
Rosario Pulella
666eee4f72 programs.foot: Always create config file (#2091)
foot complains if there is no config file.
2021-06-10 18:40:36 +02:00
bb010g
42847469b3 zsh: add completionInit option (#2046)
Factored out from original .zshrc construction.
2021-06-09 11:15:10 -04:00
Christopher League
aa36e2d6b4 xsession.pointerCursor: .icons file for AwesomeWM (#2084) 2021-06-07 18:00:31 -04:00
Johannes Schleifenbaum
06a98ba0fd pantalaimon: add module (#2056) 2021-06-07 17:38:42 -04:00
Dominik Schrempf
f74dc9c70b xidlehook: add module (#1761)
Co-authored-by: Nicolas Berbiche <nic.berbiche@gmail.com>
2021-06-07 16:13:43 -04:00
Ethan Edwards
9424f31f86 piston-cli: add module (#2052)
* piston-cli: add module

* News: Remove trailing whitespace
2021-06-07 08:07:15 -06:00
malte-v
3ffe2a4cdf programs.senpai: add module (#2076)
* maintainers: add malvo

* programs.senpai: add module
2021-06-07 07:40:32 -06:00
Rodney Lorrimar
afb5fd962c irssi: add ssl_cert option for servers (#2043)
* irssi: add ssl_cert option for servers

I was following these instructions
https://www.oftc.net/NickServ/CertFP/
and found that the `/server add -ssl_cert` option was needed.

This patch therefore adds an optional
`programs.irssi.networks.<name>.server.ssl.certificateFile` path.

Perhaps this could also be done with a `settings` attribute, but that
would probably require most of this module to be reworked.

* irsii: Add example-settings test case
2021-06-06 15:31:25 -06:00
Bruno BELANYI
7591c8041d rbw: add module (#1998)
`rbw` is a stand-alone Bitwarden client, which makes use of a daemon to
cache your password and manage state.

Its configuration can be managed by `home-manager` or not, leaving the
user free to configure it through `rbw config`.
2021-06-05 18:09:02 -06:00
Rodney Lorrimar
5060262b79 services/emacs: Prevent deletion of socket file
When running a socket-activated emacs service, we don't want emacs to
remove the socket file after exiting, because then subsequent
invocations of `emacsclient` won't be able to use the socket to start
emacs.service again.
2021-06-06 01:00:20 +02:00
Tad Fisher
ac82c036d8 services/emacs: Update systemd definitions, drop Emacs 26 support
Emacs 27 added Type=notify support and updated the service definition to
remove the use of `emacsclient' to kill the service. Emacs 28 changes
the `StartupWMClass' in emacsclient.desktop to `Emacsd'. Update our
emacs.service and emacsclient.desktop definitions to match upstream
changes.

When killing emacs.service, the socket is removed, and subsequently
starting the service manually results in a service without a socket.
Prevent this by adding `RefuseManualStart=true' to the service's Unit
definition.

Drop Emacs 26 support as it is no longer shipped in nixpkgs. Update the
tests to verify the following configuration scenarios:

- Emacs version: 27, 28
- Socket activation: disabled, enabled
2021-06-06 01:00:19 +02:00
puzzlewolf
e9ed9c2e11 etesync-dav: fix typo (#2067)
Upstream (https://github.com/etesync/etesync-dav/blob/master/README.md#configuration-and-running) uses 37358 as default port.
2021-06-05 16:58:12 -06:00
bb010g
5eb199e937 home-manager: pass on --debug option (#2049)
* man-home-manager: remove trailing whitespace

* home-manager: pass on `--debug` option
2021-06-05 16:11:06 -06:00
Naïm Favier
dba802c1d9 dunst: add the whole package to home.packages (#2079)
The `dunst` package provides the `dunstctl` and `dunstify` command-line utilities which are useful to have.
2021-06-05 15:31:50 -06:00
lunik1
e4c55ed4e6 Revert "foot: add foot binaries to user service's path (#2061)"
This reverts commit cb227dc6c2.
2021-06-05 20:53:45 +02:00
Robert Helgesson
19d95258ac docs: set current version to 21.11 2021-06-05 20:05:04 +02:00
Robert Helgesson
5c1415d67f docs: mark 21.05 as stable version 2021-06-05 19:54:25 +02:00
Dusk Banks
45f9cb06a9 texlive: add packageSet option 2021-06-03 22:44:09 +02:00
Dusk Banks
c12d53dd7c texlive: "Texlive" -> "TeX Live" 2021-06-03 22:44:08 +02:00
Robert Helgesson
d3cdabb5c9 Replace references to pkgs.gnome3 by pkgs.gnome 2021-06-03 22:09:59 +02:00
Matthieu Coudron
c7e79b5337 programs.neovim: dont wrap init.vim (#2058)
since we want to write it ourself in ~/.config/nvim/init.vim
2021-06-03 21:37:53 +02:00
Basti
95da56b783 i3,sway: workspace output assignment (#2003)
(cherry picked from commit ea3ff797c87313e71f2ed2fd2b932a18a4b4400b)
2021-06-02 18:03:20 -06:00
cwyc
30102ea9e5 xdg-desktop-entries: add module (#1450)
* xdg-desktop-entries: add module

rebase

* xdg-desktop-entries: adapt to changes in makeDesktopItem

This package depends on the makeDesktopItem function in nixpkgs, which recently changed its syntax:
https://github.com/NixOS/nixpkgs/pull/91790

This commit makes the module compatible with the new syntax.

It also exposes the fileValidation option in makeDesktopItem.

Co-authored-by: cwyc <cwyc@users.noreply.github.com>
Co-authored-by: --get <--show>
2021-06-02 19:36:17 -04:00
Bart Bakker
d6bbd02e95 htop: fix preserving the order of meters (#2065)
Pass meters for formatting in a list of attrsets so that ordering can be
preserved. In addition provide some mode-specific functions to create these
attrsets, to make for a bit nicer config.

This fixes #2060.
2021-06-02 19:27:17 -04:00
Sylvain Fankhauser
b917624670 i3status-rust: replace deprecated format keys (#2062) 2021-06-02 11:05:19 -04:00
lunik1
cb227dc6c2 foot: add foot binaries to user service's path (#2061)
This is needed for foot's new terminal spawning feature to function.
2021-06-01 19:24:59 -04:00
Matthieu Coudron
2a4ab0d891 programs.neovim: fix tests + swap extraConfig and pluginconfig (#2053)
makes more sense to have extraConfig afterwards in case use want to override config
2021-05-31 19:32:21 +02:00
Robert Helgesson
9e253a8c30 docs: minor additional issue template update 2021-05-31 17:27:34 +02:00
Robert Helgesson
5573c10ea4 docs: update issue template
Most importantly change chat contact information.
2021-05-31 17:24:37 +02:00
bb010g
0e329cee4c jq: add package option 2021-05-30 22:48:57 +02:00
Robert Helgesson
d2aaeac42c files: remove assertion on recursive onChange
See discussion in

  https://github.com/nix-community/home-manager/pull/2031
2021-05-30 11:54:33 +02:00
Robert Helgesson
07ad6a4f76 files: fix use of onChange with directory source
Previously, the comparison would not handle directory comparison
correctly, always finding that the source and target differed. This
would trigger the `onChange` script on each activation.

Fixes #2004
2021-05-29 21:52:37 +02:00
Robert Helgesson
ab64dc3249 docs: make OFTC upper case 2021-05-29 20:22:40 +02:00
Robert Helgesson
3591cd2b3b docs: switch IRC to OFTC 2021-05-29 19:29:15 +02:00
Joe Hermaszewski
0e6c61a440 programs.neovim: Set customRC for new nixpkgs (#2039)
Previously with newer nixpkgs revisions extraConfig would not make it into init.nvim
2021-05-27 22:05:20 +02:00
Ilan Joselevich
ddf35436b7 nextcloud-client: add startInBackground option (#2038)
* nextcloud-client: add runInBackground option

* nextcloud-client: Change runInBackground description

Co-authored-by: Sumner Evans <me@sumnerevans.com>

* nextcloud-client: Use optionalString for the runInBackground option

Co-authored-by: Sumner Evans <me@sumnerevans.com>

* nextcloud-client: Remove "defaultText" in the runInBackground option

* nextcloud-client: Fixed formatting

* nextcloud-client: Rename runInBackground to startInBackground

Co-authored-by: Sumner Evans <me@sumnerevans.com>
2021-05-27 10:54:20 -06:00
Rosario Pulella
b840707a87 firefox: Always create profile directories
Write ".keep" file in profile dir for each profile regardless of any
other settings to creare profile dir.
2021-05-26 09:41:43 +02:00
Robert Helgesson
90493027e3 mbsync: fix news entry 2021-05-23 20:32:01 +02:00
Karl H
64607f58b7 isync/mbsync: replace master/slave with far/near (#1776)
* isync/mbsync: replace master/slave with far/near

  isync/mbsync: update tests to match new changes

* isync/mbsync: use mkRenamedOptionModule to alert user to near/far change

* isync/mbsync: use warnings to alert about master/slave far/near change

  Fix capitalization

  isync/mbsync: fix nitpicks

* isync/mbsync: run format script

* isync/mbsync: include new test for expected master/slave warnings

* isync/mbsync: add news about changes
2021-05-22 15:31:06 -06:00
Nick Hu
4f70f49cec Add systemd target tray.target (#2027)
This target is for systemd units that require a system tray to be
running.

This also fixes taffybar.service: previously, systemd would consider it
to be active (running) before it was actually ready to accept tray
icons.
2021-05-22 03:15:12 +01:00
Scott Olson
82ab1ad467 syncthing: fix news link (#2032) 2021-05-20 20:23:55 -06:00
Bart Bakker
3d18912f5a htop: fix deprecation warnings (#2026)
Previous patch on deprecation warnings broke use of old options due to function
call with too many arguments. This fixes the arguments so deprecation warnings
are properly traced while preserving old configuration options.
2021-05-19 11:38:14 +02:00
Bruno BELANYI
b449cb77b1 firefox: deprecate 'enableGnomeExtensions'
Fixes #1990.
2021-05-19 08:51:52 +02:00
Nicolas Berbiche
cced902dda gpg: document lists are converted to duplicate keys (#2025) 2021-05-18 22:58:38 -06:00
Bart Bakker
91450f23ce htop: replace individual option with 'settings' (#1844)
* htop: add some missing meters
* htop: replace individual options with 'settings'
Deprecate all options and introduce `settings` for setting htop configuration
values in Nix configuration.

Use `lib.htop` to provide `fields` and `modes` for easy access to htop's integer
configuration. And `leftMeters` and `rightMeters` functions for building the
separate `*_meters` and `*_meter_modes` attributes.

* htop: add release-notes 21.05 entry
* htop: improve deprecation warnings

Move default configuration into `settings` and make deprecated options default
to `null`. Print deprecation warnings for any option that is non-null --
i.e. only show warnings for explicitly specified deprecated options.

* htop: make self code owner of module
* release notes: fix invalid programs.htop xref
2021-05-19 01:36:08 +02:00
Pierre Labadens
ff616b2734 foot: add module
Foot is a fast terminal emulator for Wayland. It can optionally be run
in a client-server configuration.

There are three unit tests to handle an empty configuration, the
default configuration, and systemd service file generation.
2021-05-18 22:29:41 +02:00
Nick Hu
73ecbd3722 Revert "status-notifier-watcher: introduce unit start delay"
This reverts commit 02c1f8d416.
2021-05-18 22:12:59 +02:00
Nick Hu
3612ca58e8 syncthing: make syncthing tray package configurable (#1257)
Also sets the default syncthing tray package to
https://github.com/Martchus/syncthingtray instead of
https://github.com/sieren/QSyncthingTray, which indirectly fixes #603
2021-05-18 15:43:17 +01:00
Robert Helgesson
f9e45390de scmpuff: use pkgs.scmpuff 2021-05-18 00:47:40 +02:00
Robert Helgesson
adbabcd0a0 gtk: fix gtk2-basic-config test 2021-05-18 00:47:15 +02:00
Robert Helgesson
e9b7d12e06 bash: generate files using writeShellScript
This ensures that the generated file is syntactically valid.

Issue #2015
2021-05-18 00:46:04 +02:00
Robert Helgesson
794d08a1d8 home-environment: generate checked activation script
By using `writeShellScript` when writing the activation script we
automatically get the right shebang and also get syntax validation.

Issue #2015
2021-05-18 00:18:57 +02:00
Ivan Kovnatsky
b0688a631b i3status-rust: fix bars.block example (#2016) 2021-05-17 11:25:03 -06:00
Sebastian Sellmeier
6a471f1b11 i3,sway: add option for default workspace (#2002)
Related to #695
2021-05-16 22:54:53 -06:00
Tad Fisher
01ec2aaefe systemd: revert systemd-environment-generator usage for environment variables (#2001) 2021-05-16 17:43:50 -04:00
asymmetric
77188bcd6e services/kanshi: add module example (#2008) 2021-05-15 23:17:48 -04:00
Tad Fisher
23769994e8 xdg.systemDirs: init module (#1797)
There is a need to manage XDG Base Directory system directory
environment variables in Home Manager modules. There is an existing
mechanism in `targets.genericLinux.extraXdgDataDirs', but this does not
apply to NixOS systems.

Furthermore, it is important that `XDG_CONFIG_DIRS' and `XDG_DATA_DIRS'
are set in both login shells (to support getty and SSH sessions) as well
as the systemd user manager (to propagate them to user services and
desktop environments).

The first need is addressed by adding the `xdg.systemDirs' module, which
configures lists of directory names for both `config' and `data'
directories. These are then set in
`$XDG_CONFIG_DIR/environment.d/10-home-manager.conf' and picked up by
the systemd user manager.

To make these, and other variables set in
`systemd.user.sessionVariables', available in login shells, an
additional step is added to `etc/profile.d/hm-session-vars.sh' which
exports the result of
`user-environment-generators/30-systemd-environment-d-generator' which
is shipped with systemd. The effect of this generator is to print
variables set on the systemd user manager such that shells can import
these into their environment.
2021-05-10 20:14:42 -04:00
Bruno BELANYI
3b799f6ea4 nix-index: add module (#1984)
`nix-index` is a tool to quickly locate the package providing a certain
file in `nixpkgs`. It indexes built derivations found in binary caches.

This module adds the shell integration for its `command-not-found`
script for interactive shells.
2021-05-09 18:13:10 -04:00
Bruno BELANYI
7d765d8f46 firefox: do not override other attributes in 'cfg' (#1988)
Closes #1962.
2021-05-09 18:06:04 -04:00
Robert Helgesson
15a2953c81 powerline-go: avoid dependency in tests 2021-05-09 12:23:44 +02:00
Robert Helgesson
e42e147b58 Remove some usage of config.lib.dag
The `lib.hm.dag` attribute set should always be preferred.
2021-05-09 12:13:31 +02:00
Robert Helgesson
4896c50074 msmtp: add note about account commands in extraConfig
Fixes #1975
2021-05-08 11:39:12 +02:00
Michal Sojka
b2dec35b86 Fix eval errors when i3 or sway null configs are null (#1989) 2021-05-07 15:39:10 -06:00
0qq
ff959fd49a sxhkd: fix environment (#1892)
* sxhkd: move to xsession.initExtra

When sxhkd is launched as systemd service it
doesn't have $PATH a user expects to see.

* sxhkd: add news entry
2021-05-07 15:28:52 -04:00
Robert Helgesson
86944b0fb1 docs: remove requirement about capitalization
Seems a bit too pedantic.
2021-05-06 23:44:16 +02:00
Vincent Breitmoser
30355f8ee6 etesync-dav: add module 2021-05-06 22:48:57 +02:00
Robert Helgesson
f298705ae4 i3,sway: break documentation dependency on configuration
Before the documentation for a number of options had a dependency on
the configuration.
2021-05-06 00:16:37 +02:00
Robert Helgesson
90dd375eba zsh: break configuration dependency in documentation
Before the documentation for the `programs.zsh.history.path` had a
dependency on the configuration.
2021-05-06 00:00:45 +02:00
Antoine Martin
64c5228c08 i3, sway: description and example for font options (#1980)
Adds an example to the root fonts submodule because the documentation doesn't know how to handle `type = with types; either (listOf str) fontOptions;`
2021-05-04 08:31:37 -06:00
Sumner Evans
9ffb206050 i3, sway: replace fonts with submodule (#1950)
This applies to both the root-level and the bar configs.

Closes #1937.
2021-05-03 21:54:35 -06:00
Robert Schütz
e0ee5068dd neovim: drop python2 support (#1978)
Nixpkgs did the same in https://github.com/NixOS/nixpkgs/pull/121339.
2021-05-03 21:47:08 -06:00
Sumner Evans
225bf275ba neomutt: make folder change when sourcing account optional
This adds an option for disabling setting the folder when sourcing
accounts in neomutt.
2021-05-03 09:04:58 +02:00
David Terry
cdc774f337 lieer-service: add path to notmuch config (#1704)
This change makes the services created via the lieer module aware of the notmuch config created by the home-mangager notmuch module (which is stored in a non-standard location).

Without this change all the lieer services created by the lieer module failed for me, as they were unable to find the notmuch config.
2021-05-03 00:19:41 +02:00
Hans
ca7868dc29 fzf: option for tmux usage in shell integration (#1926)
Added options for setting:
FZF_TMUX
FZF_TMUX_OPTS
environment variables, which changes behaviour of fzf shell integration.
2021-05-01 18:10:41 -04:00
Mario Rodas
2f857761d0 ncspot: add module (#1939)
* ncspot: add module

ncspot is a ncurses Spotify client written in Rust using librespot.

* news: fix bad github ui merge

Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
2021-05-01 17:38:12 -04:00
oxalica
5709b5f953 zsh: add history.ignorePatterns option (#1933)
The corresponding variable is `HISTORY_IGNORE` described in zshparam(1).
2021-05-01 16:33:45 -04:00
Blaž Hrastnik
19fc0917c0 waybar: fix systemd service
Fix xdg-portal issue where it'd take 25s for a GTK app to start
2021-05-01 16:26:10 -04:00
Christian Kalhauge
614a5b55bf lazygit: add module (#1930)
Co-authored-by: Nicolas Berbiche <nic.berbiche@gmail.com>
Co-authored-by: Sumner Evans <me@sumnerevans.com>
2021-05-01 09:56:19 -06:00
Kritnich
2eed138026 barrier: add module
Co-authored-by: Sumner Evans <me@sumnerevans.com>
2021-05-01 00:11:17 +02:00
Sumner Evans
5e6f09795c gtk2: allow configuration of gtkrc file
Closes #519
2021-04-30 22:56:56 +02:00
Robert Helgesson
d57c59e7cb home-environment: extra message on nix-env error
When profile installation fails during activation we'll print an extra
message that explain that, if the error is due to conflicting
packages, then it may be that the user has a manually installed copy
of the package.

Fixes #1244
2021-04-29 17:58:15 +02:00
Harsh Shandilya
137a584e22 topgrade: add module (#1924) 2021-04-28 19:56:58 -04:00
Sumner Evans
55ef8d3a10 format: remove exception for keybase and kbfs modules 2021-04-29 00:49:01 +02:00
Robert Helgesson
5ae7817dc5 kitty: use dummy package in test
Also remove assignment to non-existent option
`programs.kitty.package`.
2021-04-29 00:40:32 +02:00
Ivar Scholten
4727b0543d pbgopy: add missing options 2021-04-29 00:26:17 +02:00
Sumner Evans
4edc2091e0 github: configure probot/stale 2021-04-29 00:03:28 +02:00
Sumner Evans
2d421b30ad format: removed exceptions already formatted files (#1954)
Removed format exclusion exceptions for modules that are already
formatted correctly (that is, when running nixfmt, no changes happen) or
have been moved (in the case of i3.nix).
2021-04-28 21:59:51 +02:00
Sumner Evans
b706d101eb format: remove exception for afew module (#1955) 2021-04-28 21:58:49 +02:00
Sumner Evans
19ebab97e8 i3, sway: extract border functionality to common function (#1947)
* i3, sway: extract border functionality to common function

Converted the i3 module to use default_border and
default_floating_border and extracted that functionality out to be
shared between the i3 and sway modules.

* i3: add sumnerevans as maintainer
2021-04-28 15:52:31 -04:00
Thibaut Marty
a759143ae1 mpris-proxy: add module (#1832) 2021-04-28 15:05:56 -04:00
fortune
a513fbc395 qutebrowser: fix config location on darwin (#1925) 2021-04-28 14:41:30 -04:00
Cole Mickens
c0ba8c526d gpg: can configure scdaemon.conf (#1960) 2021-04-28 14:39:58 -04:00
Tad Fisher
18ad12d52b programs.ssh: Use nullable types for optional forward attrs (#1946)
Attempting to build a flake configuration using `ssh.remoteForwards' results in
evaluation errors when `port' is undefined, as `!(entry ? port)' evaluates to
false. This was verified in the nix repl, and also occurs for `nix flake
check'.

Set optional attrs in `bindOptions' and `forwardModule' to `null' by default
and adjust the assertion to check for `null' instead of attr definitions.
2021-04-27 17:16:33 -04:00
Cole Mickens
d437baa41c gnupg/gpg-agent: gnupg package is configurable (#1949) 2021-04-27 16:40:05 -04:00
Thibaut Marty
865e404826 poweralertd: add module (#1951) 2021-04-27 16:38:41 -04:00
Nicolas Berbiche
d4278212b5 pass-secret-service: fix systemd unit install option (#1959) 2021-04-27 16:17:36 -04:00
Vladimir Serov
b4e3f069f1 pass-secret-service: add module (#1898)
pass-secret-service is a proxy between
secret service (libsecret) and pass.
2021-04-27 15:36:29 -04:00
Sumner Evans
827636c619 dunst: add service package option (#1944)
* add service package option

* add waylandDisplay option dunst now supports wayland, and looks for WAYLAND_DISPLAY var to use it

Co-authored-by: @li:maisiliym.uniks <@li:maisiliym.uniks>
2021-04-25 01:56:48 -04:00
Robert Helgesson
c2c26120d7 scmpuff: fix formatting 2021-04-24 19:06:40 +02:00
Sumner Evans
839645caf3 programs.neovim: fix failing test (#1943)
Updated the expected plugin-config.vim to match what is actually
returned by the neovim utils from upstream.
2021-04-23 20:19:26 +02:00
Mario Rodas
e00dd0d7d2 programs.tmux: use xdg config path (#1928)
Tmux 3.2 includes support to use `$XDG_CONFIG_HOME/tmux/tmux.conf` as
well as `~/.config/tmux/tmux.conf` for configuration file.
2021-04-23 09:25:13 +02:00
Phillip Cloud
26fa84ebce scmpuff: init (#1921)
scmpuff is a command line tool that allows you to work quicker with Git by substituting numeric shortcuts for files
2021-04-22 22:27:29 -04:00
Bruno BELANYI
db00b39a9a termite: add option to enable VTE integration (#1917)
This also migrates to using the VTE module directly, centralising bug
fixes.

Fixes #1909.
2021-04-20 19:45:39 -04:00
Terje Larsen
0c236e13bc flake: add extraModules option, inherit nixpkgs config and overlays in homeManagerConfiguration (#1767)
* flake: ensure passed pkgs with overlays and config is used

In the pkgsModule inside modules/modules.nix it will try to use the
<nixpkgs> from NIX_PATH if home.stateVersion is not set. This is not
available when using flakes so we need to require at least 20.09 and we
might as well default to that.

Also if you have added overlays and config to your pkgs it will be lost
so we need to transfer those as well.

This is an alternative to passing pkgs to extraSpecialArgs which will
break the usage of things like nixpkgs.config.packageOverrides.

* flake: add extraModules

If you want to add some extra home-manager modules, you have to mix them
with the configuration as such:

configuration = {
  imports = [
    emacs-config.homeManagerModules.emacsConfig
    ./home.nix
  ];
};

Instead of:
configuration = ./home.nix;
extraModules = [ emacs-config.homeManagerModules.emacsConfig ];

Which separates these two concerns.
2021-04-20 16:19:24 -04:00
Tamás Hetesi
1e7e8ac75d pet: Add support for tags in snippets (#1883)
Add missing `tag` option for elements of `programs.pet.snippets`.
2021-04-20 16:16:27 -04:00
fricklerhandwerk
6aa6556bca gpg-agent: add GNUPG_HOMEDIR to environment (#1932)
otherwise, if `programs.gpg.homedir` is not set to default, calls to
`gpg` will fail to pick up anything related to secrets
2021-04-19 01:52:31 +02:00
Robert Helgesson
ebbbd4f2b5 gpg: fix homedir option documentation
Previously the documentation had a dependency on the configuration.
2021-04-15 08:53:13 +02:00
fricklerhandwerk
348b5a5a69 gpg: make homedir configurable 2021-04-14 23:44:34 +02:00
Imran Hossain
0a6227d667 flake.nix: Add packages and defaultPackages outputs (#1913) 2021-04-11 17:46:27 -04:00
Christian Gram Kalhauge
7cf69a3b8d exa: add module
Exa is a 'ls' alternative with more sane colorscheme than lsd on white
backgrounds.
2021-04-11 22:47:06 +02:00
Sumner Evans
073710d7f2 newsboat: add sumnerevans as maintainer 2021-04-11 22:20:03 +02:00
Sumner Evans
f7159a0f76 newsboat: use $XDG_CONFIG_HOME/newsboat
As of Newsboat 2.19, configuration using XDG_CONFIG_HOME/newsboat is
supported:
https://newsboat.org/releases/2.19/docs/newsboat.html#_xdg_base_directory_support

This is a continuation of #1331 and includes gating logic so that the
change doesn't happen until state version 21.05.

Supersedes and Closes #1331
2021-04-11 22:20:02 +02:00
Sumner Evans
18930aaf75 sway: add sumnerevans as maintainer 2021-04-11 22:11:23 +02:00
Sumner Evans
5c5d562266 sway: add config.seat
Added seat configuration to sway config. Also improved the way that the
configuration is generated to reduce superfluous whitespace.

Supersedes #1663
2021-04-11 22:11:22 +02:00
malte-v
91418d3e57 programs.neomutt: Make manual configuration take precedence over generated settings (#1896) 2021-04-11 19:52:31 +02:00
Vonfry
f567ea8228 msmtp: add extraAccounts option
It is appended to the end of msmtprc instead of top like extraConfig.
2021-04-10 10:03:47 +02:00
brwith
17a10287d2 gtk: use font.size option in dconf (#1920)
Allow usage of font.size for the GTK interface font in dconf.
2021-04-09 21:45:14 -04:00
jgart
56f5f41ed4 README: typo fix (#1912) 2021-04-08 11:11:39 -04:00
Sumner Evans
be56b6f2c5 neomutt: Add encryptByDefault support (#1882)
Adds support for encryptByDefault to the neomutt module using the
crypt_opportunistic_encrypt option.
2021-04-07 15:45:50 -04:00
dependabot[bot]
c12897e8e1 ci: bump cachix/cachix-action from v8 to v10
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from v8 to v10.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v8...73e75d1a0cd4330597a571e8f9dedb41faa2fc4e)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-07 19:21:04 +00:00
dependabot[bot]
4fd4066d2f ci: bump cachix/install-nix-action from v12 to v13
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from v12 to v13.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v12...8d6d5e949675fbadb765c6b1a975047fa5f09b27)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-07 21:18:15 +02:00
Robert Helgesson
7fcfd9b565 home-manager: format home-manager/default.nix 2021-04-07 21:09:27 +02:00
ant-arctica
3a16ebdf72 home-manager: Add --flake option to home-manager (#1856)
Implements a --flake options for build and switch, along with the usual
flake related optons (for lock-files etc).

Configurations in the flake are automatically discovered in the
following order:
1. `outputs.homeConfigurations."$flake-uri"` (the `--flake parameter`)
2. `outputs.homeConfigurations."$USERNAME@$HOSTNAME"`
3. `outputs.homeConfigurations."$USERNAME"`

Make home-manager use default configuration from
~/.config/nixpkgs/flake.nix, if it exists and nothing else is
specified.

Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
2021-04-07 13:17:39 -04:00
Nicolas Berbiche
e5a260a569 xmonad: use compiled configuration when config is not null (#1893)
If the configuration is `null`, the compiled configuration
`xmonadBin` should not be used and instead the WM startup command
should be set to the bare `xmonad` binary.
2021-04-07 13:05:21 -04:00
Sebastian Zivota
33edf558a0 lib/types/fontType: Add size attribute (#1848)
* lib/types: Add size attribute to fontType
* tests: Add test for kitty
* modules/types/fontType: Make size nullable
* Add release notes

Co-authored-by: Sebastian Zivota <sebastian.zivota@mailbox.org>
2021-04-07 16:18:09 +02:00
Viacheslav Lotsmanov
cc60c22c69 programs.git: make signing key id be optional (#1886)
* Git: Make signing key id be optional

Thus by default the signing key is selected by commit’s author.

* Git: Add tests for config with and without signing key id
* Git: Format tests for signing key
* Git: Remove default value (null) for signing key
* Git: Update description for signing key
2021-04-05 14:28:36 +02:00
Sumner Evans
25a6a6d298 neomutt: support list in binds.map (#1885)
* neomutt: support list in binds.map
Closes #1245

Adds support for specifying programs.neomutt.binds[].map as a list. If
specified as a list, then the binds will be concatenated with a ",".

* neomutt: add deprecation warning for (binds|macros).map as string
Added note that specifying 'programs.neomutt.(binds|macros).map' as a string is deprecated. Instead, use the list form.

* neomutt: note deprecation warning in release notes
Added note that specifying 'programs.neomutt.(binds|macros).map' as a
single string is deprecated in favor of specifying it as a list

* neomutt: add assertion that map is not empty
Added an assertion that each 'programs.neomutt.(binds|macros).map' list contains at least one element.
2021-04-04 01:47:40 +02:00
Thiago Kenji Okada
6e3d93d7cc xdg-user-dirs: add createDirectories option
It automatically creates all the XDG user directories. Set to false as
default to not break backwards compatibility.
2021-04-03 17:59:52 +02:00
lunik1
ad04237d51 dircolors: apply extraConfig after settings (#1890)
Applying extraConfig before settings made it unable to override the
defaults.
2021-03-31 22:01:02 +02:00
Naïm Favier
447ed0fbcb bash: improve initialisation (#1850)
Resolves #1843. Allows aliases to be expanded in initExtra, and adds a
visible bashrcExtra option for commands that should be run in ~/.bashrc
even by non-interactive shells.
2021-03-31 20:08:24 +02:00
Sandro
90223cf3eb home-manager: allow overriding pkgs with --arg(str) (#1889) 2021-03-31 19:40:37 +02:00
Rodney Lorrimar
cbf0667037 programs.neomutt: Fix eval error when primary account not enabled (#1873)
* neomutt: Fix eval error when primary account not enabled

If neomutt is enabled for an account, but not the primary account, the
configuration will fail with "list index 0 is out of bounds".

This adds the first neomutt-enabled account as a fallback.

* neomutt: add regression test/update tests
2021-03-29 00:44:47 -04:00
Markus Scherer
c1761366b5 xmonad: add libFiles option and build type compilation
The `libFiles` option allows Home Manager to manage additional files
for xmonad.

Also compile xmonad during configuration build time. This avoids the
need to compile the configuration during activation.
2021-03-28 09:57:19 +02:00
Sumner Evans
7b30fc9922 dunst: update documentation on settings (#1881)
Fix a small discrepancy in the documentation for the dunst module.
2021-03-26 23:27:13 -04:00
Pacman99
fedfd430f9 nixos/nix-darwin: switch sharedModules type to anything with custom check (#1880)
functionTo tries to evaluate functions too quickly and prevents modules
from accessing pkgs argument. fixes #1878.

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-25 22:01:16 -04:00
Sandro Jäckel
ddcd476603 termite: remove use of package alias
This allow building with `allowAlias = false`.
2021-03-21 10:23:58 +01:00
Dany Marcoux
f30b62a74d git: install delta when it's enabled (#1866) 2021-03-18 18:32:50 -04:00
Dany Marcoux
f9b5172d95 jq: Use default upstream values for colors (#1870)
As documented here: https://stedolan.github.io/jq/manual/#Colors
2021-03-18 18:19:42 -04:00
Hugo Lageneste
de1fa8defb docs: fix darwin-rebuild command (#1869)
Fixing the `darwin-rebuild --switch` command on the manual 
to `darwin-rebuild switch` because the `--switch` flag does 
not exists.
2021-03-18 18:15:30 -04:00
Nicolas Berbiche
6245dd11cf chromium: remove 'extensions' option for proprietary Chrome versions (#1867)
Fixes #1383 by removing the `extensions` option for
- `programs.google-chrome`
- `programs.google-chrome-beta`
- `programs.google-chrome-dev`
2021-03-17 20:47:00 -04:00
anna
ffbc3819e4 prezto: fix environment files being overwritten (#1863)
Fixed the breakage for prezto introduced in #1778.

The previous method created issues where certain configuration files would get
replaced by prezto's variants instead of being merged as before. This led to
issues like no config being loaded if `home.zsh.dotDir` was set.

The old method of loading these files has been restored. This fixes the issue.
2021-03-17 18:35:10 +00:00
Naïm Favier
920ea74afe flake.nix: add nixosModule and darwinModule to outputs (#1858) 2021-03-16 21:19:01 -04:00
Peter Rice
b42d987ad9 neovim: fall back to plugin name if no pname (#1864)
When installing plugins, Home Manager expects plugins (packages) to have
a `pname` attribute.

This is not always the case, so fallback to `name` if `pname` is unset.
2021-03-16 20:09:16 -04:00
Mario Rodas
07f6c6481e lsd: use explicit path for aliases 2021-03-14 21:25:45 +01:00
Mario Rodas
1ee1835a3e lsd: add support for config file
lsd 0.19.0 added support for a configuration file
2021-03-14 21:25:44 +01:00
Mario Rodas
42bb553544 broot: use formats.toml to generate configuration 2021-03-13 04:20:00 +00:00
Mario Rodas
19c7d4e29f nushell: use formats.toml to generate configuration 2021-03-13 04:20:00 +00:00
Mario Rodas
a4e146693e starship: use formats.toml to generate configuration 2021-03-13 04:20:00 +00:00
erictapen
040ea28e44 offlineimap: Strip newlines from offlineimap passwordcommand (#1853)
This allows me to use offlineimap with passwordstore. I guess nobody
uses a newline in their password?

Co-authored-by: Kerstin Humm <kerstin@erictapen.name>
2021-03-10 18:39:29 -05:00
Thiago Kenji Okada
57a7e5e2c5 docs: document qt.style and programs.rofi.theme changes (#1849)
* docs: document qt.style changes

* docs: document programs.rofi.theme changes
2021-03-08 15:46:57 -05:00
midchildan
5fbb33cff5 targets/genericLinux: set TERMINFO_DIRS (#1819)
This makes terminfo descriptions in installed packages available to
shell sessions. Not needed for NixOS, which does the same thing already.
2021-03-08 15:41:23 -05:00
Pierre Labadens
abc9d96d19 waybar: fix slow service stop (#1852)
Set the systemd user service to use "mixed" killmode, which lets waybar
stop its module scripts. This fixes issues where waybar blocks shutdown
until systemd sends a SIGKILL to waybar child processes.
2021-03-06 02:09:51 -05:00
fortuneteller2k
73559e0dbc qutebrowser: add option to load autoconfig (#1842)
See #1774.

The option default to false.
2021-03-04 22:33:23 -05:00
Thiago Kenji Okada
0e2dc4be30 qt: add qt.style option (#1839)
This allows you to set a theme for Qt applications. For example, if you
want to use `adwaita-qt` theme to have uniform look between Gtk and Qt
applications, you can use it like this:

```nix
{
  qt = {
    enable = true;
    platformTheme = "gnome";
    style = {
      name = "adwaita";
      package = pkgs.adwaita-qt;
    };
  };
}
```
2021-03-03 22:20:17 -05:00
Andrew Fontaine
39e4991856 git: Add configured SSL certificate for SMTP (#1833)
If you have a custom SSL certificate configured for SMTP TLS, git should
use it.
2021-03-03 21:24:19 -05:00
Teo Ljungberg
69e2693342 home-manager: respect NO_COLOR environment variable
This makes Home Manager respect the NO_COLOR environment variable to
disable coloring from output generated by Home Manager.

This initiative can be found more on https://no-color.org/
2021-03-03 23:28:06 +01:00
Nicolas Berbiche
ddee030dc7 gpg: export GPG_TTY for fish (#1846) 2021-03-03 21:59:13 +01:00
Thibaut Marty
e72e241d7a getmail: fix configuration mailboxes generation (#1719)
The mailboxes must be a tuple of string or the string "ALL".
The generated value was broken if the mailboxes configuration was a list
of only one string (but not "ALL"): the generated expression ( "str" )
was not a tuple but a string.
Now, we always generate a tuple (by adding a comma, even with a list of
size one). Getmail works with the special value "ALL" whether it is a
in tuple or not, so this case is not specifically handled.
2021-03-01 17:58:18 -05:00
Markus Scherer
9068ff292c offlineimap: precompile get_settings.py
Fixes #1802
2021-03-01 13:02:10 +01:00
Andrew Fontaine
f45c7000d5 git: correct value of envelopeSender for msmtp (#1838)
The value should be "auto", not `true`.

Also fix news entry.
2021-02-28 20:42:44 +01:00
Andrew Fontaine
aa479b0124 git: rely on msmtp for smtp if msmtp is enabled (#1829)
If a user using msmtp to send all their email, it would be preferred if
git used it as well.

The only settings necessary are to set the smtp server to the msmtp
binary and set envelop sender to true, which makes git call msmtp with
the -f flag to set the from address from the email.
2021-02-28 16:06:11 +01:00
Phillip Cloud
3327cbe1f9 gh: fix protocol setting (#1831)
* gh: fix protocol setting

* gh: fix test
2021-02-27 21:42:56 +01:00
Rien
fb9bf032fb alot: set primary email first (#1826)
Alot uses the first email in the config as primary email. Because the
order in which the email.accounts were sorted was alphabetical, the account
set to `primary = true` was not put first in the alot config and thus
not considered as primary email for alot.

This was fixed by sorting the email accounts again such that accounts
with `primary = true` come first.
2021-02-27 21:41:16 +01:00
fortuneteller2k
e7b1491fb8 pulseeffects: add option to specify package (#1825) 2021-02-23 14:37:38 -05:00
Kevin Mullins
0933fb8765 Starship: improve zsh terminal check (#1821)
Matches zsh's check with bash and fish, checking for a dumb terminal and
allowing vterm inside Emacs.
2021-02-23 19:51:27 +01:00
Manuel Mendez
7582090eb0 kakoune: Fix reference to group in hook config (#1820)
Fixes "undefined variable 'group' at .../kakoune.nix:577
2021-02-22 22:21:36 +01:00
Nicolas Berbiche
21952f1cab fzf: remove non-working historyWidgetCommand option (#1818)
The environment variable FZF_CTRL_R_COMMAND has never existed
and been support by fzf according to
`git grep FZF_CTRL_R_COMMAND $(git rev-list --all)` and
`git log -G FZF_CTRL_R_COMMAND`.
2021-02-21 23:34:33 -05:00
Robert Helgesson
029767ca63 docs: use working link for "DocBook rocks!" 2021-02-21 18:41:12 +01:00
Robert Helgesson
aa9affb53f nix-darwin: remove trailing whitespace 2021-02-21 18:40:19 +01:00
Pacman99
82d6ba7003 nixos,darwin: add sharedModules and extraSpecialArgs options (#1793)
This allows users of the nixos and nix-darwin module to set shared modules
for all users and extra specialArgs to be available to home-manager modules.

The latter is named extraSpecialArgs just like the argument to
modules/default.nix.
This could be confusing since the the two are independent in code,
but they do mean the same thing so I think the name fits.

Darwin can now refer to the global system configuration if used as a module
through the special `darwinConfig` argument.

Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
2021-02-21 01:02:25 -05:00
Nicolas Berbiche
eb3a0342a8 gpg: allow for duplicate keys in config (#1814)
Allow for duplicate keys in the form of a list of strings.

Also update the `settings` example configuration to use `literalExample`.
2021-02-21 00:37:46 -05:00
midchildan
2b7a73071a targets/darwin: copy fonts to ~/Library/Fonts/HomeManager (#1817)
Fonts are copied instead of being symlinked because macOS won't
recognize symlinked fonts.
2021-02-21 00:34:56 -05:00
Nadrieril
da92360208 polybar: allow config to be more nix-like (#1430)
Polybar's config format is a bit strange, and lists in particular are
annoying to handle. This enables using normal nix lists and nested
attrsets instead.

This change is not backwards-compatible, because the INI converter
converts lists of strings to space-separated values, and this does
something else. I expect that this is only relevant for the
`modules-left` etc bar setting, but that's enough to break things :(.
2021-02-20 18:34:59 +01:00
Matthieu Coudron
55030c8302 neovim: deprecate programs.neovim.configure (#1810)
The `configure` option is not type checked and an artifact of how
nixpkgs is implemented.
We now have the equivalent options in home-manager and managing
interactions between the 2 systems complexifies maintainance of the
module.
Please use the other options at your disposal:
configure.packages.*.opt  -> programs.neovim.plugins = [ { plugin = ...; optional = true; }]
configure.packages.*.start  -> programs.neovim.plugins = [ { plugin = ...; }]
configure.customRC -> programs.neovim.extraConfig
2021-02-19 09:52:46 +01:00
Thiago Kenji Okada
2e795f3efd redshift/gammastep: fix deprecated options warning (#1804)
It was not working since I forgot to inherit imports from commonOptions.
2021-02-16 23:19:28 -05:00
Olmo Kramer
1ee1d01daa bash: don't unconditionally set HISTFILE variable (#1621)
The bash module always assigns a value to HISTFILE in the bashrc, even
when no value is explicitly set. This makes it impossible to tell bash
to use a different HISTFILE by setting the HISTFILE environment variable

    HISTFILE=/tmp/bash_history bash

This changes the default value of programs.bash.historyFile to null, and
only writes the HISTFILE=... line to the bashrc if it is changed to
something else.
2021-02-12 19:06:24 +01:00
Thiago Kenji Okada
87e2ec341b rofi: support top-level clauses in rasi (#1788)
See https://github.com/nix-community/home-manager/pull/1748#issuecomment-774995577
for details.

Related documentation:
920de75c4b (splitting-configuration-over-multiple-files)
2021-02-09 15:59:29 +01:00
Martin Weinelt
e6f2687a83 firefox: drop enableAdobeFlash option (#1791)
It was removed in nixpkgs and causes an error on rebuilds.

error: Your configuration mentions firefox.enableAdobeFlash. All plugin related options have been removed, since Firefox from version 52 onwards no longer supports npapi plugins (see https://support.mozilla.org/en-US/kb/npapi-plugins).
2021-02-08 23:37:24 -05:00
Pablo Ovelleiro Corral
b220d5c446 prezto: fix #1773 (#1778)
* zsh: update prezto path structure

The path structure was changed in Nixpkgs and this commit updates
the module to match.

Fixes #1773

* zsh-prezto: fix tests, small tidyup

Co-authored-by: Nick Hu <me@nickhu.co.uk>
2021-02-09 02:11:56 +00:00
Tristan
88e05a5472 obs-studio: Allow package to be configurable (#1787) 2021-02-08 15:50:59 -05:00
Thiago Kenji Okada
d8dd2a09b0 redshift/gammastep: use ini file
Not every option is exposed by redshift/gammastep parameters, for
example gamma options are only exposed in configuration file. So this
PR refactors this module to generate a configuration file and pass it
to the redshift/gammastep using -c parameter.

This is a breaking change since there is no support for some of the
older options like `extraOptions`, but unless you use `extraOptions`
it should work without changes.
2021-02-07 23:33:17 +01:00
Robert Helgesson
ef4370bedc tests: allow testing assertions
By default tests are expected to produce no assertion.

This also updates the existing tests to match.
2021-02-07 22:48:22 +01:00
Robert Helgesson
bdee1be7b3 Revert "redshift/gammastep: use ini file"
Manual latitude and longitude setting doesn't work in Redshift.

This reverts commit dd6ee694df.
2021-02-07 10:20:03 +01:00
Thiago Kenji Okada
dd6ee694df redshift/gammastep: use ini file
Not every option is exposed by redshift/gammastep parameters, for
example gamma options are only exposed in configuration file. So this
PR refactors this module to generate a configuration file and pass it
to the redshift/gammastep using -c parameter.

This is a breaking change since there is no support for some of the
older options like `extraOptions`, but unless you use `extraOptions`
it should work without changes.
2021-02-07 10:02:57 +01:00
yoctocell
6dfa9ef85c mbsync: add subFolders option (#1760)
The `SubFolders` option in mbsync controls the folder naming style in
the maildir.  There are three different styles:

* Verbatim - <maildirPath>/top/sub/subsub
* Maildir++ - <inboxPath>/.top.sub.subsub (used by Dovecot)
* Legacy - <maildirPath>/top/.sub/.subsub

Previously, the `SubFolders` option was hardcoded to `Verbatim`.  This
change allows configuration of the `SubFolders` option.
2021-02-06 22:25:49 +01:00
Matthieu Coudron
fc87ac92af neovim: suffix path with extraPackages (#1756)
* neovim: suffix path with extraPackages
* neovim: avoid generating empty blocks in config
* fix(neovim): install plugin regardless if there is config
2021-02-06 20:43:17 +01:00
Jakub Kozłowski
d420287583 vscode: add args option to keybindings
Also make `when` optional.
2021-02-05 22:38:37 +01:00
Robert Helgesson
46a750f94f home-manager: use 21.05 as next version
Fixes #1662
2021-02-05 22:09:00 +01:00
Jakub Kozłowski
63d5d28db6 sbt: add new module 2021-02-04 23:42:37 +01:00
Robert Helgesson
22ecd0e568 vscode: fix typo 2021-02-04 23:26:00 +01:00
Thiago Kenji Okada
3f2f7f8efa rofi: add support for lists in rasi (#1768)
This is now supported without the need of using to represent them:
9a843caa86/Official%20Themes/solarized.rasi (L134)
2021-02-03 18:48:34 -05:00
midchildan
9dad146639 targets/darwin: add more options for configuring macOS (#1753)
Add new options Darwin options:

- `targets.darwin.defaults`
  This adds options for configuring macOS through the `defaults(1)` system.
  This option can be used to manipulate a vast majority of user settings for macOS
  and its applications.

  This is implemented using freeform modules and includes additional descriptions
  and type information for some useful options.

- `targets.darwin.keybindings`
  This adds options for configuring the default keybindings for macOS text fields.

- `targets.darwin.search`
  This adds options for configuring the default search engine for macOS.
2021-02-03 18:46:16 -05:00
Robert Helgesson
bbb6d30001 newsboat: switch from xdg_utils to xdg-utils 2021-02-03 23:40:41 +01:00
Bernardo Meurer
0fa2b16a07 modules: don't reference deprecated stdenv.lib (#1770)
`stdenv.lib` has been deprecated, and the correct approach is to use
`lib` directly through `pkgs.lib`.
2021-02-01 09:52:05 -05:00
Sara Johnsson
df7d81b0b3 playerctld: add module 2021-01-31 12:36:30 +01:00
Thiago Kenji Okada
98d030f723 rofi: add support to custom themes
If this commit now it is possible to define a custom theme directly
using Nix, like this:

```nix
{
   programs.rofi.theme = {
      "*" = {
         background-color = "#000000";
         border-color = "FFFFFF";
         width = 512;
      };
      listview = {
         cycle = true;
      };
   };
}
```

And this will be converted to the proper rasi format to be used in
rofi.
2021-01-30 09:13:28 +01:00
Jack McCown
7313258b45 spotifyd: change config format to toml
Fixes #1754
2021-01-29 21:25:00 +01:00
Robert Helgesson
db88b625f9 docs: minor fix 2021-01-27 22:48:41 +01:00
Thiago Kenji Okada
7de0d07dd9 redshift/gammastep: add tests 2021-01-26 01:40:25 -03:00
Thiago Kenji Okada
6b15b03898 redshift/gammastep: unify common options
Nowadays services.{redshift,gammastep} modules are really similar. They
should, since Gammastep is a fork of Redshift with the main objective is
to support Wayland.

So instead of trying to maintain two separate modules, this commit unify
the options in lib/options.nix file, making the implementation of the
module itself ends up being really simple (just calling the common
options with the necessary parameters to differentiate between them).
2021-01-26 01:39:50 -03:00
Robert Helgesson
c137866bd7 redshift: add systemd unit documentation field 2021-01-23 18:26:25 +01:00
William Carroll
3d634914ce redshift: use on-failure restart policy 2021-01-23 18:22:28 +01:00
midchildan
e44faef21c i18n: various fixes 2021-01-23 16:40:25 +01:00
Thiago Kenji Okada
6f7074d21d rofi: migrate to rasi configuration format (#1736)
* rofi: migrate to rasi configuration format

The Xresources configuration format is deprecated in Rofi. For example,
using Rofi from unstable (1.6.1 as of now) you get the following
warnings when starting the application:

```
(process:9272): Rofi-WARNING **: 01:38:48.596: The old Xresources based configuration format is deprecated.

(process:9272): Rofi-WARNING **: 01:38:48.596: Please upgrade: rofi -upgrade-config.
``````

So this commit migrates it for its new configuration format, called rasi
instead.

This new implementation uses attrsets manipulation instead of using
strings, making the code clearer and also fixing some bugs found during
the way. To make sure everything is right, I also created some tests.

If someone wants to validate if the generated config is correct, just
run in terminal:

```
$ rofi -dump-config
```

And rofi will dump the current configuration file, including all
unsetted options.

* docs: document programs.rofi.extraConfig changes

* rofi: add thiagokokada as maintainer

* rofi: add toRasi function
2021-01-23 16:30:34 +01:00
midchildan
9a12cd7e81 i18n: set the appropriate LOCALE_ARCHIVE_x_xx variable (#1659) 2021-01-23 15:56:38 +01:00
li
08fc1586c0 fzf: add package option 2021-01-22 23:29:41 +01:00
Tino Breddin
4e86d65aee nextcloud-client: add package option 2021-01-22 21:34:13 +01:00
Thiago Kenji Okada
2c0e3f61da mpv: fix issue #1725 and add tests (#1726)
Closes issue #1725.

This allows mpv module to be customized with support for more advanced
features than the `programs.mpv.scripts` current support. For example,
with this change now this is possible:

```nix
{
  programs.mpv.package = (pkgs.wrapMpv (pkgs.mpv-unwrapped.override {
    vapoursynthSupport = true;
  }) {
    extraMakeWrapperArgs = [
      "--prefix" "LD_LIBRARY_PATH" ":" "${pkgs.vapoursynth-mvtools}/lib/vapoursynth"
    ];
  });
}

```

Since `programs.mpv.package` doesn't necessary reflect the final
derivation anymore (see #1524), we introduce `programs.mpv.finalPackage`
that has the resulting derivation.

This includes 2 tests:
- One to check if everything is alright with mpv
- Other to validate our assertion that package and scripts can't be
  passed both at the same time

* docs: document recent mpv module changes

* mpv: add thiagokokada as maintainer
2021-01-21 18:10:12 -05:00
Robert Helgesson
5280360d6c docs: NixOS and nix-darwin option documentation 2021-01-21 23:45:52 +01:00
jD91mZM2
c33b1777b6 chromium: fix preinstallation of crx files
We currently check `isPath` and `isString` on crxPath and version
respectively, which is

1. pointless because the module system already does such checks, and
2. wrong because isPath means path literal; a derivation therefore is
   not a path.
2021-01-21 23:24:29 +01:00
Robert Helgesson
b0c8727286 dconf: make sure the configuration directory exists
Fixes #1731
2021-01-21 20:35:03 +01:00
jD91mZM2
6f5fa6350d chromium: support ungoogled-chromium
The guessed browser name is wrong here, ungoogled-chromium simply uses
"chromium" as configuration name.
2021-01-21 20:23:16 +01:00
Robert Helgesson
9d680ec662 kakoune: disable the kakoune-use-plugins test 2021-01-20 19:49:15 +01:00
Robert Helgesson
7e80e034cc gh: fix attribute paths
This fixes some attribute paths to match recent changes in Nixpkgs.
2021-01-20 18:59:58 +01:00
Robert Helgesson
8f24ed4c7f git: fix attribute paths
This fixes some attribute paths to match recent changes in Nixpkgs.
2021-01-20 18:58:35 +01:00
MaxSchlueter
3fe2a57b95 mu: fix command (#1623)
mu-cfind is meant to search for contacts within your contacts database and the emails that you have sent/received. The use of the --personal flag in that command is meant to filter for only emails that use your email addresses (which are all the ones you specify with the ${myAddresses} variable. Disregard what I said in #1623 (comment).

--my-address=<my-email-address>

    specifies that some e-mail addresses are 'my-address' (--my-address can be used multiple times).
    This is used by mu cfind -- any e-mail address found in the address fields of a message which also
    has <my-email-address> in one of its address fields is considered a personal e-mail address. This
    allows you, for example, to filter out (mu cfind --personal) addresses which were merely seen in
    mailing list messages.

To initialize the database with mu init, the ${myAddresses} is not required to be passed to successfully initialize the database, but it is heavily recommended to do so.

To see the difference, in a safe location, run mu init --maildir=<path>, then mu index. You'll notice that "personal addresses" returns <none>, although the database will still work. However, mu cfind --personal will fail (as the personal contacts don't exist). Then run mu init --maildir=<path> --my-address=<address>, then mu index. Then you'll be able to search for contacts using mu cfind --personal.
2021-01-19 19:36:31 +01:00
Nicolas Berbiche
8127799f79 sxhkd: configurable package and command line arguments
Fixes #1598.
2021-01-16 10:57:32 +01:00
Alexander Foremny
4b772fd698 neomutt: fix smtp_pass option
Configuration option `smtp_pass` is expected to evaluate a shell
command, thus its value has to be in double-quotes.
2021-01-12 13:32:03 +01:00
Simon Bruder
65d0e2d241 mpv: add defaultProfiles option 2021-01-11 23:51:58 +01:00
Nicolas Berbiche
d62bdaf938 sway: fix error with null package and swaybar
When setting `...sway.package = null`, the default bar configuration
would throw an error trying to use the bar from the null package.

Logic is added to use the bar from `pkgs.sway` instead of `cfg.package`
if it is null.

Fixes #1714
2021-01-11 12:26:18 -05:00
Nicolas Berbiche
45e3b0ce0e sway&i3: refactor replace moduleName check with variables 2021-01-11 12:18:32 -05:00
Ivan Babrou
cc89be5a30 docs: remove stray ` from README.md
The typo came from #1705.
2021-01-11 00:14:01 +01:00
meck
e8358125d9 fish: fix regression due to changes in Nixpkgs
Fixes #1701
Fixes #1702
2021-01-09 22:35:03 +01:00
Robert Helgesson
cb1ed0d2f3 docs: rephrase warning section slightly 2021-01-09 10:09:43 +01:00
Aleksey Kladov
32371301d3 doc: clarify what is user environment 2021-01-09 08:58:46 +01:00
mlatus
cf5dad76c1 flake: add extraSpecialArgs
This allows flake user to pass extra arguments to all modules.
2021-01-07 21:13:28 +01:00
workflow
a361541c10 broot: add package option
Allow for overriding the package used.
2021-01-06 11:16:36 +08:00
Robin Townsend
b9597e5774 starship: remove deprecated character.symbol setting
Fixes #1550
PR #1695
2021-01-03 10:21:55 +01:00
Anund
68dfc86173 home-manager: add zsh completion
Fixes #1075
2021-01-03 10:13:46 +01:00
Emery Hemingway
73506f947c plan9port: add module 2021-01-02 08:50:57 +01:00
Philipp Mildenberger
f0e6396b78 nushell: fix link in the description (fixes #1693) (#1694) 2021-01-01 21:35:43 -05:00
Robert Helgesson
6acc6bc651 pam: add note about future deprecation
See #1691 for more information.
2021-01-01 09:51:26 +01:00
Robert Helgesson
f6fd7e3fa4 octant: add code owner entry 2020-12-31 15:49:29 +01:00
06kellyjac
05448dcedb octant: add module 2020-12-31 15:18:13 +01:00
Vojtěch Káně
374649a15b docs: some extension for flakes users
PR #1655
2020-12-31 15:12:40 +01:00
zimbatm
118b36bf45 direnv: fix the fish source
This is needed for the latest version of direnv. See
https://github.com/direnv/direnv/issues/742
2020-12-31 00:49:55 +01:00
Robert Helgesson
3e218f2600 docs: improve phrasing around backwards compatibility 2020-12-31 00:46:56 +01:00
Nicolas Berbiche
f4b5ae026c waybar: fix css identifier check (#1687)
Fixes #1686
2020-12-30 18:17:39 -05:00
Robert Helgesson
9d53afb709 tests: add support for asserting warnings
This adds a "test.asserts" module that currently just provides a
convenient way to assert on the content of warnings. By default all
tests will assert that no warnings are given.
2020-12-30 17:25:48 +01:00
Robert Helgesson
4dedfcfd95 tests: bump nmt 2020-12-30 17:25:44 +01:00
Matthieu Coudron
8e0c1c55fb programs.neovim: write config in $XDG_CONFIG_HOME/init.vim (#1652)
* neovim: write config in $XDG_CONFIG_HOME/init.vim

instead of wrapping the configuration, which has sideeffects
https://github.com/NixOS/nixpkgs/issues/55376

* fix: update test accordingly
2020-12-29 20:26:02 +01:00
Nicolas Berbiche
99f0074362 waybar: allow CSS class when using a default module
Fixes #1682
2020-12-28 20:43:40 -05:00
Shane
5263fe4594 imapnotify: switch to goimapnotify instead of node-imapnotify (#1675)
I also made some modifications to the systemd service to match the [AUR version](https://aur.archlinux.org/cgit/aur.git/tree/goimapnotify@.service?h=goimapnotify) of `goimapnotify`. In particular, restarting is useful in case a network failure causes `imapnotify` to exit - that shouldn't mean that it stops trying when the network comes back up.
2020-12-27 16:10:55 +01:00
Sebastián Estrella
cd86c2638b gnome-terminal: Add audibleBell option (#1671)
Turn on/off the terminal's bell
2020-12-27 16:09:59 +01:00
Wael M. Nasreddine
bcbf09a202 github: configure dependabot
Configure GH's dependabot to file pull requests automatically that
updates our GitHub actions.
2020-12-26 08:55:23 +01:00
David Arnold
ca7fd5a643 readme: use less ambiguous user name in example
The example used `user` as the username, which may be confusing.
Instead use `jdoe`, which is more clearly a username.
2020-12-25 13:16:30 +01:00
Sebastien Waegeneire
3627ec4de5 chromium: add support for external extensions
This allows the installation of external (outside of the Chrome Web
Store) extensions, both local and remote.

PR #1648
2020-12-23 00:59:03 +01:00
Mario Rodas
2901044520 mcfly: add option to enable fuzzy search
McFly 0.5.1 added support for fuzzy searching.
2020-12-22 00:30:47 +01:00
Andrew Jeffery
cb136f37c7 mako: add extraConfig option 2020-12-22 00:19:37 +01:00
Austin Butler
76de0632ac starship: update prompt_order to format in example 2020-12-21 23:56:46 +01:00
Robert Helgesson
8b3fca4ec5 dconf: format file 2020-12-21 23:22:22 +01:00
bobfp
2b1892e646 docs: make nix-channel choice more clear 2020-12-21 00:28:14 +01:00
toonn
a1162e04b3 tmux: add a prefix option overruling shortcut if defined
Previously, it was not possible to set an arbitrary tmux prefix since
CTRL was hardcoded in the module.

To avoid breaking existing configs, a new option was implemented that
conveniently uses the tmux terminology but defaults to null and does
not affect previous behavior when set to null.

The behavior for the shortcut option was not completely replicated,
i.e., it does not bind "b" to send-prefix but stick to the default of
the prefix binding sending prefix (C-b C-b instead of C-b b) and it
does not bind repetition of the prefix (C-b C-b) to `last-window`,
both of these bring the option closer to the default tmux
configuration.

Fixes #1237
2020-12-21 00:10:59 +01:00
Christian Lütke-Stetzkamp
e87bccabc3 dunst: include legacy icons
Fixes #744
2020-12-19 09:56:17 +01:00
seylerius
1a7f190cb9 rofi-pass: add rofi-pass plugin for password-store 2020-12-18 23:22:57 +01:00
c4710n
66a68b4a58 chromium: add support for brave
Brave Browser is a chromium-based browser, too.

+ it use the same web store with Chromium and Google Chrome.
+ the machanism of installing extensions works, and it's verified on
my macOS box.
2020-12-15 18:39:16 +01:00
Roosembert Palacios
6dc8de259a flake: expose Home Manager lib 2020-12-14 21:02:15 +01:00
Robert Helgesson
708cb61e82 systemd: support sd-switch
This adds support for sd-switch, a tool to perform systemd generation
switches. It can be activated by setting

    systemd.startServices = "sd-switch";
2020-12-13 22:00:30 +01:00
Vojtěch Káně
b6ed605d4a systemd: support mount units 2020-12-10 23:16:51 +01:00
Guillaume Girol
6739d8bb50 targets/genericLinux: make locales work 2020-12-10 22:34:30 +01:00
Jos van Bakel
4f0b0d78af msmtp: fix passwordeval (#1649) 2020-12-10 22:32:34 +01:00
Matthieu Coudron
9d775bad07 neovim: mark plugins as optional (possibly) (#1559)
can be loaded with packadd!
2020-12-10 22:30:16 +01:00
Ivar
e6a58a7e71 pbgopy: add service 2020-12-09 23:45:51 +01:00
Jos van Bakel
e3828769e8 msmtp: fix passwordeval (#1643)
msmtp fails with broken pipe error when sending emails.
The new line after the password is not required anymore since msmtp 1.8.0.
2020-12-09 09:22:00 +01:00
Sandro Jäckel
275d1b5212 systemd: allow creating slices 2020-12-05 09:18:17 +01:00
Sandro
aaa5329d39 systemd: Fix example (#1639)
missing `;`
2020-12-04 18:39:05 +01:00
Nicolas Berbiche
005ea6cc18 zathura: allow configuring the package used (#1636)
Closes #1633
2020-12-04 18:38:22 +01:00
Blaž Hrastnik
0654364426 waybar: fix systemd service
The current definition makes waybar wait for dbus.service, but that
never happens because dbus.service is started on demand by
dbus.socket.

Per systemd docs:
  https://www.freedesktop.org/software/systemd/man/systemd.service.html#Implicit%20Dependencies

- Services with Type=dbus set automatically acquire dependencies of
  type Requires= and After= on dbus.socket.

- Socket activated services are automatically ordered after their
  activating .socket units via an automatic After= dependency.
  Services also pull in all .socket units listed in Sockets= via
  automatic Wants= and After= dependencies.

Removing Requisite/After makes the service properly start for me,
simply specifying Type=dbus is enough.

See #1370
2020-12-01 23:07:39 +01:00
Robert Helgesson
0027b0e76b gitlab-ci: use nixos-unstable channel 2020-12-01 22:46:22 +01:00
Matthias Riße
33407189c1 wlsunset: add module
This adds the wlsunset module, a program for day/night gamma
adjustments on wayland.

Fixes #1625
2020-12-01 21:46:46 +01:00
Nicolas Berbiche
44f9d68d8c treewide: replace attrs by formats or types.anything 2020-11-29 21:54:55 -05:00
Robert Helgesson
c1faa848c5 tests: update nmt version
Greatly reduces the memory use when running full test suite.

Fixes #1610.
2020-11-30 00:12:38 +01:00
Tyler Benster
c6263347de zsh: add initExtraFirst option 2020-11-29 19:39:47 +01:00
Terje Larsen
a3a0f1289a emacs: make service package configurable 2020-11-22 13:09:22 +01:00
Robert Helgesson
7b6ebf2785 Revert "sway: validate configuration at build time"
This reverts commit 99b75f99df. See

  https://github.com/nix-community/home-manager/issues/1613 and
  https://github.com/nix-community/home-manager/pull/1614

for associated discussions.
2020-11-17 18:45:23 +01:00
Nicolas Berbiche
6dc68b1d16 i3: validate configuration at build time
PR #1579
2020-11-16 23:51:59 +01:00
Nicolas Berbiche
99b75f99df sway: validate configuration at build time
PR #1579
2020-11-16 23:51:34 +01:00
Nicolas Berbiche
964f698095 waybar: fix null modules-{left,center,right} error
- Change the `attrsOf unspecified` to `pkgs.formats.json`
- Add missing default modules
- Expand the `with lib` with every function used
- Add inline documentation about the generated warnings
2020-11-16 22:56:54 +01:00
Robert Helgesson
4f20ee61c2 sway: restore use of pkgs.sway
Using the final package in the `onChange` block broke some use cases.
This restores the old behavior and instead solves the test
dependencies in a different way.

Fixes #1611

This reverts commit 7c3c64208e.
2020-11-16 22:35:07 +01:00
Ashish SHUKLA
9e01441c5c zsh: Add dirHashes option 2020-11-15 23:49:55 +01:00
Robert Helgesson
9fe15dc83b tests: remove format meta test
This test requires copying the Home Manager checkout to the Nix store,
which seems to require too much memory for the CI jobs. Instead simply
run the format script directly.
2020-11-15 23:12:26 +01:00
Robert Helgesson
b9b8a42fda github-ci: use default max-jobs 2020-11-15 23:12:06 +01:00
Martin Toman
b04aa56503 powerline-go: add zsh integration 2020-11-15 00:12:02 +01:00
Robert Helgesson
cde1d33e61 sway: remove test dependency on xwayland 2020-11-14 23:49:34 +01:00
Robert Helgesson
b3fdbfdf42 git: use gitMinimal in test 2020-11-14 23:18:07 +01:00
Robert Helgesson
f3372bf982 kakoune: use a plugin with smaller closure size in test 2020-11-14 23:17:54 +01:00
malte-v
234de0270a broot: improve configuration
The `invocation` is an optional attribute, so it doesn't make sense to
use it as the key in an attribute set. See

  https://dystroy.org/broot/documentation/configuration/#verb-definition-attributes

Actually, `invocation` should not be defined when one wants to rebind
a built-in verb to a different key.

Also added documentation for the `key` attribute.
2020-11-14 23:04:46 +01:00
Joe Hermaszewski
9c14bbe988 tmux: allow setting default-shell before new-session 2020-11-14 10:59:10 +01:00
Robert Helgesson
7c3c64208e sway: use configured package in reload script
Fixes unnecessary download of the plain `sway` package.
2020-11-14 10:38:58 +01:00
Robert Helgesson
b5e7817de2 zsh-prezto: remove package dependency in test 2020-11-14 10:37:35 +01:00
Robert Helgesson
fe849640ad ci: update github workflow actions 2020-11-14 10:15:12 +01:00
Robert Helgesson
fd79015c0f home-manager: pass -j to nix-build
Fixes #1596
2020-11-13 23:56:57 +01:00
Nicolas Berbiche
4cc1b77c3f kakoune: fix tests
Following https://github.com/NixOS/nixpkgs/pull/91792
2020-11-05 21:00:22 -05:00
workflow
9e9d8ffc7c i3status-rust: add module
This adds the i3status-rust[0] module, a replacement for i3status
written in pure Rust.

[0] https://github.com/greshake/i3status-rust
2020-11-05 23:59:47 +01:00
Robert Helgesson
faca77d77d docs: convert installation chapter to AsciiDoc 2020-11-05 22:52:20 +01:00
Robert Helgesson
ef72617c4a home-manager: add --version option 2020-11-03 23:12:24 +01:00
Robert Helgesson
249e31b656 docs: expand the issue template a bit 2020-11-03 22:46:13 +01:00
Robert Helgesson
0261950395 docs: update issue template 2020-11-03 20:29:25 +01:00
AstroSnail
1066e01707 mpv: use lib.generators to render config
There exist mpv configurations which cannot be expressed in
`programs.mpv.config` currently. For example, it is impossible to use
multiple 'profile' attributes. This commit changes the way config and
profiles are parsed, using `lib.generators.toKeyValue` and
`lib.generators.toINI`, to allow for these kinds of configurations
through the use of `listsAsDuplicateKeys`.
2020-11-03 00:28:24 +01:00
Nick Hu
61e63c10dc parcellite: make package configurable 2020-11-03 00:12:04 +01:00
workflow
5125fc0a47 CI: update nix-install-action to v11
Release notes: https://github.com/cachix/install-nix-action/releases/tag/v11
2020-11-02 23:55:37 +01:00
Nikita Uvarov
cabf9ddd98 caffeine: add service 2020-11-02 23:38:47 +01:00
Robert Helgesson
612afee126 docs: fix copy-paste mistake 2020-11-02 23:37:28 +01:00
Robert Helgesson
072a6ea333 docs: change stable from 20.03 to 20.09 2020-11-02 23:13:20 +01:00
Ivan Tham
a98ec6ec15 readme: mention that Nix 2.4 is not supported
Improves experience before people manually find #1561.
2020-10-28 23:03:00 +01:00
arcnmx
c8746fb588 mpd: systemd socket activation 2020-10-28 22:31:01 +01:00
arcnmx
99fbae0ec5 mpd: configurable executable package 2020-10-28 22:31:00 +01:00
Tad Fisher
b5291e995f emacs: avoid desktop file collision 2020-10-28 11:56:22 -07:00
Robert Helgesson
28eb093a1e systemd: use listsAsDuplicateKeys
This causes list values to be emitted as a list of key-value pairs
instead of a single key-value pair where the value is space separated.

This is useful, e.g., for socket units that would like to specify more
than one `ListenStream=` address.
2020-10-25 22:55:06 +01:00
Niklas Hambüchen
abaebf3b34 README: Remove dangling reference to IcedTea 2020-10-25 19:44:12 +01:00
arcnmx
9bf1f40af1 xdg: disambiguate home.file attribute names 2020-10-22 23:51:01 +02:00
Tobias Happ
22a3a5651d gh: add module 2020-10-22 23:36:15 +02:00
Milan Pässler
308ee310de gammastep: add module
Fixes #1396
2020-10-22 23:11:43 +02:00
Nicolas Berbiche
0778a80ee0 waybar: use Nixpkgs maintainers entry
I recently had my first package added to Nixpkgs and am now in the
official list of maintainers so this information is no longer required
here.
2020-10-22 22:57:58 +02:00
Robert Helgesson
10df7a7eee Merge PR #1560 2020-10-22 22:52:06 +02:00
zimbatm
9cf5f764e1 tree-wide: update link to the doc 2020-10-22 22:41:56 +02:00
zimbatm
014d8deb60 tree-wide: update url to the repo 2020-10-22 22:41:56 +02:00
zimbatm
1c4ced745c ci: deploy the manual to GitHub Pages 2020-10-22 22:41:55 +02:00
zimbatm
731959ef0e ci: add cachix cache 2020-10-22 22:41:54 +02:00
Robert Helgesson
18429f1d1d emacs: remove use of makeDesktopItem
Can generate the file directly to avoid the dependency on the
`makeDesktopItem` API.
2020-10-22 22:00:22 +02:00
Robert Helgesson
77913ff17e tests: run neovim tests on Linux only
Currently the package is unbuildable on Darwin. Also sort the test
includes.
2020-10-22 21:26:15 +02:00
Robert Helgesson
dc5239b5ce firefox: minor option description fix 2020-10-20 00:28:52 +02:00
dawidsowa
c5e47e25a6 firefox: add enableGnomeExtensions option (#1552) 2020-10-19 15:37:49 +02:00
Robert Helgesson
e7d5531cfa vscode: apply nixfmt 2020-10-12 22:51:12 +02:00
Robert Helgesson
aecd4acfb4 neovim: apply nixfmt 2020-10-12 22:50:49 +02:00
Nick Hu
18a05a9604 zsh: add support for prezto configuration framework (#655) 2020-10-12 01:27:44 +01:00
uosis
7339784e07 nixos: pass system configuration to HM modules 2020-10-11 23:33:44 +02:00
c4710n
0e9b6e6dc9 chromium: enable for all platforms 2020-10-11 23:07:38 +02:00
happysalada
fc5619764e skim: add fish integration
Add fish integration to `programs.skim`.

PR #1549
2020-10-11 22:59:23 +02:00
Robert Helgesson
57518cd0bf git: remove test dependencies on delta and git-lfs 2020-10-11 22:36:26 +02:00
Robbert Gurdeep Singh
b584745506 neovim: add extraPackages (#1522)
Add an option to add packages to the PATH of nvim.
This may be usefull to make extra programes availible
for plugins and/or for usage in :! myprogram
2020-10-10 16:15:42 +02:00
Charlotte Van Petegem
473d9acdad neomutt: fix duplicated extraConfig in account (#1546)
The `accounts.email.accounts.<name>.neomutt.extraConfig` option is
included twice in the resulting config file for the account. One time as
part of the `mraSection`, one time as part of `accountStr` (`accountStr`
includes the `mraSection`). This removes that duplication. I opted to
keep the one in `accounStr`, since `extraConfig` doesn't necessarily
have anything to do with the `mraSection`.
2020-10-09 20:55:35 +02:00
Evan Stoll
8537920706 autojump: add module
This also deprecates the `programs.bash.enableAutojump` option in
favor of this module.
2020-10-08 23:50:43 +02:00
Samuel Ainsworth
7e5fee4268 home-manager: handle $EDITOR containing spaces
The quoted `$EDITOR` causes errors when using values containing
arguments, eg. "code --wait". This is in contrast to the majority of
tools (git, etc.) that do support this usage.

Fixes #1496
2020-10-08 23:17:28 +02:00
Andrew Fontaine
0006da1381 home-environment: add option home.sessionPath
This option allows adding additional entries to `PATH`.
2020-10-05 21:06:42 +02:00
Olmo Kramer
9ff2188c5d mpv: make wrapped package available via package 2020-10-01 22:28:33 +02:00
Vladimir Serov
da6077a899 README: less complex minimal flake.nix example 2020-09-30 23:27:28 +02:00
Olmo Kramer
41147ae09a feh: allow binding actions to multiple buttons/keys
In feh you can bind multiple keys to the same action, but Home Manager
only let you set a single key to an action. You can cheat and pass a
string with space-separated keys, but with this change you can pass a
list for each action to bind multiple keys to it.

Also adds a couple of tests.

Fixes #1366
2020-09-30 00:55:09 +02:00
Olli Helenius
6fed10a09a gnome-terminal: add backspace- and delete-binding options
These settings control the string sent by gnome-terminal when the
respective keys are pressed. The options are the ones described in
libvte documentation:

https://developer.gnome.org/vte/0.48/VteTerminal.html#VteEraseBinding
2020-09-29 23:48:41 +02:00
Karl Hallsby
f0fc2a8702 mu: add module 2020-09-29 23:26:45 +02:00
Mattia Gheda
521a808151 README: Update README.md to point to new url (#1530)
home-manager moved to a community-based project.
2020-09-29 20:30:06 +02:00
Joe Hermaszewski
abfb4cde51 vim: Allow setting init.vim config alongside plugins + neovim test (#876)
* neovim: allow setting init.vim config alongside plugins
* neovim: add test for neovim plugins
* neovim: make pluginWithConfigType a have type submodule
2020-09-25 02:08:39 +02:00
Robert Helgesson
43ab2f40b9 notmuch: inline notmuch-accounts.nix
Having it in a separate file is a bit unnecessary.
2020-09-24 20:02:49 +02:00
Alex Rice
690d93c22a sway: fix startup example (#1517)
Fixes #1515. Example for `wayland.windowManager.config.startup`
referenced options `notification` and `workspace` which are not valid
for sway.
2020-09-24 10:16:54 +01:00
John Axel Eriksson
8a160f01ab sway: fix onChange for sway config when sway isn't running (#1506)
`pgrep -x somecommand` exits with a non-zero status if it finds no
process running with the given name. When using home-manager as a
NixOS module, on boot (when sway isn't running) this script would
fail and then fail the unit since it seems the onChange scripts
are running with the -e switch.

This change ensures we're always returning a 0 exit status where we
attempt to get the pid of sway - we're only interested in either the
pid or an empty string, the exit status isn't important.
2020-09-23 12:10:58 +01:00
Robert Helgesson
a6a3abb295 gitlab-ci: update Nixpkgs pin 2020-09-22 23:26:53 +02:00
Vojtěch Káně
84bcce3c25 pet: add module
Adds a pet module without sync support as it makes no sense when
configuration is managed with Home Manager and the config would be
unwritable for pet anyway.

PR #1045
2020-09-22 23:20:17 +02:00
Karl H
96d7de6db1 mbsync: per account multiple channels (#1360)
* mbsync: option for configuring a channel

A channel is a relationship between 2 directories/boxes/mailboxes
between the local machine (slave) and the remote mail server (master).
Each channel must be given at least:
     * an account-unique name
     * a pattern for which mailboxes to sync from master
     * a pattern for what directory where that mail ends up on the
     slave

Additional options can be added later.

* mbsync: option for configuring a group

A group is a grouping of channels together, so that many channels with
very different names can be handled as a single entity.

Groups are unique in mbsync because they will shadow channels that
have the same name on the command-line.

* mbsync: create groups configuration attribute

This is the end of the configuration that the end-user will use.

They will specify an attribute set that contains the name for the
group, so they can say
`accounts.email.accounts.<aname>.groups.<gname>` to access the
configuration for the group with the name `<gname>`.

* mbsync: write function to generate group-channel blocks

This function takes in a set of groups, and their consituent
channels and writes the appropriate .mbsyncrc block. The block is as
shown below:

      Group groupName1
      Channel channelName1
      Channel channelName2

      Group groupName2
      Channel channelName3

Each group must have a unique name, no matter which account it is
declared under. The same holds true for channels. However, if there is
a group that shares the same name as the channel, the channel will
effectively be "shadowed" by the group, and mbsync will default to
working with the group in that case.

* mbsync: write function to generate channel configuration blocks

This function takes in a set of groups, which includes their
consituent channels and writes the appropriate .mbsyncrc block for the
channel. The block that is generated is shown below:
      Channel groupName1-channelName1
      Master :<accountName>-remote:<master-pattern>
      Slave :<accountName>-local:<slave-pattern>

      Channel groupName2-channelName2
      Master :<accountName>-remote:<master-pattern>
      Slave :<accountName>-local:<slave-pattern>

Each group must have a unique name, no matter which account it is
declared under. The same holds true for channels.

Using channels with the patterns set up this way allows one to specify
which maildir directories are to be synchronized FROM the master TO
the slave. In addition, it allows for these maildirs to be remapped,
between the master server and the local slave.
This is critical, because Gmail has a strange way of storing its mail
that makes using mbsync, mu, and mu4e more difficult.

There are additional channel parameters that are already present in
this codebase from the previous use of group-channel configuration,
which will be reused.

* mbsync: set the submodule's names field according to parameter

This is the same method as is used in creating an email account, named
`<name>` under `accounts.email.accounts.<name>`. This allows the user
to specify groups and channels, in a list-like format, but still gets
the "namespacing" to more easily handle the options available in each
of these locations.

* mbsync: provide examples of master/slave patterns for channels

* mbsync: create nested-let function to generate channel pattern

This pattern is required to either NOT be present, which means the
master pattern is used to match, or it has a list of patterns to use
beneath the master maildir to match against.

This function checks to ensure that if patterns is not empty, ONLY
then is the `Pattern` keyword printed. Otherwise, there are many, many
problems.
If there IS a list of patterns, then we use proper escaping methods to
ensure that the exact string is constructed.

* mbsync: per-account groups can have additional patterns

Gave the
`accounts.email.accounts.<name>.mbsync.groups.<gname>.channel.<cname>`
set a `patterns` option, which will allow for greater customization
and filtering of the master maildir to sync to the slave maildir.

* mbsync: add extraConfig option for easier-to-format options

These are options that can be handled by the `genSection` function in
the `genAccountFunction`, so they are left to the user to decide.
Most of these are made on a global basis anyways.

* mbsync: remove unneeded extraConfig.channel

This was originally placed here, seemingly, just to get this module
working. However, this field is actually more confusing now that a
separate per-channel configuration option for extra configurations has
been made available.

* mbsync: correct and improve comment in masterPattern description

* mbsync: switch channel/group generation to new functions

Changing this out is what moves us from the old system to the new one.
Instead of having a single channel manage a whole mailbox, we can now
specify an attribute set of groups that should correspond to an email
account.

Each of these groups contains an attribute set of channels that make
it up, and are grouped together for synchronization. In addition, each
of these channels can have additional IMAP4 parameters attached to
them to further refine synchronization.

Lastly, each of the channels is grouped together under the Group
section, ensuring that the channels' mailboxes synchronize as they
have been specified.

* mbsync: only generate group/channel configuration if channels present

Typically, when a group is specified, channels will be specified as
well. However, if due to error or mistake, the user forgets to specify
ANY channels for a group, we should not generate that group's
information.

This means that no channels are specified (which maps the remote
master to local slave). In addition, the `Group <gName>` block (which
brings the separate channels together) is also not generated.

Another thing to consider is that a user might specify a group and a
channel, but perform no additional configuration of the channel.
In a configuration, this would be realized by
`accounts.email.accounts.<aName>.mbsync.groups.<gName>.channels.<cName>;`

This creates the channel with the name `<cName>` and the
`masterPattern`, `slavePattern`, and `patterns` fields use their defaults.
By definitions set within mbsync, these defaults actually specify that
the remote master's `INBOX` mail directory is synchronized to the
local slave's `INBOX` directory.

So, if there is a channel that has no fields specified, then we DO
want to generate its configuration. But if there is a group that has
no channels, then we do NOT generate it.

* mbsync: acc comment explaining why groups attr set is never empty

* Revert "mbsync: remove unneeded extraConfig.channel"

This reverts commit 941c4771ca.

To support backwards compatibility, I need to leave this field/option
in the module, even if it will likely be more confusing to do it this way.

* mbsync: channel compatibility with previous iteration of mbsync

The previous version of mbsync used a single channel for an entire
account. This leads to issues when trying to change the mailbox
hierarchy on the local machine. The problem with this is that some
email providers (Gmail, among others) use a slightly different maildir
hierarchy, where the standard mailboxes (Inbox, Drafts, Trash, etc.)
are stored inside another directory (`[Gmail]/` in the case of Gmail).

This new version allows the user to specify any number of groups with
any number of channels within to reorder their mail however they wish.

However, to maintain backwards compatibility, I moved the original
channel-generating code to a function that will run ONLY when
there are no groups specified for THIS account.

* Revert "mbsync: channel compatibility with previous iteration of mbsync"

This reverts commit b1a241ff9f.

This function is in the wrong location and this was wrongly committed.

* mbsync: function for backwards compatibility with previous mbsync

NOTE THAT THIS IS THE CORRECT COMMIT FOR THIS CHUNK OF CODE!!

The previous version of mbsync used a single channel for an entire
account. This leads to issues when trying to change the mailbox
hierarchy on the local machine. The problem with this is that some
email providers (Gmail, among others) use a slightly different maildir
hierarchy, where the standard mailboxes (Inbox, Drafts, Trash, etc.)
are stored inside another directory (`[Gmail]/` in the case of Gmail).

This new version allows the user to specify any number of groups with
any number of channels within to reorder their mail however they wish.

However, to maintain backwards compatibility, I moved the original
channel-generating code to a function that will run ONLY when
there are no groups specified for THIS account.

* mbsync: function to choose which style of group/channels to generate

This is a simple if-check. If the old style is used, then this
account's mbsync.groups attribute set is empty. If that is the case,
then the old-style single-channel per account is used.

If that is NOT the case, then the new style is used in preference of
the old. This means that ALL channel code that would be generated by
the old version is replaced by the new one.

* mbsync: switch per-account config generation to check channels

* mbsync: program-wide groups if no account-specific groups

At the end, we have to choose whether or not to generate the old style
of having program-wide groups to specify things, where the boxes on
the channel underneath the group specifies which mailboxes to sync.

Here, we only generate the old style of group IF there is ANY account
that does NOT have the new `accounts.mbsync.groups` defined. At that
point, it is up to the user to ensure that the accounts in
`programs.mbsync.groups.{}` align with the name chosen for the
account, as I have made no attempt to change this old code.

However, if ALL accounts have their `mbsync.groups` defined, even if
each of the groups has a single empty channel, it will generate the
groups in the new style.

* mbsync: ensure \n after hm-generated comment

This was a multi-part fix. First, the `# Generated by Home Manager.`
comment has been reworked to ensure that it will ALWAYS have a
newline, even if the program-wide extraConfiguration is empty.

Next, we switched to placing 2 newlines between every account, to
provide further visual distinction between each account, which can
have multiple channels and multiple groups defined at the same time.

Lastly, the groupsConfig was slightly reworked, so that both the old
and new version can be used, but the new one will take precedence.
Because of this, groupsConfig is now a list of strings, which will
have single newlines inserted between each element.

But if the old style is NOT used, then the groupsConfig list
contains one element, an empty string. A single element has nothing
added as a separator, and an empty string produces no output.

* mbsync: only generate new group/channels if channels present

Here, the problem was if the user created a group for an account, but
did not also include a set of channels. If no channels have been
specified, then the group should NOT have its group-channel mapping generated.

I also corrected and improved the comment regarding
`genGroupChannelString`'s function and intended behavior.

* mbsync: channel patterns generate their own newlines

This means that when a channel has extra `patterns` defined for it, it
will generate those, and a single newline will be appended to the end
of that newly constructed string.

The moving of the newline character is slightly important because
otherwise, every account would receive an extra newline after every
channel, leading to 2 newlines after every channel.

* mbsync: place newline between each channel in a group

* mbsync: ensure old group/channel has proper spacing

This ensures that if the old style of generating program-wide groups
that there is the proper spacing before the group and in between each
line within the group.

* mbsync: ensure no empty channels present

If the user specifies a group correctly, they must still specify an
attribute set of channels. However, if they do not, then we need to
ensure that a group with no channels does NOT have any channel
configurations generated for it.

If there is a channel string generated for a channel that is empty,
then the `mapAttrsToList` returns a singleton list that contains just
the empty string. Thus, we can filter out all those results, to ensure
that no empty channels are generated.

It is important to keep in mind the difference between an empty
channel and a channel that has received no configuration, but is
named.
	* A named channel is technically configured to have a name.
	  While the `masterPattern`, `slavePattern`, and `patterns`
	  field have NOT been populated, mbsync assumes that if
	  master/slave-Pattern are empty that means match against
	  `INBOX`.
	  If `patterns` is empty, no patterns are printed.
	* An empty channel set is a set that has no channels within
	  it, but `mbsync.groups.<gName>.channels` is defined.

* mbsync: filter empty groups and correct newlines

First thing, someone can specify that a group is empty. If this is
done, technically a group with channels would be generated at the end.
However, because they were empty and did not exist, whitespacing would
be generated, leading to a usable, but mangled config file.
The `filter` solves this problem by removing empty strings (which are
generated by groups that are empty) from the output strings to place
in the file.

Lastly, because the whitespacing was fixed elsewhere in the file, the
crazy double-newline at the end was changed to a single newline.
However, the double newline within the `concatStringsSep` is still
required, because the list that is being concatenated together is a
list of channel configurations. Each element corresponds to one of the
groups specified, whose contents are the channels specified within.

The double newline is needed because each string element is lacking a
trailing newline, because `concatStringsSep` does not add the
separator to the end of the last element in the list. So, the last
channel to be configured will not have that newline appended when the
channel-configuration list is created, thus, 2 are inserted here.

* mbsync: update test input to use per-account channels

* mbsync: comment how old/new style collision handled

This is left in the test input for now, because I think it is useful
to see why certain things are happening the way they are.

* mbsync: update test output pattern

The test output should now have the correct configuration according to
the way I have specified it in the input file.

* mbsync: use format script on new code

* mbsync: add KarlJoad as maintainer

Co-authored-by: Nick Hu <me@nickhu.co.uk>
2020-09-21 18:16:06 +01:00
Evan Stoll
9b1b55ba02 numlock: add test
- Add evanjs to CODEOWNERS for numlock and numlock test
- Add evanjs to maintainers for numlock module
2020-09-18 19:35:19 +02:00
Robert Helgesson
b3498cccb3 info: generate dir file directly in profile
This avoids the need for the activation block. The `dir` file is
instead built directly in the installed profile.
2020-09-18 14:05:42 +02:00
Symphorien Gibol
92c682cd10 unison: fix escaping of arguments
The `ExecStart=` option of systemd must take arguments fully quoted.
That is,

    "-sshargs=-i somekey"

and not

    -ssargs="-i somekey"

Additionally, inside arguments passed to unison, `=` characters must
be quoted. After unquotation by systemd, one must have

    -sshargs=-o Foo\=4

instead of

    -sshargs=-o Foo=4
2020-09-18 00:16:22 +02:00
Damien Cassou
472ca211ca man: support building manual page index cache
The apropos software is useful to get a list of manpages matching a
description or to get a list of all manpages. The latter feature is
used by Emacs to get manpage completion (`M-x man`).

To have apropos working, a database of all available manpages must be
built with mandb. This is what this commits does.

A similar change was done for NixOS:
edc6a76cc0
2020-09-13 20:52:08 +02:00
Damien Cassou
812b64d4d3 man: prepare for new programs.man options 2020-09-11 20:16:33 +02:00
Damien Cassou
605a8fc92e generic-linux: add option extraXdgDataDirs
PR #1486
2020-09-11 12:26:55 +02:00
Damien Cassou
b819d2cc41 generic-linux: prepare code for new options
This moves the enable option into an explicit attribute set to allow
future addition of new options.
2020-09-11 12:26:54 +02:00
Bruno Bigras
1f04af74f2 mcfly: fix when non-interactive with fish 2020-09-11 11:41:08 +02:00
dawidsowa
249650a07e mpd: change musicDirectory to str (#1449) 2020-09-06 23:37:46 +02:00
Niclas
4ebb7d1715 systemd: fix systemd spelling (#1373)
Systemdaemons are lowercased and get suffixed with a d
2020-09-06 11:28:40 +02:00
Paho Lurie-Gregg
1a6d6b8ace zplug: Reduce noise (#1441)
Running `zplug install` will always product output, even if there is
nothing to do.

Gating it behind a `zplug check` eliminates that output when there is
nothing to do, and is recommended in the zplug README.
2020-09-06 11:16:34 +02:00
Elis Hirwing
f146620897 htop: Add new configuration options (#1463)
There's some new configuration options since the 3.0.0 release of htop.
2020-09-06 10:58:37 +02:00
Robert Helgesson
41b1af808f targets.darwin: disable application directory
This disables the generation of the application directory until
conflicting behavior with nix-darwin is resolved.

See https://github.com/rycee/home-manager/issues/1341#issuecomment-687286866
2020-09-04 20:01:19 +02:00
Nicolas Berbiche
182454fe6b kanshi: fix exec configuration
Also add a test case for the exec option.

PR #1446
2020-09-04 16:45:42 +02:00
Robert Helgesson
a063b73d5c Merge PR #1460 2020-09-04 16:02:17 +02:00
Nicolas Berbiche
d3aee544b6 targets.darwin: add module
Currently, this module makes sure that `/Applications` directories for
packages in `home.packages` get linked into the user's environment.
2020-09-04 15:21:48 +02:00
Nicolas Berbiche
bd4c2b0651 nix-darwin: add missing options
Add useGlobalPkgs, verbose and backupFileExtension support
2020-09-04 15:00:00 +02:00
Nicolas Berbiche
1f34c048b3 flake: add nix-darwin module 2020-09-04 14:34:37 +02:00
Tony Olagbaiye
bfc66df13d readme: add a basic flake usage example 2020-09-04 14:24:38 +02:00
Christoph Herzog
1ed8e7ef98 vscode: add options for keybindings
Adds a new `keybindings` option to the `vscode` configuration.

It contains a list of key bindings, which will be written to
`%vscode-dir%/User/keybindings.json`.

PR #1351
2020-09-04 14:14:52 +02:00
Robert Helgesson
e6e49ad73c home-environment: coerce home.homeDirectory to string
The home directory option should be a string without context to avoid
the directory being copied to the Nix store.

Fixes #1471
2020-09-02 22:37:21 +02:00
Cole Helbling
0399839271 lib/file-type: remove types.loaOf
loaOf has been deprecated for a long time and is now in the process of
removal (see https://github.com/NixOS/nixpkgs/pull/96042). Thus, we
remove it here, too.
2020-09-02 11:13:36 -07:00
Olmo Kramer
4b702bf6b7 ncmpcpp: add module
PR #1457
2020-09-01 22:05:57 +02:00
Robert Helgesson
4fe5afa755 files: make sure the target file name is escaped
The previous implementation would allow variables to sneak into the
file names. This commit makes sure the resulting target file path
exactly matches the expected path.
2020-08-29 18:22:03 +02:00
Robert Helgesson
209fb62d49 xdg-mime: more forcefully create directories
By installing two packages with the same directories we should force
`buildEnv` to generate real directories instead symlinks into the Nix
store.
2020-08-29 17:33:07 +02:00
Tony Olagbaiye
6cf6b587b5 flake: add flake.nix
No flake.lock is added because the only input (nixpkgs) will almost
always be overridden, and currently Home Manager's testing and
verification is not flake based.

PR #1455
2020-08-26 23:49:12 +02:00
Mario Rodas
a79d31fcfd mcfly: add module
PR #1452
2020-08-26 00:21:01 +02:00
Alex Rice
0869e23700 sway: set bar defaults to null
Allows fields of bar to be nullable and omit them from the generated
configuration if unset.

Fixes #1361
PR #1386
2020-08-26 00:05:05 +02:00
Alex Rice
625b92cbba sway: add default test 2020-08-25 23:58:43 +02:00
Robert Helgesson
9854342b9f nixpkgs: take Nixpkgs path from argument
This removes the dependency on the `nixpkgs` channel within the
modules for state version ≥ 20.09. The default Nixpkgs source starting
from this state version is the path of the `pkgs` argument used to
bootstrap the Home Manager modeuls.

This is a prerequisite for using Home Manager withing Nix flakes.

PR #1420
2020-08-19 00:33:25 +02:00
Vincent Gatine
a3dd580adc kanshi: add service
PR #1142
2020-08-15 01:02:23 +02:00
Robert Helgesson
2bcd96928e xdg-mime: make sure the target directories exist
Before the profile commands would not run if a single package is
installed since `buildEnv` will produce a symlink directly to that
package. By adding this dummy package we ensure that a real directory
will be generated.

Fixes #1392
2020-08-15 00:17:24 +02:00
Robert Helgesson
2c6a023744 home-manager: remove home-manager-path on uninstall
Fixes #1443
2020-08-14 23:19:48 +02:00
James Ottaway
9a473b693a zsh: add cdpath option (#1418) 2020-08-14 22:36:23 +02:00
Nicolas Berbiche
f4f9f1a618 waybar: add module
PR #1329
2020-08-14 00:20:49 +02:00
Jack McCown
2a54c353a9 gnome-terminal: add profile command options
Allow setting custom command and login shell.

PR #1423
2020-08-13 23:55:24 +02:00
Daniel Gorin
96e2f1bdf0 kakoune: add support for plugins
The kakoune editor has a plugin mechanism and several plugins are
already packaged under `pkgs.kakounePlugins`. However, adding these
packages to `home.packages` is not enough: the `kakoune` package needs
to be configured with the list of plugins to include, so that they get
sourced on start-up.

We add a `programs.kakoune.plugins` option, analogous to
`programs.vim.plugins`.

The change is backwards compatible since `pkgs.kakoune` is defined as

    wrapKakoune kakoune-unwrapped { };

and `wrapKakoune` defaults the list of plugins to empty.

PR #1356
2020-08-13 23:45:49 +02:00
Philipp Mildenberger
3886f8db33 pulseeffects: fix autostart
PR #1442
2020-08-13 22:39:03 +02:00
Andrew Fontaine
baea46c5ac git: set SSL if useStartTls is false
The git-send-email [0] script uses StartTLS if `smtpEncryption` is set
to `tls`, which can break services that don't support StartTLS.

[0]: bd42bbe1a4/git-send-email.perl (L1533)

PR #1395
2020-08-13 21:36:31 +02:00
jD91mZM2
fceef469c2 xdg-user-dirs: fix erroneous dirs file
Before this change,

```rust
fn main() {
    println!("{:?}", glib::get_user_special_dir(glib::UserDirectory::Documents));
}
```

would return `None` even though `~/Documents` is available and
`xdg.userDirs.enable = true`. Checking the differences between
`xdg-user-dirs-update` shows that the latter has quotes around each
thing.

PR #1440
2020-08-13 00:07:04 +02:00
Tom Bereknyei
ae8f432a75 bash: initExtra after autojump config
Allow for initExtra to manipulate results of autojump, e.g., remove
aliases.

PR #1431
2020-08-12 23:21:57 +02:00
Symphorien Gibol
e1fbb74b41 lib.gvariant: escape backslashes in strings
PR #1433
2020-08-12 22:53:28 +02:00
Daniel Gorin
d1f4d1514d kakoune: escape showWhitespace separators
We were passing the separators for the `show-whitespaces` highlighter
verbatim. This was problematic in case one wanted to use, spaces,
quotes or `%` as separators since the resulting kakoune configuration
would be invalid.

According to kakoune's docs, the separator has to be one character
long, so we can use a simple rule for escaping them. It is possible
that people has been working this around by passing, e.g. `"' '"` as
separator in order to get a space (i.e., escaped explicitly by the
user), so we just let longer strings be used verbatim.

PR #1357
2020-08-12 22:44:33 +02:00
Daniel Gorin
861690ff29 kakoune: simplify testcase
Instead of using several regex assertions, just state precisely what we
are producing. While the regex was technically more flexible, since it
would ignore differences in whitespace, it was also harder to read/edit.
2020-08-12 22:43:38 +02:00
Robert Helgesson
223e3c38a1 Revert "systemd: use sd-switch"
This reverts commit 9c0fe3957b.
2020-08-04 19:38:14 +02:00
Robert Helgesson
9c0fe3957b systemd: use sd-switch
This makes the systemd module use the sd-switch application to perform
the unit switch during a generation activation.

Since the closure of sd-switch is relatively lightweight we
unconditionally pull it in as a dependency. We simultaneously remove
the `systemd.user.startServices` option and perform the switch action
automatically.

PR #1388
2020-08-04 01:01:10 +02:00
Robert Helgesson
152769aed9 xscreensaver: restart if settings change 2020-08-02 14:05:18 +02:00
hpfr
dbf6b2d2ab starship: fix fish integration syntax
The previous fish integration for starship erroneously used parts of
POSIX-esque test syntax. It also used `-n` instead of `-z` to check
for an unset variable.

PR #1422
2020-08-02 13:04:24 +02:00
Robert Helgesson
f119d4d142 fontconfig: disable multiple font packages test
This test started failing as described in the code comment. May be
related to Nixpkgs updating Fontconfig from version 2.12 to 2.13. See
https://github.com/NixOS/nixpkgs/pull/73795.
2020-07-31 17:30:57 +02:00
Robert Helgesson
79a2320fd0 files: minor documentation improvements 2020-07-31 00:54:23 +02:00
eyjhb
bb6eb9b13e dropbox: fix bug caused by Python gi import
When running the service start script with `DISPLAY` set, a `gi`
import error is triggered. Blanking the variable will make the script
use a different code path that does not attempt to import `gi`.

Also moves activation script up into start of script instead.

PR #1415
2020-07-30 00:07:23 +02:00
Leon Kowarschick
2e7935767f alacritty: add package option
PR #1372
2020-07-27 17:08:10 +02:00
seylerius
89adfc9f01 qutebrowser: unwrap list from keybinding removal
The option to remove the default keybindings by setting the
`programs.qutebrowser.enableDefaultKeybindings` variable to `false`
had a list wrapped around the `config.py` line. This would cause a
type coercion error.

PR #1410
2020-07-27 16:48:38 +02:00
eyjhb
7b73f84071 dropbox: add module
Ability to control Dropbox daemon, if it should start and where to
place the files.

PR #1391
2020-07-25 23:12:33 +02:00
Sergei Maximov
5cd7865c6c spotifyd: add package option
This option can be used to enable optional Spotifyd features, such as
looking up the Spotify password in the system keyring or enabling
MPRIS support.

PR #1390
2020-07-25 20:43:43 +02:00
Philipp Mildenberger
3f1be69359 nushell: add module (#1333) 2020-07-24 17:15:55 +02:00
Robert Helgesson
83301ca787 lib: support gvariant maybe type
Fixes #1397
2020-07-24 16:45:13 +02:00
Robert Helgesson
8ad5580021 zsh: fix trailing white space 2020-07-21 01:10:54 +02:00
dawidsowa
e2e8b7371d zsh: add shellGlobalAliases (#1381) 2020-07-20 19:54:30 +02:00
Mario Rodas
4bd0ca2cd7 git: configure delta through [delta] git section (#1371)
this breaks backwards compatibility (now accepts a dict instead of a list) so please update
programs.git.delta.options accordingly.
2020-07-20 17:03:40 +02:00
Cole Mickens
5c639ff68a sway: focus.followMouse supports yes/no/always
Also add associated tests for both Sway and i3.

PR #1231
2020-07-17 15:35:00 +02:00
Robert Helgesson
a49ce0e9ed home-environment: use per-user profile path in /etc
Before the profile directory value would point directly to the build
output in the Nix store. Unfortunately this would cause an infinite
loop if the user's configuration directly or indirectly refers to the
profile directory value.

Fixes #1188
2020-07-14 23:31:20 +02:00
Robert Helgesson
1a8ab9d9de nixos, nix-darwin: fix user packages install
It is insufficient to install the packages in `home.packages`, it has
to be `home.path`, which includes configured extra package outputs or
profile commands.
2020-07-14 23:31:19 +02:00
f4814n
e0fb488e57 sway: Fix output example (#1385)
The example for wayland.windowManager.sway.config.output has to
contain a mode behind the filename to be correct.
2020-07-14 09:17:05 +01:00
Alex Rice
05565a0145 CODEOWNERS: fix typo 2020-07-13 12:40:13 +01:00
Siva Mahadevan
5f189acce4 neomutt: fix SMTP port string
Fix the SMTP port string from #1374 by properly converting the integer
port into a string.

PR #1377
2020-07-04 12:21:02 +02:00
Robin Stumm
7dc322c1eb kakoune: support user modes in keyMappings
kakoune: support user modes in keyMappings

User modes are declared automatically.

PR #1286
2020-07-03 22:43:18 +02:00
Siva Mahadevan
8736190743 neomutt: Add SMTP port to smtp_url 2020-07-03 15:30:12 -04:00
Damien Cassou
7f7348b470 powerline-go: fix argument to -error option
Addition of the line "local old_exit_status=$?" broke the call to
powerline-go.

PR #1364
2020-06-29 10:21:17 +02:00
Robert Helgesson
58716b7541 xresources: add missing test file 2020-06-28 11:23:34 +02:00
Robert Helgesson
600f39f966 xresources: do not generate file for empty properties 2020-06-28 00:41:05 +02:00
Robert Helgesson
a94c8b072e readme: add reference to Nix Pills 2020-06-25 00:10:08 +02:00
Robert Helgesson
5a15f3833d ne: use dummy package in tests
This is to avoid unnecessary downloads and builds when running the
tests suite.
2020-06-24 23:02:49 +02:00
Tad Fisher
54b69d2ef8 emacs: fix service environment
Emacs populates 'exec-path' at launch from the 'PATH' environment
variable. Likewise, the emacs derivation from nixpkgs populates
'load-path' from the 'NIX_PROFILES' variable. As neither of these are
available by default in the systemd user manager, revert to the
previous behavior of launching the Emacs daemon from a login shell.

Fixes #1354
Fixes #1340
PR #1355
2020-06-24 22:50:30 +02:00
cwyc
8f2342e13a ne: add module
Added a simple module to place configuration files for ne: the nice
editor.

PR #1336
2020-06-23 22:37:02 +02:00
Mario Rodas
8ab1139891 tmux: only enable secureSocket on Linux by default
Darwin does not have the `/run/user` directory.

PR #1349
2020-06-22 19:34:52 +02:00
Robert Helgesson
1f174f6681 git: add news entry about changed escaping 2020-06-18 00:54:41 +02:00
Robert Helgesson
bf7297d55c Move email account options to their owning modules
This removes the long list of submodules from

    modules/accounts/email.nix

and instead move each entry to its owning module.
2020-06-16 00:45:20 +02:00
Jonathan Reeve
ad4f33cfc4 qutebrowser: add package option
Fixes #1315
PR #1334
2020-06-15 21:06:14 +02:00
Robert Helgesson
ecb93ab9ae generic-linux: respect NIX_STATE_DIR 2020-06-14 23:34:53 +02:00
Dmitry Kalinkin
dc227b579d home-manager: respect NIX_STATE_DIR
This allows to install home-manager on a system without root access.

PR #1196
2020-06-14 20:41:55 +02:00
Vincent Breitmoser
7682eb88c4 fluidsynth: fix description 2020-06-14 16:58:08 +02:00
Vincent Breitmoser
b0e8a1569e fluidsynth: add module
Fluidsynth is a real-time MIDI synthesizer based on the SoundFont 2
format.

PR #1326
2020-06-14 15:30:51 +02:00
s1341
1b210e7143 zplug: add module
This adds initial support for the zsh package manager "zplug".

PR #1105
2020-06-14 15:12:49 +02:00
Robert Helgesson
bb567e20b3 vte: add module
This abstracts out the VTE setup from the gnome-terminal module into
its own module and options.
2020-06-14 12:20:12 +02:00
Zsolt Szende
507e446475 vscode: fix extensions directory path
Fixes #1302
PR #1327
2020-06-14 00:43:44 +02:00
Damien Cassou
478022afad powerline-go: add module
PR #1285
2020-06-13 00:02:13 +02:00
Robert Helgesson
edc3bede6e tests: avoid dependency on documentation 2020-06-12 21:59:51 +02:00
Robert Helgesson
21fbc5e5ad ci: do a nightly test run 2020-06-12 20:13:29 +02:00
Damien Cassou
43ef16c3e1 clipmenu: add module
PR #1309
2020-06-12 19:52:52 +02:00
Shamrock Lee
561b3d5650 eclipse: add option package
PR #1310
2020-06-12 19:34:39 +02:00
Robert Helgesson
a3cb63265d emacs: make news entry Linux specific 2020-06-12 10:30:52 +02:00
Damien Cassou
4ba9cedd68 doc: add "Add relevant documentation" guideline
This adds a new section to the contributing guidelines that discusses
how contributions should be documented.

PR #1306
2020-06-11 23:55:31 +02:00
Damien Cassou
6f683d9726 home-manager: add documentation to root default.nix
This adds documentation related packages to default.nix to allow
building documentation separately from building a Home Manager
configuration.
2020-06-11 22:53:33 +02:00
Tad Fisher
2209d3cb51 emacs: add myself to maintainers 2020-06-11 20:40:10 +02:00
Tad Fisher
3815248786 emacs: Support socket activation via systemd
Add 'services.emacs.socketActivation.enable' for generating an
'emacs.socket' systemd unit.

Emacs since version 26 has supported socket activation, whereby an
external process manager such as systemd listens on a socket and passes
it to the Emacs daemon when the manager launches it. This improves
startup time of the user session and avoids launching the daemon when not
needed, for example when launching the user session via SSH.

This implementation hard-codes the socket path to the default for the
version of 'programs.emacs.finalPackage', because systemd does not
perform shell expansion in the socket unit's 'ListenStream' parameter
and it seems like an advanced use-case to change the socket path. Shell
expansion would be desirable as the socket path usually resides in
directories such as $XDG_RUNTIME_DIR or $TMPDIR.

Tests were added to verify behavior in the following cases:

- Emacs service with socket activation disabled
- Emacs 26 with socket activation enabled
- Emacs 27 with socket activation enabled

PR #1314
2020-06-11 20:39:49 +02:00
Robert Helgesson
02c1f8d416 status-notifier-watcher: introduce unit start delay
Fixes #1312
2020-06-10 23:32:44 +02:00
Dany Marcoux
c378c1cbcd autorandr: add crtc option
This option was missing. It is generated by autorandr when executing
`autorandr --save my_profile`.

Fixes #1024
PR #1283
2020-06-09 23:15:44 +02:00
Robert Helgesson
89be0943e1 ci: run tests only for pull requests 2020-06-09 23:07:46 +02:00
Robert Helgesson
abcddfe090 firefox: update extensions option description
This adds a note that the extensions will only apply to profiles
managed through Home Manager.
2020-06-09 22:12:08 +02:00
Robert Helgesson
5a97bf30d4 ci: switch from Travis CI to GitHub Actions
Unfortunately Travis CI seems stuck on Nix 2.0 on macOS, which no
longer works with Nixpkgs unstable.
2020-06-09 20:48:22 +02:00
Damien Cassou
b33802ca7f direnv: add support for nix-direnv
PR #1297
2020-06-06 22:17:43 +02:00
Damien Cassou
575cd4b8ba direnv: add initial test for bash integration 2020-06-06 21:40:41 +02:00
Alex Rice
68b931aef8 sway: add alexarice as codeowner 2020-06-06 21:35:09 +02:00
Alex Rice
2dbe637478 sway: allow package to be null
This allows the `sway.package` option to be null so that the module
can be used alongside the nixos module.
2020-06-06 21:35:08 +02:00
Jakub Fišer
479274775f home-environment: add full locale options support
Allows setting every locale option independently. Also fixes `LC_`
order to match the order of `locale` command output for better
reference.

PR #1278
2020-06-06 21:23:01 +02:00
Robert Helgesson
ba91ac5948 texlive: remove upstream dependency in tests
This changes the tests to not require downloading the texlive
distribution.
2020-06-06 16:43:17 +02:00
Robert Helgesson
cca5161289 i3: replace deprecated package name 2020-06-06 14:53:44 +02:00
Robert Helgesson
354344d971 gnome-keyring: replace deprecated package name 2020-06-06 14:53:43 +02:00
Robert Helgesson
248dc17394 gnome-terminal: replace deprecated package names
The names `gnome3.vte` and `gnome3.gnome_terminal` have been replaced
by their more modern names.
2020-06-06 14:53:42 +02:00
Robert Helgesson
410d2febbb dunst: replace deprecated package name 2020-06-06 14:53:41 +02:00
Robert Helgesson
42fd47b246 emacs: replace use of emacsPackagesGen
Instead we use `emacsPackagesFor`, which `emacsPackagesGen` aliases
anyway.
2020-06-06 14:53:40 +02:00
Robert Helgesson
46cd37abc9 dunst: replace deprecated package name 2020-06-06 14:53:15 +02:00
Robert Helgesson
b2a7d24770 doc: update nmd version 2020-06-06 14:10:14 +02:00
zowoq
3b33862b04 files: reference lndir through xorg
The xlibs attribute set is deprecated and is an alias for xorg.

PR #1304
2020-06-06 13:24:51 +02:00
Roman Volosatovs
85748171ec sway: add option config.bindkeysToCode
Do not use `--to-code` by default in `bindsym`.

PR #1289
2020-06-04 23:40:42 +02:00
Julien Moutinho
0ee5c9536b broot: fix install check
broot uses `~/.config/broot/launcher/installed-v1`, not
`~/.config/broot/launcher/installed`.

PR #1303
2020-06-04 21:54:35 +02:00
Damien Cassou
ca6fcc92a1 firefox: show how to get pre-packaged add-ons
PR #1296
2020-06-04 21:29:51 +02:00
Robert Helgesson
8e8210b441 xdg-mime: fix issue on WSL1
This change stops update-mime-database from running unless the
`share/mime/packages` directory is writable. For some reason it
appears to be read-only on WSL1.

Fixes #1192
2020-06-04 19:45:22 +02:00
Damien Cassou
a21c97d011 ssh: add support for ServerAliveCountMax
PR #1299
2020-06-03 23:16:43 +02:00
Robert Helgesson
dd50dc4c13 doc: add licensing section in contribution guidelines 2020-06-03 19:13:41 +02:00
Nicolas Berbiche
b567d27394 mpv: use wrapMpv instead of mpv-with-scripts
The latter has been removed from Nixpkgs.

See:

- <https://github.com/NixOS/nixpkgs/pull/88620>
- <https://github.com/NixOS/nixpkgs/pull/89208>

PR #1295
2020-05-31 14:11:10 +02:00
Robert Helgesson
d64fff1fe0 doc: add note about line width 2020-05-30 00:45:57 +02:00
Robert Helgesson
c8b73e415a doc: add contribution guidelines section
This adds a section in the documentation for describing a list of
guidelines that code in Home Manager should follow.

This also updates the pull request template to reference this new
section.
2020-05-29 21:43:40 +02:00
Robert Helgesson
728c3eba67 doc: bump nmd version 2020-05-29 12:12:16 +02:00
Robert Helgesson
a505bb5253 doc: include IRC channel in preface 2020-05-29 12:12:03 +02:00
Robert Helgesson
8bbefa77f7 tests: perform code formatting test in test suite
This should improve visibility when CI job fails due to bad
formatting.
2020-05-28 01:37:27 +02:00
Justin Lovinger
3a80ece9fa dircolors: fix usage together with zsh.oh-my-zsh
PR #1280
2020-05-28 00:08:15 +02:00
Robert Helgesson
fe59b5bbc7 Minor cleanup of GitHub issue template
In particular indicate that the IRC channel is better for support
issues.
2020-05-28 00:01:51 +02:00
Robert Helgesson
8af92f844f Fix link to contributing document in PR template 2020-05-27 20:11:23 +02:00
Robert Helgesson
f36c8a09e6 Add basic GitHub issue template 2020-05-27 00:29:31 +02:00
Matthew Bauer
0e2858af94 Add path attribute to root default.nix
This makes it possible to refer to the path of Home Manager when you
just have a Nix expression, not the actual source. Some things run
import on a source and just give access to the result of the import,
not the source.

PR #1259
2020-05-26 19:25:55 +02:00
Finn Behrens
5ba71ef91f nixos: add mount check for home directory
PR #1271
2020-05-26 19:18:24 +02:00
Mario Rodas
a957e2dc6b zoxide: add module
PR #1274
2020-05-26 19:14:39 +02:00
Nikita Uvarov
99a97c917a autorandr: remove blank lines from config
Fixes #1249.
2020-05-26 19:04:26 +02:00
Nikita Uvarov
09304026ae autorandr: add basic configuration test 2020-05-26 19:04:25 +02:00
Robert Helgesson
b95ad63201 Deprecate use of builtins.getEnv
This removes the use of the non-deterministic function
`builtins.getEnv` for state version ≥ 20.09.

PR #1269
2020-05-26 00:28:59 +02:00
Robert Helgesson
2ed978eb79 systemd: apply nixfmt to test root file 2020-05-25 00:47:29 +02:00
Robert Helgesson
31ed6f1604 gtk: apply nixfmt 2020-05-25 00:46:58 +02:00
Robert Helgesson
ac6235e53d emacs: apply nixfmt 2020-05-25 00:45:51 +02:00
Robert Helgesson
f90b86b577 sway: fix config.keybindings example 2020-05-24 13:00:51 +02:00
Robert Helgesson
1c71bd1242 i3: fix config.keybindings example 2020-05-24 13:00:30 +02:00
Robert Helgesson
a0d9a58616 lorri: make system environment attribute a list
It should be a list to allow inclusions of additional variables.
2020-05-24 12:19:39 +02:00
Matthew Bauer
d99f54b51b readme: remove firefox "enableIcedTea" option
This option was actually removed in commit
3461ceebc0.
2020-05-22 00:07:53 +02:00
Matthew Bauer
4d49cee194 home-manager: allow unspecified confAttr
PR #1255
2020-05-21 14:04:13 +02:00
Robert Helgesson
dcbe0f2a31 home-manager: add activation sanity check of Nix
This adds an empty `nix-build` command to verify that the user is
having a good Nix install. It also, as a side effect, will create the
necessary per-user `profiles` and `gcroots` directories.

Fixes #1246
2020-05-20 22:32:35 +02:00
Robert Helgesson
cc48e15f28 doc: add chapter with contribution guidelines 2020-05-20 01:13:23 +02:00
Sophie Taylor
a43e7112e5 starship: improve Emacs handling for fish
PR #1248
2020-05-19 00:12:11 +02:00
piegames
6c7a031367 files: print source path for detected collision
PR #1236
2020-05-17 21:49:18 +02:00
Cole Helbling
645149d77b files: fix warning message
PR #1241
2020-05-17 21:20:40 +02:00
Robert Helgesson
9ec9f004e1 home-manager: use nix-env to list generations
Using the `nix-env` command is far more robust. It also has the
benefit that if the per-user `profiles` and `gcroots` directories do
not exist then they will be created with the correct permissions.

Because of the second point this commit also removes the `mkdir` step
of the installation instructions.

PR #1239
Closes #474, #948, #1091
2020-05-16 19:17:13 +02:00
dawidsowa
0fe984d575 tmpfiles: add module
PR #1144
2020-05-16 13:32:33 +02:00
Robert Helgesson
69f8e47e9e starship: allow running in Emacs if vterm is used
The vterm buffer is backed by libvterm and can handle Starship prompts
without issues.
2020-05-15 22:58:57 +02:00
Robert Helgesson
db6e261794 gitlab-ci: update nixpkgs pin 2020-05-14 00:02:34 +02:00
Robert Helgesson
5cfc9fed79 gitlab-ci: minor test job improvements
Specifically,

- add code format checking and
- run tests in a pure shell.
2020-05-14 00:02:33 +02:00
Andrew McDermott
40b1c5c448 gnome-terminal: allow for 'system' theme variant
PR #1228
2020-05-13 00:30:09 +02:00
Justin Lovinger
e9945ee6ee dircolors: add module
PR #1219
2020-05-12 22:15:32 +02:00
Bruno Bigras
cca024da2b starship: check if $TERM == "dumb" for Bash setup
This fixes an issue with Emacs tramp.

PR #1191
2020-05-12 20:40:34 +02:00
Samuel Grahn
1ec45b11ab rofi: add package option
Add option to specify which package provides the rofi binary.

PR #1225
2020-05-11 23:07:26 +02:00
Robert Helgesson
4ae188bfc7 Merge PR #1229 2020-05-11 23:02:14 +02:00
Roman Volosatovs
7f4053084c sway: allow unsetting status command 2020-05-11 22:02:38 +02:00
Roman Volosatovs
37202a1b70 sway: use --to-code in bindsym 2020-05-11 22:02:37 +02:00
Robert Helgesson
b886cbea0b xdg.mimeApps: use xdg.dataFile instead of home.file
The former honors the data home path set by the user.
2020-05-09 23:53:48 +02:00
Hugo Geoffroy
9f396fddc6 emacs: add emacsclient desktop file
Add an option to enable a .desktop file for the Emacs client.

PR #1223

Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: Robert Helgesson <robert@rycee.net>
2020-05-09 22:13:04 +02:00
Robert Helgesson
2434984336 doc: fix highlighting of root commands 2020-05-08 00:21:42 +02:00
Robert Helgesson
1afa5e257b doc: move FAQ to manual
This converts the FAQ into AsciiDoc and includes it in the HTML
manual.
2020-05-07 23:46:13 +02:00
Mario Rodas
cba7b6ee6e git: add basic support for delta
PR #1198
2020-05-05 00:12:58 +02:00
ivann
03b4f81679 qutebrowser: add some options
Specificially, this adds options

- `aliases`,
- `searchEngines`,
- `keyMappings`, and
- `keyBindings`.

PR #1212
2020-05-03 13:53:06 +02:00
Justin Lovinger
1dd226fde7 aria2: add module
PR #1202
2020-05-03 13:21:52 +02:00
Robert Helgesson
ded327b9fc i3status: add news entry 2020-05-03 13:13:26 +02:00
Justin Lovinger
ecc1f2310c i3status: add module
PR #1210
2020-05-03 13:12:13 +02:00
Robert Helgesson
866d7d5152 lib: add maintainers attribute set
This attribute set is for users who are Home Manager maintainers but
not Nixpkgs maintainers.
2020-05-02 16:30:55 +02:00
Robert Helgesson
91551c09d4 files: add helper function mkOutOfStoreSymlink
Using this function it is possible to make `home.file` create a
symlink to a path outside the Nix store. For example, a Home Manager
configuration containing

    home.file."foo".source = config.lib.file.mkOutOfStoreSymlink ./bar;

would upon activation create a symlink `~/foo` that points to the
absolute path of the `bar` file relative the configuration file.

PR #1211
2020-05-02 01:22:14 +02:00
Robert Helgesson
70f7c9f355 alot: apply nixfmt 2020-05-01 22:33:05 +02:00
Matthieu Coudron
10673bff4c alot: add structured settings
- Also support tags.

- Optionally write the hooks file.

PR #812
2020-05-01 22:26:26 +02:00
Robert Helgesson
642d9ffe24 git: escape string values in configuration
This should handle the special characters that typically occur.

Fixes #1206
2020-05-01 00:50:58 +02:00
Peter Rice
8b82f52e75 fish: source each file in plugin conf.d separately
According to https://fishshell.com/docs/current/cmds/source.html,
only one file can be sourced at a time: "If additional arguments are
specified after the file name, they will be inserted into the $argv
variable."

PR #1204
2020-04-29 21:46:10 +02:00
Johannes Rosenberger
a7cdfaa325 tmux: reorder tmux.conf content
In particular, put `extraConfig` in the end, which enables overriding
of all settings, even plugin settings.

PR #945
2020-04-27 22:04:13 +02:00
Jonathan Ringer
a6037a9eb8 pulseeffects: add module
Pulseeffects is an advanced mixer for PulseAudio.

PR #1182
2020-04-26 15:50:21 +02:00
Johannes Rosenberger
23220d43f3 tmux: use stable plugin names (name -> pname)
PR #1195
2020-04-26 15:22:23 +02:00
Wael M. Nasreddine
ad8b644de1 lorri: allow customization of the lorri package
PR #1158
2020-04-24 22:25:54 +02:00
Robert Helgesson
95b95b1407 tests: improve test purity
Before the XDG variables would be set from the user's environment, if
available. This would break some tests.

With this change the tests should be fully deterministic.

Fixes #1190
2020-04-24 21:46:34 +02:00
Robert Helgesson
cfaf213980 tests: bump nmt revision 2020-04-24 21:45:20 +02:00
Diego Alvarez
5baa0c300f faq: show how to add the nixpkgs-unstable channel
Adds the necessary command to install the nixpkgs-unstable channel.

PR #1165
2020-04-23 23:59:55 +02:00
Bruno Bigras
2d88cbe496 spotifyd: user -> username
PR #1168
2020-04-23 23:53:03 +02:00
Cole Helbling
8369624512 systemd: don't page failed user units
Otherwise, the pager (typically `less`) pauses execution of
`home-manager switch` until the pager is dismissed, if the content is
larger than would fit on the screen.

PR #1175
2020-04-23 23:40:58 +02:00
Paul
ee1c40e5c5 keynav: use correct ExecStart command
When the change requested in

  https://github.com/rycee/home-manager/pull/1082#discussion_r392715440

was applied, the service `ExecStart` attribute was not updated to use
`pkgs.keynav`.

Fixes #1177
PR #1184
2020-04-23 22:48:01 +02:00
Owen McGrath
2f2a4396c6 lf: add module
Adds 'programs.lf', configuration managment for lf, a terminal file
manager.

PR #1174
2020-04-23 22:41:22 +02:00
Robert Helgesson
cb17f1ede2 Add preliminary release notes for 20.09 2020-04-23 00:29:12 +02:00
Robert Helgesson
42e4eef749 Update documentation for release 20.03 2020-04-23 00:29:11 +02:00
Robert Helgesson
7613fd12ec doc: document dagOf and gvariant types 2020-04-22 23:59:10 +02:00
Robert Helgesson
f735fac91b doc: bump nmd revision
Also convert `release-notes.xml` to AsciiDoc.
2020-04-22 23:59:09 +02:00
Robin Stumm
f0710115c5 kakoune: add missing hook name
PR #1185
2020-04-22 23:18:23 +02:00
nurelin
8c920682e6 sway: remove restart command from sway configuration (#1155)
The restart command does not exists in sway, only reload.
See https://github.com/swaywm/sway/blob/1.4/sway/sway.5.scd
2020-04-22 02:31:07 +02:00
Terje Larsen
9905ab5087 fish: fix fish plugins complete path update
PR #1178
2020-04-22 01:02:10 +02:00
dawidsowa
b3bbc8b769 xdg-user-dirs: add user-dirs.conf
PR #1143
2020-04-22 00:52:39 +02:00
Lisa Ugray
3a5cd90631 bat: add custom themes
Add the ability to add custom theme files to bat.

Co-Authored-By: Robert Helgesson <robert@rycee.net>
2020-04-21 18:26:13 -04:00
Bruno Bigras
3e3de8cee2 i3/sway: fix typo in fonts option (#1152) 2020-04-21 08:18:38 +02:00
Robert Helgesson
687395ebda home-manager: remove unsupported -2 option
This option used to make the `home-manager` command use the `nix` tool
from Nix 2. Unfortunately the `nix` tool is a bit experimental and it
is best to await its stabilization before supporting it in Home
Manager.
2020-04-18 11:37:06 +02:00
Robert Helgesson
e5325c2274 home-manager: fix shellcheck warning 2020-04-18 11:37:05 +02:00
Robert Helgesson
3461ceebc0 firefox: remove options removed upstream
Fixes #1166
2020-04-18 11:24:11 +02:00
Robert Helgesson
133badb297 ssh: deprecate the list form of match block
Configurations depending on specific block order should use the DAG
functions instead of lists.
2020-04-16 23:27:40 +02:00
Robin Stumm
86ccd8fecb kakoune: implement whitespace highlighter config
The options under `programs.kakoune.config.showWhitespace` existed
but were not implemented.

PR #1162
2020-04-16 22:34:31 +02:00
Robert Helgesson
f6afd95ef8 tmux: fix broken test case 2020-04-15 23:25:16 +02:00
Robert Helgesson
022228e0aa ssh: switch type of matchBlocks to listOrDagOf
This switches the type of `matchBlocks` from `loaOf` to `listOrDagOf`.
The former has been deprecated in Nixpkgs. The latter allows
dependencies between entries to be expressed using the DAG functions.
2020-04-13 23:24:40 +02:00
Robert Helgesson
8ad4bd6c1b types: improve dagOf and listOrDagOf
In particular, improve the behavior of these types if the element type
is a submodule.
2020-04-13 22:01:20 +02:00
Piotr Bogdan
9f223e98b7 gnome-terminal: add cursorBlinkMode option 2020-04-10 17:10:26 +02:00
Robert Helgesson
2102b4e7b3 home-environment: minor fix of DocBook code 2020-04-10 16:16:46 +02:00
Robert Helgesson
ebdfa06685 tests: update nmt 2020-04-10 01:01:20 +02:00
Robert Helgesson
41094aa3c7 neovim: fix docbook syntax in option descriptions 2020-04-09 19:27:57 +02:00
Jonathan Ringer
09abc29b73 neovim: add vimdiffAlias 2020-04-09 19:20:19 +02:00
Terje Larsen
5b7b9821e0 qutebrowser: add support for list values in settings 2020-04-09 19:13:07 +02:00
Robert Helgesson
ee18288eeb codeowners: add entry for mako 2020-04-09 11:28:22 +02:00
Jonas Heinrich
f856da6690 mako: add module
PR #1113
2020-04-09 11:21:22 +02:00
Robert Helgesson
5cdbfc9064 Add code owners and pull request template 2020-04-08 19:29:57 +02:00
Robert Helgesson
068ff76a10 gitlab-ci: improve NUR update trigger
Specifically, trigger NUR updates for all release branches by default.

Also updates the GitLab CI definition to use the new `rules` attribute
rather than the deprecated `only` attribute.
2020-04-08 16:13:01 +02:00
Justin Lovinger
b7737f1732 qutebrowser: add module
PR #1132
2020-04-08 14:50:59 +02:00
Tobias Happ
d06bcf4c97 targets.genericLinux: add module
PR #797
2020-04-08 13:36:25 +02:00
Robert Helgesson
dd538c2969 home-environment: add option sessionVariablesExtra
This is an internal option for adding additional code to
`hm-session-vars.sh`.
2020-04-08 13:23:02 +02:00
Robert Helgesson
f56c4187a4 screen-locker: add option enableDetectSleep
Fixes #1125
2020-04-06 19:41:13 +02:00
Diep Pham
1fd874b7ea go: add goPrivate option
This option configures the `GOPRIVATE` variable. See

   https://golang.org/cmd/go/#hdr-Module_configuration_for_non_public_modules

for more information.

PR #1126
2020-04-06 19:28:31 +02:00
Griffin Smith
5ff245790d gtk: add bookmarks option
Add a new 'bookmarks' option, for managing `~/.config/gtk3/bookmarks`,
a list of URIs to display as bookmarks in the sidebar of GTK file
browsers.

PR #1129
2020-04-06 15:52:46 +02:00
Robert Helgesson
1cfc0a3203 sxhkd: add dummy package in tests 2020-04-06 12:55:58 +02:00
Robert Helgesson
a128e35927 Update nixfmt and apply to a few more files 2020-04-06 12:51:11 +02:00
Matthieu Coudron
dd93c300bb vim: avoid using alias of vim-sensible 2020-03-30 21:55:10 +02:00
Michael Millwood
14f83a46d0 kakoune: fix set option
The old `set-option global/ autoreload` code causes an error.

PR #1117
2020-03-30 21:33:24 +02:00
Timo Kaufmann
5969551a5c home-manager: add instantiate subcommand
It can be useful to simply instantiate a Home Manager configuration
without actually building it, for example for the purpose of
pre-building it with some custom command.

PR #1099
2020-03-25 21:16:43 +01:00
Carlos Tomé
7fa890462d zsh: support extra settings in oh-my-zsh plugins (#1106)
Co-Authored-By: Robert Helgesson <robert@rycee.net>
2020-03-25 15:40:42 +01:00
Ruby Iris Juric
78a0bbb38b picom: add module
Nixpkgs no longer packages compton, and instead packages picom, a
(mostly) compatible fork of compton, providing an alias from compton
to picom. Because some configuration options have been changed, and
all references to "compton" have been made deprecated and replaced
with "picom", 'services.compton' has been deprecated in favor of the
new 'services.picom'.

Resolves #878
PR #1101
2020-03-24 23:50:22 +01:00
Erik Arvstedt
e2414c4a4f systemd: improve systemd-activate.rb script
- Pass arguments verbatim to the `systemctl` subprocess, obviating the
  need for shell escaping.

- Use open3 for capturing subprocess output.

- Fix printing of commands during dry run.

- Simplify `X-RestartIfChanged` regular expression.

  1. Use \s to match whitespace, \b to match a word boundary.

  2. Rename variable to conform to Ruby's underscore naming
     conventions.

- Remove no-op set operation. Specifically, 'no_restart' and 'to_stop'
  are disjunct since

  1. After reloading the daemon with the new generation, units in
     'to_stop' (i.e. units from the old gen that are missing in the
     new gen) are not registered anymore in the systemd daemon.

  2. Hence, 'systemctl cat' returns no output for these units.

  3. Because this output is needed to detect 'no_restart' units,
     'no_restart' includes no units from 'to_stop'.

  So 'to_stop -= to_restart' is a no-op.

- Only notify about units that would otherwise be restarted. That is,
  exclude units that are started but not restarted.

- Previously, all inactive units, like short-running services, were
  handled as failed units.

  Now systemd activation doesn't fail for oneshot services like
  'setxkbmap' while 'servicesStartTimeoutMs' is set.

- Don't start unchanged oneshot services.

PR #1110
2020-03-24 00:00:44 +01:00
Robert Helgesson
d11803d7b4 syncthing: install man pages to user profile 2020-03-22 21:15:25 +01:00
Robert Helgesson
19dd9866da dunst: install man pages 2020-03-22 21:15:23 +01:00
Robert Helgesson
f080f29292 faq: outline how to override packages
Fixes #1107
2020-03-22 13:16:59 +01:00
Cole Helbling
8571e568e0 sway: fix onChange when defunct sockets exist
Fixes `..../generation/activate: line 181: [: too many arguments`
when, for whatever reason, the user has multiple `sway-ipc` sockets.

PR #1086
2020-03-21 18:00:26 +01:00
Bill Sun
fe145b12cd vscode: fix extension path symlink error
Fix extension path symlink error caused by [1], which removes
`/share/{wrappedPkgName}/extensions` from the extension install path.

[1] https://github.com/NixOS/nixpkgs/pull/71251

PR #1100
2020-03-21 17:47:32 +01:00
Robert Helgesson
0f11a79e02 dconf: make settings have type gvariant
Closes #835, #1094, #1095
2020-03-21 01:02:41 +01:00
Robert Helgesson
ac9e44a831 lib: add GVariant datatype and functions 2020-03-21 00:28:50 +01:00
Desetude
3673107bc4 termite: fix the key for bold foreground color
PR #1097
2020-03-17 23:47:36 +01:00
Robert Helgesson
b9d4f55228 firefox: force extension file linking 2020-03-17 23:42:27 +01:00
Robert Helgesson
37694e9f51 files: add force flag
Enabling this flag for a `home.file` entry causes the target to be
unconditionally overwritten. The option is not visible in
documentation for now and shouldn't be relied on for general use.
2020-03-17 23:42:26 +01:00
William Carroll
2cd168467e keynav: add module
PR #1082
2020-03-17 22:59:15 +01:00
Robert Helgesson
cc386e4b3b firefox: prepare for updated sideloading behavior
Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com>
2020-03-15 19:48:07 +01:00
Joshua Fern
2681568f2b firefox: support user content CSS
The `userContent.css` file is similar to `userChrome.css`, it's a CSS
file that you can use to change the way web sites and e-mails look.

See http://kb.mozillazine.org/index.php?title=UserContent.css

PR #1079
2020-03-15 18:26:37 +01:00
Robert Helgesson
5c1e7349bb lieer: remove package dependency in tests 2020-03-08 12:02:35 +01:00
Tad Fisher
9f46d516fa services.lieer: add module
Add 'services.lieer', which generates systemd timer and service units
to synchronize a Gmail account with lieer. Per-account configuration
lives in 'accounts.email.accounts.<name>.lieer.sync'.
2020-03-07 15:13:50 +01:00
Tad Fisher
60a939bd01 programs.lieer: add module
Add 'programs.lieer', a tool for synchronizing a Gmail account with a
local maildir and notmuch database. Per-account configuration lives in
'accounts.email.accounts.<name>.lieer'.
2020-03-07 15:13:15 +01:00
Maximilian Bosch
0056a5aea1 debug: add module
This one is fairly similar to `environment.enableDebugInfo`[1] (hence
the name). It ensures that the `debug`-output of packages defined in
`home.packages` is installed if available and ensures that
`gdb`/`elfutils` find those symbols by adding
`~/.nix-profile/lib/debug` to the `NIX_DEBUG_INFO_DIRS`[2] variable.

[1] https://github.com/NixOS/nixpkgs/blob/release-19.09/nixos/modules/config/debug-info.nix
[2] https://github.com/NixOS/nixpkgs/blob/release-19.09/pkgs/development/tools/misc/gdb/debug-info-from-env.patch

PR #1040
2020-03-07 15:03:44 +01:00
Robert Helgesson
b36d3e0261 news: fix condition
The news entry for the new Fish functions functionality was
accidentally conditioned for people using zsh.
2020-03-07 14:33:13 +01:00
Erik Arvstedt
efbe1383e6 nixos integration: add option 'useGlobalPkgs'
PR #1059
2020-03-07 14:25:00 +01:00
Erik Arvstedt
c7b43786ad README: add link to main manual page
The main manual page is highly relevant and should be easily
discoverable from the README.

PR #1059
Fixes #1048
2020-03-07 13:32:36 +01:00
Cole Helbling
a11cf1decd fish: allow arguments to functions
This allows the ability to provide arguments to a function, such as
`--on-event` in order to trigger a function on the
`fish_command_not_found` event, for example.

PR #1063
2020-03-07 12:51:37 +01:00
zimbatm
9a1feb5b10 git: fix the config output formatting
When setting values using the `git config --set` command, git formats
the file a bit differently. This changes the output so it maps to that
format.

Differences:

* each `key = value` in a section is prefixed by a tab character
* the `=` between the key and the value is surrounded by spaces

PR #1069
2020-03-07 12:02:20 +01:00
William Carroll
71c7aaee83 fzf: support fish integration
Create the `enableFishIntegration` option to install the fzf
key-bindings for people who use fish shell.

PR #1074
2020-03-07 11:52:54 +01:00
Robert Helgesson
faa2945606 tests: remove package dependencies on rofi and abook 2020-03-06 00:27:21 +01:00
Robert Helgesson
1a4c10e950 ci: run tests with --pure 2020-03-06 00:14:09 +01:00
Robert Helgesson
f3fbb50b68 polybar: add test case 2020-03-04 21:26:35 +01:00
Alex Rice
a6657d6b21 sway: fix floating modifier description
PR #1054
2020-03-04 21:09:36 +01:00
MmeQuignon
0a1ce53990 abook: add module
PR #1058
2020-03-04 19:58:05 +01:00
Robert Helgesson
2678fb3441 format: pin Nixpkgs version
This is to make sure that we get a consistent version of nixfmt.
2020-03-04 19:36:07 +01:00
Robert Helgesson
6fc6c736f9 tests: bump nmt version 2020-03-02 23:47:39 +01:00
Robert Helgesson
28401ddd91 systemd: skip services taking an instance parameter
Fixes #730
2020-03-02 20:33:20 +01:00
Robert Helgesson
7bd043e9ee xresources: give properties option more specific type
This more readily allows merging configurations.
2020-02-29 22:32:52 +01:00
Robert Helgesson
acf106ced0 starship: give settings option more specific type
This more readily allows merging configurations.

Fixes #1023
2020-02-29 22:17:47 +01:00
Robert Helgesson
2f726bbd1c bash, fish, zsh: fix shellAliases example
Unfortunately the document generator is not smart enough to quote the
`..` alias in the documentation which is very misleading. By making it
a literal example the quotes stay.
2020-02-26 22:44:54 +01:00
Alex Rice
02d6040003 sway: add module
PR #829
2020-02-26 22:37:15 +01:00
Robert Helgesson
2fcdf3df34 contributing: add section about tests 2020-02-26 22:13:48 +01:00
Robert Helgesson
aedde6dcde contributing: add note about news entry for new modules 2020-02-26 21:59:36 +01:00
Martin Potier
ef148ab3cb newsboat: show queries before urls
PR #1047
2020-02-26 21:38:07 +01:00
Robert Helgesson
03b622b356 Bump copyright year 2020-02-25 19:27:54 +01:00
Chris Hodapp
9ab59dd6ac home-manager: handle args with spaces to doBuildAttr
Presently, if you pass an argument with spaces in it to `doBuildAttr`,
it will be split it into multiple arguments to `nix build` or
`nix-build`. This situation arises, for example, on systems with
spaces in `XDG_DATA_HOME`.

Specifically, the `home-manager` script errors out in trying to
address the `read-news` state file. With this change, argument
separation should be preserved properly in `doBuildAttr`.

PR #1044
2020-02-24 23:51:36 +01:00
Vojtěch Káně
9ab4e70d17 readme: add notes on release policy
PR #1046
2020-02-24 23:09:18 +01:00
Robert Helgesson
91c7059d98 udiskie: fix formatting 2020-02-24 23:07:58 +01:00
Robert Helgesson
d90ae6dffa udiskie: remove obsolete -2 command line argument
Fixes #1042
2020-02-24 20:45:54 +01:00
ivann
9ab0d2305c kitty: add module
PR #1000
2020-02-23 11:28:53 +01:00
ivann
9bddef74df types: create fontType option type 2020-02-23 11:18:59 +01:00
Wael Nasreddine
4e50809c78 modules: remove unused checkPlatform function
PR #1041
2020-02-21 21:56:51 +01:00
Evan Stoll
7f748f27bc neomutt: add reverse sort options (#1036) 2020-02-21 15:24:52 +01:00
Robert Helgesson
543118ac70 fish: apply nixfmt 2020-02-20 00:16:01 +01:00
Robert Helgesson
57bd27b3e7 Merge PR #635 2020-02-20 00:07:04 +01:00
Cole Helbling
5ca224f75b fish: consistency is key and other style changes
I like my empty sets with spaces between them.
2020-02-20 00:03:29 +01:00
Cole Helbling
89239d554d fish: prepend fenv functions dir
Instead of concatenating the `fish_function_path` with the fenv
functions path, just prepend it. Functionally the same, but looks
cleaner (IMO).
2020-02-20 00:03:28 +01:00
Cole Helbling
a08dabf015 fish: escape abbrs and aliases
Some of my aliases have apostrophes in them, so shell-escaping them is a
must.
2020-02-20 00:03:27 +01:00
Cole Helbling
9a258edc10 fish: fix sourcing of .fish files
Turns out, the quotes were messing things up.
2020-02-20 00:03:26 +01:00
Ryan Orendorff
111011b2c2 fish: add some tests
- If a function is defined, check that the function file exists and
  that the contents matches a given string.

- If no functions exists, the functions folder should not exist.

- Verify plugin functionality.
2020-02-20 00:03:26 +01:00
Ryan Orendorff
108259925a fish: plugins separated into conf.d files
This was done to make it easier for the generated files to be understood.
2020-02-20 00:03:25 +01:00
Ryan Orendorff
639f6fea8c fish: plugins concated to 99plugins.fish
This change allows the entire repo to be imported directly. Some plugins (such
as oh-my-fish's vi-mode) have extra files that are referenced by the plugin
itself. This means we cannot create a generic plugin file structure out of the
plugins that exist currently.
2020-02-20 00:03:24 +01:00
Ryan Orendorff
f5b24635b6 fish: whitespace and style fixes (camel case) 2020-02-20 00:03:23 +01:00
Ryan Orendorff
0522c7c1f6 fish: plugins uses pluginModule type, add example 2020-02-20 00:03:22 +01:00
Ryan Orendorff
2f51b9e418 fish: add pluginModule type
Similar to zsh's `pluginModule` type, but without an initialization
file.
2020-02-20 00:03:21 +01:00
Ryan Orendorff
4f532948f7 fish: shell{Abbrs,Aliases} has more specific type
Converted attrs to attrsOf str.
2020-02-20 00:03:20 +01:00
Ryan Orendorff
0740c257b1 fish: remove fileType function
Replaced by types that are more common. This additionally reflects in the
manpages, which should have types the reader is familiar with.
2020-02-20 00:03:19 +01:00
Ryan Orendorff
490f5fc585 fish: remove completions
They are not currently handled in the code, hence they are removed for now.
2020-02-20 00:03:18 +01:00
Ryan Orendorff
642bd67126 fish: add comma to program slogan
Matches what is on the fish website
2020-02-20 00:03:18 +01:00
Ryan Orendorff
4833a8b532 fish: add section headers to generated config
The section headers help show where each section came from when looking at the
generated config. Added a note about how the config was generated in the
generated file.
2020-02-20 00:03:17 +01:00
Ryan Orendorff
d45e1c4adc fish: functions type to attrsOf lines, load by text
Functions in fish are now defined in terms of adding the appropriate
files and `files.text` sets to `xdg.configFile`.
2020-02-20 00:02:58 +01:00
Ryan Orendorff
3de8102e7f fish: revamp descriptions to match bash style 2020-02-19 23:42:54 +01:00
Ryan Orendorff
665766f8bb fish: add examples for shellAliases, shellAbbrs 2020-02-19 23:42:53 +01:00
Ryan Orendorff
2eb1cb077d fish: move type declarations to top of mkOptions
A closer match to the style of the definitions in the bash program.
2020-02-19 23:42:52 +01:00
Jonas Holst Damtoft
c22f3e1d29 fish: basic completions support 2020-02-19 23:42:51 +01:00
Jonas Holst Damtoft
b18d302d44 fish: add plugin functionality 2020-02-19 23:42:51 +01:00
Robert Helgesson
5be9aa417a neomutt: fix sendMailCommand when msmtp is enabled
This resolves the error

    The option `accounts.email.accounts.xyz.neomutt.sendMailCommand`
    is defined both null and not null, in
    `…/home-manager/modules/accounts/email.nix' and
    `…/home-manager/modules/accounts/email.nix'.

that would occur previously when both neomutt and msmtp were enabled
for an account.
2020-02-16 23:08:37 +01:00
Robert Helgesson
7a3e2cc063 files: use nix-env to create profile links 2020-02-15 23:53:39 +01:00
Robert Helgesson
e1153f4d2e home-manager: make sure all files are uninstalled
This forces the `home.file` option to be completely empty when
switching to the uninstall configuration. This is necessary to guard
against files are added by default in Home Manager, such as
`$XDG_CACHE_HOME/.keep`.
2020-02-15 19:26:23 +01:00
brettm12345
7b7499dd70 starship: use promptInit for fish 2020-02-14 21:07:50 +01:00
Robert Helgesson
f0fe18cd22 systemd: start timers as well
Fixes #1019
2020-02-09 22:59:36 +01:00
Jonathan Ringer
f487b527ec compton: add inactiveDim option
PR #1016
2020-02-05 20:13:20 +01:00
Gregory C. Oakes
6cc4fd6ede screen-locker: made xss-lock a systemd service.
Takes advantage of the new `--session` xss-lock parameter to allow
xss-lock be made into a systemd service.

PR #1015
2020-02-02 01:33:36 +01:00
Robert Helgesson
115e76ae12 Merge PR #1006 2020-02-02 01:26:45 +01:00
Robert Helgesson
a4a07ba996 readline: fix example 2020-02-02 01:20:05 +01:00
Robert Helgesson
70af3b126a ci: add format script and use in CI pipeline
The format script can be used to automatically format the Nix source
files and also verify that the files are formatted using the `-c`
command argument.

At the moment some files are exempt from the formatting to avoid
causing merge conflicts in active pull requests.

Finally, update the contribution guidelines to note that `nixfmt`
should be used.
2020-02-02 01:19:35 +01:00
Robert Helgesson
45abf3d38a Apply nixfmt on many files 2020-02-02 01:07:28 +01:00
Michael Hoang
9799d3de2d feh: add buttons option
Use `null` to disable keybindings or button mappings.
2020-02-01 10:04:52 +01:00
Owen Shepherd
a591e8f9e4 zsh: add 'ignoreSpace' option
This option sets HIST_IGNORE_SPACE, which determines whether commands starting with a
space are put in the history or not.
2020-01-26 21:36:03 +01:00
Robert Helgesson
de8033747c tests: clean up tests
- Move all module tests to their own directories.

- Avoid duplication of `// import`.
2020-01-26 21:11:23 +01:00
Matthieu Coudron
fba87f8998 neomutt: add module
PR #1002
2020-01-26 20:46:44 +01:00
dind
d8d5f85ab7 termite: fix scrollbar position option description
Signed-off-by: dind <lewdavatar@gmail.com>
2020-01-26 16:31:41 +00:00
Marius Bergmann
b4e8d9869f grobi: add module
This adds a service module for [grobi](https://github.com/fd0/grobi),
which can be used to automatically configure monitors/outputs for Xorg
via RANDR.
2020-01-26 13:57:49 +01:00
Néfix Estrada
b270fcef2f bspwm: add module
PR #362, #981

Co-authored-by: Vincent Breitmoser <look@my.amazin.horse>
2020-01-26 13:43:13 +01:00
arcnmx
244d795325 nixpkgs: add indirection to _module.args.pkgs
This allows pkgs to be overridden in such a way that `<nixpkgs>` is
never imported, allowing home-manager to be used in environments where
`NIX_PATH` is not set.

PR #993
2020-01-26 13:03:23 +01:00
eyeinsky
e5fb259872 readme: add more prominent link to the manual
PR #996
2020-01-26 12:04:43 +01:00
Robert Helgesson
ba097beb17 tests: remove unnecessary user of import 2020-01-26 11:30:32 +01:00
Robert Helgesson
1397570eea tests: use lib.hm.types instead of explicit import 2020-01-26 11:28:34 +01:00
Robert Helgesson
57ede1369f emacs: use lib.hm.types instead of explicit import 2020-01-26 11:26:33 +01:00
Robert Helgesson
95c8007b8f xresources: improve properties option example
Fixes #1001
2020-01-21 22:27:57 +01:00
Ashish SHUKLA
805d82e1be ssh: make certificateFile similar to identityFile
PR #998
2020-01-21 21:10:11 +01:00
Robert Helgesson
6e4b9af080 Switch to extended Nixpkg's lib
This change makes use of the `extend` function inside `lib` to inject
a new `hm` field containing the Home Manager library functions. This
simplifies use of the Home Manager library in the modules and reduces
the risk of accidental infinite recursion.

PR #994
2020-01-21 20:47:04 +01:00
0x6d6178
c8323a0bf1 xdg-user-dirs: fix typo in option name
Fixes #985
PR #987
2020-01-17 23:55:27 +01:00
Robert Helgesson
4b04050953 Merge PR #991 2020-01-16 00:29:57 +01:00
Robert Helgesson
f65510b1d1 home-environment: make home.activation public
Also improve documentation and add an example.
2020-01-16 00:16:35 +01:00
Robert Helgesson
7f87329fca home-environment: use DAG type in activation option 2020-01-16 00:16:35 +01:00
Robert Helgesson
6c127efb2d lib: add type generators dagOf and listOrDagOf
Given an inner type, the former function generates a type that expect
DAG option values. The latter function is only present to temporarily
allow the `programs.ssh.matchBlocks` to keep accepting list values.
2020-01-16 00:16:09 +01:00
arcnmx
b053dc8697 modules: use pkgs.path instead of <nixpkgs>
PR #992
2020-01-15 20:58:15 +01:00
Robert Helgesson
bff499113e manual: note deprecation of list values for file options
In particular, this entry notes that assigning lists to `home.file`,
`xdg.configFile`, and `xdg.dataFile` is deprecated and will be removed
in the next release.
2020-01-13 22:34:38 +01:00
Robert Helgesson
ee01d24a45 notmuch: use writeShellScript 2020-01-13 21:45:20 +01:00
Robert Helgesson
e9beef31eb getmail: use attribute set to define files
To avoid warning message concerning deprecation of the `loaOf` type.
2020-01-13 21:45:19 +01:00
Robert Helgesson
cff9ee7cce zsh: use attribute set to define files
To avoid warning message concerning deprecation of the `loaOf` type.
2020-01-13 21:45:18 +01:00
Robert Helgesson
07dc3e5425 notmuch: use attribute set to define files
To avoid warning message concerning deprecation of the `loaOf` type.
2020-01-13 21:45:17 +01:00
Robert Helgesson
e857249d86 go: use attribute set to define files
To avoid warning message concerning deprecation of the `loaOf` type.
2020-01-13 21:45:17 +01:00
Robert Helgesson
8ace1ab1b0 browserpass: use attribute set to define files
To avoid warning message concerning deprecation of the `loaOf` type.
2020-01-13 21:45:16 +01:00
Robert Helgesson
00e26ceffe chromium: use attribute set to define files
To avoid warning message concerning deprecation of the `loaOf` type.
2020-01-13 21:45:15 +01:00
Vojtěch Káně
4ad3fe78f9 go: adds an option extraGoPaths
PR #946
2020-01-13 21:44:13 +01:00
Robert Helgesson
297ed97166 mpv: allow string values in scripts list
Fixes #976
2020-01-11 17:44:04 +01:00
Ross A. Baker
0fce533e70 lorri: add gitMinimal to daemon path
Fixes https://github.com/target/lorri/issues/255 when the service is
installed through home-manager.

PR #975
2020-01-11 17:19:10 +01:00
Philipp Middendorf
3a3657b107 cbatticon: add module (#963) 2020-01-11 13:08:56 +01:00
Denys Pavlov
d677556e62 spotifyd: update flags (#979)
Following nixos/nixpkgs@54433c4
2020-01-09 15:10:16 +01:00
Wael M. Nasreddine
1b7b1bc294 neovim: un-deprecate the configure option
The `programs.neovim.configure` option is consistent with NixOS's
`wrapNeovim` and offers features not supported by the `extraConfig`
and `plugins` option pair.

Closes #971
2020-01-06 07:02:37 -08:00
Robert Helgesson
ef6674d1d1 contributing.md: minor update
This elaborates the instructions for the news entry of new modules.
2020-01-06 11:31:37 +01:00
YVT
e70912df26 lsd: add shell aliases for fish 2020-01-06 15:09:51 +09:00
Robert Helgesson
0bb2d87cfd gitlab-ci: pin Nixpkgs version 2020-01-01 13:52:01 +01:00
jD91mZM2
ebf1df58da gpg-agent: fix GnuPG by adding pinentry flavor option
See https://github.com/NixOS/nixpkgs/pull/71095.

Fixes #908
2020-01-01 13:26:21 +01:00
oxalica
7c30831e8f home-manager: fix pass-through option passing
This resolves, e.g., the errors occurring when passing empty arguments
like `--option builders ''`.

Closes #967
2020-01-01 12:27:29 +01:00
Michael Hoang
df4db50632 i3: update default i3 key bindings
Update to match the default i3 key bindings

  https://github.com/i3/i3/blob/master/etc/config

PR #957
2019-12-31 11:19:20 +01:00
Robert Helgesson
54f367b119 install: add state version to initial configuration
This sets the state version in recent installs to the latest released
version. It is beneficial for people to be aware of this option and it
is also good to help new users get a more recent setup.
2019-12-31 09:27:37 +01:00
cmacrae
f66cc1b851 firefox: add darwin support 2019-12-31 00:08:20 +01:00
jD91mZM2
a0ab0b16fe keychain: add xsession integration 2019-12-28 17:29:57 +01:00
Julien Tanguy
5992c1b469 keychain: add fish shell integration
The shell command is added in the interactiveShellInit, as it is the
equivalent of initExtra in bash or zsh.
2019-12-27 10:58:03 +01:00
Robert Helgesson
8d14ffbe88 blueman-applet: minor cleanup of enable option
In particular use proper DocBook format in description.
2019-12-25 22:00:54 +01:00
Cabia Rangris
a5d3d6f665 blueman: update advice for removing error message
The old method for hiding the error no longer works in NixOS 19.09,
and ends up breaking blueman-applet entirely. Enable the NixOS service
instead.

Pull request #950
2019-12-25 21:52:49 +01:00
Gregory Oakes
a12a8f7977 random-background: add bgSupport documentation
On NixOS it is necessary to set `bgSupport = true` when creating a
Home Manager desktop manager session. Otherwise NixOS will add code
that sets the background, overriding the effort made by the
`random-background` module.

Fixes #955
Pull request #956
2019-12-25 21:44:23 +01:00
Bernardo Meurer
0f1c9f25cf beets: allow custom package (#952) 2019-12-18 01:25:52 +01:00
arcnmx
8abaa025ec systemd: fix degraded warning 2019-12-15 14:58:43 -08:00
Robert Helgesson
621c98f15a mbsync: skip maildir creation if no account is defined
Fixes #937
2019-12-08 21:46:30 +01:00
Robert Helgesson
bcfc52cb85 tests: move git and files tests to directories 2019-12-08 21:40:22 +01:00
David Wood
5c9ec0d8e9 starship: add package option 2019-12-08 21:24:04 +01:00
Robert Helgesson
284b8d94d4 readline: add variables option
Also add a basic test case.
2019-12-08 21:13:58 +01:00
Vojtěch Káně
bb5dea02b9 readline: add module
Add basic readline configuration (~/.inputrc) management.
2019-12-08 20:49:00 +01:00
Konrad Borowski
711109d468 vscode: correct VSCodium extension directory path 2019-12-07 15:04:11 +01:00
Robert Helgesson
ed9a6e34ad gpg: remove dummy gnupg package from test
It caused evaluation issues related to systemd.

Fixes #934
2019-12-02 21:16:44 +01:00
Sebastian Ullrich
571989f564 xdg-mime: add module 2019-12-01 23:11:49 +01:00
Robin Stumm
fdd65e5fad parcellite: remove obsolete backward compatibility fixes
This also fixes that the `gtk.theme` option was not picked up due to
hardcoded XDG_DATA_DIRS.
2019-12-01 20:03:05 +01:00
Robert Helgesson
7c2532d9f9 home-manager: add --(no-)substitute options
Fixes #312
2019-12-01 10:43:39 +01:00
pacien
94d183eaaa unison: add module 2019-11-29 23:49:00 +01:00
pacien
9d09738e4d password-store: add modules 2019-11-29 23:03:15 +01:00
worldofpeace
ef11164c0c vscode: don't create an empty settings.json
If I enable this module without using the userSettings option it will
create an empty settings.json. We use mkIf to prevent this on the default
value.
2019-11-28 16:01:58 -05:00
leotaku
34dc4a5e03 mpdris2: improve service description
In particular, make sure the systemd service actually starts.
2019-11-27 22:46:02 +01:00
Philip Stears
0e9b7aab3c files: additional support for symlinked /nix
In the case where `/nix` is a link, for example, on macOS Catalina,
`builtins.storeDir` returns `/nix`, not the canonical location.

This causes tests on existing files to result in Home Manager thinking
those files are outside of the store.

This change uses `readlink` on the store path so that the tests work
as intended.
2019-11-26 22:22:19 +01:00
Robert Helgesson
9781f3766d systemd: perform reload even in degraded state
This fixes #355, fixes #798, and fixes #909.
2019-11-24 18:55:01 +01:00
Robert Helgesson
9e716025b6 lorri: restrict news entry to Linux 2019-11-24 18:53:44 +01:00
Kloenk
eee6ae33e8 spotifyd: add module 2019-11-24 18:52:52 +01:00
Anton Plotnikov
b1dd373f5a files: update script to support linked Nix store 2019-11-22 20:16:42 +01:00
Tobias Happ
286dd9b308 lorri: add service 2019-11-17 20:36:27 +01:00
Pasquale
595150be86 vscode: correct base path from which to pull extensions 2019-11-15 23:18:12 +01:00
HerrMAzik
08094f3cc2 vscode: fix configDir for VSCodium 2019-11-15 23:15:00 +01:00
pacien
24dbac8da7 Revert "astroid: require notmuch synchronize flags"
The Astroid program can work without this option,
which should be disabled when synchronising emails with muchsync for example.

This reverts commit fa3d1f98e0.
2019-11-15 23:11:27 +01:00
pacien
18dc4153c7 astroid: fix maildir folder paths
Using the absolute path of maildir folders is required for Astroid to save
messages in those.
2019-11-15 18:14:58 +01:00
Nikita Uvarov
4505710565 zsh: fix history.path issues
- Default value is set to static '$HOME/.zsh_history' -- dotDir is not
prepended anymore
- $HOME is not prepended to the option value
- Ensure history path directory exists

Fixes #886, replaces #427.
2019-11-05 23:04:06 +01:00
Mario Rodas
05dabb7239 pazi: add module 2019-11-04 21:57:15 +01:00
adisbladis
49852220f9 emacs: Don't use emacsPackagesNg
It's deprecated and since Nixos 19.09 it's an alias to `emacsPackages`.
2019-11-04 11:16:06 +00:00
Robert Helgesson
6b6f759e7a doc: update version number in some places 2019-10-29 23:08:46 +01:00
Nikita Uvarov
149c0593ab version: add 20.03 2019-10-28 22:08:51 +01:00
Nikita Uvarov
26defdf205 tests: fix i3-keybindings test 2019-10-28 22:05:09 +01:00
wedens
5161dd3b2e i3: add workspaceAutoBackAndForth option 2019-10-28 11:31:51 +01:00
Robert Helgesson
a93d01fb4d faq: describe how to install Nixpkgs unstable packages 2019-10-26 16:43:14 +02:00
Robert Helgesson
797c77a00a tests: reduce number of downloads
This replaces some derivation outputs by simple strings rather than
full Nix store paths. This removes the need to download the whole
derivation when all we need is a static string.
2019-10-26 13:07:04 +02:00
dnsdhrj
a177d0282f getmail: fix port option type mismatch
Fixed type mismatch in commit 410f573226.
Added test case to ensure it works well.
2019-10-26 10:58:31 +02:00
Robert Helgesson
1b987952b5 kakoune: prepend extra configuration with newline (#870)
Fixes #869
2019-10-23 20:39:52 +09:00
SoonHo Seo
410f573226 getmail: add port option (#882)
Fixed bug where "accounts.email.accounts.<name>.imap.port" option was being ignored in getmail.
2019-10-23 20:17:04 +09:00
Pasquale
024d1aa227 vscode: add package option and link extensions 2019-10-20 21:49:17 +02:00
Wael Nasreddine
b1d8c0f9c3 termite: use vte-ng at pkgs.termite.vte-ng (#865) 2019-10-12 11:39:33 -07:00
Robert Helgesson
90bf989002 newsboat: support feed titles
Fixes #861
2019-10-11 21:41:05 +02:00
Robert Helgesson
79c16b9a90 doc: fix section ID for 20.03 release notes 2019-10-09 22:41:56 +02:00
Robert Helgesson
83018ac54a doc: add preliminary release notes for 20.03 2019-10-09 21:07:43 +02:00
Robert Helgesson
ad52dbe044 doc: finalize the 19.09 release notes 2019-10-09 21:03:04 +02:00
Robert Helgesson
8bddc1adab redshift: add assertion on latitude and longitude
These two options must be set if the provider is set to "manual".

Closes #841
2019-10-02 23:17:57 +02:00
David Wood
e8dbc35613 ssh: sockets forwards; remote and dynamic forwards
This commit adds support for forwarding paths rather than just
addresses/ports. It also adds options for specifying remote and
dynamic forwards.
2019-10-02 20:42:29 +02:00
Robert Helgesson
3d546e0d01 starship: use [[ in bash init 2019-10-01 21:56:56 +02:00
Robert Helgesson
a5999a62cd starship: fix fish syntax
Fixes #858
2019-10-01 21:21:36 +02:00
Robert Helgesson
761b3d0c12 rtorrent: add news entry 2019-09-26 23:47:41 +02:00
Mario Rodas
bdb4cf6c59 rtorrent: add module 2019-09-26 23:42:52 +02:00
Mario Rodas
7205d3b2d2 starship: add module 2019-09-26 23:19:39 +02:00
Mario Rodas
bb5c29107e git: add attributes support 2019-09-26 22:11:01 +09:00
Tobias Happ
3f45630180 xdg-mime-apps: add legacy mimeapps.list path
Although `.local/share/applications/mimeapps.list` is deprecated, this
file is still being read by some applications. To ensure compatibility
duplicate the file as recommended in
https://wiki.archlinux.org/index.php/XDG_MIME_Applications#mimeapps.list
2019-09-20 20:15:47 +02:00
Nazarii Bardiuk
51581b7e43 sxhkd: add service 2019-09-17 21:42:05 +02:00
Robert Helgesson
b0544c8cde mpd: allow path literal values in options
This allows specifying, for example, the music directory using path
literals without causing the directory to be copied to the Nix store.

Suggested-by: Silvan Mosberger <infinisil@icloud.com>
2019-09-16 21:43:53 +02:00
pacien
e347e932af xdg-mime-apps: add module 2019-09-15 17:21:42 +02:00
Robert Helgesson
0dfa1eef25 xsession: remove bashisms in start scripts
Fixes #836
2019-09-12 21:28:36 +02:00
pacien
aa5ba177cc xdg-user-dirs: add module 2019-09-11 20:03:32 +02:00
Bjarki Ágúst Guðmundsson
41f918499b gpg: sane default for throw-keyids option
The [throw-keyids](https://www.gnupg.org/gph/en/manual/r2110.html)
option "hides the receiver of the encrypted data as a countermeasure
against traffic analysis." However, it also slows down decryption, and
even breaks some applications; see e.g.
https://github.com/open-keychain/open-keychain/issues/626

I think the sane default would be to leave it off, just as it is off
by default in gpg. The typical user will probably not need this level
of security, and will probably prefer a better user experience (faster
decryption and compatibility with a wider range of applications).

Closes #838
2019-09-11 19:30:26 +02:00
Bruno Bigras
d3e316eec5 imapnotify: pkgs.mbsync -> pkgs.isync 2019-09-11 19:27:04 +02:00
Robert Helgesson
45ec65e1cc doc: convert some DocBook files to AsciiDoc 2019-09-07 09:29:24 +02:00
Hugo Geoffroy
05d91c5f50 mpd: use systemd journal instead of syslog
MPD is using syslog for its logging output, while it could directly
log to systemd's journal, as this daemon is primarily used as a
systemd user service. This change makes MPD log to standard output,
which is captured by systemd.

See https://github.com/NixOS/nixpkgs/pull/57608, which does the same
thing to NixOS's MPD service.
2019-09-05 22:38:35 +02:00
Robert Helgesson
d6b36f12ff keyboard: make the model option optional
Also, actually use it in the call to setxkbmap.
2019-09-05 01:56:14 +02:00
Robert Helgesson
824d31a21c keyboard: make layout and variant optional
Also default these options to `null` for state version ≥ 19.09.

Fixes #811

Suggested-by: Sean Marshallsay <srm.1708@gmail.com>
2019-09-05 01:56:06 +02:00
Robert Helgesson
0083087e01 xsession: verify setxkbmap service in test 2019-09-05 01:32:53 +02:00
Robert Helgesson
1923ac3358 rofi: add test to verify assertion 2019-09-04 12:52:14 +02:00
Robert Helgesson
698d0f0a44 polybar: restart service on failure 2019-09-03 23:51:23 +02:00
Alex Rice
ec0459e139 rofi: string -> str 2019-09-03 01:25:24 +01:00
dawidsowa
d5e73c39fc mpv: add scripts option 2019-09-02 18:23:17 +02:00
Robert Helgesson
a144c723a1 doc: surround name? with fancier characters 2019-09-01 21:28:40 +02:00
Robert Helgesson
a28614e65d git: deprecate extraConfig as string 2019-08-30 14:50:10 +02:00
Robert Helgesson
8ab1d22a82 home-manager: support --option argument
Fixes #784
2019-08-30 00:52:09 +02:00
Tobias Happ
b6289f7022 vim: always add sensible plugin 2019-08-29 23:18:11 +02:00
Robert Helgesson
875eea1330 systemd: fix unit examples
Closes #823
2019-08-29 19:12:39 +02:00
Robert Helgesson
7c76ae1814 manual: add nmd as a generation dependency
This is to allow network-less rebuilding of a generation after a
garbage collection.

Fixes #819
2019-08-28 20:36:11 +02:00
Tobias Happ
c142e5264d neovim: add extraConfig and plugins options 2019-08-28 12:35:48 +02:00
Tobias Happ
5d7eabb93f neovim: add finalPackage option as readOnly 2019-08-28 12:25:06 +02:00
Tobias Happ
f1146a1fef vim: allow packages to be passed as plugins
This change allows to pass custom packages into the `vim.plugins`
option.

Additionally this adds a deprecation warning and an error message if a
vim plugin is not present. This is an improvement because the user
gets instant feedback, when a plugin is not found.
2019-08-28 12:18:24 +02:00
Robert Helgesson
55b71223d4 Fix option defaultText when referencing packages
By using `literalExample` the documentation will show the option
default without surrounding quotes.
2019-08-28 00:14:22 +02:00
Robert Helgesson
db86bd6c01 doc: update nmd
Also perform scrubbing of `pkgs` since nmd no longer does this
automatically.
2019-08-27 23:40:52 +02:00
Robert Helgesson
13fa61744c doc: minor grammar fix 2019-08-26 23:14:51 +02:00
Robert Helgesson
8fe4e0879c home-manager: support a few extra pass-through options
These options will be passed through to the `nix-build` tool.
2019-08-26 23:06:36 +02:00
Robert Helgesson
6bec9547c6 home-manager: exit directly after printing help 2019-08-26 23:06:36 +02:00
Robert Helgesson
bfc28cacbe random-background: disable creation of ~/.fehbg file 2019-08-26 20:07:07 +02:00
Michael Fellinger
b2a787ca69 random-background: add option enableXinerama 2019-08-26 16:42:00 +02:00
Robert Helgesson
eb1b86a5ec Replace use of stdenv.shell by runtimeShell 2019-08-22 08:35:06 +02:00
Robert Helgesson
7159c293af gitlab-ci: fix deployment of manual 2019-08-21 23:00:04 +02:00
Robert Helgesson
eb0ccf7286 docs: use nmd for generating documentation
The nmd library is an external library for generating Nix-centric
documentation.
2019-08-21 20:35:59 +02:00
Robert Helgesson
35752e07fa kakoune: add missing period at end of description 2019-08-21 20:34:43 +02:00
Robert Helgesson
57925c50bf nixpkgs: improve description formatting slightly 2019-08-21 20:20:08 +02:00
Tobias Happ
0e871b490e ssh: add localForwards option for matchBlocks 2019-08-20 12:11:00 +02:00
Robert Helgesson
ed4f66185f Use types.port where applicable
This changes the type of all options that specify ports to
`types.port`. This type restricts values to between 0 and 65535.
2019-08-19 20:37:48 +02:00
leotaku
3d645c0ce1 kdeconnect: fix incorrect path to kdeconnectd 2019-08-18 23:35:53 +02:00
Robert Helgesson
8830b8d082 gitlab-ci: only run a single test
Unfortunately the full test suite seems to run out of memory on the
GitLab CI runner.
2019-08-18 21:33:56 +02:00
Robert Helgesson
73641e492c firefox: use wrapped package
This makes the

    programs.firefox.package

option take a pre-wrapped Firefox package as value if state version is
set to "19.09" or later. This should make the Firefox module work with
a wider range of Firefox packages.
2019-08-18 18:04:04 +02:00
Robert Helgesson
c2429ca0cf nix-darwin: pass on warnings to the system configuration 2019-08-18 17:37:26 +02:00
Robert Helgesson
7834ffbbf1 nixos: pass on warnings to the system configuration
Fixes #804
2019-08-18 17:35:42 +02:00
Robert Helgesson
fa82ced414 nixos: use non-deprecated fontconfig option 2019-08-18 17:35:41 +02:00
Tobias Happ
9cc30b18f7 nixos: add backup file extension and verbosity options 2019-08-18 17:19:39 +02:00
Tobias Happ
db0dfb4b08 dwm-status: add module 2019-08-18 16:23:31 +02:00
Robert Helgesson
5eed33ef08 emacs: document how to list available extra packages 2019-08-18 13:34:26 +02:00
pacien
31ae1bc2ff alot: fix account extraConfig section 2019-08-18 12:00:38 +02:00
Robert Helgesson
6932e6330e muchsync: add news entry 2019-08-17 14:25:15 +02:00
pacien
a124dae35a muchsync: add module 2019-08-17 20:08:11 +09:00
Tobias Happ
5203340b64 zsh: add envExtra option 2019-08-16 17:00:08 +09:00
Tobias Happ
ed0e40dee8 zsh: add initExtraBeforeCompInit config option
The new initExtraBeforeCompInit option enables the user to inject
commands in zshrc before compinit is executed.
2019-08-16 16:57:52 +09:00
Tobias Happ
8b759c24e6 bash: add logoutExtra option 2019-08-16 16:46:38 +09:00
paumr
1499b85ac6 alot: added send/draf_box to configuration file 2019-08-16 16:27:28 +09:00
Robert Helgesson
fcdab6a62d install: restrict to nix-shell
This commit adds a "build" command to the install derivation that
tells the user that `nix-shell` should be used.

A derivation attribute `shellHookOnly = true` is also added with the
intent to indicate that the shell hook is the entire point of the
derivation.
2019-08-15 23:23:43 +02:00
Tobias Happ
5c94538c7d numlock: set RemainAfterExit for numlockx.service 2019-08-15 11:53:34 +02:00
Tobias Happ
2eae9daae7 xsession: set RemainAfterExit for setxkbmap.service 2019-08-15 11:53:34 +02:00
Robert Helgesson
55c962fda2 gitlab-ci: trigger NUR update
This will trigger a CI job at

    https://gitlab.com/rycee/nur-expressions

that will update Home Manager in NUR.
2019-08-14 21:57:22 +02:00
Robert Helgesson
eb7f39f0aa gitlab-ci: add test stage 2019-08-14 17:38:47 +02:00
Nikita Uvarov
7310cfc557 zsh: fix completion when oh-my-zsh is enabled
enableCompletion option not only calls compinit but also adds
nix-zsh-completions package to home.packages which should still happen
even if oh-my-zsh is enabled.

The double compinit call will still be eliminated by moving guarding condition
down to the compinit call itself.

Fixes #771.
2019-08-09 15:02:31 +02:00
Nikita Uvarov
42ad0effdd zsh: create oh-my-zsh cache directory
Fixes #761.
2019-08-09 14:53:03 +02:00
paumr
bce63e4dff msmtp: add account option tls.fingerprint 2019-08-08 14:12:34 +02:00
Robert Helgesson
9302523d34 modules: fix module order 2019-08-08 13:53:22 +02:00
adisbladis
a9ecef1fa9 hound: add module 2019-08-08 13:52:27 +02:00
Evan Stoll
e59b8b0c37 numlock: add module
This adds an option `xsession.numlock` that enable the Num Lock key
when starting a graphical session.

Fixes #651
2019-08-08 13:25:01 +02:00
paumr
3743e8995a mbsync: fix use of certificatesFile
The `tls.certificatesFile` option may be set to a path but the
`CertificateFile` attribute should be a string.
2019-08-08 00:50:52 +02:00
Tobias Happ
4c9b40ca0e systemd-activate.rb: add start/stop/restart sockets 2019-08-07 23:12:30 +02:00
Robert Helgesson
d625186ce5 Remove use of network-online.target
This target is only available at the system level and has no effect on
user services.
2019-07-28 14:17:28 +02:00
Olli Helenius
caf3349f01 dconf: assume empty list value is a list of strings
Fixes #769.
2019-07-28 13:01:29 +03:00
Brian Hicks
6239ce20af nix-darwin: add docs 2019-07-26 23:45:05 +02:00
Robert Helgesson
54de0e1d79 xdg: create cache directory using keep file
We can avoid the activation block by instead creating a hidden file in
the directory.
2019-07-26 23:23:51 +02:00
Robert Helgesson
056443ccbd vscode: fix configuration path for Darwin
Fixes #737
2019-07-22 12:44:52 +02:00
Sebastian Zivota
7d68c46feb kakoune: add module 2019-07-17 22:40:26 +02:00
Shanon McQuay
734128930f skim: correctly name default options
skim uses SKIM_DEFAULT_OPTIONS rather than SKIM_DEFAULT_OPTS.
2019-07-17 21:53:30 +02:00
pacien
cc0cd538e6 taskwarrior-sync: add service module 2019-07-17 21:34:53 +02:00
Robert Helgesson
ca4f22be85 mbsync: use full path to mu in example 2019-07-17 10:02:35 +02:00
Robert Helgesson
c3520bfa52 mbsync: put extra config at the beginning
If it is at the end it will just end up applying to the last defined
section.

Fixes #748
2019-07-05 22:16:15 +02:00
Andreas Fehn
2029e104d4 xsuspender: write all options to config 2019-07-05 18:44:28 +02:00
Andreas Fehn
7c76f4a71f xsuspender: correctly name default section 2019-07-05 18:44:28 +02:00
arcnmx
95382060eb git: support nested section options
Closes #614
2019-07-04 16:51:28 +02:00
arcnmx
472d7731d6 git: support multiple values
Closes #614
2019-07-04 16:51:24 +02:00
Alexandre Héaumé
28f2dd612e broot: add module 2019-07-02 11:28:31 +02:00
Robert Helgesson
8467e7e10a getmail: restrict tests to Linux 2019-06-28 05:56:42 +02:00
Robert Helgesson
8f7cd53204 getmail: restrict platform to Linux
Need to limit this module to Linux since it uses systemd.
2019-06-27 20:04:18 +02:00
Róman Joost
68fe8623ad Address code review comments for getmail service
This patch started by addresssing the code review comments to close
https://github.com/rycee/home-manager/pull/290. However initiating a new
pull request it became clear, that home-manager changed significantly
since then.

This changes the initial pull request to be consistent with the email
account management in home-manager now. It also adds a simple test and support
for multiple accounts.
2019-06-27 07:48:09 +02:00
Mats Rauhala
8243cc0a5d getmail: add module 2019-06-27 07:48:09 +02:00
Robert Helgesson
95d55b8da1 xsession: add option importedVariables
This option lists the environment variables to be imported into the
systemd user session.

Also add a basic test of the xsession module.
2019-06-23 14:06:29 +02:00
Kai Wohlfahrt
f83c49baa3 gpg-agent: add sshcontrol configuration
This lets gpg-agent serve specific keys with authentication capability
as SSH keys
2019-06-18 13:37:19 +01:00
Jonas Holst Damtoft
cf0aad391c emacs: fix merging of extraPackages and overrides
Because `extraPackages` and `overrides` expect functions as values it
has not been possible to perform merges. This adds suitable types for
these options that allow reasonable merging.
2019-06-10 22:56:47 +02:00
Robert Helgesson
42732990cd home-manager: rewrite argument parsing
This rewrite allows "long options" but unfortunately does not allow
merged options such as `-vn`.

Also improve the home-manager manual page, with this it should include
all sub-commands and arguments.

Finally, include the home-manager manual page in the generated HTML
documentation.
2019-06-09 22:19:03 +02:00
Judson
f82246171b files: backup file collisions
When a configuration file would be written to an existing file, rather
than failing switch (and having the user have to move or delete those
files), move the files automatically to a new path.

Closes #585
2019-06-09 14:26:12 +02:00
Robert Helgesson
5b50eb18fc network-manager-applet: fix indentation 2019-06-09 12:13:11 +02:00
Sebastián Estrella
29824a8cf6 tmux: Disable confirmation prompt 2019-06-05 13:05:10 +09:00
Jaka Hudoklin
0db26fc3ab gpg: add module 2019-06-03 23:50:50 +02:00
Florian Klink
8991fe2e90 screen-locker: fix systemd unit
In particular, don't add trailing backslashes introduced by
`xautolockExtraOptions`. Systemd's unit file parser seems to have
gotten a bit stricter and with systemd 242, the trailing backslash
caused the next non-empty line to be ignored.

In that case, this was `[Section]`, so all subsequent settings were
mistakenly added to `[Service]`, causing them to be ignored entirely.

Simplify and fix this by using `concatStringsSep` to build a single
`ExecStart` line.
2019-06-02 23:29:37 +02:00
Sam Boosalis
2211770d8b home-manager: add Bash completion 2019-06-01 14:00:38 +02:00
Tad Fisher
e25113bcf0 browserpass: fix host/policy link sources 2019-06-01 12:24:30 +02:00
Robert Helgesson
e1535d2bd8 vscode: add example for extensions option 2019-05-31 21:37:28 +02:00
Robert Helgesson
d5bf68d77d xsuspender: limit module to Linux 2019-05-30 23:25:30 +02:00
Jaka Hudoklin
5b95fd0521 firefox: add profile options 2019-05-30 22:58:36 +02:00
Jaka Hudoklin
fcacba268d xsuspender: add module 2019-05-30 19:53:10 +02:00
Richard Marko
d7eaeaf636 random-background: add option display
This option parameterizes the `--bg-*` argument for feh.
2019-05-30 13:40:15 +02:00
Jaka Hudoklin
2e13c3cdfd nixos: use usercfg.home.username for username
Use `usercfg.home.username` for username instead of attribute name,
as this way we can change username regardless of the name of the attribute.
2019-05-25 14:26:49 +02:00
Robert Helgesson
d726afd9e4 imapnotify: specify notmuch configuration path 2019-05-19 01:08:06 +02:00
Roman Volosatovs
1480a6ca14 nix-darwin: actually install packages
Also apply assertions when using the nix-darwin module.

Closes #702
2019-05-19 00:36:35 +02:00
kalium
02a07f19a1 zsh: add autocd option 2019-05-17 09:39:26 +02:00
Tadeo Kondrak
d2ed39f103 alacritty: don't create file if settings is empty
Also add a few test cases for the alacritty module.
2019-05-14 23:53:10 +02:00
Tadeo Kondrak
8b15f18993 mpv: add module 2019-05-08 00:42:18 +02:00
Robert Helgesson
b256e3a44f fontconfig: fix build error
This fixes a build error occurring when building a configuration
having fontconfig enabled and `home.packages` only containing one
package installing things to `/lib`.

Also adds a number of test cases to verify the fontconfig cache
generation functionality.

Fixes #703
2019-05-06 00:44:23 +02:00
Robert Helgesson
939274281a tests: bump nmt version 2019-05-06 00:17:30 +02:00
Jos van Bakel
be4b100ae5 rsibreak: add module 2019-05-05 01:56:53 +02:00
Robert Helgesson
f99d4ba7c4 flameshot: fix service description 2019-05-01 13:13:38 +02:00
Robert Helgesson
1f4e9681f7 fontconfig: fix error on missing cachedir file
Fixes #699
2019-04-30 18:43:58 +02:00
Will Dietz
f56256f488 files: fix find invocation broken in c94eaa0e
Add parens to expression so the `-exec` includes files matching both.

Otherwise (before this change) the `-exec` is only invoked for
links (`-type l`):

    file or (link -> doexec)
      =>
    (file or link) -> doexec
2019-04-30 15:07:47 +02:00
Robert Helgesson
f18e2933d4 fontconfig: generate font cache files
Also deprecates the `fonts.fontconfig.enableProfileFonts` option. The
configuration is now always generated if `fonts.fontconfig.enable` is
set.

Fixes #520
2019-04-30 00:28:07 +02:00
Nick Hu
2f819d1647 imapnotify: add service 2019-04-29 00:05:02 +02:00
Mario Rodas
821df406c9 z-lua: add module 2019-04-28 23:57:31 +02:00
Robert Helgesson
3bb7c75db3 home-manager: add uninstall command 2019-04-28 18:40:41 +02:00
Robert Helgesson
c94eaa0e6c files: replace unnecessary use of xargs 2019-04-27 13:48:57 +02:00
Robert Helgesson
a16439e38e firefox: deprecate Google Talk and IcedTea options 2019-04-27 10:01:30 +02:00
Robert Helgesson
b6e613c771 Fix type of various sessionVariables options
Unfortunately, using `attrsOf` is not possible since it results in too
eager evaluation. In particular, the

    home.sessionVariables = {
      FOO = "Hello";
      BAR = "${config.home.sessionVariables.FOO} World!";
    };

example will cause an infinite recursion.

This commit restores the option type of

- `home.sessionVariables`,
- `pam.sessionVariables`,
- `programs.bash.sessionVariables`, and
- `programs.zsh.sessionVariables`

to `attrs`. It also adds test cases for the above options to avoid
regressions.

Fixes #659
2019-04-27 01:07:09 +02:00
Robert Hensing
c5f230e682 vscode.haskell: add module
- Haskell IDE Engine integration
- Syntax highlighting
2019-04-27 01:00:57 +02:00
Robert Helgesson
ba0375bf06 docs: add systemd type change to 19.03 release notes 2019-04-23 22:02:29 +02:00
Robert Helgesson
13ad532412 xscreensaver: add option settings 2019-04-22 23:44:46 +02:00
Robert Helgesson
8ecc311bcc Update stable version to 19.03
Also prepares for 19.09.
2019-04-22 20:04:31 +02:00
hyperfekt
e3831d8ecc alacritty: add module 2019-04-22 14:43:43 +02:00
Robert Helgesson
9c0536deda emacs: prevent service restart on change
Fixes #668
2019-04-18 01:38:25 +02:00
Robert Helgesson
6b42bd7abf systemd: support X-RestartIfChanged = false
Having this in the unit file will prevent the file from being
restarted if a change is detected. This is useful if data loss may
occur if the unit is suddenly restarted. For example, restarting the
Emacs service may result in the loss of unsaved open buffers.
2019-04-18 01:38:20 +02:00
Robert Helgesson
0d246aa435 systemd: escape unit names in systemctl commands 2019-04-18 01:37:59 +02:00
Benjamin Staffin
c5f35b7ff9 dconf: allow values to be floats
Technically dconf calls these "double" but nix floats ought to work.
2019-04-17 23:04:48 +02:00
Alex Ameen
ff602cb906 manual: add option manual.json.enable
Make it possible to install a JSON file containing the available Home
Manager options.
2019-04-15 22:43:46 +02:00
Olli Helenius
1806e5511e skim: add module 2019-04-14 17:36:27 +02:00
ash lea
cb93316fed browserpass: update app id 2019-04-14 11:40:37 +02:00
Nick Hu
a6f0fa90f7 email: add facility for email aliases
Also update the notmuch and alot modules to include support for email
aliases.
2019-04-12 21:26:46 +02:00
Robert Helgesson
30a16e3a87 polybar: change restart trigger to contain a string
The systemd unit type is a bit more strict now and needs an explicit
string in this position.
2019-04-12 17:56:14 +02:00
Robert Helgesson
3db46fa9bf news: limit mpdris2 and xcape news to Linux
These modules are limited to Linux since they define systemd services.
2019-04-12 01:02:12 +02:00
Robert Helgesson
12cb82af91 systemd: make the unit option type more robust
This should allow more sensible merging behavior. In particular, with
this change it is possible to use, for example, `mkForce` for greater
control of merging.

Fixes #543
2019-04-12 01:02:12 +02:00
Nick Hu
d49b514aa6 make notmuch search.exclude_tags configurable 2019-04-11 23:28:36 +09:00
Robert Helgesson
b6e1d82685 home-environment: make home.keyboard optional
When set to `null` then the `xsession` module will not attempt to
manage the keyboard settings.
2019-04-11 01:09:27 +02:00
Nick Hu
6cd5c8fca5 alot: fix address book completion regex 2019-04-10 23:55:07 +02:00
Robert Helgesson
67aee78fdf home-manager: remove unnecessary error message
An error message about the erroneous option is already printed by
`getopts` so there is no need to print it again.
2019-04-10 01:31:22 +02:00
Nick Hu
c48db4fbba xcape: add service 2019-04-09 22:15:48 +02:00
Robert Helgesson
f8b03f5750 modules: register the base modules path
This is needed, for example, to support relative paths when disabling
modules.
2019-04-07 13:26:38 +02:00
arcnmx
2c07829be2 home-manager: use callPackage where appropriate 2019-04-06 18:48:29 +02:00
Wael M. Nasreddine
652c694244 programs.tmux: implement secureSocket 2019-04-04 17:14:29 -07:00
Olli Helenius
995fa3af36 qt: add option platformTheme
This deprecates `useGtkTheme=true` with the intention of replacing it
with the `platformTheme` selection.
2019-04-03 23:55:36 +02:00
Robert Helgesson
4323b35198 pam: use attrsOf instead of attrs 2019-04-03 00:09:56 +02:00
Robert Helgesson
fd50f5465f zsh: use attrsOf instead of attrs 2019-04-03 00:09:55 +02:00
Robert Helgesson
13d2c470be home-environment: use attrsOf instead of attrs 2019-04-03 00:09:55 +02:00
Robert Helgesson
b690a8be2f bash: use attrsOf instead of attrs 2019-04-03 00:09:55 +02:00
Robert Helgesson
e85804efa2 feh: use attrsOf instead of attrs 2019-04-03 00:09:55 +02:00
Robert Helgesson
e26ad2026c gtk: use attrsOf instead of attrs 2019-04-03 00:09:46 +02:00
Olli Helenius
03162970cd gnome-terminal: add cursor and highlight color settings 2019-03-31 14:24:31 +02:00
Tadeo Kondrak
bc2b7d4f09 qt: use xdg.configHome instead of hard-coding 2019-03-27 22:40:12 +01:00
Robert Helgesson
f77d6b7a2d taffybar: restart the service on failure 2019-03-26 18:05:44 +01:00
Olli Helenius
1fdb16866b systemd: add support for session variables
Via environment.d(5).
2019-03-24 17:23:50 +01:00
Robert Helgesson
6ebf14143a systemd: add some basic tests 2019-03-24 15:52:30 +01:00
Robert Helgesson
cf5dac9563 random-background: minor documentation improvements 2019-03-24 15:29:08 +01:00
Robert Helgesson
2e1c825b90 readme: expand contact section slightly
In particular, mention that the channel is hosted by freenode and the
channel logs are hosted by samueldr.
2019-03-23 23:20:22 +01:00
Robert Helgesson
a974ce6257 readme: add contact section with the IRC channel 2019-03-22 19:10:43 +01:00
Robert Helgesson
5d81cb6ac7 manual: use writeShellScriptBin 2019-03-21 00:39:54 +01:00
Robert Helgesson
41356ac267 polybar: use writeShellScriptBin 2019-03-21 00:39:36 +01:00
Robert Helgesson
86af599a18 firefox: make the extensions option visible
Also change the example to use the firefox-addons available on NUR.
2019-03-20 23:41:02 +01:00
Mario Rodas
95e36dfe74 lsd: add module 2019-03-20 00:07:49 +01:00
Mario Rodas
24b5f62090 bat: add module 2019-03-19 23:58:12 +01:00
Robert Helgesson
989e636d98 ssh: add some basic tests 2019-03-19 23:00:17 +01:00
Robert Helgesson
eec78fbd1e ssh: support multiple identity files in a match block
Fixes #625
2019-03-19 22:35:13 +01:00
Robert Helgesson
70d4cf2cd9 Remove some use of mkDerivation
Instead use `runCommand`, which by default uses `stdenvNoCC` resulting
in a reduced dependency footprint.

Fixes #612
2019-03-18 23:09:54 +01:00
arcnmx
52692e299d git: make userName and userEmail options optional 2019-03-17 20:46:00 +01:00
Robert Helgesson
fd2bc150d8 faq: add entry about missing ca.desrt.dconf 2019-03-17 15:30:59 +01:00
Robert Helgesson
267afa5a3b firefox: add support for add-on packages
Since no official source of packages exist the option is hidden for
now. For adventurous people there is an overlay of a few selected
add-ons available at

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

This overlay is automatically built daily using the REST API available
on https://addons.mozilla.org/.
2019-03-11 00:55:32 +01:00
Wael M. Nasreddine
7ec153889c nix-darwin: login as the user when activating 2019-03-10 02:10:15 +01:00
Wael M. Nasreddine
efc795920b nix-darwin: support package install through user packages 2019-03-10 02:09:00 +01:00
Wael M. Nasreddine
d3fd287efb nix-darwin: activate home-manager through postActivation 2019-03-10 02:03:26 +01:00
Robert Prije
0fa19ed555 gnome-terminal: add support for light/dark theme variants 2019-03-10 01:59:00 +01:00
Robert Helgesson
52fdf5b7ec docs: add NixOS module installation instructions 2019-03-06 19:20:42 +01:00
Robert Helgesson
a09196c4ae docs: add language attribute to program listings 2019-03-06 18:52:54 +01:00
Robert Helgesson
1d8997633c docs: use <screen> for terminal interaction 2019-03-06 18:52:54 +01:00
Maximilian Bosch
0898b6b482 nixos module: evaluate assertions from Home Manager modules 2019-03-06 18:37:37 +01:00
Olli Helenius
848b8b983e pam: enclose session variable values in quotes 2019-03-06 18:00:51 +01:00
Maximilian Bosch
465d08d99f programs/zsh: properly escape shell aliases
Otherwise all aliases break that use single quotes inside.

Already fixed in the nixpkgs module in 1e211a70cbdaf230a18ea4cb67a959039d5c2ddb.
2019-02-28 14:10:14 +01:00
Peter Jones
f07510e2b6 mpdris2: add module 2019-02-24 01:32:34 +01:00
Robert Helgesson
b8b391ad18 tests: remove tests attribute from root default.nix
Having it there prevented, e.g., `nix-env -qaP` from working in some
cases.

Fixes #509
2019-02-23 22:32:44 +01:00
Matthieu Coudron
81dae2f88e alot: support contact completion
Make choice of contact completion easier.
2019-02-20 00:55:39 +01:00
Douglas Wilson
74811679b7 systemd: sanitize unit derivation names
To allow a few special characters such as "@".

This is taken from

    c414e5bd08/nixos/modules/system/boot/systemd-lib.nix (L14)
2019-02-19 23:43:47 +01:00
Robert Helgesson
93f5fcae1e msmtp: use <parameter> for CLI options in description 2019-02-17 23:25:42 +01:00
Robert Helgesson
92d4e3e75a autorandr: remove unnecessary method attribute
I mistakenly added this before noticing that it was already defaulted
to "factory". Sorry!
2019-02-17 23:06:39 +01:00
Terje Larsen
03f1aea069 autorandr: add support for xrandr scale and dpi 2019-02-17 22:56:01 +01:00
Mario Rodas
6da88339f5 git: allow contents in git.includes 2019-02-17 22:28:15 +01:00
Robert Helgesson
e0e8d5061d keychain: add news entry 2019-02-17 22:12:25 +01:00
Mario Rodas
62e73b17d2 keychain: add module 2019-02-17 22:07:24 +01:00
Robert Helgesson
799a90ecfa fontconfig: make fonts accessible when in NixOS module 2019-02-16 21:42:47 +01:00
Robert Helgesson
ef168979bf nixos module: support NixOS user packages install
When using the NixOS module we cannot guarantee that the Nix store
will be writable during startup. Installing the user packages through
`nix-env -i` will fail in these cases.

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

    users.users.<name?>.packages

option.

Note, when submodule support and external package install is enabled
then the installed packages are not available in `~/.nix-profile`. We
therefore set `home.profileDirectory` directly to the HM profile
packages.
2019-02-16 21:42:47 +01:00
Wael M. Nasreddine
2093cf425f tmux: general improvements and added options
See #575 for discussion.
2019-02-13 22:14:30 +01:00
Olli Helenius
a3462daeb1 msmtp: use XDG config directory 2019-02-11 01:06:28 +01:00
Robert Helgesson
a334a941c4 tests: bump to latest nmt version 2019-02-10 12:09:47 +01:00
Robert Helgesson
1cdb8abf30 git: add basic support for LFS
Fixes #542
2019-02-10 00:51:16 +01:00
Ingolf Wanger
fbdb5beb59 nixos: use correct username for systemd service 2019-02-10 00:46:44 +01:00
Robert Helgesson
2f372ab4d6 Clean up support code for Home Manager as a submodule
This removes the `nixosSubmodule` option in favor of a new option
`submoduleSupport.enable`. This name better indicates that the
submodule mode applies to both NixOS and nix-darwin.
2019-02-10 00:44:55 +01:00
Lorenzo Manacorda
524ce43e23 doc: add "See also" section to manpages
Pointing to each other.
2019-02-10 00:38:35 +01:00
Lorenzo Manacorda
7f8e139413 doc: remove extraneous contrib element
`contrib` is "A summary of the contributions made to a document by a
credited source", which we don't need in this case.
2019-02-10 00:38:35 +01:00
Robert Helgesson
99d79d0a80 doc: move home-manager man page to section 1
This is not really a system administration tool so 8 is unsuitable.
2019-02-10 00:38:28 +01:00
Jonas Holst Damtoft
0ca1bf3cfd emacs: add service module 2019-02-09 15:28:11 +01:00
Matthieu Coudron
c18984c452 neovim: allow to override package
If you want to run a development version for instance, it is easier to
set neovim.package rather than work around the wrapping mechanism etc.
2019-02-04 21:52:01 +01:00
Robert Helgesson
445c0b1482 git: use attrsOf instead of attrs
This makes sure that values added to

    programs.git.aliases

or

    programs.git.extraConfig

are merged as expected.

Also add a few option examples.
2019-02-01 01:12:58 +01:00
Robert Helgesson
0590c2a4f6 mbsync: add basic test of result configuration 2019-01-31 02:08:40 +01:00
Nadrieril
81ec856a0f mbsync: add some required assertions 2019-01-31 01:41:12 +01:00
Yurii Rashkovskii
2410bc603b nixpkgs: fix installation on non-x86
On non-x86 architectures (for example, aarch64) the installation of
home-manager fails indicating that it is attempting to select i686
packages for Linux and those aren't available.

Solution: make the condition for choosing these packages stricter
2019-01-29 20:15:18 +01:00
Robert Helgesson
45cadbd4f3 git: quote sendemail section header
This will allow, e.g., the character `@` in the email identity.

Also adds a test case.

Fixes #557
2019-01-29 18:28:55 +01:00
Amarandus
02a5a678f6 irssi: add module
irssi is a cli IRC client.
2019-01-29 00:53:39 +01:00
Robert Helgesson
98f534e172 flameshot: add bars to systemd After
Fixes #544
2019-01-29 00:20:16 +01:00
Matthieu Coudron
a68c8cf5f1 git: generate identities from mail accounts 2019-01-29 00:13:21 +01:00
wedens
604fc92943 polybar: add /run/wrappers/bin to PATH
Without this the network module in polybar is unable to check
connection as it invokes 'ping' command directly.
2019-01-26 14:44:57 +01:00
Robert Helgesson
008d93928f xembed-sni-proxy: add module 2019-01-26 14:20:46 +01:00
Jonas Holst Damtoft
601619660d fish: use global for abbr
Makes fish use global scope for abbreviations.
This makes it so that they don't stick across config changes.
Before, an abbreviation would still exist even if removed from the config.
2019-01-23 21:19:23 +01:00
Robert Helgesson
4aa07c3547 doc: bump copyright year to 2019 in man pages 2019-01-20 18:03:04 +01:00
Robert Helgesson
f3f7c5cc57 doc: reformat XML files 2019-01-20 18:01:22 +01:00
Robert Helgesson
c035046999 doc: add basic release notes 2019-01-20 17:56:44 +01:00
Robert Helgesson
e15cd64ac9 Update LICENSE file for 2019 2019-01-19 22:12:55 +01:00
Robert Helgesson
59a4ac71f9 i3: replace use of types.string by types.str 2019-01-19 19:02:59 +01:00
Robert Helgesson
7c04351a57 files: allow a wider range of source file names
In particular support source files whose name start with `.` or
contain characters not allowed in the nix store, such as spaces.

Also add some test cases for `home.file`.
2019-01-19 12:44:58 +01:00
Robert Helgesson
46f787950a tests: bump nmt version 2019-01-19 12:41:45 +01:00
Adam Washington
6a244b3a8d matplotlib: add module 2019-01-18 01:23:36 +01:00
John Wiegley
3cf8b9ea86 ssh: add proxyJump option 2019-01-15 22:31:08 +01:00
Nadrieril
df8a14e12a i3: add bar.extraConfig option 2019-01-15 12:31:10 +09:00
Robert Helgesson
f6ec26075d tests: simplify test names 2019-01-14 23:02:33 +01:00
Robert Helgesson
c42206db02 i3: add test of keybinding merge logic 2019-01-14 22:50:11 +01:00
Robert Helgesson
bb64012914 tests: bump nmt to latest 2019-01-14 22:48:59 +01:00
Nadrieril
d5cc53a4e1 i3: reallow using null to disable a keybinding 2019-01-14 22:21:42 +01:00
Robert Helgesson
55100918cc dunst: avoid error on missing dunst process 2019-01-14 00:04:50 +01:00
Robert Helgesson
faee571850 dunst: kill daemon on configuration change
Since Dunst is DBus activated it is OK to simply kill it since DBus
will restart it when necessary.
2019-01-13 23:48:20 +01:00
hyperfekt
6f422785c3 fish: autogenerate completions from man pages 2019-01-13 01:06:46 +01:00
David Guibert
a7affc93ba msmtp: add extraConfig account option
This patch allow to define custom msmtp options per email account. For
example: to change the "auth" method from "on" to "login", add
`msmtp.extraConfig.auth="login"`.
2019-01-13 00:25:05 +01:00
Marcial Gaißert
9052131aef programs.zsh: option localVariables
Add option "extraLocalVars" for additional local variable definitions
in .zshrc, at the top of the file.

Some zsh plugins/themes expect configuration in local variables before they
are loaded (example: https://github.com/bhilburn/powerlevel9k). Exporting
those clutters the environment and is unnecessary.
2019-01-11 10:26:13 +01:00
Marcial Gaißert
6b5e0efd1e programs.zsh: generate export statements in zsh syntax
Use the new module lib.zsh to generate export statements in zsh syntax, using
zsh arrays for lists.

Being a zsh script, this seems more intuitive for .zshrc
2019-01-11 10:26:12 +01:00
Marcial Gaißert
62eb7ebeba lib.zsh: add module
Added utilities to generate export statements and definitions for zsh scripts.

Currently, there is only lib.shell which generates export statements in bash
syntax. However, this does not allow to generate export statements for zsh
arrays (syntax: NAME=(elem1 elem2 ...) ), which would be the natural
representation of lists in the nix language.
2019-01-11 10:26:12 +01:00
Wael M. Nasreddine
c48fd9d842 autorandr: add support for xrandr transformation 2019-01-10 01:39:01 +01:00
Robert Helgesson
e150dd4a66 texlive: always require at least one extra package
Fixes #526
2019-01-09 02:09:23 +01:00
Olli Helenius
b3d73e0aff gnome-terminal: enable VTE OSC7 support for bash and zsh 2019-01-08 23:14:55 +01:00
Olli Helenius
16946a6f00 Address review comments 2019-01-03 10:51:37 +01:00
Olli Helenius
a4383075af zsh: add default keymap configuration 2019-01-03 10:51:37 +01:00
Robert Helgesson
20a60be550 emacs: make finalPackage option more accessible
Instead of "internal" mark it as "invisible".
2019-01-03 02:15:17 +01:00
Mario Rodas
7afefcf75d opam: add module 2018-12-28 13:33:13 +01:00
Robert Helgesson
40b3443c8f dconf: add some information of use under NixOS 2018-12-24 18:36:55 +01:00
Robert Helgesson
e3167068d9 Merge PR #436 2018-12-24 17:35:48 +01:00
Robert Helgesson
cc964b4609 gtk: remove option gtk.gtk3.waylandSupport 2018-12-24 17:26:34 +01:00
Robert Helgesson
370a84192e gtk: make gtk.gtk2 and gtk.gtk3 not submodules 2018-12-24 17:26:34 +01:00
Robert Helgesson
4104ff2b6a gtk: use dconf module for settings 2018-12-24 17:26:34 +01:00
Robert Helgesson
a0162dacf6 gnome-terminal: use dconf module for settings 2018-12-24 17:26:34 +01:00
Robert Helgesson
b2cc186d22 dconf: add module
This module allows unified configuration of dconf settings.
2018-12-24 17:26:34 +01:00
Robert Helgesson
235a6617c4 readme: add notice that relog may be needed
Also add instructions for non-NixOS users to add the user channel
directory to `NIX_PATH`.
2018-12-23 10:55:30 +01:00
Robert Helgesson
218a8c4d90 modules: support conditional module inclusion
Also make use of this functionality for the `programs.chromium`
module.

See #501
2018-12-22 23:57:00 +01:00
Robert Helgesson
e68d6e7924 emacs: add overrides option
This option enables overriding packages within the generated Emacs
package set.

Fixes #486
2018-12-17 23:01:43 +01:00
Olli Helenius
dc72aa2305 jq: add module 2018-12-12 22:02:51 +01:00
Lorenzo
93b10bcf3c readme: fix .gitconfig example
The example was referencing `~/.gitconfig`, which isn't being checked
anymore since 356c0bf751.
2018-12-12 00:17:09 +01:00
Lorenzo Manacorda
4971e3735e readme: clarify bash/zsh compatibility
Makes it clearer that the compatibility mentioned only relates to the
manual loading approach.
2018-12-12 00:15:54 +01:00
Robert Helgesson
6d56abcec1 tests: add initial test framework 2018-12-11 00:57:58 +01:00
Nikita Uvarov
5d63abb473 i3: fix default keybindings override
All default keybindings should have a default priority attached to them.
This will allow users to redefine some of the default keybindings
without using mkForce. Fixes #485.
2018-12-08 15:32:30 +01:00
Robert Helgesson
6e67bb7ae6 doc: add installation instructions to manual
Also minor cleanups in README.
2018-12-06 00:57:49 +01:00
Nikita Uvarov
d67835260d polybar: switch from attrs to attrsOf 2018-12-05 12:14:43 +01:00
Nikita Uvarov
b085344b91 dunst: switch from attrs to attrsOf 2018-12-05 12:14:40 +01:00
Nikita Uvarov
c108eaba42 i3: switch from attrs to attrsOf 2018-12-05 12:00:20 +01:00
dsx
6ce3ce69b9 ssh: add addressFamily option 2018-12-05 00:24:34 +01:00
Robert Helgesson
6826521ec5 ssh: add certificateFile option 2018-12-05 00:19:40 +01:00
Robert Helgesson
5fe62660aa ssh: realign options 2018-12-05 00:14:15 +01:00
dsx
7a28f68ad0 dunst: use 'icon_path' instead of 'icon_folders'
The 'icon_folders' option is deprecated.
2018-12-05 00:05:06 +01:00
Robert Helgesson
ea9d44bede rofi: switch from types.string to types.str 2018-12-04 23:43:12 +01:00
Robert Helgesson
fd3692b36f newsboat: switch from types.string to types.str 2018-12-04 23:42:30 +01:00
Robert Helgesson
cd7b6fdbc1 autorandr: switch from types.string to types.str 2018-12-04 23:41:42 +01:00
zimbatm
571e17410a home-manager: add edit command
With this change, running

    home-manager edit

opens `$HOME_MANAGER_CONFIG` in `$EDITOR`.

This is mainly for convenience. Users should not have to remember the
exact location of the Home Manager configuration.
2018-12-04 23:17:19 +01:00
Robert Helgesson
797fbbf826 beets: add enable option 2018-12-04 23:03:23 +01:00
Robert Helgesson
a37b5c9c61 Change installation instructions to use nix-channel
This avoids the uncontrollable nature of fetching the tarball as part
of the evaluation. Instead the user can decide when to update and also
perform rollbacks, if necessary.
2018-12-04 00:59:52 +01:00
Wael M. Nasreddine
30f3baabaf home-manager: import modules using relative path 2018-12-04 00:39:34 +01:00
Robert Helgesson
ef29f321e0 readme: switch stable channel to 18.09 2018-12-03 01:06:12 +01:00
dsx
15bca92b2c i3: support for workspace_layout option 2018-12-01 01:01:35 +01:00
dsx
71f6bc41eb i3: support for bar tray_output option 2018-12-01 00:53:16 +01:00
Robert Helgesson
6d2f16a7ae pasystray: add paprefs and pavucontrol
This enables the "volume control" and "control local sound server"
menu options.

Fixes #461
2018-11-30 23:43:26 +01:00
zimbatm
40b279e3a3 ssh: tweak default controlPath
Instead of using the hostname `%h`, which can be changed by the
~/.ssh/config file, use the commandline-given hostname `%n`.

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

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

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

Without this change, if a connection was established with the first
github.com alias, then the user would try to pull a repo from the second
account, ssh would re-use the SSH connection which doesn't have access
to that repository.
2018-11-30 00:13:50 +01:00
Lee Henson
5d8b089188 neovim: support withNodeJs option 2018-11-29 00:54:27 +01:00
Wael M. Nasreddine
9686d93ff6 keybase: install the keybase package 2018-11-29 00:51:58 +01:00
zimbatm
67ebe16b40 termite: setup the shell hook
This fixes Ctrl+Shift+T not working.
2018-11-26 21:28:06 +01:00
hyperfekt
6ab6488e5a vscode: add module 2018-11-26 00:01:01 +01:00
Manuel Bärenz
ffdbefe22c nextcloud-client: add module
Adds the nextcloud-client as a service, simply copying the syntax from owncloud.client.
2018-11-25 23:13:13 +01:00
zimbatm
456e2d7ed5 ssh: add more options 2018-11-25 22:46:06 +01:00
Robert Helgesson
fa3d1f98e0 astroid: require notmuch synchronize flags 2018-11-25 13:53:45 +01:00
Robert Helgesson
c21b69e73e notmuch: add maildir.synchronizeFlags option 2018-11-25 13:33:30 +01:00
Robert Helgesson
9318bd3b0d notmuch: replace incorrect use of toJSON 2018-11-25 13:33:30 +01:00
Robert Helgesson
59448d635c version: add module 2018-11-24 17:27:59 +01:00
Will Fancher
a9a4fb641f nix-darwin: add system module for nix-darwin 2018-11-20 00:22:53 +01:00
Wael M. Nasreddine
f247b3b99b offlineimap: add an extraConfig for the account section 2018-11-19 23:57:58 +01:00
Robert Helgesson
fa62c5afb6 modules: fix list sort order 2018-11-19 00:07:29 +01:00
Ben Sima
061c7b633f afew: add module 2018-11-18 23:47:45 +01:00
Matthieu Coudron
dacc07136c astroid: add module
Astroid is a notmuch/gtk based MUA: https://github.com/astroidmail/astroid
2018-11-18 19:55:28 +01:00
Robert Helgesson
abfc37076a compton: minor reformatting 2018-11-15 00:28:52 +01:00
Robert Helgesson
9a0f388f66 compton: fix corrupt colors under Mesa 18
Fixes #441
2018-11-15 00:28:50 +01:00
Ben Sima
b08e6221e0 faq: add instructions on targeting multiple logins
Content adapted from

    https://github.com/rycee/home-manager/issues/394#issuecomment-422958338
2018-11-14 23:25:17 +01:00
Robert Helgesson
0efda9cd6b Use preferLocalBuild with runCommand 2018-11-14 20:59:45 +01:00
Sam Stites
f4ebbcbf70 tmux: add module
This commit adds the tmux program to Home Manager.

In addition to configuring tmux, a user may specify tmux plugins from
Nixpkgs. These can be included in the list of `plugins` and can either
be a package (all tmux plugins live under `nixpkgs.tmuxPlugins.*`), or
an object which includes the plugin and an `extraConfig`, which will
be run immediately after sourcing the tmux plugin.

Finally, this commit introduces two nested programs which may be
enabled which depend on tmux: tmuxp and tmuxinator. These do not have
the ability to be configured, although this may be a future
contribution.
2018-11-14 00:08:39 +01:00
Robert Helgesson
36ecad6cbe Add basic gitignore file 2018-11-14 00:08:39 +01:00
Robert Helgesson
22568a3d26 Revert PR #408
This reverts the commits

- "alot: change msmtp default command"
  8e798e4c28

- "astroid: init"
  736e340bde

because they include changes that break some configurations and some
options that are misplaced.
2018-11-12 21:59:11 +01:00
Matthieu Coudron
8e798e4c28 alot: change msmtp default command 2018-11-12 23:16:03 +09:00
Matthieu Coudron
736e340bde astroid: init
Astroid is a notmuch/gtk based MUA: https://github.com/astroidmail/astroid
2018-11-12 23:16:03 +09:00
Robert Helgesson
05c93ff3ae home-manager: remove uninstall activation phase
The manual install has been long deprecated so it should be safe to no
longer attempt to do an uninstall on each activation.
2018-11-04 09:58:00 +01:00
Robert Helgesson
8d4c65f259 fzf: only enable when line editing is available
Fixes #401

Suggested-by: Alex Vorobiev
Suggested-by: Mario Rodas
2018-10-30 00:17:09 +01:00
Robert Helgesson
0435d9c338 news: remove news item about removed vim options 2018-10-29 19:42:09 +01:00
Jonas Carpay
15a5f3278a Remove tabSize and lineNumbers check from news item 2018-10-20 16:57:27 +02:00
Nikita Uvarov
34bbd0ded1 vim: remove deprecated options 2018-10-20 13:13:19 +02:00
Nikita Uvarov
c17f37857c urxvt: add module 2018-10-20 11:35:39 +02:00
Nikita Uvarov
a2e09b4c9d vim: add options 2018-10-20 11:00:13 +02:00
Robert Helgesson
5013155e58 readme: documentation is now hosted on GitLab 2018-10-18 23:42:15 +02:00
Alex Brandt
7575e119d6 systemd: add more detail to user unit documentation
The current documentation does not provide guidance to users on how
systemd units are defined in Home Manager. A user may expect the
configuration to be similar to NixOS, when it actually differs.

Fixes #418
2018-10-18 23:39:28 +02:00
Alex Brandt
3b9b897af3 home-manager: add generation expiration command
This adds a new command to the home-manager shell script that allows
generations to be removed that are older than an given absolute or
relative date.

This allows users to manage the expiration of their home-manager
generations separately from their system or user profiles via
nix-collect-garbage. It is most important if the user desires to have
a convenient way to have different expiration times for Home Manager
generations than other system or user profiles.
2018-10-18 23:12:29 +02:00
Will Dietz
0cfd21cc15 compton: drop no-dock-blur option, add dock and dnd shadow
no-dock-blur doesn't exist in compton and was added by mistake.
2018-10-14 12:13:57 +02:00
Daniël de Kok
05a98b6be0 mbsync: change service unit type to 'oneshot'
The ExecStartPost command is currently started when the mbsync is
invoked succesfully. However, we typically want to run something like
'mu index' or 'notmuch new' after mbsync completes.  This changes the
unit type to oneshot, so that the ExecStartPost command is run after
mbsync finishes succesfully.
2018-10-13 19:28:40 +02:00
Nikita Uvarov
52b9363745 rofi: set configPath defaultText to avoid rebuilds 2018-10-12 10:52:41 +02:00
Mario Rodas
f947fafec9 direnv: add config option 2018-10-10 23:05:30 +02:00
Mario Rodas
68d3cdd722 direnv: add stdlib option 2018-10-10 23:02:31 +02:00
Will Dietz
5770dc58b9 mbsync: add option to add extra account configuration 2018-10-03 13:35:04 -05:00
Edward Betts
36da7a918f Correct spelling mistakes 2018-10-02 22:41:08 +02:00
Matthieu Coudron
782d2fab83 rofi: fix default path 2018-10-01 09:27:33 +02:00
Matthieu Coudron
d9c5d3c868 alot: add module
Alot is a python mail user agent (MUA) built around the Notmuch mail
system.
2018-09-28 23:43:40 +02:00
Robert Helgesson
9b3122e92c lib: copy module from NixOS
Importing the module directly from NixOS causes the documentation to
break, in particular the "Declared by" section.

Fixes #405
2018-09-27 21:01:13 +02:00
adisbladis
f44d4a1d86 obs-studio: add module 2018-09-27 19:58:31 +02:00
gnidorah
33a2943e8c gtk: add support for wayland 2018-09-26 21:32:43 +02:00
Mario Rodas
a1a7e7cd24 bash: fix bashrcExtra interactive shell test
To determine if bash is running interactively test whether "$-"
contains "i".

See: https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html
2018-09-26 18:18:57 +02:00
Robert Helgesson
6957911657 xresources: remove unnecessary parentheses 2018-09-24 23:24:04 +02:00
Robert Helgesson
7cc36b7703 xresources: run xrdb -merge on change
Fixes #400
2018-09-24 23:19:54 +02:00
Matthieu Coudron
9407b42f97 accounts.emails: adding gpg/signature modules 2018-09-23 23:22:39 +02:00
Matthieu Coudron
151f29a17a mbsync: add options extraConfig.{channel|local|remote}
To allow supporting more advanced configurations. The local refers to
the "maildir store" configuration, remote to the "IMAP store", and
"channel" to the channel.
2018-09-23 23:22:39 +02:00
Roman Volosatovs
f7dc354f42 go: Fix package example 2018-09-21 09:46:11 +02:00
Robert Helgesson
4d870f665b taffybar: fix indentation 2018-09-21 00:51:23 +02:00
Roman Volosatovs
0635423e73 go: add module 2018-09-21 00:11:25 +02:00
Mario Rodas
3f34bf4465 noti: add module 2018-09-20 21:26:55 +02:00
Robert Helgesson
9f0fdc68a9 xsession: add option xsession.scriptPath
This option allows overriding the default script path `~/.xsession`.
On NixOS, this is needed to allow multiple possible graphical login
sessions.

Fixes #391.
2018-09-19 23:33:13 +02:00
Robert Helgesson
701b4130bd Remove unnecessary dag variables
Also remove a few trailing whitespaces.
2018-09-19 00:13:31 +02:00
Adam Washington
d27bccdff1 zathura: add module
Add the zathura document viewer as a program option with support for
managing the zathurarc configuration file.
2018-09-18 23:57:36 +02:00
Minijackson
5ff03ce5ac taskwarrior: add module 2018-09-18 23:31:37 +02:00
Nikita Uvarov
6eea2a409e vim: improve instructions for listing available plugins 2018-09-15 12:01:36 +02:00
Robert Helgesson
ea74820176 home-environment: add option home.extraProfileCommands
This _internal_ option indicates extra commands that should be run in
the `postBuild` step of the profile environment build.

Fixes #386
2018-09-14 21:08:51 +02:00
Robert Helgesson
50de1a6885 emacs: add internal finalPackage option 2018-09-11 21:23:11 +02:00
gnidorah
055d100548 i3 module: add missing pieces to default config 2018-09-10 11:33:51 +09:00
Roman Volosatovs
63efd26767 neovim: support new extraPython*Packages options
Also fix `configure` argument.
2018-09-09 22:09:00 +02:00
Robert Helgesson
8d2cb0ef9b fish: minor formatting fixes 2018-09-09 21:18:39 +02:00
gnidorah
2bff6e5188 fish module: envoke hm-session-vars.sh 2018-09-09 21:17:13 +02:00
Matthieu Coudron
453d0494fb notmuch: synchronize_flag should be "true"
...and not "True"

According to doc https://notmuchmail.org/manpages/notmuch-config-1/

It also causes a crash in astroid :
https://github.com/astroidmail/astroid/issues/546
2018-09-07 19:38:39 +02:00
gnidorah
97c6073d39 i3 module: fonts option for bar section 2018-09-06 17:09:47 +02:00
Roman Volosatovs
9fe6fa7f44 neovim: add vi{,m}Alias options 2018-09-04 07:32:01 +02:00
Mario Rodas
7699ed3fc8 email: fix port setting for flavor gmail.com
See https://support.google.com/mail/answer/7126229.
2018-09-02 12:07:30 +02:00
Matthieu Coudron
5eca556fe7 offlineimap: add module
OfflineIMAP is a Mail Retrieval Agent (MRA) like mbsync but written in
Python.
2018-08-30 18:57:35 +02:00
Robert Helgesson
4602c00dcf polybar: minor reformatting 2018-08-29 21:46:11 +02:00
Jonathan Reeve
629d66e0b9 polybar: only quote strings if needed
Polybar expects quoted values only when whitespace is important to the
value.

Fixes #356
2018-08-29 21:42:42 +02:00
Robert Helgesson
859c132ee2 home-manager: enable build output during switch
Fixes #352
2018-08-28 00:17:57 +02:00
adisbladis
99a0e2469b direnv: add fish support 2018-08-27 22:52:53 +02:00
Mogria
2548c43175 fzf: add options for setting commands for all keys
This allows you to specify your own custom commands
to be run when calling fzf. You might use tools like
fd to search faster and take `.gitignore` files into
consideration.
2018-08-23 23:22:53 +02:00
Anton Plotnikov
90bcaaf582 pasystray: add module 2018-08-22 23:17:47 +02:00
Tad Fisher
da8307cd26 chromium: parseDrvName quick fix 2018-08-22 23:13:54 +02:00
Matthieu Coudron
cfa06c3f38 msmtp: add module
msmtp is a simple mail transfer agent (MTA).
2018-08-21 00:22:51 +02:00
Robert Helgesson
906965b48b Revert "email: note that passwordCommand should output '\n'"
This reverts commit d5bbbbd41d.

This was premature, the example will not emit a terminal newline and
it is not clear whether it is a good idea to force this limitation.
2018-08-21 00:19:33 +02:00
Robert Helgesson
d5bbbbd41d email: note that passwordCommand should output '\n'
This is because some programs, for example msmtp, expect the output to
end with a newline character.
2018-08-20 22:47:49 +02:00
Robert Helgesson
8e05229e62 Add initial GitLab CI configuration
This will automatically build and publish the Home Manager manual on
GitLab Pages.
2018-08-20 22:03:26 +02:00
Matthieu Coudron
7a8d50a803 xdg: create $XDG_CACHE_HOME
Some programs fail silently (bash with HISTFILE for instance) when the
folder doesn't exist.
2018-08-20 20:37:26 +02:00
Robert Helgesson
6630cfbe16 chromium: only enable for the linux platform 2018-08-20 07:11:00 +02:00
Tad Fisher
dd25fbcb4b chromium: add module 2018-08-19 22:46:30 +02:00
LightDiscord
f9ac73732b awesome: fix missing concatenation 2018-08-19 22:42:14 +02:00
Tad Fisher
26342588ab gpg-agent: add extraConfig option 2018-08-19 21:46:25 +02:00
Vincent Demeester
29191eb2c7 fish: add module
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-08-17 22:32:08 +02:00
Matthieu Coudron
168d546304 accounts.mail: add "gmail.com" as a flavor
To help with some autoconfiguration.
2018-08-16 23:46:27 +02:00
Robert Helgesson
34133ca7f3 accounts.email: add global certificatesFile option
This defaults to `/etc/ssl/certs/ca-certificates.crt` and will be
picked up as default by the account specific option.
2018-08-16 23:29:10 +02:00
Robert Helgesson
4b32f16747 Use submodules for program email accounts
This reworks the way program specific email account options are
specified. In particular, we no longer use the deprecated `options`
field of `mkOption`. Instead submodules are used.
2018-08-16 21:37:42 +02:00
Robert Helgesson
99c900946d Avoid substitution for some derivations
In particular, don't bother attempting to do substitution of the home
files and home generation derivations since these rarely, if ever,
could be substituted.

Fixes #330
2018-07-31 21:16:36 +02:00
Robert Helgesson
39213a1847 home-manager: fix work directory when building generation 2018-07-31 21:05:05 +02:00
Malte Brandy
c18b1328a5 Parametrize path to profile directory 2018-07-31 16:04:19 +02:00
Robert Helgesson
93ef6aefce direnv: add module 2018-07-31 15:48:08 +02:00
Anton Plotnikov
2e9e1909da status-notifier-watcher: add service 2018-07-31 15:33:57 +02:00
Robert Helgesson
4f67e8d0c3 home-manager: fix GC issue
It was previously possible to create the news information and lose it
in a Nix GC before being able to view it. This also causes a switch to
error out. This change makes the news information a root in the
garbage collector.

Note, this change also removes the need for `nix eval` so the
`doBuildAttr` function is simplified accordingly.

Fixes #327
2018-07-31 13:42:56 +02:00
Andrew Scott
30cba446f2 files: add onChange option
This option allows execution of arbitrary shell code when a file that
is linked into the home directory has been changed between
generations.
2018-07-27 22:07:12 +02:00
Robert Helgesson
dda65c0877 polybar: let systemd reload trigger restart 2018-07-26 18:01:35 +02:00
Roman Volosatovs
cf80199bfc xresources: join lists with a "," 2018-07-25 20:53:02 +02:00
Robert Helgesson
6694330bb2 udiskie: use xsession.preferStatusNotifierItems 2018-07-24 12:59:56 +02:00
Robert Helgesson
a5a49c350d network-manager-applet: use xsession.preferStatusNotifierItems 2018-07-24 12:59:50 +02:00
Robert Helgesson
6ae2d74fca xsession: add option preferStatusNotifierItems
The intent is for tray applets to honor this option if they support
the SNI protocol.
2018-07-24 12:53:20 +02:00
Anton Plotnikov
29ad012763 udiskie: add sni support 2018-07-24 11:52:38 +02:00
Robert Helgesson
9570cedff6 nixos module: we need a running nix-daemon
Make sure the nix-daemon is prepared before we attempt to do the user
activation otherwise the script may fail due to not being able to
communicate.
2018-07-21 13:15:34 +02:00
rembo10
d3871ed774 mpd: add module 2018-07-18 22:17:26 +02:00
rembo10
34db8df6d9 redshift: enable geoclue2 2018-07-13 22:07:07 +02:00
Mario Rodas
092706eff8 nixpkgs: only pass pkgs_i686 argument on Linux
Nixpkgs added an assertion on pkgsi686Linux [1] to avoid evaluating it
pkgsi686Linux on non-Linux systems.

[1] ad20a4a1c3
2018-07-13 19:26:08 +02:00
Robert Helgesson
f4a1a5e94c home-manager: resolve default configuration file path
Home Manager needs an absolute and resolved path to its configuration
file. The default configuration path is absolute but not necessarily
resolved. For example, some users may have `~/.config` be a symbolic
link to somewhere else. We therefore run the default configuration
path through the `realpath` tool to resolve it.

Fixes #304
2018-07-12 00:30:54 +02:00
Robert Helgesson
dadfaed829 home-manager: add support for the nix tool
This adds an experimantal, undocumented, and unsupported flag `-2` for
the `home-manager` command that enables the use of the new `nix`
command instead of `nix-build`.
2018-07-08 23:24:35 +02:00
LightDiscord
e365943a70 awesome: add module 2018-07-07 17:49:11 +02:00
Robert Helgesson
86fcfc74da nixpkgs: replace use of traceValIfNot
The `traceValIfNot` function is deprecated in Nixpkgs master. Instead
use `traceSeqN`.

Fixes #301
2018-07-04 19:56:13 +02:00
Robert Helgesson
eecebbf186 notmuch: add module
Co-authored-by: Matthieu Coudron <mattator@gmail.com>
2018-07-01 18:44:53 +02:00
Robert Helgesson
8dc1737e39 mbsync: add module
Co-authored-by: Matthieu Coudron <mattator@gmail.com>
2018-07-01 18:44:53 +02:00
Robert Helgesson
34bb9b5766 email: add module
This adds a general module infrastructure for configuring email
accounts. The intent is to specify high level information such as IMAP
and SMTP hostnames and login information so that more specific program
and service modules do not have to duplicate options for specifying
accounts.

It is allowed for modules to inject further options within this
namespace where relevant. For example, an MUA may wish add an option
to add per-account filter rules.

Co-authored-by: Matthieu Coudron <mattator@gmail.com>
2018-07-01 18:06:09 +02:00
Olli Helenius
299e01722f Add support for systemd path units 2018-07-01 18:04:06 +02:00
jD91mZM2
97ee4578c9 gpg-agent: Add maxCacheTtl(Ssh) options 2018-06-29 00:39:14 +02:00
Robin Stumm
0d3f9ba913 compton: fix syntax error 2018-06-27 15:18:30 +02:00
Denny Schaefer
6aa44d62ad autorandr: add rotate option 2018-06-26 21:17:54 +02:00
Nadrieril
5641ee3f94 i3: use null to disable a keybinding 2018-06-14 09:26:30 +02:00
Robert Helgesson
2e9fbbc978 termite: use docbook man page reference 2018-06-13 23:56:47 +02:00
Robert Helgesson
ad634c0a94 compton: use docbook man page references 2018-06-13 23:51:53 +02:00
gmarmstrong
7190f46938 bash: fix shellAliases description
The aliases aren't added to all users' shells.
2018-06-11 22:32:53 +02:00
Robert Helgesson
e27cd96494 newsboat: remove unnecessary period 2018-06-09 11:40:49 +02:00
Mats Rauhala
4caa45b8bb newsboat: add module 2018-06-09 11:36:45 +02:00
Robert Helgesson
f3473b9eba zsh: add missing periods in descriptions 2018-06-09 10:29:02 +02:00
Mats Rauhala
06a984e4ff zsh: add extended, expireDuplicatesFirst history options 2018-06-09 10:26:41 +02:00
adisbladis
53f10f4d46 kdeconnect: add module 2018-06-05 14:58:54 +02:00
Robert Helgesson
ed0cd78e05 i3: use fancy docbook markup in description 2018-06-03 20:53:07 +02:00
Robert Helgesson
faf04b009b qt: support GTK+ theming for Qt services 2018-06-03 17:26:47 +02:00
Lenz Weber
965bad626a flameshot: set PATH to let Qt find plugins 2018-05-31 20:26:25 +02:00
Julien Langlois
69445cb4a0 udiskie: change package
The old package is deprecated.
2018-05-31 20:10:47 +02:00
Nikita Uvarov
30c97391d7 i3: add modifier option
This allows to easily change modifier key for default keybindings and
gives a possibility to reference specified value in other modules.

Fixes #147.
2018-05-27 20:20:00 +02:00
Nikita Uvarov
cacb8d410e i3: deprecate i3.config.startup.*.workspace option
Fixes #265.
2018-05-27 00:00:10 +02:00
Nikita Uvarov
4b388ee902 i3: fix reloading for nixos module
By default, i3-msg gets socket from X11 property
which is not available when home manager is running
as nixos module.

This patch changes i3-msg command call by specifying
all i3 sockets found in $XDG_RUNTIME_DIR/i3 folder.

Fixes #252.
2018-05-26 19:14:05 +02:00
Robert Helgesson
10865f9952 bash: escape alias values
This should allow use of the apostrophe character within aliases
without having to escape them manually.

Fixes #273
2018-05-26 10:52:40 +02:00
Robert Helgesson
dfaccdd03b readme: make branch suggestion more clear
Fixes #270.
2018-05-22 18:14:37 +02:00
Robert Helgesson
f812260c23 manual: add HTML manual
Also add a `home-manager-help` script that attempts to open the HTML
manual in a browser.
2018-05-18 23:22:03 +02:00
Robert Helgesson
b6da6569c4 qt: add module 2018-05-18 20:57:36 +02:00
Robert Helgesson
bbcef2fd33 readme: add link to online options documentation 2018-05-11 22:38:47 +02:00
Robert Helgesson
ec3cbf81c4 manual: some cleanups 2018-05-11 22:26:21 +02:00
Adrian Kummerlaender
1a471b0a45 xcursor: add default cursor file option 2018-05-10 20:26:01 +02:00
Cornelius Mika
73b8aa8bcc systemd: merge unit definitions recursively
This removes the need for monolithic unit definitions and allows
users to modify existing units.

Example:
```
{
  systemd.user.services.owncloud-client.Unit.OnFailure = "my-notify-service";
}
```
2018-05-10 20:13:58 +02:00
Cornelius Mika
394045f68a systemd: improve comments 2018-05-09 16:22:02 +02:00
Robert Helgesson
f9af8e0390 manual: fix import path
Need to refer to the `default.nix` in the same home-manager source
otherwise you might get an old version.
2018-05-07 00:10:58 +02:00
Robert Helgesson
1260349384 doc: make documentation independent from NixOS
Unfortunately this duplicates some code from NixOS but it does allow
much more flexibility and, hopefully, stability in the Home Manager
documentation.

Fixes #254.
2018-05-06 22:16:48 +02:00
Nikita Uvarov
74f4ed5fd2 syncthing: fix tray startup
Workaround for #249.
2018-05-04 13:08:08 +02:00
Nikita Uvarov
91725ddced owncloud-client: fix startup
Workaround for #249.
2018-05-04 13:01:34 +02:00
Hamish Hutchings
e055e4a092 flameshot: add module 2018-05-03 17:21:03 +02:00
Peter Jones
f26cc3b957 mbsync: add module 2018-05-01 22:50:37 +02:00
Minijackson
9a3b1ec222 screen-locker: Add extraOptions for xss-lock and xautolock 2018-05-01 22:40:32 +02:00
Robert Helgesson
9141d11a7d readme: update stable NixOS version to 18.03 2018-04-19 18:29:04 +02:00
Tad Fisher
6dc4f31ba1 git: add 'includes' option 2018-04-19 17:45:09 +02:00
Silvan Mosberger
d294aa4356 zsh: only source plugin file if it exists
This allows adding plugins to fpath without sourcing anything
2018-04-19 16:43:03 +02:00
Nikita Uvarov
f314ee3d6a autorandr: add module 2018-04-19 10:41:52 +02:00
Tad Fisher
581ad6fc29 kbfs: fix systemd service PATH 2018-04-18 19:01:57 +02:00
Anton Plotnikov
8ff7d934b2 Add blur options to compton 2018-04-16 08:50:28 +02:00
Anton Plotnikov
5bdebf5ab0 Add opacity-rules to compton 2018-04-16 08:50:28 +02:00
Guthrie McAfee Armstrong
96250b7ad3 Fix typo: compton.shadowOffsets description 2018-04-16 08:45:48 +02:00
Lenz Weber
7c9278bd92 xresources: add option extraConfig 2018-03-26 21:10:32 +02:00
Robert Helgesson
4205c91609 ssh: move options to end of configuration file
This is needed to support overriding these options inside match
blocks. A new option `programs.ssh.extraOptionOverrides` has been
added to allow global overrides.
2018-03-25 08:51:20 +02:00
Robert Helgesson
75c4075345 nixpkgs: expand description of nixpkgs.config and nixpkgs.overlays 2018-03-20 20:23:42 +01:00
Gleb Peregud
f8398339a3 fzf: add enableZshIntegration option
When enabled this will extend user's `$HOME/.zshrc` with sourcing of fzf's
completion and key-bindings integration libraries.
2018-03-14 17:37:39 +01:00
Gleb Peregud
9bf9e7ac5c gpg-agent: add enableExtraSocket and verbose options.
This option enables a GPG Agent restricted socket (aka "extra-socket"), which
can be used to forward GPG Agent over SSH.

Additionally `verbose` option enables verbose output of an `gpg-agent.service`
unit for easier debugging.

See: https://wiki.gnupg.org/AgentForwarding
2018-03-13 22:36:30 +01:00
Robert Helgesson
567b21b1d6 activation-init: sanity check oldGenNum and oldGenPath
Something is terribly wrong if one is set but not the other so error
out with a message if that happens.
2018-03-13 20:49:45 +01:00
Robert Helgesson
fa7d63d9d1 fzf: add module 2018-03-07 22:44:29 +01:00
Robert Helgesson
46a94cce56 texlive: add option programs.texlive.package
This read-only option will hold a reference to the customized texlive
package.
2018-03-05 19:05:30 +01:00
Robert Helgesson
bc50202d0d gpg-agent: do updatestartuptty only when SSH is enabled
Inspired by #163.
2018-03-04 22:20:35 +01:00
Tad Fisher
8fc8e158e2 unclutter: add module 2018-03-03 22:54:46 -08:00
Robert Helgesson
06e7d087f2 home-manager: colorize only when connected to terminal
Before, the output of `home-manager generations` would be colorized
even when used in a pipeline.
2018-03-03 22:00:02 +01:00
Robert Helgesson
fbff38de33 xscreensaver: install the xscreensaver package
This is needed to make the xscreensaver tools available.
2018-03-01 23:21:45 +01:00
Robert Helgesson
19b4002f25 home-environment: use nix-env from PATH
It is safest to use the system install of Nix since that will be
compatible with the running nix-daemon and/or databases.

Also add a printout of the used Nix version in the activation script
when running in verbose mode.

Fixes #218.
2018-02-27 20:31:03 +01:00
Robert Helgesson
b47cc4bc66 qsyncthingtray: remove deprecated option 2018-02-26 22:30:28 +01:00
Robert Helgesson
e307ceeee7 systemd: replace use of who command
Curiously the `who` command sometimes does not list logged-in users,
resulting in systemd not being reloaded. Instead we use

    systemctl --user is-system-running

to more directly detect whether systemd is running.
2018-02-20 22:04:29 +01:00
Robert Helgesson
4745c7a00d pidgin: add module 2018-02-19 22:57:50 +01:00
Robert Helgesson
5c783e1a63 Add initial Travis-CI configuration 2018-02-19 22:52:56 +01:00
Nikita Uvarov
05ad0c9e06 i3: escape ${} in bars.command example 2018-02-19 20:17:33 +01:00
Matthieu Coudron
6d7b5c9513 i3: don't evaluate "command" example
else it attempts to build i3-gaps and fails on darwin see
https://github.com/rycee/home-manager/pull/214#issuecomment-366594833
2018-02-19 16:28:30 +09:00
Nikita Uvarov
de001e05da i3: add missing bar options
New options are: id, commmand, workspaceNumbers, colors.
Fixes #210.
2018-02-18 20:58:52 +01:00
Matthieu Coudron
08ce0579aa Merge pull request #212 from teto/neovim_configurable
neovim: add 'configure' flag
2018-02-18 22:42:24 +09:00
Matthieu Coudron
be60600a47 neovim: add 'configure' flag
so that we have the same options as in nixpkgs.
2018-02-19 07:41:24 +09:00
Andrew Scott
f2265b10e4 rofi: add theme option
The preferred method of theming rofi is now to use "rasi" theme files.
This commit therefore downplays the colors option and introduces the
theme option.
2018-02-10 20:11:33 +01:00
755 changed files with 45193 additions and 3812 deletions

346
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,346 @@
* @rycee
/flake.nix @bqv @kisik21
/modules/home-environment.nix @rycee
/modules/i18n/input-method @Kranzes
/tests/modules/i18n/input-method @Kranzes
/modules/misc/dconf.nix @gnidorah @rycee
/modules/misc/fontconfig.nix @rycee
/tests/modules/misc/fontconfig @rycee
/modules/misc/gtk.nix @rycee
/modules/config/i18n.nix @midchildan
/tests/modules/config/i18n @midchildan
/modules/misc/news.nix @rycee
/modules/misc/numlock.nix @evanjs
/tests/modules/misc/numlock @evanjs
/modules/misc/pam.nix @rycee
/tests/modules/misc/pam @rycee
/modules/misc/qt.nix @rycee
/modules/misc/submodule-support.nix @rycee
/modules/misc/tmpfiles.nix @dawidsowa
/modules/misc/vte.nix @rycee
/modules/misc/xdg-mime-apps.nix @pacien
/modules/misc/xdg-user-dirs.nix @pacien
/modules/misc/xdg-system-dirs.nix @tadfisher
/tests/modules/misc/xdg/system-dirs.nix @tadfisher
/modules/misc/xdg-desktop-entries.nix @cwyc
/tests/modules/misc/xdg/desktop-entries.nix @cwyc
/tests/modules/misc/xdg/desktop-full-expected.desktop @cwyc
/tests/modules/misc/xdg/desktop-min-expected.desktop @cwyc
/modules/programs/aria2.nix @JustinLovinger
/modules/programs/autojump.nix @evanjs
/tests/modules/programs/autojump @evanjs
/modules/programs/autorandr.nix @uvNikita
/modules/programs/bash.nix @rycee
/modules/programs/bat.nix @marsam
/modules/programs/beets.nix @rycee
/modules/programs/broot.nix @aheaume
/modules/programs/dircolors.nix @JustinLovinger
/modules/programs/direnv.nix @rycee
/modules/programs/eclipse.nix @rycee
/modules/programs/emacs.nix @rycee
/modules/programs/exa.nix @kalhauge
/modules/programs/firefox.nix @rycee
/modules/programs/foot.nix @plabadens
/tests/modules/programs/foot @plabadens
/modules/programs/gh.nix @Gerschtli
/tests/modules/programs/gh @Gerschtli
/modules/programs/git.nix @rycee
/modules/programs/gnome-terminal.nix @kamadorueda @rycee
/modules/programs/go.nix @rvolosatovs
/modules/programs/himalaya.nix @ambroisie
/tests/modules/programs/himalaya @ambroisie
/modules/programs/home-manager.nix @rycee
/modules/programs/htop.nix @bjpbakker
/modules/programs/i3status.nix @JustinLovinger
/modules/programs/i3status-rust.nix @workflow
/modules/programs/keychain.nix @marsam
/modules/programs/lazygit.nix @kalhauge
/modules/programs/lesspipe.nix @rycee
/modules/programs/lf.nix @owm111
/tests/modules/programs/lf @owm111
/modules/programs/lieer.nix @tadfisher
/modules/programs/lsd.nix @marsam
/modules/programs/matplotlib.nix @rprospero
/modules/programs/mangohud.nix @ZerataX
/tests/modules/programs/mangohud @ZerataX
/modules/programs/mbsync.nix @KarlJoad
/tests/modules/programs/mbsync @KarlJoad
/modules/programs/mcfly.nix @marsam
/modules/programs/mpv.nix @tadeokondrak @thiagokokada
/tests/modules/programs/mpv @thiagokokada
/modules/programs/mu.nix @KarlJoad
/modules/programs/ncmpcpp.nix @olmokramer
/tests/modules/programs/ncmpcpp @olmokramer
/tests/modules/programs/ncmpcpp-linux @olmokramer
/modules/programs/ncspot.nix @marsam
/modules/programs/ne.nix @cwyc
/tests/modules/programs/ne @cwyc
/modules/programs/newsboat.nix @sumnerevans
/tests/modules/programs/newsboat @sumnerevans
/modules/programs/nix-index.nix @ambroisie
/tests/modules/programs/nix-index @ambroisie
/modules/programs/noti.nix @marsam
/modules/programs/nushell.nix @Philipp-M
/tests/modules/programs/nushell @Philipp-M
/modules/programs/obs-studio.nix @adisbladis
/modules/programs/octant.nix @06kellyjac
/modules/programs/opam.nix @marsam
/modules/programs/openssh.nix @rycee
/modules/programs/password-store.nix @pacien
/modules/programs/pazi.nix @marsam
/modules/programs/pidgin.nix @rycee
/modules/programs/piston-cli.nix @ethancedwards8
/modules/programs/powerline-go.nix @DamienCassou
/modules/programs/rbw.nix @ambroisie
/tests/modules/programs/rbw @ambroisie
/modules/programs/rofi.nix @thiagokokada
/tests/modules/programs/rofi @thiagokokada
/modules/programs/rofi-pass.nix @seylerius
/tests/modules/programs/rofi-pass @seylerius
/modules/programs/rtorrent.nix @marsam
/modules/programs/sbt.nix @kubukoz
/tests/modules/programs/sbt @kubukoz
/modules/programs/scmpuff.nix @cpcloud
/tests/modules/programs/scmpuff @cpcloud
/modules/programs/senpai.nix @malte-v
/modules/programs/sm64ex.nix @ivarwithoutbones
/tests/modules/programs/sm64ex @ivarwithoutbones
/modules/programs/ssh.nix @rycee
/modules/programs/starship.nix @marsam
/modules/programs/terminator.nix @chisui
/modules/programs/texlive.nix @rycee
/modules/programs/topgrade.nix @msfjarvis
/tests/modules/programs/topgrade @msfjarvis
/modules/programs/waybar.nix @berbiche
/tests/modules/programs/waybar @berbiche
/modules/programs/xmobar.nix @t4ccer
/tests/modules/programs/xmobar @t4ccer
/modules/programs/z-lua.nix @marsam
/modules/programs/zathura.nix @rprospero
/modules/programs/zoxide.nix @marsam
/modules/programs/zsh/prezto.nix @NickHu
/modules/services/barrier.nix @Kritnich
/tests/modules/services/barrier @Kritnich
/modules/services/caffeine.nix @uvNikita
/modules/services/cbatticon.nix @pmiddend
/modules/services/clipmenu.nix @DamienCassou
/modules/services/devilspie2.nix @dawidsowa
/tests/modules/services/devilspie2 @dawidsowa
/modules/services/dropbox.nix @eyJhb
/tests/modules/services/dropbox @eyJhb
/modules/services/dunst.nix @rycee
/modules/services/emacs.nix @tadfisher
/modules/services/etesync-dav.nix @Valodim
/modules/services/flameshot.nix @moredhel
/modules/services/fluidsynth.nix @Valodim
/modules/services/gnome-keyring.nix @rycee
/modules/services/gpg-agent.nix @rycee
/modules/services/grobi.nix @mbrgm
/modules/services/hound.nix @adisbladis
/modules/services/imapnotify.nix @nickhu
/modules/services/kanshi.nix @nurelin
/tests/modules/services/kanshi @nurelin
/modules/services/kdeconnect.nix @adisbladis
/modules/services/keepassx.nix @rycee
/modules/services/lieer.nix @tadfisher
/modules/services/lorri.nix @Gerschtli
/modules/services/mako.nix @onny
/modules/services/mbsync.nix @pjones
/modules/services/mpdris2.nix @pjones
/modules/services/mpris-proxy.nix @ThibautMarty
/modules/services/muchsync.nix @pacien
/modules/services/network-manager-applet.nix @rycee
/modules/services/pantalaimon.nix @jojosch
/tests/modules/services/pantalaimon @jojosch
/modules/services/parcellite.nix @gleber
/modules/services/pass-secret-service.nix @cab404
/modules/services/password-store-sync.nix @pacien
/modules/services/pasystray.nix @pltanton
/modules/services/pbgopy.nix @ivarwithoutbones
/tests/modules/services/pbgopy @ivarwithoutbones
/modules/services/plan9port.nix @ehmry
/modules/services/playerctld.nix @fendse
/tests/modules/playerctld @fendse
/modules/services/poweralertd.nix @ThibautMarty
/modules/services/pulseeffects.nix @jonringer
/modules/services/random-background.nix @rycee
/modules/services/redshift-gammastep @rycee @petabyteboy @thiagokokada
/tests/modules/redshift-gammastep @thiagokokada
/modules/services/status-notifier-watcher.nix @pltanton
/modules/services/syncthing.nix @rycee
/modules/services/taffybar.nix @rycee
/modules/services/tahoe-lafs.nix @rycee
/modules/services/taskwarrior-sync.nix @minijackson @pacien
/modules/services/trayer.nix @AndreasMager
/tests/modules/services/trayer @AndreasMager
/modules/services/udiskie.nix @rycee
/modules/services/unison.nix @pacien
/modules/services/window-managers/bspwm @ncfavier
/tests/modules/services/window-managers/bspwm @ncfavier
/modules/services/window-managers/i3-sway/i3.nix @sumnerevans
/tests/modules/services/window-managers/i3 @sumnerevans
/modules/services/window-managers/i3-sway/lib @sumnerevans
/modules/services/window-managers/i3-sway/sway.nix @alexarice @sumnerevans
/tests/modules/services/window-managers/sway @sumnerevans
/modules/services/wlsunset.nix @matrss
/tests/modules/services/wlsunset @matrss
/modules/services/xcape.nix @nickhu
/modules/services/xembed-sni-proxy.nix @rycee
/modules/services/xidlehook.nix @dschrempf
/modules/services/xscreensaver.nix @rycee
/modules/services/xsuspender.nix @offlinehacker
/modules/systemd.nix @rycee
/modules/xcursor.nix @league
/modules/xresources.nix @rycee
/modules/xsession.nix @rycee
/modules/services/volnoti.nix @IvanMalison

View File

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

46
.github/ISSUE_TEMPLATE/issue.yaml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: Bug Report
description: File a bug/issue
title: 'bug: '
labels: [bug, triage]
# We cannot use nix-community/home-manager
# See https://github.com/dear-github/dear-github/issues/170
assignees: [rycee, berbiche, sumnerevans]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: |
Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Issue description
description: |
Please describe the issue.
For support and help please use the IRC channel #home-manager at irc.oftc.net or
Matrix room <https://matrix.to/#/#hm:rycee.net> instead.
validations:
required: false
- type: textarea
attributes:
label: Maintainer CC
description: |
Please @ people who are in the `meta.maintainers` list of the offending module.
If in doubt, check `git blame` for whoever last touched something.
validations:
required: false
- type: textarea
id: system
attributes:
label: System information
description: |
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
render: markdown
validations:
required: true

44
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,44 @@
### Description
<!--
Please provide a brief description of your change.
-->
### Checklist
<!--
Please go through the following checklist before opening a non-WIP
pull-request.
Also make sure to read the guidelines found at
https://github.com/nix-community/home-manager/blob/master/doc/contributing.adoc#sec-guidelines
-->
- [ ] Change is backwards compatible.
- [ ] Code formatted with `./format`.
- [ ] Code tested through `nix-shell --pure tests -A run.all`.
- [ ] Test cases updated/added. See [example](https://github.com/nix-community/home-manager/commit/f3fbb50b68df20da47f9b0def5607857fcc0d021#diff-b61a6d542f9036550ba9c401c80f00ef).
- [ ] Commit messages are formatted like
```
{component}: {description}
{long description}
```
See [CONTRIBUTING](https://github.com/nix-community/home-manager/blob/master/doc/contributing.adoc#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
- If this PR adds a new module
- [ ] Added myself as module maintainer. See [example](https://github.com/nix-community/home-manager/blob/068ff76a10e95820f886ac46957edcff4e44621d/modules/programs/lesspipe.nix#L6).
- [ ] Added myself and the module files to `.github/CODEOWNERS`.

17
.github/dependabot.yml vendored Normal file
View File

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

75
.github/stale.yml vendored Normal file
View File

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

28
.github/workflows/github_pages.yml vendored Normal file
View File

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

23
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Test
on:
pull_request:
schedule:
- cron: "30 2 * * *"
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: ./format -c
- run: nix-shell . -A install
- run: nix-shell --pure tests -A run.all

2
.gitignore vendored Normal file
View File

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

43
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,43 @@
image: nixos/nix:latest
variables:
NIX_PATH: "nixpkgs=channel:nixos-unstable"
stages:
- test
- deploy
Run tests:
stage: test
script:
- nix-shell --pure tests -A run.files-text
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
pages:
stage: deploy
script:
- mkdir -p ~/.config/nixpkgs
- echo '{ manual.html.enable = true; }' > ~/.config/nixpkgs/home.nix
- nix-shell . -A install
- mkdir public
- cp -r ~/.nix-profile/share/doc/home-manager/* public/
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
Deploy NUR:
stage: deploy
variables:
HM_BRANCH: $CI_COMMIT_REF_NAME
HM_COMMIT_SHA: $CI_COMMIT_SHA
trigger:
project: rycee/nur-expressions
branch: master
rules:
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH =~ /^release-/
when: always

1
.release Normal file
View File

@@ -0,0 +1 @@
21.11

View File

@@ -1,13 +0,0 @@
language: nix
os:
- linux
- osx
before_script:
- mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
- mkdir -p ~/.config/nixpkgs
- echo "{}" > ~/.config/nixpkgs/home.nix
script:
nix-shell . -A install

1
CONTRIBUTING.adoc Symbolic link
View File

@@ -0,0 +1 @@
doc/contributing.adoc

View File

@@ -1,158 +0,0 @@
Contributing
============
Thanks for wanting to contribute to Home Manager! These are some
guidelines to make the process as smooth as possible for both you and
the Home Manager developers.
If you are only looking to report a problem then it is sufficient to
read through the following section on reporting issues. If you instead
want to directly contribute improvements and additions then please
have a look at everything here.
Reporting an issue
------------------
If you notice a problem with Home Manager and want to report it then
have a look among the already [open issues][], if you find one
matching yours then feel free to comment on it to add any additional
information you may have.
If no matching issue exists then go to the [new issue][] page and
write a description of your problem. Include as much information as
you can, ideally also include relevant excerpts from your Home Manager
configuration.
Contributing code
-----------------
If you want to contribute code to improve Home Manager then please
follow these guidelines.
### Fork and create a pull request ###
If you have not previously forked Home Manager then you need to do
that first. Have a look at GitHub's "[Fork A Repo][]" for instructions
on how to do this.
Once you have a fork of Home Manager you should create a branch
starting at the most recent `master`. Give your branch a reasonably
descriptive name. Perform your changes on this branch and when you are
happy with the result push the branch to GitHub and
[create a pull request][].
Assuming your clone is at `$HOME/devel/home-manager` then you can make
the `home-manager` command use it by either
1. overriding the default path by using the `-I` command line option:
home-manager -I home-manager=$HOME/devel/home-manager
or
2. changing the default path by ensuring your configuration includes
programs.home-manager.enable = true;
programs.home-manager.path = "$HOME/devel/home-manager";
and running `home-manager switch` to activate the change.
Afterwards, `home-manager build` and `home-manager switch` will
use your cloned repository.
The first option is good if you only temporarily want to use your
clone.
### Commits ###
The commits in your pull request should be reasonably self-contained,
that is, each commit should make sense in isolation. In particular,
you will be asked to amend any commit that introduces syntax errors or
similar problems even if they are fixed in a later commit.
The commit messages should follow the format
{component}: {description}
{long description}
where `{component}` refers to the code component (or module) your
change affects, `{description}` is a brief description of your change,
and `{long description}` is an optional clarifying description. Note,
`{description}` should start with a lower case letter. As a rare
exception, if there is no clear component, or your change affects many
components, then the `{component}` part is optional.
When adding a new module, say `foo.nix`, we use the fixed commit
format `foo: add module`. You can, of course, still include a long
description if you wish.
In addition to the above commit message guidelines, try to follow the
[seven rules][] as much as possible.
### Style guidelines ###
The code in Home Manager should follow the [Nixpkgs syntax
guidelines][]. Note, we prefer `lowerCamelCase` for variable and
attribute names with the accepted exception of variables directly
referencing packages in Nixpkgs which use a hyphenated style. For
example, the Home Manager option `services.gpg-agent.enableSshSupport`
references the `gpg-agent` package in Nixpkgs.
### News ###
Home Manager includes a system for presenting news to the user. When
making a change you, therefore, have the option to also include an
associated news entry. In general, a news entry should only be added
for truly noteworthy news. For example, a bug fix or new option does
generally not need a news entry.
If you do have a change worthy of a news entry then please add one in
[`news.nix`][] but you should follow some basic guidelines:
- The entry timestamp should be in ISO-8601 format having "+00:00" as
time zone. For example, "2017-09-13T17:10:14+00:00". A suitable
timestamp can be produced by the command
date --iso-8601=second --universal
- The entry condition should be as specific as possible. For example,
if you are changing or deprecating a specific option then you could
restrict the news to those users who actually use this option.
- Wrap the news message so that it will fit in the typical terminal,
that is, at most 80 characters wide. Ideally a bit less.
- Unlike commit messages, news will be read without any connection to
the Home Manager source code. It is therefore important to make the
message understandable in isolation and to those who do not have
knowledge of the Home Manager internals. To this end it should be
written in more descriptive, prose like way.
- If you refer to an option then write its full attribute path. That
is, instead of writing
> The option 'foo' has been deprecated, please use 'bar' instead.
it should read
> The option 'services.myservice.foo' has been deprecated, please
> use 'services.myservice.bar' instead.
- A new module, say `foo.nix`, should always include a news entry
(without any condition) that has a message along the lines of
> A new service is available: 'services.foo'.
or
> A new program configuration is available: 'program.foo'.
depending on the type of module.
[open issues]: https://github.com/rycee/home-manager/issues
[new issue]: https://github.com/rycee/home-manager/issues/new
[Fork A Repo]: https://help.github.com/articles/fork-a-repo/
[create a pull request]: https://help.github.com/articles/creating-a-pull-request/
[seven rules]: https://chris.beams.io/posts/git-commit/#seven-rules
[`news.nix`]: https://github.com/rycee/home-manager/blob/master/modules/misc/news.nix
[Nixpkgs syntax guidelines]: https://nixos.org/nixpkgs/manual/#sec-syntax

1
FAQ.adoc Symbolic link
View File

@@ -0,0 +1 @@
doc/faq.adoc

66
FAQ.md
View File

@@ -1,66 +0,0 @@
Frequently Asked Questions (FAQ)
================================
Why is there a collision error when switching generation?
---------------------------------------------------------
Home Manager currently installs packages into the user environment,
precisely as if the packages were installed through
`nix-env --install`. This means that you will get a collision error if
your Home Manager configuration attempts to install a package that you
already have installed manually, that is, packages that shows up when
you run `nix-env --query`.
For example, imagine you have the `hello` package installed in your
environment
```console
$ nix-env --query
hello-2.10
```
and your Home Manager configuration contains
home.packages = [ pkgs.hello ];
Then attempting to switch to this configuration will result in an
error similar to
```console
$ home-manager switch
these derivations will be built:
/nix/store/xg69wsnd1rp8xgs9qfsjal017nf0ldhm-home-manager-path.drv
[…]
Activating installPackages
replacing old home-manager-path
installing home-manager-path
building path(s) /nix/store/b5c0asjz9f06l52l9812w6k39ifr49jj-user-environment
Wide character in die at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 79.
collision between /nix/store/fmwa4axzghz11cnln5absh31nbhs9lq1-home-manager-path/bin/hello and /nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10/bin/hello; use nix-env --set-flag priority NUMBER PKGNAME to change the priority of one of the conflicting packages
builder for /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed with exit code 2
error: build of /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed
```
The solution is typically to uninstall the package from the
environment using `nix-env --uninstall` and reattempt the Home Manager
generation switch.
Why are the session variables not set?
--------------------------------------
Home Manager is only able to set session variables automatically if it
manages your Bash or Z shell configuration. If you don't want to let
Home Manager manage your shell then you will have to manually source
the
~/.nix-profile/etc/profile.d/hm-session-vars.sh
file in an appropriate way. In Bash and Z shell this can be done by
adding
```sh
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
```
to your `.profile` and `.zshrc` files, respectively. The
`hm-session-vars.sh` file should work in most Bourne-like shells.

View File

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

205
README.md
View File

@@ -3,23 +3,36 @@ Home Manager using Nix
This project provides a basic system for managing a user environment
using the [Nix][] package manager together with the Nix libraries
found in [Nixpkgs][]. Before attempting to use Home Manager please
read the warning below.
found in [Nixpkgs][]. It allows declarative configuration of user
specific (non global) packages and dotfiles.
Before attempting to use Home Manager please read the warning below.
For a more systematic overview of Home Manager and its available
options, please see the [Home Manager manual][manual].
Words of warning
----------------
This project is under development. I personally use it to manage
several user configurations but it may fail catastrophically for you.
So beware!
Unfortunately, it is quite possible to get difficult to understand
errors when working with Home Manager, such as infinite loops with no
clear source reference. You should therefore be comfortable using the
Nix language and the various tools in the Nix ecosystem. Reading
through the [Nix Pills][] document is a good way to familiarize
yourself with them.
If you are not very familiar with Nix but still want to use Home
Manager then you are strongly encouraged to start with a small and
very simple configuration and gradually make it more elaborate as you
learn.
In some cases Home Manager cannot detect whether it will overwrite a
previous manual configuration. For example, the Gnome Terminal module
will write to your dconf store and cannot tell whether a configuration
that it is about to be overwrite was from a previous Home Manager
that it is about to be overwritten was from a previous Home Manager
generation or from manual configuration.
Home Manager targets [NixOS][] unstable and NixOS version 17.09 (the
Home Manager targets [NixOS][] unstable and NixOS version 21.05 (the
current stable version), it may or may not work on other Linux
distributions and NixOS versions.
@@ -31,73 +44,72 @@ on how to manually perform a rollback.
Now when your expectations have been built up and you are eager to try
all this out you can go ahead and read the rest of this text.
Contact
-------
You can chat with us on IRC in the channel [#home-manager][] on
[OFTC][].
Installation
------------
Currently the easiest way to install Home Manager is as follows:
1. Make sure you have a working Nix installation. If you are not
using NixOS then you may here have to run
```console
$ mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
```
since Home Manager uses these directories to manage your profile
generations. On NixOS these should already be available.
Also make sure that your user is able to build and install Nix
packages. For example, you should be able to successfully run a
command like `nix-instantiate '<nixpkgs>' -A hello`. For a
multi-user install of Nix this means that your user must be
covered by the [`allowed-users`][nixAllowedUsers] Nix option. On
NixOS you can control this option using the
1. Make sure you have a working Nix installation. Specifically, make
sure that your user is able to build and install Nix packages. For
example, you should be able to successfully run a command like
`nix-instantiate '<nixpkgs>' -A hello` without having to switch to
the root user. For a multi-user install of Nix this means that
your user must be covered by the
[`allowed-users`][nixAllowedUsers] Nix option. On NixOS you can
control this option using the
[`nix.allowedUsers`][nixosAllowedUsers] system option.
2. Assign a temporary variable holding the URL to the appropriate
archive. Typically this is
Note that Nix 2.4 (`nixUnstable`) is not yet supported.
2. Add the appropriate Home Manager channel. If you are following
Nixpkgs master or an unstable channel you can run
```console
$ HM_PATH=https://github.com/rycee/home-manager/archive/master.tar.gz
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
```
or
and if you follow a Nixpkgs version 21.05 channel you can run
```console
$ HM_PATH=https://github.com/rycee/home-manager/archive/release-17.09.tar.gz
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
$ nix-channel --update
```
depending on whether you follow Nixpkgs unstable or version 17.09.
On NixOS you may need to log out and back in for the channel to
become available. On non-NixOS you may have to add
3. Create an initial Home Manager configuration file:
```shell
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
```
to your shell (see [nix#2033](https://github.com/NixOS/nix/issues/2033)).
3. Install Home Manager and create the first Home Manager generation:
```console
$ cat > ~/.config/nixpkgs/home.nix <<EOF
{
programs.home-manager.enable = true;
programs.home-manager.path = $HM_PATH;
}
EOF
$ nix-shell '<home-manager>' -A install
```
4. Install Home Manager and create the first Home Manager generation:
Once finished, Home Manager should be active and available in your
user environment.
```console
$ nix-shell $HM_PATH -A install
```
Home Manager should now be active and available in your user
environment.
5. If you do not plan on having Home Manager manage your shell
3. If you do not plan on having Home Manager manage your shell
configuration then you must source the
```
"$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
```
file in your shell configuration. Unfortunately, we currently only
support POSIX.2-like shells such as [Bash][] or [Z shell][].
file in your shell configuration. Unfortunately, in this specific
case we currently only support POSIX.2-like shells such as
[Bash][] or [Z shell][].
For example, if you use Bash then add
@@ -105,13 +117,19 @@ Currently the easiest way to install Home Manager is as follows:
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
```
or this when managing home configuration together with system
configuration
```bash
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
```
to your `~/.profile` file.
Note, because the `HM_PATH` variable above points to the live Home
Manager repository you will automatically get updates whenever you
build a new generation. If you dislike automatic updates then perform
a Git clone of the desired branch and instead do the above steps with
`HM_PATH` set to the _absolute path_ of your clone.
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the
`programs.home-manager.path` option to specify the absolute path to
the repository.
Usage
-----
@@ -123,8 +141,8 @@ configuration generations.
As an example, let us expand the initial configuration file from the
installation above to install the htop and fortune packages, install
Emacs with a few extra packages enabled, install Firefox with the
IcedTea plugin enabled, and enable the user gpg-agent service.
Emacs with a few extra packages enabled, install Firefox with
smooth scrolling disabled, and enable the user gpg-agent service.
To satisfy the above setup we should elaborate the
`~/.config/nixpkgs/home.nix` file as follows:
@@ -148,7 +166,13 @@ To satisfy the above setup we should elaborate the
programs.firefox = {
enable = true;
enableIcedTea = true;
profiles = {
myprofile = {
settings = {
"general.smoothScroll" = false;
};
};
};
};
services.gpg-agent = {
@@ -179,8 +203,9 @@ $ home-manager build
which will create a `result` link to a directory containing an
activation script and the generated home directory files.
To see available configuration options with descriptions and usage
examples run
Documentation of available configuration options, including
descriptions and usage examples, is available in the [Home Manager
manual][configuration options] or offline by running
```console
$ man home-configuration.nix
@@ -231,7 +256,7 @@ such collision is detected the activation will terminate before
changing anything on your computer.
For example, suppose you have a wonderful, painstakingly created
`~/.gitconfig` and add
`~/.config/git/config` and add
```nix
{
@@ -254,7 +279,7 @@ then result in
$ home-manager switch
Activating checkLinkTargets
Existing file '/home/jdoe/.gitconfig' is in the way
Existing file '/home/jdoe/.config/git/config' is in the way
Please move the above files and try again
```
@@ -292,6 +317,59 @@ in your system configuration and
in your Home Manager configuration.
Nix Flakes
----------
Home Manager includes a `flake.nix` file for compatibility with [Nix Flakes][]
for those that wish to use it as a module. A bare-minimum `flake.nix` would be
as follows:
```nix
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
};
outputs = { home-manager, nixpkgs, ... }: {
nixosConfigurations = {
hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jdoe = import ./home.nix;
}
];
};
};
};
}
```
Note, the Home Manager library is exported by the flake under
`lib.hm`.
When using flakes, switch to new configurations as you do for the
whole system (e. g. `nixos-rebuild switch --flake <path>`) instead of
using the `home-manager` command line tool.
Releases
--------
Home Manager is developed against `nixpkgs-unstable` branch, which
often causes it to contain tweaks for changes/packages not yet
released in stable NixOS. To avoid breaking users' configurations,
Home Manager is released in branches corresponding to NixOS releases
(e.g. `release-21.05`). These branches get fixes, but usually not new
modules. If you need a module to be backported, then feel free to open
an issue.
[Bash]: https://www.gnu.org/software/bash/
[Nix]: https://nixos.org/nix/
[NixOS]: https://nixos.org/
@@ -299,3 +377,10 @@ in your Home Manager configuration.
[nixAllowedUsers]: https://nixos.org/nix/manual/#conf-allowed-users
[nixosAllowedUsers]: https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers
[Z shell]: http://zsh.sourceforge.net/
[manual]: https://nix-community.github.io/home-manager/
[configuration options]: https://nix-community.github.io/home-manager/options.html
[#home-manager]: https://webchat.oftc.net/?channels=home-manager
[OFTC]: https://oftc.net/
[samueldr]: https://github.com/samueldr/
[Nix Pills]: https://nixos.org/nixos/nix-pills/
[Nix Flakes]: https://nixos.wiki/wiki/Flakes

View File

@@ -1,14 +1,18 @@
{ pkgs ? import <nixpkgs> {} }:
{ pkgs ? import <nixpkgs> { } }:
rec {
home-manager = import ./home-manager {
inherit pkgs;
path = toString ./.;
docs = with import ./doc { inherit pkgs; }; {
html = manual.html;
manPages = manPages;
json = options.json;
};
install = import ./home-manager/install.nix {
inherit home-manager pkgs;
};
home-manager = pkgs.callPackage ./home-manager { path = toString ./.; };
install =
pkgs.callPackage ./home-manager/install.nix { inherit home-manager; };
nixos = import ./nixos;
path = ./.;
}

258
doc/contributing.adoc Normal file
View File

@@ -0,0 +1,258 @@
[[ch-contributing]]
== Contributing
:open-issues: https://github.com/nix-community/home-manager/issues
:new-issue: https://github.com/nix-community/home-manager/issues/new
:fork-a-repo: https://help.github.com/articles/fork-a-repo/
:create-a-pull-request: https://help.github.com/articles/creating-a-pull-request/
:seven-rules: https://chris.beams.io/posts/git-commit/#seven-rules
:news-nix: https://github.com/nix-community/home-manager/blob/master/modules/misc/news.nix
:nixfmt: https://github.com/serokell/nixfmt/
:example-commit-message: https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef
Contributions to Home Manager are very welcome. To make the process as smooth as possible for both you and the Home Manager maintainers we provide some guidelines that we ask you to follow. See <<sec-contrib-getting-started>> for information on how to set up a suitable development environment and <<sec-guidelines>> for the actual guidelines.
This text is mainly directed at those who would like to make code contributions to Home Manager. If you just want to report a bug then first look among the already {open-issues}[open issues], if you find one matching yours then feel free to comment on it to add any additional information you may have. If no matching issue exists then go to the {new-issue}[new issue] page and write a description of your problem. Include as much information as you can, ideally also include relevant excerpts from your Home Manager configuration.
[[sec-contrib-getting-started]]
=== Getting started
If you have not previously forked Home Manager then you need to do that first. Have a look at GitHub's {fork-a-repo}[Fork a repo] for instructions on how to do this.
Once you have a fork of Home Manager you should create a branch starting at the most recent `master` branch. Give your branch a reasonably descriptive name. Commit your changes to this branch and when you are happy with the result and it fulfills <<sec-guidelines>> then push the branch to GitHub and {create-a-pull-request}[create a pull request].
Assuming your clone is at `$HOME/devel/home-manager` then you can make the `home-manager` command use it by either
1. overriding the default path by using the `-I` command line option:
+
[source,console]
$ home-manager -I home-manager=$HOME/devel/home-manager
+
or
2. changing the default path by ensuring your configuration includes
+
[source,nix]
----
programs.home-manager.enable = true;
programs.home-manager.path = "$HOME/devel/home-manager";
----
+
and running `home-manager switch` to activate the change. Afterwards, `home-manager build` and `home-manager switch` will use your cloned repository.
The first option is good if you only temporarily want to use your clone.
[[sec-guidelines]]
=== Guidelines
:irc-home-manager: https://webchat.oftc.net/?channels=home-manager
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
:assertions: https://nixos.org/manual/nixos/stable/index.html#sec-assertions
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
If you are uncertain how these rules affect the change you would like to make then feel free to start a discussion in the {irc-home-manager}[#home-manager] IRC channel, ideally before you start developing.
[[sec-guidelines-back-compat]]
==== Maintain backward compatibility
Your contribution should not cause another user's existing configuration to break unless there is a very good reason and the change should be announced to the user through an {assertions}[assertion] or similar.
Remember that Home Manager is used in many different environments and you should consider how your change may effect others. For example,
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
- Does your change work for people whose configuration is built on one system and deployed on another system?
[[sec-guidelines-forward-compat]]
==== Keep forward compatibility in mind
The master branch of Home Manager tracks the unstable channel of Nixpkgs, which may update package versions at any time. It is therefore important to consider how a package update may affect your code and try to reduce the risk of breakage.
The most effective way to reduce this risk is to follow the advice in <<sec-guidelines-valuable-options>>.
[[sec-guidelines-valuable-options]]
==== Add only valuable options
When creating a new module it is tempting to include every option supported by the software. This is _strongly_ discouraged. Providing many options increases maintenance burden and risk of breakage considerably. This is why only the most {valuable-options}[important software options] should be modeled explicitly. Less important options should be expressible through an `extraConfig` escape hatch.
A good rule of thumb for the first implementation of a module is to only add explicit options for those settings that absolutely must be set for the software to function correctly. It follows that a module for software that provides sensible default values for all settings would require no explicit options at all.
If the software uses a structured configuration format like a JSON, YAML, INI, TOML, or even a plain list of key/value pairs then consider using a `settings` option as described in {rfc-42}[Nix RFC 42].
[[sec-guidelines-add-tests]]
==== Add relevant tests
If at all possible, make sure to add new tests and expand existing tests so that your change will keep working in the future. See <<sec-tests>> for more information about the Home Manager test suite.
All contributed code _must_ pass the test suite.
[[sec-guidelines-module-maintainer]]
==== Add relevant documentation
:docbook: https://tdg.docbook.org/
:asciidoc: https://asciidoc.org/
:docbook-rocks: https://berbiche.github.io/docbook.rocks/
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
The HTML version of the manual containing both the module option descriptions and the documentation of Home Manager can be generated and opened by typing the following in a shell within a clone of the Home Manager Git repository:
[source,console]
$ nix-build -A docs.html
$ xdg-open ./result/share/doc/home-manager/index.html
When you have made changes to a module, it is a good idea to check that the man page version of the module options looks good:
[source,console]
$ nix-build -A docs.manPages
$ man ./result/share/man/man5/home-configuration.nix.5
==== Add yourself as a module maintainer
Every new module _must_ include a named maintainer using the `meta.maintainers` attribute. If you are a user of a module that currently lacks a maintainer then please consider adopting it.
If you are present in the NixOS maintainer list then you can use that entry. If you are not then you can add yourself to `modules/lib/maintainers.nix` in the Home Manager project.
Also add yourself to `.github/CODEOWNERS` as owner of the associated module files, including the test files. You will then be automatically added as a reviewer on any new pull request that touches your files.
Maintainers are encouraged to join the IRC channel and participate when they have opportunity.
[[sec-guidelines-code-style]]
==== Format your code
Make sure your code is formatted as described in <<sec-code-style>>. To maintain consistency throughout the project you are encouraged to browse through existing code and adopt its style also in new code.
[[sec-guidelines-commit-message-style]]
==== Format your commit messages
Similar to <<sec-guidelines-code-style>> we encourage a consistent commit message format as described in <<sec-commit-style>>.
[[sec-guidelines-news-style]]
==== Format your news entries
If your contribution includes a change that should be communicated to users of Home Manager then you can add a news entry. The entry must be formatted as described in <<sec-news>>.
When new modules are added a news entry should be included but you do not need to create this entry manually. The merging maintainer will create the entry for you. This is to reduce the risk of merge conflicts.
[[sec-guidelines-conditional-modules]]
==== Use conditional modules and news
Home Manager includes a number of modules that are only usable on some of the supported platforms. The most common example of platform specific modules are those that define systemd user services, which only works on Linux systems.
If you add a module that is platform specific then make sure to include a condition in the `loadModule` function call. This will make the module accessible only on systems where the condition evaluates to `true`.
Similarly, if you are adding a news entry then it should be shown only to users that may find it relevant, see <<sec-news>> for a description of conditional news.
[[sec-guidelines-licensing]]
==== Mind the license
The Home Manager project is covered by the MIT license and we can only accept contributions that fall under this license, or are licensed in a compatible way. When you contribute self written code and documentation it is assumed that you are doing so under the MIT license.
A potential gotcha with respect to licensing are option descriptions. Often it is convenient to copy from the upstream software documentation. When this is done it is important to verify that the license of the upstream documentation allows redistribution under the terms of the MIT license.
[[sec-commit-style]]
=== Commits
The commits in your pull request should be reasonably self-contained, that is, each commit should make sense in isolation. In particular, you will be asked to amend any commit that introduces syntax errors or similar problems even if they are fixed in a later commit.
The commit messages should follow the {seven-rules}[seven rules]. We also ask you to include the affected code component or module in the first line. That is, a commit message should follow the template
----
{component}: {description}
{long description}
----
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
[[ex-commit-message]]
.Compliant commit message
===============================================================================
The commit {example-commit-message}[69f8e47e9e74c8d3d060ca22e18246b7f7d988ef] contains the commit message
----
starship: allow running in Emacs if vterm is used
The vterm buffer is backed by libvterm and can handle Starship prompts
without issues.
----
which ticks all the boxes necessary to be accepted in Home Manager.
===============================================================================
Finally, when adding a new module, say `programs/foo.nix`, we use the fixed commit format `foo: add module`. You can, of course, still include a long description if you wish.
[[sec-code-style]]
=== Code Style
The code in Home Manager is formatted by the {nixfmt}[nixfmt] tool and the formatting is checked in the pull request tests. Run the `format` tool inside the project repository before submitting your pull request.
Keep lines at a reasonable width, ideally 80 characters or less. This also applies to string literals.
We prefer `lowerCamelCase` for variable and attribute names with the accepted exception of variables directly referencing packages in Nixpkgs which use a hyphenated style. For example, the Home Manager option `services.gpg-agent.enableSshSupport` references the `gpg-agent` package in Nixpkgs.
[[sec-news]]
=== News
Home Manager includes a system for presenting news to the user. When making a change you, therefore, have the option to also include an associated news entry. In general, a news entry should only be added for truly noteworthy news. For example, a bug fix or new option does generally not need a news entry.
If you do have a change worthy of a news entry then please add one in {news-nix}[`news.nix`] but you should follow some basic guidelines:
- The entry timestamp should be in ISO-8601 format having "+00:00" as time zone. For example, "2017-09-13T17:10:14+00:00". A suitable timestamp can be produced by the command
+
[source,console]
$ date --iso-8601=second --universal
- The entry condition should be as specific as possible. For example, if you are changing or deprecating a specific option then you could restrict the news to those users who actually use this option.
- Wrap the news message so that it will fit in the typical terminal, that is, at most 80 characters wide. Ideally a bit less.
- Unlike commit messages, news will be read without any connection to the Home Manager source code. It is therefore important to make the message understandable in isolation and to those who do not have knowledge of the Home Manager internals. To this end it should be written in more descriptive, prose like way.
- If you refer to an option then write its full attribute path. That is, instead of writing
+
----
The option 'foo' has been deprecated, please use 'bar' instead.
----
+
it should read
+
----
The option 'services.myservice.foo' has been deprecated, please
use 'services.myservice.bar' instead.
----
- A new module, say `foo.nix`, should always include a news entry that has a message along the lines of
+
----
A new module is available: 'services.foo'.
----
+
If the module is platform specific, e.g., a service module using systemd, then a condition like
+
[source,nix]
condition = hostPlatform.isLinux;
+
should be added. If you contribute a module then you don't need to add this entry, the merger will create an entry for you.
[[sec-tests]]
=== Tests
Home Manager includes a basic test suite and it is highly recommended to include at least one test when adding a module. Tests are typically in the form of "golden tests" where, for example, a generated configuration file is compared to a known correct file.
It is relatively easy to create tests by modeling the existing tests, found in the `tests` project directory.
The full Home Manager test suite can be run by executing
[source,console]
$ nix-shell --pure tests -A run.all
in the project root. List all test cases through
[source,console]
$ nix-shell --pure tests -A list
and run an individual test, for example `alacritty-empty-settings`, through
[source,console]
$ nix-shell --pure tests -A run.alacritty-empty-settings

120
doc/default.nix Normal file
View File

@@ -0,0 +1,120 @@
{ pkgs
# Note, this should be "the standard library" + HM extensions.
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
let
nmdSrc = pkgs.fetchFromGitLab {
name = "nmd";
owner = "rycee";
repo = "nmd";
rev = "2398aa79ab12aa7aba14bc3b08a6efd38ebabdc5";
sha256 = "0yxb48afvccn8vvpkykzcr4q1rgv8jsijqncia7a5ffzshcrwrnh";
};
nmd = import nmdSrc { inherit lib pkgs; };
# Make sure the used package is scrubbed to avoid actually
# instantiating derivations.
scrubbedPkgsModule = {
imports = [{
_module.args = {
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
pkgs_i686 = lib.mkForce { };
};
}];
};
buildModulesDocs = args:
nmd.buildModulesDocs ({
moduleRootPaths = [ ./.. ];
mkModuleUrl = path:
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
channelName = "home-manager";
} // args);
hmModulesDocs = buildModulesDocs {
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [ scrubbedPkgsModule ];
docBook.id = "home-manager-options";
};
nixosModuleDocs = buildModulesDocs {
modules = let
nixosModule = module: pkgs.path + "/nixos/modules" + module;
mockedNixos = with lib; {
options = {
environment.pathsToLink = mkSinkUndeclaredOptions { };
systemd.services = mkSinkUndeclaredOptions { };
users.users = mkSinkUndeclaredOptions { };
};
};
in [
../nixos/default.nix
mockedNixos
(nixosModule "/misc/assertions.nix")
scrubbedPkgsModule
];
docBook = {
id = "nixos-options";
optionIdPrefix = "nixos-opt";
};
};
nixDarwinModuleDocs = buildModulesDocs {
modules = let
nixosModule = module: pkgs.path + "/nixos/modules" + module;
mockedNixDarwin = with lib; {
options = {
environment.pathsToLink = mkSinkUndeclaredOptions { };
system.activationScripts.postActivation.text =
mkSinkUndeclaredOptions { };
users.users = mkSinkUndeclaredOptions { };
};
};
in [
../nix-darwin/default.nix
mockedNixDarwin
(nixosModule "/misc/assertions.nix")
scrubbedPkgsModule
];
docBook = {
id = "nix-darwin-options";
optionIdPrefix = "nix-darwin-opt";
};
};
docs = nmd.buildDocBookDocs {
pathName = "home-manager";
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
documentsDirectory = ./.;
documentType = "book";
chunkToc = ''
<toc>
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
<d:tocentry linkend="ch-nixos-options"><?dbhtml filename="nixos-options.html"?></d:tocentry>
<d:tocentry linkend="ch-nix-darwin-options"><?dbhtml filename="nix-darwin-options.html"?></d:tocentry>
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
</d:tocentry>
</toc>
'';
};
in {
inherit nmdSrc;
options = {
json = hmModulesDocs.json.override {
path = "share/doc/home-manager/options.json";
};
};
manPages = docs.manPages;
manual = { inherit (docs) html htmlOpenTool; };
}

173
doc/faq.adoc Normal file
View File

@@ -0,0 +1,173 @@
[[ch-faq]]
== Frequently Asked Questions (FAQ)
=== Why is there a collision error when switching generation?
Home Manager currently installs packages into the user environment, precisely as if the packages were installed through `nix-env --install`. This means that you will get a collision error if your Home Manager configuration attempts to install a package that you already have installed manually, that is, packages that shows up when you run `nix-env --query`.
For example, imagine you have the `hello` package installed in your environment
[source,console]
----
$ nix-env --query
hello-2.10
----
and your Home Manager configuration contains
[source,nix]
----
home.packages = [ pkgs.hello ];
----
Then attempting to switch to this configuration will result in an error similar to
[source,console]
----
$ home-manager switch
these derivations will be built:
/nix/store/xg69wsnd1rp8xgs9qfsjal017nf0ldhm-home-manager-path.drv
[…]
Activating installPackages
replacing old home-manager-path
installing home-manager-path
building path(s) /nix/store/b5c0asjz9f06l52l9812w6k39ifr49jj-user-environment
Wide character in die at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 79.
collision between /nix/store/fmwa4axzghz11cnln5absh31nbhs9lq1-home-manager-path/bin/hello and /nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10/bin/hello; use nix-env --set-flag priority NUMBER PKGNAME to change the priority of one of the conflicting packages
builder for /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed with exit code 2
error: build of /nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv failed
----
The solution is typically to uninstall the package from the environment using `nix-env --uninstall` and reattempt the Home Manager generation switch.
You could also opt to unistall _all_ of the packages from your profile with `nix-env --uninstall '*'`.
=== Why are the session variables not set?
Home Manager is only able to set session variables automatically if it manages your Bash or Z shell configuration. If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
[source,bash]
----
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
=== How to set up a configuration for multiple users/machines?
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
For example, if you have two machines, called "kronos" and "rhea" on which you want to configure your user "jane" then you could create the files
- `kronos-jane.nix`,
- `rhea-jane.nix`, and
- `common.nix`
in your repository. On the kronos and rhea machines you can then make `~jane/.config/nixpkgs/home.nix` be a symbolic link to the corresponding file in your configuration repository.
The `kronos-jane.nix` and `rhea-jane.nix` files follow the format
[source,nix]
----
{ ... }:
{
imports = [ ./common.nix ];
# Various options that are specific for this machine/user.
}
----
while the `common.nix` file contains configuration shared across the two logins. Of course, instead of just a single `common.nix` file you can have multiple ones, even one per program or service.
You can get some inspiration from the {post-your-homenix}[Post your home-manager home.nix file!] Reddit thread.
=== Why do I get an error message about `ca.desrt.dconf`?
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]
services.dbus.packages = with pkgs; [ gnome.dconf ];
to your system configuration.
=== How do I install packages from Nixpkgs unstable?
If you are using a stable version of Nixpkgs but would like to install some particular packages from Nixpkgs unstable or some other channel then you can import the unstable Nixpkgs and refer to its packages within your configuration. Something like
[source,nix]
----
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
home.packages = [
pkgsUnstable.foo
];
# …
}
----
should work provided you have a Nix channel called `nixpkgs-unstable`.
You can add the `nixpkgs-unstable` channel by running
[source,console]
----
# nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
# nix-channel --update
----
Note, the package will not be affected by any package overrides, overlays, etc.
=== How do I override the package used by a module?
:nixpkgs-overlays: https://nixos.org/nixpkgs/manual/#chap-overlays
By default Home Manager will install the package provided by your chosen `nixpkgs` channel but occasionally you might end up needing to change this package. This can typically be done in two ways.
1. If the module provides a `package` option, such as `programs.beets.package`, then this is the recommended way to perform the override. For example,
+
[source,nix]
programs.beets.package = pkgs.beets.override { enableCheck = true; };
2. If no `package` option is available then you can typically override the relevant package using an {nixpkgs-overlays}[overlay].
+
For example, if you want to use the `programs.skim` module but use the `skim` package from Nixpkgs unstable, then a configuration like
+
[source,nix]
----
{ pkgs, config, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
programs.skim.enable = true;
nixpkgs.overlays = [
(self: super: {
skim = pkgsUnstable.skim;
})
];
# …
}
----
+
should work OK.

263
doc/installation.adoc Normal file
View File

@@ -0,0 +1,263 @@
[[ch-installation]]
== Installing Home Manager
:nix-darwin: https://github.com/LnL7/nix-darwin/
Home Manager can be used in three primary ways:
1. Using the standalone `home-manager` tool. For platforms other than
NixOS and Darwin, this is the only available choice. It is also
recommended for people on NixOS or Darwin that want to manage their
home directory independent of the system as a whole. See
<<sec-install-standalone>> for instructions on how to perform this
installation.
2. As a module within a NixOS system configuration. This allows the
user profiles to be built together with the system when running
`nixos-rebuild`. See <<sec-install-nixos-module>> for a description of
this setup.
3. As a module within a {nix-darwin}[nix-darwin] system configuration.
This allows the user profiles to be built together with the system
when running `darwin-rebuild`. See <<sec-install-nix-darwin-module>>
for a description of this setup.
[[sec-install-standalone]]
=== Standalone installation
:nix-allowed-users: https://nixos.org/nix/manual/#conf-allowed-users
:nixos-allowed-users: https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers
1. Make sure you have a working Nix installation. Specifically, make
sure that your user is able to build and install Nix packages. For
example, you should be able to successfully run a command like
`nix-instantiate '<nixpkgs>' -A hello` without having to switch to the
root user. For a multi-user install of Nix this means that your user
must be covered by the {nix-allowed-users}[`allowed-users`] Nix
option. On NixOS you can control this option using the
{nixos-allowed-users}[`nix.allowedUsers`] system option.
2. Add the Home Manager channel that you wish to follow. If you are
following Nixpkgs master or an unstable channel then this is done by
running
+
[source,console]
----
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
----
+
and if you follow a Nixpkgs version 21.05 channel, you can run
+
[source,console]
----
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
$ nix-channel --update
----
+
On NixOS you may need to log out and back in for the channel to become
available. On non-NixOS you may have to add
+
[source,bash]
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
+
to your shell (see
https://github.com/NixOS/nix/issues/2033[nix#2033]).
3. Run the Home Manager installation command and create the first Home
Manager generation:
+
[source,console]
$ nix-shell '<home-manager>' -A install
+
Once finished, Home Manager should be active and available in your
user environment.
4. If you do not plan on having Home Manager manage your shell
configuration then you must source the
+
[source,bash]
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
+
file in your shell configuration. Alternatively source
+
[source,bash]
/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh
+
when managing home configuration together with system configuration.
+
Unfortunately, we currently only support POSIX.2-like shells such as
https://www.gnu.org/software/bash/[Bash] or
http://zsh.sourceforge.net/[Z shell].
+
For example, if you use Bash then add
+
[source,bash]
----
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
----
+
to your `~/.profile` file.
If instead of using channels you want to run Home Manager from a Git
checkout of the repository then you can use the
<<opt-programs.home-manager.path>> option to specify the absolute path
to the repository.
[[sec-install-nixos-module]]
=== NixOS module
Home Manager provides a NixOS module that allows you to prepare user
environments directly from the system configuration file, which often
is more convenient than using the `home-manager` tool. It also opens
up additional possibilities, for example, to automatically configure
user environments in NixOS declarative containers or on systems
deployed through NixOps.
To make the NixOS module available for use you must `import` it into
your system configuration. This is most conveniently done by adding a
Home Manager channel. For example, if you are following Nixpkgs master
or an unstable channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
# nix-channel --update
----
and if you follow a Nixpkgs version 21.05 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
# nix-channel --update
----
It is then possible to add
[source,nix]
imports = [ <home-manager/nixos> ];
to your system `configuration.nix` file, which will introduce a new
NixOS option called `home-manager.users` whose type is an attribute
set that maps user names to Home Manager configurations.
For example, a NixOS configuration may include the lines
[source,nix]
----
users.users.eve.isNormalUser = true;
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
};
----
and after a `nixos-rebuild switch` the user eve's environment should
include a basic Bash configuration and the packages atool and httpie.
[NOTE]
====
By default packages will be installed to `$HOME/.nix-profile` but they
can be installed to `/etc/profiles` if
[source,nix]
home-manager.useUserPackages = true;
is added to the system configuration. This is necessary if, for
example, you wish to use `nixos-rebuild build-vm`. This option may
become the default value in the future.
====
[NOTE]
====
By default, Home Manager uses a private `pkgs` instance that is
configured via the `home-manager.users.<name>.nixpkgs` options. To
instead use the global `pkgs` that is configured via the system level
`nixpkgs` options, set
[source,nix]
home-manager.useGlobalPkgs = true;
This saves an extra Nixpkgs evaluation, adds consistency, and removes
the dependency on `NIX_PATH`, which is otherwise used for importing
Nixpkgs.
====
[[sec-install-nix-darwin-module]]
=== nix-darwin module
Home Manager provides a module that allows you to prepare user
environments directly from the {nix-darwin}[nix-darwin] configuration
file, which often is more convenient than using the `home-manager`
tool.
To make the NixOS module available for use you must `import` it into
your system configuration. This is most conveniently done by adding a
Home Manager channel. For example, if you are following Nixpkgs master
or an unstable channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
# nix-channel --update
----
and if you follow a Nixpkgs version 21.05 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
# nix-channel --update
----
It is then possible to add
[source,nix]
imports = [ <home-manager/nix-darwin> ];
to your nix-darwin `configuration.nix` file, which will introduce a
new NixOS option called `home-manager` whose type is an attribute set
that maps user names to Home Manager configurations.
For example, a nix-darwin configuration may include the lines
[source,nix]
----
home-manager.users.eve = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ];
programs.bash.enable = true;
};
----
and after a `darwin-rebuild switch` the user eve's environment
should include a basic Bash configuration and the packages atool and
httpie.
[NOTE]
====
By default user packages will not be ignored in favor of
`environment.systemPackages`, but they will be intalled to
`/etc/profiles/per-user/$USERNAME` if
[source,nix]
home-manager.useUserPackages = true;
is added to the nix-darwin configuration. This option may become the
default value in the future.
====
[NOTE]
====
By default, Home Manager uses a private `pkgs` instance that is
configured via the `home-manager.users.<name>.nixpkgs` options. To
instead use the global `pkgs` that is configured via the system level
`nixpkgs` options, set
[source,nix]
home-manager.useGlobalPkgs = true;
This saves an extra Nixpkgs evaluation, adds consistency, and removes
the dependency on `NIX_PATH`, which is otherwise used for importing
Nixpkgs.
====

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

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

587
doc/man-home-manager.xml Normal file
View File

@@ -0,0 +1,587 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refmeta>
<refentrytitle><command>home-manager</command>
</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="source">Home Manager</refmiscinfo>
</refmeta>
<refnamediv>
<refname><command>home-manager</command>
</refname><refpurpose>reconfigure a user environment</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>home-manager</command> <group choice="req">
<arg choice="plain">
build
</arg>
<arg choice="plain">
instantiate
</arg>
<arg choice="plain">
edit
</arg>
<arg choice="plain">
expire-generations <replaceable>timestamp</replaceable>
</arg>
<arg choice="plain">
generations
</arg>
<arg choice="plain">
help
</arg>
<arg choice="plain">
news
</arg>
<arg choice="plain">
option <replaceable>option.name</replaceable>
</arg>
<arg choice="plain">
packages
</arg>
<arg choice="plain">
remove-generations <replaceable>ID …</replaceable>
</arg>
<arg choice="plain">
switch
</arg>
<arg choice="plain">
uninstall
</arg>
</group>
<sbr />
<arg>
-A <replaceable>attrPath</replaceable>
</arg>
<arg>
-I <replaceable>path</replaceable>
</arg>
<arg>
--flake <replaceable>flake-uri</replaceable>
</arg>
<arg>
-b <replaceable>ext</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-f
</arg>
<arg choice="plain">
--file
</arg>
</group> <replaceable>path</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-h
</arg>
<arg choice="plain">
--help
</arg>
</group>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-n
</arg>
<arg choice="plain">
--dry-run
</arg>
</group>
</arg>
<arg>
--option <replaceable>name</replaceable> <replaceable>value</replaceable>
</arg>
<arg>
--cores <replaceable>number</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-j
</arg>
<arg choice="plain">
--max-jobs
</arg>
</group>
<replaceable>number</replaceable>
</arg>
<arg>
--debug
</arg>
<arg>
--keep-failed
</arg>
<arg>
--keep-going
</arg>
<arg>
--show-trace
</arg>
<arg>
--(no-)substitute
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-v
</arg>
<arg choice="plain">
--verbose
</arg>
</group>
</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsection>
<title>Description</title>
<para>
This command updates the user environment so that it corresponds to the
configuration specified in <filename>~/.config/nixpkgs/home.nix</filename> or <filename>~/.config/nixpkgs/flake.nix</filename>.
</para>
<para>
All operations using this tool expects a sub-command that indicates the
operation to perform. It must be one of
<variablelist>
<varlistentry>
<term>
<option>build</option>
</term>
<listitem>
<para>
Build configuration into a <filename>result</filename> directory.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>instantiate</option>
</term>
<listitem>
<para>
Instantiate the configuration and print the resulting derivation.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>edit</option>
</term>
<listitem>
<para>
Open the home configuration using the editor indicated by
<envar>EDITOR</envar>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>expire-generations <replaceable>timestamp</replaceable></option>
</term>
<listitem>
<para>
Remove generations older than <replaceable>timestamp</replaceable> where
<replaceable>timestamp</replaceable> is interpreted as in the
<option>-d</option> argument of the <citerefentry>
<refentrytitle>date</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry> tool. For example <literal>-30
days</literal> or <literal>2018-01-01</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>generations</option>
</term>
<listitem>
<para>
List all home environment generations.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>help</option>
</term>
<listitem>
<para>
Print tool help.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>news</option>
</term>
<listitem>
<para>
Show news entries in a pager.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>option <replaceable>option.name</replaceable></option>
</term>
<listitem>
<para>
Inspect the given option name in the home configuration, like <citerefentry>
<refentrytitle>nixos-option</refentrytitle>
<manvolnum>8</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>packages</option>
</term>
<listitem>
<para>
List all packages installed in <varname>home-manager-path</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>remove-generations <replaceable>ID …</replaceable></option>
</term>
<listitem>
<para>
Remove indicated generations. Use the <option>generations</option>
sub-command to find suitable generation numbers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>switch</option>
</term>
<listitem>
<para>
Build and activate the configuration.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>uninstall</option>
</term>
<listitem>
<para>
Remove Home Manager from the user environment. This will
<itemizedlist>
<listitem>
<para>
remove all managed files from the home directory,
</para>
</listitem>
<listitem>
<para>
remove packages installed through Home Manager from the user profile,
and
</para>
</listitem>
<listitem>
<para>
optionally remove all Home Manager generations and make them
available for immediate garbage collection.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
The tool accepts the options
</para>
<variablelist>
<varlistentry>
<term>
<option>-A <replaceable>attrPath</replaceable></option>
</term>
<listitem>
<para>
Optional attribute that selects a configuration expression in the
configuration file. That is, if <filename>home.nix</filename> contains
<programlisting language="nix">
{
joe-at-work = {pkgs, ...}: { home.packages = [ pkgs.fortune ]; };
joe-at-home = {pkgs, ...}: { home.packages = [ pkgs.cowsay ]; };
}
</programlisting>
then the command <command>home-manager switch -A joe-at-work</command>
will activate the profile containing the fortune program.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-I <replaceable>path</replaceable></option>
</term>
<listitem>
<para>
Add a path to the Nix expression search path. For example, to build a
Home Manager profile using a specific Nixpkgs run <command>home-manager
-I nixpkgs=/absolute/path/to/nixpkgs build</command>. By default
<literal>&lt;nixpkgs&gt;</literal> is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--flake <replaceable>flake-uri[#name]</replaceable></option>
</term>
<listitem>
<para>
Build Home Manager configuration from the flake, which must contain the
output homeConfigurations.name. If no name is specified it will first try
username@hostname and then username.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-b <replaceable>extension</replaceable></option>
</term>
<listitem>
<para>
Enable automatic resolution of collisions between unmanaged and managed
files. The name of the original file will be suffixed by the given
extension. For example,
<screen>
<prompt>$</prompt> <userinput>home-manager -b bck switch</userinput>
</screen>
will cause a colliding file <filename>~/.config/foo.conf</filename> to be
moved to <filename>~/.config/foo.conf.bck</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-f <replaceable>path</replaceable></option>
</term>
<term>
<option>--file <replaceable>path</replaceable></option>
</term>
<listitem>
<para>
Indicates the path to the Home Manager configuration file. If not given,
<filename>~/.config/nixpkgs/home.nix</filename> is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-h</option>
</term>
<term>
<option>--help</option>
</term>
<listitem>
<para>
Prints usage information for the <command>home-manager</command> tool.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-n</option>
</term>
<term>
<option>--dry-run</option>
</term>
<listitem>
<para>
Perform a dry-run of the given operation, only prints what actions would
be taken.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--option <replaceable>name</replaceable> <replaceable>value</replaceable></option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--cores <replaceable>number</replaceable></option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-j <replaceable>number</replaceable></option>
</term>
<term>
<option>--max-jobs <replaceable>number</replaceable></option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--debug</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--keep-failed</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--keep-going</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--show-trace</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--(no-)substitute</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix-build</refentrytitle>
<manvolnum>1</manvolnum> </citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-v</option>
</term>
<term>
<option>--verbose</option>
</term>
<listitem>
<para>
Activates verbose output.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Files</title>
<variablelist>
<varlistentry>
<term>
<filename>~/.local/share/home-manager/news-read-ids</filename>
</term>
<listitem>
<para>
Identifiers of news items that have been shown. Can be deleted to reset
the read news indicator.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Bugs</title>
<para>
Please report any bugs on the
<link
xlink:href="https://github.com/nix-community/home-manager/issues">project
issue tracker</link>.
</para>
</refsection>
<refsection>
<title>See also</title>
<para>
<citerefentry>
<refentrytitle>home-configuration.nix</refentrytitle>
<manvolnum>5</manvolnum> </citerefentry>
</para>
</refsection>
</refentry>

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

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

52
doc/manual.xml Normal file
View File

@@ -0,0 +1,52 @@
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="book-home-manager-manual">
<info>
<title>Home Manager Manual</title>
</info>
<preface>
<title>Preface</title>
<para>
This manual will eventually describes how to install, use, and extend Home
Manager.
</para>
<para>
If you encounter problems then please reach out on the IRC channel
<link xlink:href="https://webchat.oftc.net/?channels=home-manager">#home-manager</link>
hosted by <link xlink:href="https://oftc.net/">OFTC</link>.
If your problem is caused by a bug in Home Manager then it should
be reported on the
<link xlink:href="https://github.com/nix-community/home-manager/issues">Home Manager issue tracker</link>.
</para>
<note>
<para>
Commands prefixed with <literal>#</literal> have to be run as root, either
requiring to login as root user or temporarily switching to it using
<literal>sudo</literal> for example.
</para>
</note>
</preface>
<xi:include href="installation.xml" />
<xi:include href="writing-modules.xml" />
<xi:include href="contributing.xml" />
<xi:include href="faq.xml" />
<appendix xml:id="ch-options">
<title>Configuration Options</title>
<xi:include href="./nmd-result/home-manager-options.xml" />
</appendix>
<appendix xml:id="ch-nixos-options">
<title>NixOS Module Options</title>
<xi:include href="./nmd-result/nixos-options.xml" />
</appendix>
<appendix xml:id="ch-nix-darwin-options">
<title>nix-darwin Module Options</title>
<xi:include href="./nmd-result/nix-darwin-options.xml" />
</appendix>
<appendix xml:id="ch-tools">
<title>Tools</title>
<xi:include href="./man-home-manager.xml" />
</appendix>
<xi:include href="./release-notes/release-notes.xml" />
</book>

View File

@@ -0,0 +1,23 @@
[[ch-release-notes]]
[appendix]
== Release Notes
This section lists the release notes for stable versions of Home Manager and the current unstable version.
:leveloffset: 1
include::rl-2111.adoc[]
include::rl-2105.adoc[]
include::rl-2009.adoc[]
include::rl-2003.adoc[]
include::rl-1909.adoc[]
include::rl-1903.adoc[]
include::rl-1809.adoc[]
:leveloffset: 0

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,43 @@
[[sec-release-21.11]]
== Release 21.11
This is the current unstable branch and the information in this
section is therefore not final.
[[sec-release-21.11-highlights]]
=== Highlights
This release has the following notable changes:
* All Home Manager modules are now loaded on all platforms. With this
change you will get a more descriptive error message if you attempt to
enable a module that is incompatible with the host platform.
+
Previously, modules that were platform specific would only be loaded
on that particular platform. For example, a module defining a
https://systemd.io/[systemd] service would only be loaded when the
host platform was Linux. This reduced evaluation times, simplified the
generated documentation, and made it impossible to accidentally use
modules that do not support the host platform.
+
While the above benefits are quite nice, avoiding module loads also
brings a few problems. For example, the
https://nix-community.github.io/home-manager/[public documentation]
will only show the options available for Linux hosts and the
documentation cannot make references to options within modules that
are unavailable on some hosts. Finally, users who wish to use the same
configuration file for different platforms cannot do so, even if the
platform incompatible options are unused.
+
Ultimately, the benefits of loading all modules won and the behavior
has now changed. For associated discussion see
https://github.com/nix-community/home-manager/issues/1906[issue #1906].
[[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.
* Nothing has happened.

187
doc/writing-modules.adoc Normal file
View File

@@ -0,0 +1,187 @@
[[ch-writing-modules]]
== Writing Home Manager Modules
:writing-nixos-modules: https://nixos.org/nixos/manual/index.html#sec-writing-modules
The module system in Home Manager is based entirely on the NixOS module system so we will here only highlight aspects that are specific for Home Manager. For information about the module system as such please refer to the {writing-nixos-modules}[Writing NixOS Modules] chapter of the NixOS manual.
[[sec-option-types]]
=== Option Types
:wikipedia-dag: https://en.wikipedia.org/w/index.php?title=Directed_acyclic_graph&oldid=939656095
:gvariant-description: https://developer.gnome.org/glib/stable/glib-GVariant.html#glib-GVariant.description
Overall the basic option types are the same in Home Manager as NixOS. A few Home Manager options, however, make use of custom types that are worth describing in more detail. These are the option types `dagOf` and `gvariant` that are used, for example, by <<opt-programs.ssh.matchBlocks>> and <<opt-dconf.settings>>.
`hm.types.dagOf`::
Options of this type have attribute sets as values where each member is a node in a {wikipedia-dag}[directed acyclic graph] (DAG). This allows the attribute set entries to express dependency relations among themselves. This can, for example, be used to control the order of match blocks in a OpenSSH client configuration or the order of activation script blocks in <<opt-home.activation>>.
+
A number of functions are provided to create DAG nodes. The functions are shown below with examples using an option `foo.bar` of type `hm.types.dagOf types.int`.
+
`hm.dag.entryAnywhere (value: T)`:::
Indicates that `value` can be placed anywhere within the DAG. This is also the default for plain attribute set entries, that is
+
[source,nix]
----
foo.bar = {
a = hm.dag.entryAnywhere 0;
}
----
+
and
+
[source,nix]
----
foo.bar = {
a = 0;
}
----
+
are equivalent.
+
`hm.dag.entryAfter (afters: list string) (value: T)`:::
Indicates that `value` must be placed _after_ each of the attribute names in the given list. For example
+
[source,nix]
----
foo.bar = {
a = 0;
b = hm.dag.entryAfter [ "a" ] 1;
}
----
+
would place `b` after `a` in the graph.
+
`hm.dag.entryBefore (befores: list string) (value: T)`:::
Indicates that `value` must be placed _before_ each of the attribute names in the given list. For example
+
[source,nix]
----
foo.bar = {
b = hm.dag.entryBefore [ "a" ] 1;
a = 0;
}
----
+
would place `b` before `a` in the graph.
+
`hm.dag.entryBetween (befores: list string) (afters: list string) (value: T)`:::
Indicates that `value` must be placed _before_ the attribute names in the first list and _after_ the attribute names in the second list. For example
+
[source,nix]
----
foo.bar = {
a = 0;
c = hm.dag.entryBetween [ "b" ] [ "a" ] 2;
b = 1;
}
----
+
would place `c` before `b` and after `a` in the graph.
`hm.types.gvariant`::
This type is useful for options representing {gvariant-description}[GVariant] values. The type accepts all primitive GVariant types as well as arrays and tuples. Dictionaries are not currently supported.
+
To create a GVariant value you can use a number of provided functions. Examples assume an option `foo.bar` of type `hm.types.gvariant`.
+
`hm.gvariant.mkBoolean (v: bool)`:::
Takes a Nix value `v` to a GVariant `boolean` value. Note, Nix booleans are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkBoolean true;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = true;
----
`hm.gvariant.mkString (v: string)`:::
Takes a Nix value `v` to a GVariant `string` value. Note, Nix strings are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkString "a string";
----
+
is equivalent to
+
[source,nix]
----
foo.bar = "a string";
----
`hm.gvariant.mkObjectpath (v: string)`:::
Takes a Nix value `v` to a GVariant `objectpath` value.
`hm.gvariant.mkUchar (v: string)`:::
Takes a Nix value `v` to a GVariant `uchar` value.
`hm.gvariant.mkInt16 (v: int)`:::
Takes a Nix value `v` to a GVariant `int16` value.
`hm.gvariant.mkUint16 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint16` value.
`hm.gvariant.mkInt32 (v: int)`:::
Takes a Nix value `v` to a GVariant `int32` value. Note, Nix integers are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkInt32 7;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = 7;
----
`hm.gvariant.mkUint32 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint32` value.
`hm.gvariant.mkInt64 (v: int)`:::
Takes a Nix value `v` to a GVariant `int64` value.
`hm.gvariant.mkUint64 (v: int)`:::
Takes a Nix value `v` to a GVariant `uint64` value.
`hm.gvariant.mkDouble (v: double)`:::
Takes a Nix value `v` to a GVariant `double` value. Note, Nix floats are automatically coerced using this function. That is,
+
[source,nix]
----
foo.bar = hm.gvariant.mkDouble 3.14;
----
+
is equivalent to
+
[source,nix]
----
foo.bar = 3.14;
----
+
`hm.gvariant.mkArray type elements`:::
Builds a GVariant array containing the given list of elements, where each element is a GVariant value of the given type. The `type` value can be constructed using
+
--
- `hm.gvariant.type.string`
- `hm.gvariant.type.boolean`
- `hm.gvariant.type.uchar`
- `hm.gvariant.type.int16`
- `hm.gvariant.type.uint16`
- `hm.gvariant.type.int32`
- `hm.gvariant.type.uint32`
- `hm.gvariant.type.int64`
- `hm.gvariant.type.uint64`
- `hm.gvariant.type.double`
- `hm.gvariant.type.arrayOf type`
- `hm.gvariant.type.maybeOf type`
- `hm.gvariant.type.tupleOf types`
--
+
where `type` and `types` are themselves a type and list of types, respectively.
+
`hm.gvariant.mkEmptyArray type`:::
An alias of `hm.gvariant.mkArray type []`.
+
`hm.gvariant.mkNothing type`:::
Builds a GVariant maybe value whose (non-existent) element is of the given type. The `type` value is constructed as described for the `mkArray` function above.
+
`hm.gvariant.mkJust element`:::
Builds a GVariant maybe value containing the given GVariant element.
+
`hm.gvariant.mkTuple elements`:::
Builds a GVariant tuple containing the given list of elements, where each element is a GVariant value.

46
flake.nix Normal file
View File

@@ -0,0 +1,46 @@
{
description = "Home Manager for Nix";
outputs = { self, nixpkgs }:
let
# List of systems supported by home-manager binary
supportedSystems = nixpkgs.lib.platforms.unix;
# Function to generate a set based on supported systems
forAllSystems = f:
nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in rec {
nixosModules.home-manager = import ./nixos;
nixosModule = self.nixosModules.home-manager;
darwinModules.home-manager = import ./nix-darwin;
darwinModule = self.darwinModules.home-manager;
packages = forAllSystems (system: {
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
});
defaultPackage =
forAllSystems (system: self.packages.${system}.home-manager);
lib = {
hm = import ./modules/lib { lib = nixpkgs.lib; };
homeManagerConfiguration = { configuration, system, homeDirectory
, username, extraModules ? [ ], extraSpecialArgs ? { }
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
, check ? true, stateVersion ? "20.09" }@args:
assert nixpkgs.lib.versionAtLeast stateVersion "20.09";
import ./modules {
inherit pkgs check extraSpecialArgs;
configuration = { ... }: {
imports = [ configuration ] ++ extraModules;
home = { inherit homeDirectory stateVersion username; };
nixpkgs = { inherit (pkgs) config overlays; };
};
};
};
};
}

40
format Executable file
View File

@@ -0,0 +1,40 @@
#! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/05f0934825c2a0750d4888c4735f9420c906b388.tar.gz -i bash -p findutils nixfmt
CHECK_ARG=
case $1 in
-h)
echo "$0 [-c]"
;;
-c)
CHECK_ARG=-c
;;
esac
# The first block of excludes are files where nixfmt does a poor job,
# IMHO. The second block of excludes are files touched by open pull
# requests and we want to avoid merge conflicts.
find . -name '*.nix' \
! -path ./modules/programs/irssi.nix \
\
! -path ./home-manager/home-manager.nix \
! -path ./modules/default.nix \
! -path ./modules/files.nix \
! -path ./modules/home-environment.nix \
! -path ./modules/lib/default.nix \
! -path ./modules/lib/file-type.nix \
! -path ./modules/manual.nix \
! -path ./modules/misc/news.nix \
! -path ./modules/programs/bash.nix \
! -path ./modules/programs/gpg.nix \
! -path ./modules/programs/ssh.nix \
! -path ./modules/programs/tmux.nix \
! -path ./modules/programs/zsh.nix \
! -path ./modules/services/gpg-agent.nix \
! -path ./modules/services/mpd.nix \
! -path ./nix-darwin/default.nix \
! -path ./tests/default.nix \
! -path ./tests/modules/home-environment/session-variables.nix \
! -path ./tests/modules/programs/gpg/override-defaults.nix \
-exec nixfmt $CHECK_ARG {} +

View File

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

View File

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

View File

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

View File

@@ -1,34 +1,44 @@
{ pkgs
{ runCommand, lib, bash, callPackage, coreutils, findutils, gnused, less
# used for pkgs.path for nixos-option
, pkgs
# Extra path to Home Manager. If set then this path will be tried
# before `$HOME/.config/nixpkgs/home-manager` and
# `$HOME/.nixpkgs/home-manager`.
, path ? null
}:
# Extra path to Home Manager. If set then this path will be tried
# before `$HOME/.config/nixpkgs/home-manager` and
# `$HOME/.nixpkgs/home-manager`.
, path ? null }:
let
pathStr = if path == null then "" else path;
in
nixos-option = pkgs.nixos-option or (callPackage
(pkgs.path + "/nixos/modules/installer/tools/nixos-option") { });
pkgs.stdenv.mkDerivation {
name = "home-manager";
buildCommand = ''
install -v -D -m755 ${./home-manager} $out/bin/home-manager
substituteInPlace $out/bin/home-manager \
--subst-var-by bash "${pkgs.bash}" \
--subst-var-by coreutils "${pkgs.coreutils}" \
--subst-var-by less "${pkgs.less}" \
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
'';
meta = with pkgs.stdenv.lib; {
in runCommand "home-manager" {
preferLocalBuild = true;
allowSubstitutes = false;
meta = with lib; {
description = "A user environment configurator";
maintainers = [ maintainers.rycee ];
platforms = platforms.unix;
license = licenses.mit;
};
}
} ''
install -v -D -m755 ${./home-manager} $out/bin/home-manager
substituteInPlace $out/bin/home-manager \
--subst-var-by bash "${bash}" \
--subst-var-by coreutils "${coreutils}" \
--subst-var-by findutils "${findutils}" \
--subst-var-by gnused "${gnused}" \
--subst-var-by less "${less}" \
--subst-var-by nixos-option "${nixos-option}" \
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
install -D -m755 ${./completion.bash} \
$out/share/bash-completion/completions/home-manager
install -D -m755 ${./completion.zsh} \
$out/share/zsh/site-functions/_home-manager
install -D -m755 ${./completion.fish} \
$out/share/fish/vendor_completions.d/home-manager.fish
''

View File

@@ -1,9 +1,7 @@
#!@bash@/bin/bash
# This code explicitly requires GNU Core Utilities and we therefore
# need to ensure they are prioritized over any other similarly named
# tools on the system.
PATH=@coreutils@/bin:@less@/bin${PATH:+:}$PATH
# Prepare to use tools from Nixpkgs.
PATH=@coreutils@/bin:@findutils@/bin:@gnused@/bin:@less@/bin:@nixos-option@/bin${PATH:+:}$PATH
set -euo pipefail
@@ -12,6 +10,28 @@ function errorEcho() {
echo $* >&2
}
function setVerboseAndDryRun() {
if [[ -v VERBOSE ]]; then
export VERBOSE_ARG="--verbose"
else
export VERBOSE_ARG=""
fi
if [[ -v DRY_RUN ]] ; then
export DRY_RUN_CMD=echo
else
export DRY_RUN_CMD=""
fi
}
function setWorkDir() {
if [[ ! -v WORK_DIR ]]; then
WORK_DIR="$(mktemp --tmpdir -d home-manager-build.XXXXXXXXXX)"
# shellcheck disable=2064
trap "rm -r '$WORK_DIR'" EXIT
fi
}
# Attempts to set the HOME_MANAGER_CONFIG global variable.
#
# If no configuration file can be found then this function will print
@@ -32,7 +52,7 @@ function setConfigFile() {
for confFile in "$defaultConfFile" \
"$HOME/.nixpkgs/home.nix" ; do
if [[ -e "$confFile" ]] ; then
HOME_MANAGER_CONFIG="$confFile"
HOME_MANAGER_CONFIG="$(realpath "$confFile")"
return
fi
done
@@ -54,24 +74,114 @@ function setHomeManagerNixPath() {
done
}
function setFlakeAttribute() {
local configFlake="${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/flake.nix"
if [[ -z $FLAKE_ARG && ! -v HOME_MANAGER_CONFIG && -e "$configFlake" ]]; then
FLAKE_ARG="$(dirname "$(readlink -f "$configFlake")")"
fi
if [[ -n "$FLAKE_ARG" ]]; then
local flake="${FLAKE_ARG%#*}"
case $FLAKE_ARG in
*#*)
local name="${FLAKE_ARG#*#}"
;;
*)
local name="$USER@$(hostname)"
if [ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$name\"")" = "false" ]; then
name="$USER"
fi
;;
esac
export FLAKE_CONFIG_URI="$flake#homeConfigurations.\"$name\""
fi
}
function doInspectOption() {
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
errorEcho "Can't inspect options of a flake configuration"
exit 1
fi
setConfigFile
setHomeManagerNixPath
local extraArgs=("$@")
for p in "${EXTRA_NIX_PATH[@]}"; do
extraArgs=("${extraArgs[@]}" "-I" "$p")
done
if [[ -v VERBOSE ]]; then
extraArgs=("${extraArgs[@]}" "--show-trace")
fi
local HOME_MANAGER_CONFIG_NIX HOME_MANAGER_CONFIG_ATTRIBUTE_NIX
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG//'\'/'\\'}
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//'"'/'\"'}
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//$'\n'/$'\\n'}
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE//'\'/'\\'}
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//'"'/'\"'}
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//$'\n'/$'\\n'}
local modulesExpr
modulesExpr="let confPath = \"${HOME_MANAGER_CONFIG_NIX}\"; "
modulesExpr+="confAttr = \"${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX}\"; in "
modulesExpr+="(import <home-manager/modules> {"
modulesExpr+=" configuration = if confAttr == \"\" then confPath else (import confPath).\${confAttr};"
modulesExpr+=" pkgs = import <nixpkgs> {}; check = true; })"
nixos-option \
--options_expr "$modulesExpr.options" \
--config_expr "$modulesExpr.config" \
"${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}"
}
function doInstantiate() {
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
errorEcho "Can't instantiate a flake configuration"
exit 1
fi
setConfigFile
setHomeManagerNixPath
local extraArgs=()
for p in "${EXTRA_NIX_PATH[@]}"; do
extraArgs=("${extraArgs[@]}" "-I" "$p")
done
if [[ -v VERBOSE ]]; then
extraArgs=("${extraArgs[@]}" "--show-trace")
fi
nix-instantiate \
"<home-manager/home-manager/home-manager.nix>" \
"${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}" \
--argstr confPath "$HOME_MANAGER_CONFIG" \
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
}
function doBuildAttr() {
setConfigFile
setHomeManagerNixPath
local extraArgs="$*"
local extraArgs=("$@")
for p in "${EXTRA_NIX_PATH[@]}"; do
extraArgs="$extraArgs -I $p"
extraArgs=("${extraArgs[@]}" "-I" "$p")
done
if [[ -v VERBOSE ]]; then
extraArgs="$extraArgs --show-trace"
extraArgs=("${extraArgs[@]}" "--show-trace")
fi
# shellcheck disable=2086
nix-build \
"<home-manager/home-manager/home-manager.nix>" \
$extraArgs \
"${extraArgs[@]}" \
"${PASSTHROUGH_OPTS[@]}" \
--argstr confPath "$HOME_MANAGER_CONFIG" \
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
}
@@ -115,17 +225,46 @@ function presentNews() {
fi
}
function doEdit() {
if [[ ! -v EDITOR || -z $EDITOR ]]; then
errorEcho "Please set the \$EDITOR environment variable"
return 1
fi
setConfigFile
# Don't quote $EDITOR in order to support values including options, e.g.,
# "code --wait".
#
# shellcheck disable=2086
exec $EDITOR "$HOME_MANAGER_CONFIG"
}
function doBuild() {
if [[ ! -w . ]]; then
errorEcho "Cannot run build in read-only directory";
return 1
fi
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
local exitCode=0
nix build \
"${PASSTHROUGH_OPTS[@]}" \
${DRY_RUN+--dry-run} \
"$FLAKE_CONFIG_URI.activationPackage" \
|| exitCode=1
return $exitCode
fi
setWorkDir
local newsInfo
newsInfo=$(buildNews)
local exitCode
doBuildAttr -A activationPackage \
doBuildAttr --attr activationPackage \
&& exitCode=0 || exitCode=1
presentNews "$newsInfo"
@@ -134,24 +273,34 @@ function doBuild() {
}
function doSwitch() {
setFlakeAttribute
if [[ -v FLAKE_CONFIG_URI ]]; then
local exitCode=0
nix run \
"${PASSTHROUGH_OPTS[@]}" \
"$FLAKE_CONFIG_URI.activationPackage" \
|| exitCode=1
return $exitCode
fi
setWorkDir
local newsInfo
newsInfo=$(buildNews)
local generation
local exitCode=0
local wrkdir
# Build the generation and run the activate script. Note, we
# specify an output link so that it is treated as a GC root. This
# prevents an unfortunately timed GC from removing the generation
# before activation completes.
wrkdir="$(mktemp -d)"
generation=$(doBuildAttr -o "$wrkdir/result" -A activationPackage) \
&& $generation/activate || exitCode=1
generation="$WORK_DIR/generation"
# Because the previous command never fails, the script keeps
# running and $wrkdir is always removed.
rm -r "$wrkdir"
doBuildAttr \
--out-link "$generation" \
--attr activationPackage \
&& "$generation/activate" || exitCode=1
presentNews "$newsInfo"
@@ -161,11 +310,11 @@ function doSwitch() {
function doListGens() {
# Whether to colorize the generations output.
local color="never"
if [[ -t 1 ]]; then
if [[ ! -v NO_COLOR && -t 1 ]]; then
color="always"
fi
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
pushd "$NIX_STATE_DIR/profiles/per-user/$USER" > /dev/null
# shellcheck disable=2012
ls --color=$color -gG --time-style=long-iso --sort time home-manager-*-link \
| cut -d' ' -f 4- \
@@ -176,19 +325,9 @@ function doListGens() {
# Removes linked generations. Takes as arguments identifiers of
# generations to remove.
function doRmGenerations() {
if [[ -v VERBOSE ]]; then
export VERBOSE_ARG="--verbose"
else
export VERBOSE_ARG=""
fi
setVerboseAndDryRun
if [[ -v DRY_RUN ]] ; then
export DRY_RUN_CMD=echo
else
export DRY_RUN_CMD=""
fi
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
pushd "$NIX_STATE_DIR/profiles/per-user/$USER" > /dev/null
for generationId in "$@"; do
local linkName="home-manager-$generationId-link"
@@ -206,6 +345,28 @@ function doRmGenerations() {
popd > /dev/null
}
function doRmAllGenerations() {
$DRY_RUN_CMD rm $VERBOSE_ARG \
"$NIX_STATE_DIR/profiles/per-user/$USER/home-manager"*
}
function doExpireGenerations() {
local profileDir="$NIX_STATE_DIR/profiles/per-user/$USER"
local generations
generations="$( \
find "$profileDir" -name 'home-manager-*-link' -not -newermt "$1" \
| sed 's/^.*-\([0-9]*\)-link$/\1/' \
)"
if [[ -n $generations ]]; then
# shellcheck disable=2086
doRmGenerations $generations
elif [[ -v VERBOSE ]]; then
echo "No generations to expire"
fi
}
function doListPackages() {
local outPath
outPath="$(nix-env -q --out-path | grep -o '/.*home-manager-path$')"
@@ -233,18 +394,27 @@ function newsReadIdsFile() {
# Builds news meta information to be sourced into this script.
#
# Note, we suppress build output to remove unnecessary verbosity. We
# also use "no out link" to avoid the need for a build directory
# (although this exposes the risk of GC removing the result before we
# manage to source it).
# put the output in the work directory to avoid the risk of an
# unfortunately timed GC removing it.
function buildNews() {
doBuildAttr --quiet \
--attr newsInfo \
--no-out-link \
local output
output="$WORK_DIR/news-info.sh"
doBuildAttr \
--out-link "$output" \
--no-build-output \
--quiet \
--arg check false \
--argstr newsReadIdsFile "$(newsReadIdsFile)"
--argstr newsReadIdsFile "$(newsReadIdsFile)" \
--attr newsInfo \
> /dev/null
echo "$output"
}
function doShowNews() {
setWorkDir
local infoFile
infoFile=$(buildNews) || return 1
@@ -272,26 +442,98 @@ function doShowNews() {
fi
}
function doUninstall() {
setVerboseAndDryRun
echo "This will remove Home Manager from your system."
if [[ -v DRY_RUN ]]; then
echo "This is a dry run, nothing will actually be uninstalled."
fi
local confirmation
read -r -n 1 -p "Really uninstall Home Manager? [y/n] " confirmation
echo
case $confirmation in
y|Y)
echo "Switching to empty Home Manager configuration..."
HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)"
echo "{ lib, ... }: { home.file = lib.mkForce {}; }" > "$HOME_MANAGER_CONFIG"
doSwitch
$DRY_RUN_CMD nix-env -e home-manager-path || true
rm "$HOME_MANAGER_CONFIG"
$DRY_RUN_CMD rm $VERBOSE_ARG -r \
"${XDG_DATA_HOME:-$HOME/.local/share}/home-manager"
$DRY_RUN_CMD rm $VERBOSE_ARG \
"$NIX_STATE_DIR/gcroots/per-user/$USER/current-home"
;;
*)
echo "Yay!"
exit 0
;;
esac
local deleteProfiles
read -r -n 1 \
-p 'Remove all Home Manager generations? [y/n] ' \
deleteProfiles
echo
case $deleteProfiles in
y|Y)
doRmAllGenerations
echo "All generations are now eligible for garbage collection."
;;
*)
echo "Leaving generations but they may still be garbage collected."
;;
esac
echo "Home Manager is uninstalled but your home.nix is left untouched."
}
function doHelp() {
echo "Usage: $0 [OPTION] COMMAND"
echo
echo "Options"
echo
echo " -f FILE The home configuration file."
echo " Default is '~/.config/nixpkgs/home.nix'."
echo " -A ATTRIBUTE Optional attribute that selects a configuration"
echo " expression in the configuration file."
echo " -I PATH Add a path to the Nix expression search path."
echo " -v Verbose output"
echo " -n Do a dry run, only prints what actions would be taken"
echo " -h Print this help"
echo " -f FILE The home configuration file."
echo " Default is '~/.config/nixpkgs/home.nix'."
echo " -A ATTRIBUTE Optional attribute that selects a configuration"
echo " expression in the configuration file."
echo " -I PATH Add a path to the Nix expression search path."
echo " --flake flake-uri Use home-manager configuration at flake-uri"
echo " -b EXT Move existing files to new path rather than fail."
echo " -v Verbose output"
echo " -n Do a dry run, only prints what actions would be taken"
echo " -h Print this help"
echo
echo "Options passed on to nix-build(1)"
echo
echo " --arg(str) NAME VALUE Override inputs passed to home-manager.nix"
echo " --cores NUM"
echo " --debug"
echo " --keep-failed"
echo " --keep-going"
echo " -j, --max-jobs NUM"
echo " --option NAME VALUE"
echo " --show-trace"
echo " --(no-)substitute"
echo
echo "Commands"
echo
echo " help Print this help"
echo
echo " edit Open the home configuration in \$EDITOR"
echo
echo " option OPTION.NAME"
echo " Inspect configuration option named OPTION.NAME."
echo
echo " build Build configuration into result directory"
echo
echo " instantiate Instantiate the configuration and print the resulting derivation"
echo
echo " switch Build and activate configuration"
echo
echo " generations List all home environment generations"
@@ -300,67 +542,121 @@ function doHelp() {
echo " Remove indicated generations. Use 'generations' command to"
echo " find suitable generation numbers."
echo
echo " expire-generations TIMESTAMP"
echo " Remove generations older than TIMESTAMP where TIMESTAMP is"
echo " interpreted as in the -d argument of the date tool. For"
echo " example \"-30 days\" or \"2018-01-01\"."
echo
echo " packages List all packages installed in home-manager-path"
echo
echo " news Show news entries in a pager"
echo
echo " uninstall Remove Home Manager"
}
readonly NIX_STATE_DIR="${NIX_STATE_DIR:-/nix/var/nix}"
EXTRA_NIX_PATH=()
HOME_MANAGER_CONFIG_ATTRIBUTE=""
PASSTHROUGH_OPTS=()
COMMAND=""
COMMAND_ARGS=()
FLAKE_ARG=""
# As a special case, if the user has given --help anywhere on the
# command line then print help and exit.
for arg in "$@"; do
if [[ $arg == "--help" ]]; then
doHelp
exit 0
fi
done
while getopts f:I:A:vnh opt; do
while [[ $# -gt 0 ]]; do
opt="$1"
shift
case $opt in
f)
HOME_MANAGER_CONFIG="$OPTARG"
build|instantiate|option|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
COMMAND="$opt"
;;
I)
EXTRA_NIX_PATH+=("$OPTARG")
-A)
HOME_MANAGER_CONFIG_ATTRIBUTE="$1"
shift
;;
A)
HOME_MANAGER_CONFIG_ATTRIBUTE="$OPTARG"
-I)
EXTRA_NIX_PATH+=("$1")
shift
;;
v)
export VERBOSE=1
-b)
export HOME_MANAGER_BACKUP_EXT="$1"
shift
;;
n)
export DRY_RUN=1
-f|--file)
HOME_MANAGER_CONFIG="$1"
shift
;;
h)
--flake)
FLAKE_ARG="$1"
shift
;;
--recreate-lock-file|--no-update-lock-file|--no-write-lock-file|--no-registries|--commit-lock-file)
PASSTHROUGH_OPTS+=("$opt")
;;
--update-input)
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--override-input)
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
shift 2
;;
-h|--help)
doHelp
exit 0
;;
-n|--dry-run)
export DRY_RUN=1
;;
--option|--arg|--argstr)
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
shift 2
;;
-j|--max-jobs|--cores)
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--debug|--keep-failed|--keep-going|--show-trace\
|--substitute|--no-substitute)
PASSTHROUGH_OPTS+=("$opt")
;;
-v|--verbose)
export VERBOSE=1
;;
--version)
echo 21.11
exit 0
;;
*)
errorEcho "Unknown option -$OPTARG"
doHelp >&2
exit 1
case $COMMAND in
expire-generations|remove-generations|option)
COMMAND_ARGS+=("$opt")
;;
*)
errorEcho "$0: unknown option '$opt'"
errorEcho "Run '$0 --help' for usage help"
exit 1
;;
esac
;;
esac
done
# Get rid of the options.
shift "$((OPTIND-1))"
if [[ $# -eq 0 ]]; then
if [[ -z $COMMAND ]]; then
doHelp >&2
exit 1
fi
cmd="$1"
shift 1
case "$cmd" in
case $COMMAND in
edit)
doEdit
;;
build)
doBuild
;;
instantiate)
doInstantiate
;;
switch)
doSwitch
;;
@@ -368,7 +664,18 @@ case "$cmd" in
doListGens
;;
remove-generations)
doRmGenerations "$@"
doRmGenerations "${COMMAND_ARGS[@]}"
;;
expire-generations)
if [[ ${#COMMAND_ARGS[@]} != 1 ]]; then
errorEcho "expire-generations expects one argument, got ${#COMMAND_ARGS[@]}."
exit 1
else
doExpireGenerations "${COMMAND_ARGS[@]}"
fi
;;
option)
doInspectOption "${COMMAND_ARGS[@]}"
;;
packages)
doListPackages
@@ -376,11 +683,14 @@ case "$cmd" in
news)
doShowNews --all
;;
help|--help)
uninstall)
doUninstall
;;
help)
doHelp
;;
*)
errorEcho "Unknown command: $cmd"
errorEcho "Unknown command: $COMMAND"
doHelp >&2
exit 1
;;

View File

@@ -1,6 +1,6 @@
{ pkgs ? import <nixpkgs> {}
, confPath
, confAttr
, confAttr ? null
, check ? true
, newsReadIdsFile ? null
}:
@@ -9,9 +9,9 @@ with pkgs.lib;
let
env = import <home-manager/modules> {
env = import ../modules {
configuration =
if confAttr == ""
if confAttr == "" || confAttr == null
then confPath
else (import confPath).${confAttr};
pkgs = pkgs;

View File

@@ -1,37 +1,84 @@
{ home-manager, pkgs }:
{ home-manager, runCommand }:
pkgs.runCommand
"home-manager-install"
{
propagatedBuildInputs = [ home-manager ];
shellHook = ''
echo
echo "Creating initial Home Manager generation..."
runCommand "home-manager-install" {
propagatedBuildInputs = [ home-manager ];
preferLocalBuild = true;
allowSubstitutes = false;
shellHookOnly = true;
shellHook = ''
confFile="''${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix"
if [[ ! -e $confFile ]]; then
echo
echo "Creating initial Home Manager configuration..."
if home-manager switch; then
cat <<EOF
All done! The home-manager tool should now be installed and you
can edit
''${XDG_CONFIG_HOME:-~/.config}/nixpkgs/home.nix
to configure Home Manager. Run 'man home-configuration.nix' to
see all available options.
EOF
exit 0
else
cat <<EOF
Uh oh, the installation failed! Please create an issue at
https://github.com/rycee/home-manager/issues
if the error seems to be the fault of Home Manager.
EOF
exit 1
nl=$'\n'
xdgVars=""
if [[ -v XDG_CACHE_HOME && $XDG_CACHE_HOME != "$HOME/.cache" ]]; then
xdgVars="$xdgVars xdg.cacheHome = \"$XDG_CACHE_HOME\";$nl"
fi
'';
}
""
if [[ -v XDG_CONFIG_HOME && $XDG_CONFIG_HOME != "$HOME/.config" ]]; then
xdgVars="$xdgVars xdg.configHome = \"$XDG_CONFIG_HOME\";$nl"
fi
if [[ -v XDG_DATA_HOME && $XDG_DATA_HOME != "$HOME/.local/share" ]]; then
xdgVars="$xdgVars xdg.dataHome = \"$XDG_DATA_HOME\";$nl"
fi
mkdir -p "$(dirname "$confFile")"
cat > $confFile <<EOF
{ config, pkgs, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "$USER";
home.homeDirectory = "$HOME";
$xdgVars
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.11";
}
EOF
fi
echo
echo "Creating initial Home Manager generation..."
echo
if home-manager switch; then
cat <<EOF
All done! The home-manager tool should now be installed and you
can edit
$confFile
to configure Home Manager. Run 'man home-configuration.nix' to
see all available options.
EOF
exit 0
else
cat <<EOF
Uh oh, the installation failed! Please create an issue at
https://github.com/nix-community/home-manager/issues
if the error seems to be the fault of Home Manager.
EOF
exit 1
fi
'';
} ''
echo This derivation is not buildable, instead run it using nix-shell.
exit 1
''

399
modules/accounts/email.nix Normal file
View File

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

46
modules/config/i18n.nix Normal file
View File

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

View File

@@ -1,9 +1,11 @@
{ configuration
, pkgs
, lib ? pkgs.stdenv.lib
, lib ? pkgs.lib
# Whether to check that each option has a matching declaration.
, check ? true
# Extra arguments passed to specialArgs.
, extraSpecialArgs ? { }
}:
with lib;
@@ -19,10 +21,19 @@ let
in
fold f res res.config.warnings;
rawModule = lib.evalModules {
modules =
[ configuration ]
++ (import ./modules.nix { inherit check lib pkgs; });
extendedLib = import ./lib/stdlib-extended.nix pkgs.lib;
hmModules =
import ./modules.nix {
inherit check pkgs;
lib = extendedLib;
};
rawModule = extendedLib.evalModules {
modules = [ configuration ] ++ hmModules;
specialArgs = {
modulesPath = builtins.toString ./.;
} // extraSpecialArgs;
};
module = showWarnings (

View File

@@ -6,17 +6,20 @@ let
cfg = config.home.file;
dag = config.lib.dag;
homeDirectory = config.home.homeDirectory;
fileType = (import lib/file-type.nix {
inherit homeDirectory lib pkgs;
}).fileType;
# A symbolic link whose target path matches this pattern will be
# considered part of a Home Manager generation.
homeFilePattern = "${builtins.storeDir}/*-home-manager-files/*";
sourceStorePath = file:
let
sourcePath = toString file.source;
sourceName = config.lib.strings.storeFileName (baseNameOf sourcePath);
in
if builtins.hasContext sourcePath
then file.source
else builtins.path { path = file.source; name = sourceName; };
in
@@ -36,41 +39,91 @@ in
};
config = {
assertions = [
(let
badFiles =
filter (f: hasPrefix "." (baseNameOf f))
(map (v: toString v.source)
(attrValues cfg));
badFilesStr = toString badFiles;
in
{
assertion = badFiles == [];
message = "Source file names must not start with '.': ${badFilesStr}";
})
assertions = [(
let
dups =
attrNames
(filterAttrs (n: v: v > 1)
(foldAttrs (acc: v: acc + v) 0
(mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)));
dupsStr = concatStringsSep ", " dups;
in {
assertion = dups == [];
message = ''
Conflicting managed target files: ${dupsStr}
This may happen, for example, if you have a configuration similar to
home.file = {
conflict1 = { source = ./foo.nix; target = "baz"; };
conflict2 = { source = ./bar.nix; target = "baz"; };
}'';
})
];
lib.file.mkOutOfStoreSymlink = path:
let
pathStr = toString path;
name = hm.strings.storeFileName (baseNameOf pathStr);
in
pkgs.runCommandLocal name {} ''ln -s ${escapeShellArg pathStr} $out'';
# This verifies that the links we are about to create will not
# overwrite an existing file.
home.activation.checkLinkTargets = dag.entryBefore ["writeBoundary"] (
home.activation.checkLinkTargets = hm.dag.entryBefore ["writeBoundary"] (
let
# Paths that should be forcibly overwritten by Home Manager.
# Caveat emptor!
forcedPaths =
concatMapStringsSep " " (p: ''"$HOME"/${escapeShellArg p}'')
(mapAttrsToList (n: v: v.target)
(filterAttrs (n: v: v.force) cfg));
check = pkgs.writeText "check" ''
. ${./lib-bash/color-echo.sh}
# A symbolic link whose target path matches this pattern will be
# considered part of a Home Manager generation.
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
forcedPaths=(${forcedPaths})
newGenFiles="$1"
shift
for sourcePath in "$@" ; do
relativePath="''${sourcePath#$newGenFiles/}"
targetPath="$HOME/$relativePath"
if [[ -e "$targetPath" \
&& ! "$(readlink "$targetPath")" == ${homeFilePattern} ]] ; then
errorEcho "Existing file '$targetPath' is in the way"
collision=1
forced=""
for forcedPath in "''${forcedPaths[@]}"; do
if [[ $targetPath == $forcedPath* ]]; then
forced="yeah"
break
fi
done
if [[ -n $forced ]]; then
$VERBOSE_ECHO "Skipping collision check for $targetPath"
elif [[ -e "$targetPath" \
&& ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
if [[ ! -L "$targetPath" \
&& -v HOME_MANAGER_BACKUP_EXT && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
if [[ -e "$backup" ]]; then
errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'"
collision=1
else
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be moved to '$backup'"
fi
else
errorEcho "Existing file '$targetPath' is in the way of '$sourcePath'"
collision=1
fi
fi
done
if [[ -v collision ]] ; then
errorEcho "Please move the above files and try again"
errorEcho "Please move the above files and try again or use -b <ext> to move automatically."
exit 1
fi
'';
@@ -79,8 +132,8 @@ in
function checkNewGenCollision() {
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
find "$newGenFiles" -type f -print0 -or -type l -print0 \
| xargs -0 bash ${check} "$newGenFiles"
find "$newGenFiles" \( -type f -or -type l \) \
-exec bash ${check} "$newGenFiles" {} +
}
checkNewGenCollision || exit 1
@@ -108,117 +161,170 @@ in
# and a failure during the intermediate state FA ∩ FB will not
# result in lost links because this set of links are in both the
# source and target generation.
home.activation.linkGeneration = dag.entryAfter ["writeBoundary"] (
let
link = pkgs.writeText "link" ''
newGenFiles="$1"
shift
for sourcePath in "$@" ; do
relativePath="''${sourcePath#$newGenFiles/}"
targetPath="$HOME/$relativePath"
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
done
'';
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (''
function clean() {
# A symbolic link whose target path matches this pattern will be
# considered part of a Home Manager generation.
local homeFilePattern
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
cleanup = pkgs.writeText "cleanup" ''
. ${./lib-bash/color-echo.sh}
local newGenFiles="$1"
local relativePath="$2"
local targetPath="$HOME/$relativePath"
if [[ -e "$newGenFiles/$relativePath" ]] ; then
$VERBOSE_ECHO "Checking $targetPath: exists"
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete."
else
$VERBOSE_ECHO "Checking $targetPath: gone (deleting)"
$DRY_RUN_CMD rm $VERBOSE_ARG "$targetPath"
newGenFiles="$1"
shift 1
for relativePath in "$@" ; do
targetPath="$HOME/$relativePath"
if [[ -e "$newGenFiles/$relativePath" ]] ; then
$VERBOSE_ECHO "Checking $targetPath: exists"
elif [[ ! "$(readlink "$targetPath")" == ${homeFilePattern} ]] ; then
warnEcho "Path '$targetPath' not link into Home Manager generation. Skipping delete."
else
$VERBOSE_ECHO "Checking $targetPath: gone (deleting)"
$DRY_RUN_CMD rm $VERBOSE_ARG "$targetPath"
# Recursively delete empty parent directories.
targetDir="$(dirname "$relativePath")"
if [[ "$targetDir" != "." ]] ; then
pushd "$HOME" > /dev/null
# Recursively delete empty parent directories.
targetDir="$(dirname "$relativePath")"
if [[ "$targetDir" != "." ]] ; then
pushd "$HOME" > /dev/null
# Call rmdir with a relative path excluding $HOME.
# Otherwise, it might try to delete $HOME and exit
# with a permission error.
$DRY_RUN_CMD rmdir $VERBOSE_ARG \
-p --ignore-fail-on-non-empty \
"$targetDir"
# Call rmdir with a relative path excluding $HOME.
# Otherwise, it might try to delete $HOME and exit
# with a permission error.
$DRY_RUN_CMD rmdir $VERBOSE_ARG \
-p --ignore-fail-on-non-empty \
"$targetDir"
popd > /dev/null
fi
fi
done
'';
in
''
function linkNewGen() {
echo "Creating home file links in $HOME"
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
find "$newGenFiles" -type f -print0 -or -type l -print0 \
| xargs -0 bash ${link} "$newGenFiles"
}
function cleanOldGen() {
if [[ ! -v oldGenPath ]] ; then
return
fi
echo "Cleaning up orphan links from $HOME"
local newGenFiles oldGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
# Apply the cleanup script on each leaf in the old
# generation. The find command below will print the
# relative path of the entry.
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
| xargs -0 bash ${cleanup} "$newGenFiles"
}
cleanOldGen
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
echo "Creating profile generation $newGenNum"
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenProfilePath"
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG $(basename "$newGenProfilePath") "$genProfilePath"
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenGcPath"
else
echo "No change so reusing latest profile generation $oldGenNum"
popd > /dev/null
fi
fi
}
linkNewGen
''
function cleanOldGen() {
if [[ ! -v oldGenPath ]] ; then
return
fi
echo "Cleaning up orphan links from $HOME"
local newGenFiles oldGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
# Apply the cleanup script on each leaf in the old
# generation. The find command below will print the
# relative path of the entry.
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
| while IFS= read -r -d "" relativePath ; do \
clean "$newGenFiles" "$relativePath"; \
done
}
function link() {
local newGenFiles="$1"
local sourcePath="$2"
local relativePath="''${sourcePath#$newGenFiles/}"
local targetPath="$HOME/$relativePath"
if [[ -e "$targetPath" && ! -L "$targetPath" \
&& -v HOME_MANAGER_BACKUP_EXT && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
local backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
$DRY_RUN_CMD mv $VERBOSE_ARG "$targetPath" "$backup" \
|| errorEcho "Moving '$targetPath' failed!"
fi
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
}
function linkNewGen() {
echo "Creating home file links in $HOME"
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
find "$newGenFiles" \( -type f -or -type l \) -print0 \
| while IFS= read -r -d "" sourcePath ; do \
link "$newGenFiles" "$sourcePath"; \
done
}
cleanOldGen
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
echo "Creating profile generation $newGenNum"
$DRY_RUN_CMD nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath"
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenGcPath"
else
echo "No change so reusing latest profile generation $oldGenNum"
fi
linkNewGen
unset -f clean cleanOldGen link linkNewGen
'');
home.activation.checkFilesChanged = hm.dag.entryBefore ["linkGeneration"] (
let
homeDirArg = escapeShellArg homeDirectory;
in ''
function _cmp() {
if [[ -d $1 && -d $2 ]]; then
diff -rq "$1" "$2" &> /dev/null
else
cmp --quiet "$1" "$2"
fi
}
declare -A changedFiles
'' + concatMapStrings (v:
let
sourceArg = escapeShellArg (sourceStorePath v);
targetArg = escapeShellArg v.target;
in ''
_cmp ${sourceArg} ${homeDirArg}/${targetArg} \
&& changedFiles[${targetArg}]=0 \
|| changedFiles[${targetArg}]=1
'') (filter (v: v.onChange != "") (attrValues cfg))
+ ''
unset -f _cmp
''
);
home-files = pkgs.stdenv.mkDerivation {
name = "home-manager-files";
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (
concatMapStrings (v: ''
if [[ ''${changedFiles[${escapeShellArg v.target}]} -eq 1 ]]; then
${v.onChange}
fi
'') (filter (v: v.onChange != "") (attrValues cfg))
);
nativeBuildInputs = [ pkgs.xlibs.lndir ];
# Symlink directories and files that have the right execute bit.
# Copy files that need their execute bit changed.
buildCommand = ''
# Symlink directories and files that have the right execute bit.
# Copy files that need their execute bit changed.
home-files = pkgs.runCommandLocal
"home-manager-files"
{
nativeBuildInputs = [ pkgs.xorg.lndir ];
}
(''
mkdir -p $out
# Needed in case /nix is a symbolic link.
realOut="$(realpath -m "$out")"
function insertFile() {
local source="$1"
local relTarget="$2"
local executable="$3"
local recursive="$4"
# If the target already exists then we have a collision. Note, this
# should not happen due to the assertion found in the 'files' module.
# We therefore simply log the conflict and otherwise ignore it, mainly
# to make the `files-target-config` test work as expected.
if [[ -e "$realOut/$relTarget" ]]; then
echo "File conflict for file '$relTarget'" >&2
return
fi
# Figure out the real absolute path to the target.
local target
target="$(realpath -m "$out/$relTarget")"
target="$(realpath -m "$realOut/$relTarget")"
# Target path must be within $HOME.
if [[ ! $target == $out* ]] ; then
if [[ ! $target == $realOut* ]] ; then
echo "Error installing file '$relTarget' outside \$HOME" >&2
exit 1
fi
@@ -256,14 +362,16 @@ in
}
'' + concatStrings (
mapAttrsToList (n: v: ''
insertFile "${v.source}" \
"${v.target}" \
"${if v.executable == null
then "inherit"
else builtins.toString v.executable}" \
"${builtins.toString v.recursive}"
insertFile ${
escapeShellArgs [
(sourceStorePath v)
v.target
(if v.executable == null
then "inherit"
else toString v.executable)
(toString v.recursive)
]}
'') cfg
);
};
));
};
}

View File

@@ -6,8 +6,6 @@ let
cfg = config.home;
dag = config.lib.dag;
languageSubModule = types.submodule {
options = {
base = mkOption {
@@ -18,11 +16,35 @@ let
'';
};
address = mkOption {
ctype = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for addresses.
Character classification category.
'';
};
numeric = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for numerical values.
'';
};
time = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for formatting times.
'';
};
collate = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for collation (alphabetical ordering).
'';
};
@@ -34,6 +56,14 @@ let
'';
};
messages = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for messages, application UI languages, etc.
'';
};
paper = mkOption {
default = null;
type = types.nullOr types.str;
@@ -42,29 +72,62 @@ let
'';
};
time = mkOption {
name = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for formatting times.
The language to use for personal names.
'';
};
address = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for addresses.
'';
};
telephone = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for telephone numbers.
'';
};
measurement = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The language to use for measurement values.
'';
};
};
};
keyboardSubModule = types.submodule {
options = {
layout = mkOption {
type = types.str;
default = "us";
type = with types; nullOr str;
default =
if versionAtLeast config.home.stateVersion "19.09"
then null
else "us";
defaultText = literalExample "null";
description = ''
Keyboard layout.
Keyboard layout. If <literal>null</literal>, then the system
configuration will be used.
</para><para>
This defaults to <literal>null</literal> for state
version  19.09 and <literal>"us"</literal> otherwise.
'';
};
model = mkOption {
type = types.str;
default = "pc104";
type = with types; nullOr str;
default = null;
example = "presario";
description = ''
Keyboard model.
@@ -81,11 +144,19 @@ let
};
variant = mkOption {
type = types.str;
default = "";
type = with types; nullOr str;
default =
if versionAtLeast config.home.stateVersion "19.09"
then null
else "";
defaultText = literalExample "null";
example = "colemak";
description = ''
X keyboard variant.
X keyboard variant. If <literal>null</literal>, then the
system configuration will be used.
</para><para>
This defaults to <literal>null</literal> for state
version  19.09 and <literal>""</literal> otherwise.
'';
};
};
@@ -111,14 +182,34 @@ in
options = {
home.username = mkOption {
type = types.str;
defaultText = "$USER";
defaultText = literalExample ''
"$USER" for state version < 20.09,
undefined for state version 20.09
'';
example = "jane.doe";
description = "The user's username.";
};
home.homeDirectory = mkOption {
type = types.path;
defaultText = "$HOME";
description = "The user's home directory.";
defaultText = literalExample ''
"$HOME" for state version < 20.09,
undefined for state version 20.09
'';
apply = toString;
example = "/home/jane.doe";
description = "The user's home directory. Must be an absolute path.";
};
home.profileDirectory = mkOption {
type = types.path;
defaultText = "~/.nix-profile";
internal = true;
readOnly = true;
description = ''
The profile directory where Home Manager generations are
installed.
'';
};
home.language = mkOption {
@@ -128,9 +219,12 @@ in
};
home.keyboard = mkOption {
type = keyboardSubModule;
type = types.nullOr keyboardSubModule;
default = {};
description = "Keyboard configuration.";
description = ''
Keyboard configuration. Set to <literal>null</literal> to
disable Home Manager keyboard management.
'';
};
home.sessionVariables = mkOption {
@@ -152,24 +246,45 @@ in
Note, these variables may be set in any order so no session
variable may have a runtime dependency on another session
variable. In particular code like
<programlisting>
home.sessionVariables = {
FOO = "Hello";
BAR = "$FOO World!";
};
<programlisting language="nix">
home.sessionVariables = {
FOO = "Hello";
BAR = "$FOO World!";
};
</programlisting>
may not work as expected. If you need to reference another
session variable, then do so inside Nix instead. The above
example then becomes
<programlisting>
home.sessionVariables = {
FOO = "Hello";
BAR = "''${config.home.sessionVariables.FOO} World!";
};
<programlisting language="nix">
home.sessionVariables = {
FOO = "Hello";
BAR = "''${config.home.sessionVariables.FOO} World!";
};
</programlisting>
'';
};
home.sessionPath = mkOption {
type = with types; listOf str;
default = [ ];
example = [
".git/safe/../../bin"
"\${xdg.configHome}/emacs/bin"
"~/.local/bin"
];
description = "Extra directories to add to <envar>PATH</envar>.";
};
home.sessionVariablesExtra = mkOption {
type = types.lines;
default = "";
internal = true;
description = ''
Extra configuration to add to the
<filename>hm-session-vars.sh</filename> file.
'';
};
home.packages = mkOption {
type = types.listOf types.package;
default = [];
@@ -198,23 +313,57 @@ in
type = types.bool;
description = ''
Whether the activation script should start with an empty
<envvar>PATH</envvar> variable. When <literal>false</literal>
then the user's <envvar>PATH</envvar> will be used.
<envar>PATH</envar> variable. When <literal>false</literal>
then the user's <envar>PATH</envar> will be used.
'';
};
home.activation = mkOption {
internal = true;
type = hm.types.dagOf types.str;
default = {};
type = types.attrs;
example = literalExample ''
{
myActivationAction = lib.hm.dag.entryAfter ["writeBoundary"] '''
$DRY_RUN_CMD ln -s $VERBOSE_ARG \
''${builtins.toPath ./link-me-directly} $HOME
''';
}
'';
description = ''
Activation scripts for the home environment.
The activation scripts blocks to run when activating a Home
Manager generation. Any entry here should be idempotent,
meaning running twice or more times produces the same result
as running it once.
</para><para>
Any script should respect the <varname>DRY_RUN</varname>
variable, if it is set then no actual action should be taken.
If the script block produces any observable side effect, such
as writing or deleting files, then it
<emphasis>must</emphasis> be placed after the special
<literal>writeBoundary</literal> script block. Prior to the
write boundary one can place script blocks that verifies, but
does not modify, the state of the system and exits if an
unexpected state is found. For example, the
<literal>checkLinkTargets</literal> script block checks for
collisions between non-managed files and files defined in
<varname><link linkend="opt-home.file">home.file</link></varname>.
</para><para>
A script block should respect the <varname>DRY_RUN</varname>
variable, if it is set then the actions taken by the script
should be logged to standard out and not actually performed.
The variable <varname>DRY_RUN_CMD</varname> is set to
<code>echo</code> if dry run is enabled. Thus, many cases you
can use the idiom <code>$DRY_RUN_CMD rm -rf /</code>.
<command>echo</command> if dry run is enabled.
</para><para>
A script block should also respect the
<varname>VERBOSE</varname> variable, and if set print
information on standard out that may be useful for debugging
any issue that may arise. The variable
<varname>VERBOSE_ARG</varname> is set to
<option>--verbose</option> if verbose output is enabled.
'';
};
@@ -224,6 +373,16 @@ in
description = "The package containing the complete activation script.";
};
home.extraActivationPath = mkOption {
internal = true;
type = types.listOf types.package;
default = [ ];
description = ''
Extra packages to add to <envar>PATH</envar> within the activation
script.
'';
};
home.extraBuilderCommands = mkOption {
type = types.lines;
default = "";
@@ -232,6 +391,30 @@ in
Extra commands to run in the Home Manager generation builder.
'';
};
home.extraProfileCommands = mkOption {
type = types.lines;
default = "";
internal = true;
description = ''
Extra commands to run in the Home Manager profile builder.
'';
};
home.enableNixpkgsReleaseCheck = mkOption {
type = types.bool;
default = true;
description = ''
Determines whether to check for release version mismatch between Home
Manager and Nixpkgs. Using mismatched versions is likely to cause errors
and unexpected behavior. It is therefore highly recommended to use a
release of Home Manager than corresponds with your chosen release of
Nixpkgs.
</para><para>
When this option is enabled and a mismatch is detected then a warning
will be printed when the user configuration is being built.
'';
};
};
config = {
@@ -246,8 +429,43 @@ in
}
];
home.username = mkDefault (builtins.getEnv "USER");
home.homeDirectory = mkDefault (builtins.getEnv "HOME");
warnings =
let
hmRelease = fileContents ../.release;
nixpkgsRelease = pkgs.lib.trivial.release;
releaseMismatch =
config.home.enableNixpkgsReleaseCheck
&& hmRelease != nixpkgsRelease;
in
optional releaseMismatch ''
You are using
Home Manager version ${hmRelease} and
Nixpkgs version ${nixpkgsRelease}.
Using mismatched versions is likely to cause errors and unexpected
behavior. It is therefore highly recommended to use a release of Home
Manager than corresponds with your chosen release of Nixpkgs.
If you insist then you can disable this warning by adding
home.enableNixpkgsReleaseCheck = false;
to your configuration.
'';
home.username =
mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "USER"));
home.homeDirectory =
mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "HOME"));
home.profileDirectory =
if config.submoduleSupport.enable
&& config.submoduleSupport.externalPackageInstall
then "/etc/profiles/per-user/${cfg.username}"
else cfg.homeDirectory + "/.nix-profile";
home.sessionVariables =
let
@@ -255,13 +473,27 @@ in
in
(maybeSet "LANG" cfg.language.base)
//
(maybeSet "LC_ADDRESS" cfg.language.address)
(maybeSet "LC_CTYPE" cfg.language.ctype)
//
(maybeSet "LC_NUMERIC" cfg.language.numeric)
//
(maybeSet "LC_TIME" cfg.language.time)
//
(maybeSet "LC_COLLATE" cfg.language.collate)
//
(maybeSet "LC_MONETARY" cfg.language.monetary)
//
(maybeSet "LC_MESSAGES" cfg.language.messages)
//
(maybeSet "LC_PAPER" cfg.language.paper)
//
(maybeSet "LC_TIME" cfg.language.time);
(maybeSet "LC_NAME" cfg.language.name)
//
(maybeSet "LC_ADDRESS" cfg.language.address)
//
(maybeSet "LC_TELEPHONE" cfg.language.telephone)
//
(maybeSet "LC_MEASUREMENT" cfg.language.measurement);
home.packages = [
# Provide a file holding all session variables.
@@ -275,19 +507,62 @@ in
export __HM_SESS_VARS_SOURCED=1
${config.lib.shell.exportAll cfg.sessionVariables}
'';
'' + lib.optionalString (cfg.sessionPath != [ ]) ''
export PATH="$PATH''${PATH:+:}${concatStringsSep ":" cfg.sessionPath}"
'' + cfg.sessionVariablesExtra;
}
)
];
# A dummy entry acting as a boundary between the activation
# script's "check" and the "write" phases.
home.activation.writeBoundary = dag.entryAnywhere "";
home.activation.writeBoundary = hm.dag.entryAnywhere "";
# Install packages to the user environment.
home.activation.installPackages = dag.entryAfter ["writeBoundary"] ''
$DRY_RUN_CMD nix-env -i ${cfg.path}
'';
#
# Note, sometimes our target may not allow modification of the Nix
# store and then we cannot rely on `nix-env -i`. This is the case,
# for example, if we are running as a NixOS module and building a
# virtual machine. Then we must instead rely on an external
# mechanism for installing packages, which in NixOS is provided by
# the `users.users.<name?>.packages` option. The activation
# command is still needed since some modules need to run their
# activation commands after the packages are guaranteed to be
# installed.
#
# In case the user has moved from a user-install of Home Manager
# to a submodule managed one we attempt to uninstall the
# `home-manager-path` package if it is installed.
home.activation.installPackages = hm.dag.entryAfter ["writeBoundary"] (
if config.submoduleSupport.externalPackageInstall
then
''
if nix-env -q | grep '^home-manager-path$'; then
$DRY_RUN_CMD nix-env -e home-manager-path
fi
''
else
''
if ! $DRY_RUN_CMD nix-env -i ${cfg.path} ; then
cat <<EOF
Oops, nix-env failed to install your new Home Manager profile!
Perhaps there is a conflict with a package that was installed using
'nix-env -i'? Try running
nix-env -q
and if there is a conflicting package you can remove it with
nix-env -e {package name}
Then try activating your Home Manager configuration again.
EOF
exit 1
fi
''
);
home.activationPackage =
let
@@ -295,7 +570,7 @@ in
noteEcho Activating ${res.name}
${res.data}
'';
sortedCommands = dag.topoSort cfg.activation;
sortedCommands = hm.dag.topoSort cfg.activation;
activationCmds =
if sortedCommands ? result then
concatStringsSep "\n" (map mkCmd sortedCommands.result)
@@ -305,20 +580,20 @@ in
# Programs that always should be available on the activation
# script's PATH.
activationBinPaths = lib.makeBinPath [
pkgs.bash
pkgs.coreutils
pkgs.diffutils # For `cmp` and `diff`.
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
pkgs.ncurses # For `tput`.
]
activationBinPaths = lib.makeBinPath (
[
pkgs.bash
pkgs.coreutils
pkgs.diffutils # For `cmp` and `diff`.
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
pkgs.ncurses # For `tput`.
] ++ config.home.extraActivationPath
)
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
activationScript = pkgs.writeScript "activation-script" ''
#!${pkgs.stdenv.shell}
activationScript = pkgs.writeShellScript "activation-script" ''
set -eu
set -o pipefail
@@ -333,14 +608,20 @@ in
${activationCmds}
'';
in
pkgs.stdenv.mkDerivation {
name = "home-manager-generation";
buildCommand = ''
pkgs.runCommand
"home-manager-generation"
{
preferLocalBuild = true;
allowSubstitutes = false;
}
''
mkdir -p $out
cp ${activationScript} $out/activate
mkdir $out/bin
ln -s $out/activate $out/bin/home-manager-generation
substituteInPlace $out/activate \
--subst-var-by GENERATION_DIR $out
@@ -349,7 +630,6 @@ in
${cfg.extraBuilderCommands}
'';
};
home.path = pkgs.buildEnv {
name = "home-manager-path";
@@ -357,6 +637,8 @@ in
paths = cfg.packages;
inherit (cfg) extraOutputsToInstall;
postBuild = cfg.extraProfileCommands;
meta = {
description = "Environment of packages installed through home-manager";
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,15 +1,19 @@
#!/usr/bin/env bash
function setupVars() {
local profilesPath="/nix/var/nix/profiles/per-user/$USER"
local gcPath="/nix/var/nix/gcroots/per-user/$USER"
local greatestGenNum
local nixStateDir="${NIX_STATE_DIR:-/nix/var/nix}"
local profilesPath="$nixStateDir/profiles/per-user/$USER"
local gcPath="$nixStateDir/gcroots/per-user/$USER"
genProfilePath="$profilesPath/home-manager"
newGenPath="@GENERATION_DIR@";
newGenGcPath="$gcPath/current-home"
local greatestGenNum
greatestGenNum=$( \
find "$profilesPath" -name 'home-manager-*-link' \
| sed 's/^.*-\([0-9]*\)-link$/\1/' \
| sort -rn \
| head -1)
nix-env --list-generations --profile "$genProfilePath" \
| tail -1 \
| sed -E 's/ *([[:digit:]]+) .*/\1/')
if [[ -n $greatestGenNum ]] ; then
oldGenNum=$greatestGenNum
@@ -18,15 +22,15 @@ function setupVars() {
newGenNum=1
fi
if [[ -e $gcPath/current-home ]] ; then
oldGenPath="$(readlink -e "$gcPath/current-home")"
if [[ -e $profilesPath/home-manager ]] ; then
oldGenPath="$(readlink -e "$profilesPath/home-manager")"
fi
$VERBOSE_ECHO "Sanity checking oldGenNum and oldGenPath"
if [[ -v oldGenNum && ! -v oldGenPath
|| ! -v oldGenNum && -v oldGenPath ]]; then
errorEcho "Invalid profile number and GC root values! These must be"
errorEcho "either both empty or both set but are now set to"
errorEcho "Invalid profile number and current profile values! These"
errorEcho "must be either both empty or both set but are now set to"
errorEcho " '${oldGenNum:-}' and '${oldGenPath:-}'"
errorEcho "If you don't mind losing previous profile generations then"
errorEcho "the easiest solution is probably to run"
@@ -35,12 +39,6 @@ function setupVars() {
errorEcho "and trying home-manager switch again. Good luck!"
exit 1
fi
genProfilePath="$profilesPath/home-manager"
newGenPath="@GENERATION_DIR@";
newGenProfilePath="$profilesPath/home-manager-$newGenNum-link"
newGenGcPath="$gcPath/current-home"
}
if [[ -v VERBOSE ]]; then
@@ -53,6 +51,11 @@ fi
echo "Starting home manager activation"
# Verify that we can connect to the Nix store and/or daemon. This will
# also create the necessary directories in profiles and gcroots.
$VERBOSE_ECHO "Sanity checking Nix"
nix-build --expr '{}' --no-out-link
setupVars
if [[ -v DRY_RUN ]] ; then
@@ -78,6 +81,5 @@ else
fi
$VERBOSE_ECHO " newGenPath=$newGenPath"
$VERBOSE_ECHO " newGenNum=$newGenNum"
$VERBOSE_ECHO " newGenProfilePath=$newGenProfilePath"
$VERBOSE_ECHO " newGenGcPath=$newGenGcPath"
$VERBOSE_ECHO " genProfilePath=$genProfilePath"

View File

@@ -1,5 +1,7 @@
# The check for terminal output and color support is heavily inspired
# by https://unix.stackexchange.com/a/10065.
#
# Allow opt out by respecting the `NO_COLOR` environment variable.
function setupColors() {
normalColor=""
@@ -7,8 +9,8 @@ function setupColors() {
warnColor=""
noteColor=""
# Check if stdout is a terminal.
if [[ -t 1 ]]; then
# Enable colors for terminals, and allow opting out.
if [[ ! -v NO_COLOR && -t 1 ]]; then
# See if it supports colors.
local ncolors
ncolors=$(tput colors)

View File

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

View File

@@ -13,13 +13,11 @@ with lib;
rec {
emptyDag = {};
emptyDag = { };
isDag = dag:
let
isEntry = e: (e ? data) && (e ? after) && (e ? before);
in
builtins.isAttrs dag && all (x: x) (mapAttrsToList (n: isEntry) dag);
let isEntry = e: (e ? data) && (e ? after) && (e ? before);
in builtins.isAttrs dag && all (x: x) (mapAttrsToList (n: isEntry) dag);
# Takes an attribute set containing entries built by
# dagEntryAnywhere, dagEntryAfter, and dagEntryBefore to a
@@ -80,22 +78,19 @@ rec {
dagTopoSort = dag:
let
dagBefore = dag: name:
mapAttrsToList (n: v: n) (
filterAttrs (n: v: any (a: a == name) v.before) dag
);
normalizedDag =
mapAttrs (n: v: {
name = n;
data = v.data;
after = v.after ++ dagBefore dag n;
}) dag;
mapAttrsToList (n: v: n)
(filterAttrs (n: v: any (a: a == name) v.before) dag);
normalizedDag = mapAttrs (n: v: {
name = n;
data = v.data;
after = v.after ++ dagBefore dag n;
}) dag;
before = a: b: any (c: a.name == c) b.after;
sorted = toposort before (mapAttrsToList (n: v: v) normalizedDag);
in
if sorted ? result then
{ result = map (v: { inherit (v) name data; }) sorted.result; }
else
sorted;
in if sorted ? result then {
result = map (v: { inherit (v) name data; }) sorted.result;
} else
sorted;
# Applies a function to each element of the given DAG.
dagMap = f: dag: mapAttrs (n: v: v // { data = f n v.data; }) dag;
@@ -103,22 +98,20 @@ rec {
# Create a DAG entry with no particular dependency information.
dagEntryAnywhere = data: {
inherit data;
before = [];
after = [];
before = [ ];
after = [ ];
};
dagEntryBetween = before: after: data: {
inherit data before after;
};
dagEntryBetween = before: after: data: { inherit data before after; };
dagEntryAfter = after: data: {
inherit data after;
before = [];
before = [ ];
};
dagEntryBefore = before: data: {
inherit data before;
after = [];
after = [ ];
};
}

View File

@@ -1,6 +1,6 @@
{ lib }:
{
rec {
dag =
let
d = import ./dag.nix { inherit lib; };
@@ -16,5 +16,13 @@
entryBefore = d.dagEntryBefore;
};
assertions = import ./assertions.nix { inherit lib; };
gvariant = import ./gvariant.nix { inherit lib; };
maintainers = import ./maintainers.nix;
strings = import ./strings.nix { inherit lib; };
types = import ./types.nix { inherit dag gvariant lib; };
shell = import ./shell.nix { inherit lib; };
zsh = import ./zsh.nix { inherit lib; };
}

View File

@@ -2,32 +2,6 @@
with lib;
let
# Figures out a valid Nix store name for the given path.
storeFileName = path:
let
# All characters that are considered safe. Note "-" is not
# included to avoid "-" followed by digit being interpreted as a
# version.
safeChars =
[ "+" "." "_" "?" "=" ]
++ lowerChars
++ upperChars
++ stringToCharacters "0123456789";
empties = l: genList (x: "") (length l);
unsafeInName = stringToCharacters (
replaceStrings safeChars (empties safeChars) path
);
safeName = replaceStrings unsafeInName (empties unsafeInName) path;
in
"home_file_" + safeName;
in
{
# Constructs a type suitable for a `home.file` like option. The
# target path may be either absolute or relative, in which case it
@@ -37,7 +11,7 @@ in
# Arguments:
# - basePathDesc docbook compatible description of the base path
# - basePath the file base path
fileType = basePathDesc: basePath: types.loaOf (types.submodule (
fileType = basePathDesc: basePath: types.attrsOf (types.submodule (
{ name, config, ... }: {
options = {
target = mkOption {
@@ -47,6 +21,7 @@ in
absPath = if hasPrefix "/" p then p else "${basePath}/${p}";
in
removePrefix (homeDirectory + "/") absPath;
defaultText = literalExample "<name>";
description = ''
Path to target file relative to ${basePathDesc}.
'';
@@ -55,17 +30,20 @@ in
text = mkOption {
default = null;
type = types.nullOr types.lines;
description = "Text of the file.";
description = ''
Text of the file. If this option is null then
<link linkend="opt-home.file._name_.source">home.file.&lt;name?&gt;.source</link>
must be set.
'';
};
source = mkOption {
type = types.path;
description = ''
Path of the source file. The file name must not start
with a period since Nix will not allow such names in
the Nix store.
</para><para>
This may refer to a directory.
Path of the source file or directory. If
<link linkend="opt-home.file._name_.text">home.file.&lt;name?&gt;.text</link>
is non-null then this option will automatically point to a file
containing that text.
'';
};
@@ -95,6 +73,32 @@ in
are symbolic links to the files of the source directory.
'';
};
onChange = mkOption {
type = types.lines;
default = "";
description = ''
Shell commands to run when file has changed between
generations. The script will be run
<emphasis>after</emphasis> the new files have been linked
into place.
</para><para>
Note, this code is always run when <literal>recursive</literal> is
enabled.
'';
};
force = mkOption {
type = types.bool;
default = false;
visible = false;
description = ''
Whether the target path should be unconditionally replaced
by the managed file source. Warning, this will silently
delete the target regardless of whether it is a file or
link.
'';
};
};
config = {
@@ -102,7 +106,7 @@ in
source = mkIf (config.text != null) (
mkDefault (pkgs.writeTextFile {
inherit (config) executable text;
name = storeFileName name;
name = hm.strings.storeFileName name;
})
);
};

156
modules/lib/gvariant.nix Normal file
View File

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

124
modules/lib/maintainers.nix Normal file
View File

@@ -0,0 +1,124 @@
# Home Manager maintainers.
#
# This attribute set contains Home Manager module maintainers that do
# not have an entry in the Nixpkgs maintainer list [1]. Entries here
# are expected to be follow the same format as described in [1].
#
# [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1
{
justinlovinger = {
name = "Justin Lovinger";
email = "git@justinlovinger.com";
github = "JustinLovinger";
githubId = 7183441;
};
owm111 = {
email = "7798336+owm111@users.noreply.github.com";
name = "Owen McGrath";
github = "owm111";
githubId = 7798336;
};
cwyc = {
email = "cwyc@users.noreply.github.com";
name = "cwyc";
github = "cwyc";
githubId = 16950437;
};
chisui = {
name = "Philipp Dargel";
email = "chisui@users.noreply.github.com";
github = "chisui";
githubId = 4526429;
};
olmokramer = {
name = "Olmo Kramer";
email = "olmokramer@users.noreply.github.com";
github = "olmokramer";
githubId = 3612514;
};
kalhauge = {
name = "Christian Gram Kalhauge";
email = "kalhauge@users.noreply.github.com";
github = "kalhauge";
githubId = 1182166;
};
kamadorueda = {
name = "Kevin Amado";
email = "kamadorueda@gmail.com";
github = "kamadorueda";
githubId = 47480384;
keys = [{
longkeyid = "rsa4096/0x04D0CEAF916A9A40";
fingerprint = "2BE3 BAFD 793E A349 ED1F F00F 04D0 CEAF 916A 9A40";
}];
};
kubukoz = {
name = "Jakub Kozłowski";
email = "kubukoz@users.noreply.github.com";
github = "kubukoz";
githubId = 894884;
};
matrss = {
name = "Matthias Riße";
email = "matrss@users.noreply.github.com";
github = "matrss";
githubId = 9308656;
};
seylerius = {
email = "sable@seyleri.us";
name = "Sable Seyler";
github = "seylerius";
githubId = 1145981;
keys = [{
logkeyid = "rsa4096/0x68BF2EAE6D91CAFF";
fingerprint = "F0E0 0311 126A CD72 4392 25E6 68BF 2EAE 6D91 CAFF";
}];
};
thiagokokada = {
email = "thiagokokada@gmail.com";
name = "Thiago Kenji Okada";
github = "thiagokokada";
githubId = 844343;
};
fendse = {
email = "46252070+Fendse@users.noreply.github.com";
github = "Fendse";
githubId = 46252070;
name = "Sara Johnsson";
};
msfjarvis = {
email = "me@msfjarvis.dev";
github = "msfjarvis";
githubId = "13348378";
name = "Harsh Shandilya";
keys = [{
longkeyid = "rsa4096/0xB7843F823355E9B9";
fingerprint = "8F87 050B 0F9C B841 1515 7399 B784 3F82 3355 E9B9";
}];
};
ambroisie = {
email = "bruno.home-manager@belanyi.fr";
github = "ambroisie";
githubId = 12465195;
name = "Bruno BELANYI";
};
malvo = {
email = "malte@malvo.org";
github = "malte-v";
githubId = 34393802;
name = "Malte Voos";
};
kranzes = {
email = "personal@ilanjoselevich.com";
github = "Kranzes";
githubId = 56614642;
name = "Ilan Joselevich";
};
mager = {
email = "andreas@mager.eu";
github = "AndreasMager";
githubId = 5646732;
name = "Andreas Mager";
};
}

View File

@@ -2,7 +2,7 @@
rec {
# Produces a Bourne shell like variable export statement.
export = n: v: "export ${n}=\"${toString v}\"";
export = n: v: ''export ${n}="${toString v}"'';
# Given an attribute set containing shell variable names and their
# assignment, this function produces a string containing an export

View File

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

22
modules/lib/strings.nix Normal file
View File

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

99
modules/lib/types-dag.nix Normal file
View File

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

99
modules/lib/types.nix Normal file
View File

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

30
modules/lib/zsh.nix Normal file
View File

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

View File

@@ -1,49 +1,27 @@
{ config, lib, pkgs, baseModules, ... }:
{ config, lib, pkgs, ... }:
with lib;
let
/* For the purpose of generating docs, evaluate options with each derivation
in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}".
It isn't perfect, but it seems to cover a vast majority of use cases.
Caveat: even if the package is reached by a different means,
the path above will be shown and not e.g. `${config.services.foo.package}`. */
nixosManual = import <nixpkgs/nixos/doc/manual> {
inherit pkgs config;
version = "0.1";
revision = "release-0.1";
options =
let
scrubbedEval = evalModules {
modules = [ { nixpkgs.system = pkgs.stdenv.system; } ] ++ baseModules;
args = (config._module.args) // { modules = [ ]; };
specialArgs = { pkgs = scrubDerivations "pkgs" pkgs; };
};
scrubDerivations = namePrefix: pkgSet: mapAttrs
(name: value:
let wholeName = "${namePrefix}.${name}"; in
if isAttrs value then
scrubDerivations wholeName value
// (optionalAttrs (isDerivation value) { outPath = "\${${wholeName}}"; })
else value
)
pkgSet;
in scrubbedEval.options;
};
cfg = config.manual;
homeEnvironmentManPages = pkgs.runCommand "home-environment-manpages" {
allowedReferences = [ "out" ];
} ''
install -v -D -m444 \
${nixosManual.manpages}/share/man/man5/configuration.nix.5 \
$out/share/man/man5/home-configuration.nix.5
'';
docs = import ../doc { inherit lib pkgs; };
in
{
options = {
manual.html.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to install the HTML manual. This also installs the
<command>home-manager-help</command> tool, which opens a local
copy of the Home Manager manual in the system web browser.
'';
};
manual.manpages.enable = mkOption {
type = types.bool;
default = true;
@@ -57,25 +35,34 @@ in
Thanks!
'';
};
manual.json.enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether to install a JSON formatted list of all Home Manager
options. This can be located at
<filename>&lt;profile directory&gt;/share/doc/home-manager/options.json</filename>,
and may be used for navigating definitions, auto-completing,
and other miscellaneous tasks.
'';
};
};
config = mkIf config.manual.manpages.enable {
home.packages = [ homeEnvironmentManPages ];
config = {
home.packages = mkMerge [
(mkIf cfg.html.enable [ docs.manual.html docs.manual.htmlOpenTool ])
(mkIf cfg.manpages.enable [ docs.manPages ])
(mkIf cfg.json.enable [ docs.options.json ])
];
# Whether a dependency on nmd should be introduced.
home.extraBuilderCommands =
mkIf (cfg.html.enable || cfg.manpages.enable || cfg.json.enable) ''
mkdir $out/lib
ln -s ${docs.nmdSrc} $out/lib/nmd
'';
};
# To fix error during manpage build.
meta = {
maintainers = [ maintainers.rycee ];
doc = builtins.toFile "nothingness" ''
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-nothing">
<title>this is just to make the docs compile</title>
<para xml:id="sec-grsecurity"></para>
<para xml:id="sec-emacs-docbook-xml"></para>
</chapter>
'';
};
}

70
modules/misc/dconf.nix Normal file
View File

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

26
modules/misc/debug.nix Normal file
View File

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

View File

@@ -6,36 +6,100 @@ let
cfg = config.fonts.fontconfig;
in
profileDirectory = config.home.profileDirectory;
{
in {
meta.maintainers = [ maintainers.rycee ];
imports = [
(mkRenamedOptionModule [ "fonts" "fontconfig" "enableProfileFonts" ] [
"fonts"
"fontconfig"
"enable"
])
];
options = {
fonts.fontconfig = {
enableProfileFonts = mkOption {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Configure fontconfig to discover fonts installed through
Whether to enable fontconfig configuration. This will, for
example, allow fontconfig to discover fonts and
configurations installed through
<varname>home.packages</varname> and
<command>nix-env</command>.
</para><para>
Note, this is only necessary on non-NixOS systems.
'';
};
};
};
config = mkIf cfg.enableProfileFonts {
xdg.configFile."fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
config = mkIf cfg.enable {
# Create two dummy files in /lib/fontconfig to make sure that
# buildEnv creates a real directory path. These files are removed
# in home.extraProfileCommands below so the packages will not
# become "runtime" dependencies.
home.packages = [
(pkgs.writeTextFile {
name = "hm-dummy1";
destination = "/lib/fontconfig/hm-dummy1";
text = "dummy";
})
(pkgs.writeTextFile {
name = "hm-dummy2";
destination = "/lib/fontconfig/hm-dummy2";
text = "dummy";
})
];
home.extraProfileCommands = ''
if [[ -d $out/lib/X11/fonts || -d $out/share/fonts ]]; then
export FONTCONFIG_FILE="$(pwd)/fonts.conf"
cat > $FONTCONFIG_FILE << EOF
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>~/.nix-profile/lib/X11/fonts</dir>
<dir>~/.nix-profile/share/fonts</dir>
<dir>$out/lib/X11/fonts</dir>
<dir>$out/share/fonts</dir>
<cachedir>$out/lib/fontconfig/cache</cachedir>
</fontconfig>
EOF
${getBin pkgs.fontconfig}/bin/fc-cache -f
rm -f $out/lib/fontconfig/cache/CACHEDIR.TAG
rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig/cache
rm "$FONTCONFIG_FILE"
unset FONTCONFIG_FILE
fi
# Remove hacky dummy files.
rm $out/lib/fontconfig/hm-dummy?
rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig
'';
xdg.configFile = {
"fontconfig/conf.d/10-hm-fonts.conf".text = ''
<?xml version='1.0'?>
<!-- Generated by Home Manager. -->
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<include ignore_missing="yes">${config.home.path}/etc/fonts/conf.d</include>
<include ignore_missing="yes">${config.home.path}/etc/fonts/fonts.conf</include>
<dir>${config.home.path}/lib/X11/fonts</dir>
<dir>${config.home.path}/share/fonts</dir>
<dir>${profileDirectory}/lib/X11/fonts</dir>
<dir>${profileDirectory}/share/fonts</dir>
<cachedir>${config.home.path}/lib/fontconfig/cache</cachedir>
</fontconfig>
'';
};
};
}

View File

@@ -11,51 +11,29 @@ let
toGtk3Ini = generators.toINI {
mkKeyValue = key: value:
let
value' =
if isBool value then (if value then "true" else "false")
else toString value;
in
"${key}=${value'}";
value' = if isBool value then
(if value then "true" else "false")
else
toString value;
in "${key}=${value'}";
};
formatGtk2Option = n: v:
let
v' =
if isBool v then (if v then "true" else "false")
else if isString v then "\"${v}\""
else toString v;
in
"${n} = ${v'}";
fontType = types.submodule {
options = {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExample "pkgs.dejavu_fonts";
description = ''
Package providing the font. This package will be installed
to your profile. If <literal>null</literal> then the font
is assumed to already be available in your profile.
'';
};
name = mkOption {
type = types.str;
example = "DejaVu Sans 8";
description = ''
The family name and size of the font within the package.
'';
};
};
};
v' = if isBool v then
(if v then "true" else "false")
else if isString v then
''"${v}"''
else
toString v;
in "${n} = ${v'}";
themeType = types.submodule {
options = {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExample "pkgs.gnome3.gnome_themes_standard";
example = literalExample "pkgs.gnome.gnome_themes_standard";
description = ''
Package providing the theme. This package will be installed
to your profile. If <literal>null</literal> then the theme
@@ -71,17 +49,21 @@ let
};
};
in
{
in {
meta.maintainers = [ maintainers.rycee ];
imports = [
(mkRemovedOptionModule [ "gtk" "gtk3" "waylandSupport" ] ''
This options is not longer needed and can be removed.
'')
];
options = {
gtk = {
enable = mkEnableOption "GTK 2/3 configuration";
font = mkOption {
type = types.nullOr fontType;
type = types.nullOr hm.types.fontType;
default = null;
description = ''
The font to use in GTK+ 2/3 applications.
@@ -100,84 +82,105 @@ in
description = "The GTK+2/3 theme to use.";
};
gtk2 = mkOption {
description = "Options specific to GTK+ 2";
default = {};
type = types.submodule {
options = {
extraConfig = mkOption {
type = types.lines;
default = "";
example = "gtk-can-change-accels = 1";
description = ''
Extra configuration lines to add verbatim to
<filename>~/.gtkrc-2.0</filename>.
'';
};
};
gtk2 = {
extraConfig = mkOption {
type = types.lines;
default = "";
example = "gtk-can-change-accels = 1";
description = ''
Extra configuration lines to add verbatim to
<filename>~/.gtkrc-2.0</filename>.
'';
};
configLocation = mkOption {
type = types.path;
default = "${config.home.homeDirectory}/.gtkrc-2.0";
defaultText =
literalExample ''"''${config.home.homeDirectory}/.gtkrc-2.0"'';
example =
literalExample ''"''${config.xdg.configHome}/gtk-2.0/gtkrc"'';
description = ''
The location to put the GTK configuration file.
'';
};
};
gtk3 = mkOption {
description = "Options specific to GTK+ 3";
default = {};
type = types.submodule {
options = {
extraConfig = mkOption {
type = types.attrs;
default = {};
example = { gtk-cursor-blink = false; gtk-recent-files-limit = 20; };
description = ''
Extra configuration options to add to
<filename>~/.config/gtk-3.0/settings.ini</filename>.
'';
};
gtk3 = {
bookmarks = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "file:///home/jane/Documents" ];
description = "Bookmarks in the sidebar of the GTK file browser";
};
extraCss = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration lines to add verbatim to
<filename>~/.config/gtk-3.0/gtk.css</filename>.
'';
};
extraConfig = mkOption {
type = with types; attrsOf (either bool (either int str));
default = { };
example = {
gtk-cursor-blink = false;
gtk-recent-files-limit = 20;
};
description = ''
Extra configuration options to add to
<filename>~/.config/gtk-3.0/settings.ini</filename>.
'';
};
extraCss = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration lines to add verbatim to
<filename>~/.config/gtk-3.0/gtk.css</filename>.
'';
};
};
};
};
config = mkIf cfg.enable (
let
ini =
optionalAttrs (cfg.font != null)
{ gtk-font-name = cfg.font.name; }
//
optionalAttrs (cfg.theme != null)
{ gtk-theme-name = cfg.theme.name; }
//
optionalAttrs (cfg.iconTheme != null)
{ gtk-icon-theme-name = cfg.iconTheme.name; };
config = mkIf cfg.enable (let
ini = optionalAttrs (cfg.font != null) {
gtk-font-name = let
fontSize =
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
in "${cfg.font.name}" + fontSize;
} // optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; }
// optionalAttrs (cfg.iconTheme != null) {
gtk-icon-theme-name = cfg.iconTheme.name;
};
optionalPackage = opt:
optional (opt != null && opt.package != null) opt.package;
in
{
dconfIni = optionalAttrs (cfg.font != null) {
font-name = let
fontSize =
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
in "${cfg.font.name}" + fontSize;
} // optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
// optionalAttrs (cfg.iconTheme != null) {
icon-theme = cfg.iconTheme.name;
};
home.packages =
optionalPackage cfg.font
++ optionalPackage cfg.theme
++ optionalPackage cfg.iconTheme;
optionalPackage = opt:
optional (opt != null && opt.package != null) opt.package;
in {
home.packages = optionalPackage cfg.font ++ optionalPackage cfg.theme
++ optionalPackage cfg.iconTheme;
home.file.".gtkrc-2.0".text =
concatStringsSep "\n" (
mapAttrsToList formatGtk2Option ini
) + "\n" + cfg2.extraConfig;
home.file.${cfg2.configLocation}.text =
concatStringsSep "\n" (mapAttrsToList formatGtk2Option ini) + "\n"
+ cfg2.extraConfig;
xdg.configFile."gtk-3.0/settings.ini".text =
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
home.sessionVariables.GTK2_RC_FILES = cfg2.configLocation;
xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss;
}
);
xdg.configFile."gtk-3.0/settings.ini".text =
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss;
xdg.configFile."gtk-3.0/bookmarks" = mkIf (cfg3.bookmarks != [ ]) {
text = concatStringsSep "\n" cfg3.bookmarks;
};
dconf.settings."org/gnome/desktop/interface" = dconfIni;
});
}

14
modules/misc/lib.nix Normal file
View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,41 +1,36 @@
# Adapted from Nixpkgs.
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, pkgsPath, ... }:
with lib;
let
isConfig = x:
builtins.isAttrs x || builtins.isFunction x;
isConfig = x: builtins.isAttrs x || builtins.isFunction x;
optCall = f: x:
if builtins.isFunction f
then f x
else f;
optCall = f: x: if builtins.isFunction f then f x else f;
mergeConfig = lhs_: rhs_:
let
lhs = optCall lhs_ { inherit pkgs; };
rhs = optCall rhs_ { inherit pkgs; };
in
lhs // rhs //
optionalAttrs (lhs ? packageOverrides) {
in lhs // rhs // optionalAttrs (lhs ? packageOverrides) {
packageOverrides = pkgs:
optCall lhs.packageOverrides pkgs //
optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
} //
optionalAttrs (lhs ? perlPackageOverrides) {
optCall lhs.packageOverrides pkgs
// optCall (attrByPath [ "packageOverrides" ] ({ }) rhs) pkgs;
} // optionalAttrs (lhs ? perlPackageOverrides) {
perlPackageOverrides = pkgs:
optCall lhs.perlPackageOverrides pkgs //
optCall (attrByPath ["perlPackageOverrides"] ({}) rhs) pkgs;
optCall lhs.perlPackageOverrides pkgs
// optCall (attrByPath [ "perlPackageOverrides" ] ({ }) rhs) pkgs;
};
configType = mkOptionType {
name = "nixpkgs-config";
description = "nixpkgs config";
check = traceValIfNot isConfig;
merge = args: fold (def: mergeConfig def.value) {};
check = x:
let traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
in traceXIfNot isConfig;
merge = args: fold (def: mergeConfig def.value) { };
};
overlayType = mkOptionType {
@@ -45,13 +40,9 @@ let
merge = lib.mergeOneOption;
};
_pkgs = import <nixpkgs> (
filterAttrs (n: v: v != null) config.nixpkgs
);
_pkgs = import pkgsPath (filterAttrs (n: v: v != null) config.nixpkgs);
in
{
in {
options.nixpkgs = {
config = mkOption {
default = null;
@@ -76,10 +67,9 @@ in
inside and outside Home Manager you can put it in a separate
file and include something like
<programlisting>
<programlisting language="nix">
nixpkgs.config = import ./nixpkgs-config.nix;
xdg.configFile."nixpkgs/config.nix".source =
./nixpkgs-config.nix;
xdg.configFile."nixpkgs/config.nix".source = ./nixpkgs-config.nix;
</programlisting>
in your Home Manager configuration.
@@ -88,17 +78,16 @@ in
overlays = mkOption {
default = null;
example = literalExample
''
[ (self: super: {
openssh = super.openssh.override {
hpnSupport = true;
withKerberos = true;
kerberos = self.libkrb5;
};
example = literalExample ''
[ (self: super: {
openssh = super.openssh.override {
hpnSupport = true;
withKerberos = true;
kerberos = self.libkrb5;
};
) ]
'';
};
) ]
'';
type = types.nullOr (types.listOf overlayType);
description = ''
List of overlays to use with the Nix Packages collection. (For
@@ -139,8 +128,12 @@ in
config = {
_module.args = {
pkgs = _pkgs;
pkgs_i686 = _pkgs.pkgsi686Linux;
pkgs = mkOverride modules.defaultPriority _pkgs;
pkgs_i686 =
if _pkgs.stdenv.isLinux && _pkgs.stdenv.hostPlatform.isx86 then
_pkgs.pkgsi686Linux
else
{ };
};
};
}

35
modules/misc/numlock.nix Normal file
View File

@@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.xsession.numlock;
in {
meta.maintainers = [ maintainers.evanjs ];
options = { xsession.numlock.enable = mkEnableOption "Num Lock"; };
config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "xsession.numlock" pkgs platforms.linux)
];
systemd.user.services.numlockx = {
Unit = {
Description = "NumLockX";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.numlockx}/bin/numlockx";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
};
}

View File

@@ -6,14 +6,12 @@ let
vars = config.pam.sessionVariables;
in
{
in {
meta.maintainers = [ maintainers.rycee ];
options = {
pam.sessionVariables = mkOption {
default = {};
default = { };
type = types.attrs;
example = { EDITOR = "vim"; };
description = ''
@@ -23,14 +21,15 @@ in
<refentrytitle>pam_env.conf</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry>.
</para><para>
Note, this option will become deprecated in the future and its use is
therefore discouraged.
'';
};
};
config = mkIf (vars != {}) {
home.file.".pam_environment".text =
concatStringsSep "\n" (
mapAttrsToList (n: v: "${n} OVERRIDE=${toString v}") vars
) + "\n";
config = mkIf (vars != { }) {
home.file.".pam_environment".text = concatStringsSep "\n"
(mapAttrsToList (n: v: ''${n} OVERRIDE="${toString v}"'') vars) + "\n";
};
}

121
modules/misc/qt.nix Normal file
View File

@@ -0,0 +1,121 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.qt;
in {
meta.maintainers = [ maintainers.rycee ];
imports = [
(mkChangedOptionModule [ "qt" "useGtkTheme" ] [ "qt" "platformTheme" ]
(config:
if getAttrFromPath [ "qt" "useGtkTheme" ] config then "gtk" else null))
];
options = {
qt = {
enable = mkEnableOption "Qt 4 and 5 configuration";
platformTheme = mkOption {
type = types.nullOr (types.enum [ "gtk" "gnome" ]);
default = null;
example = "gnome";
relatedPackages =
[ "qgnomeplatform" [ "libsForQt5" "qtstyleplugins" ] ];
description = ''
Selects the platform theme to use for Qt applications.</para>
<para>The options are
<variablelist>
<varlistentry>
<term><literal>gtk</literal></term>
<listitem><para>Use GTK theme with
<link xlink:href="https://github.com/qt/qtstyleplugins">qtstyleplugins</link>
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>gnome</literal></term>
<listitem><para>Use GNOME theme with
<link xlink:href="https://github.com/FedoraQt/QGnomePlatform">qgnomeplatform</link>
</para></listitem>
</varlistentry>
</variablelist>
'';
};
style = {
name = mkOption {
type = types.nullOr types.str;
default = null;
example = "adwaita-dark";
relatedPackages = [ "adwaita-qt" [ "libsForQt5" "qtstyleplugins" ] ];
description = ''
Selects the style to use for Qt5 applications.</para>
<para>The options are
<variablelist>
<varlistentry>
<term><literal>adwaita</literal></term>
<term><literal>adwaita-dark</literal></term>
<listitem><para>Use Adwaita Qt style with
<link xlink:href="https://github.com/FedoraQt/adwaita-qt">adwaita</link>
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>cleanlooks</literal></term>
<term><literal>gtk2</literal></term>
<term><literal>motif</literal></term>
<term><literal>plastique</literal></term>
<listitem><para>Use styles from
<link xlink:href="https://github.com/qt/qtstyleplugins">qtstyleplugins</link>
</para></listitem>
</varlistentry>
</variablelist>
'';
};
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExample "pkgs.adwaita-qt";
description = "Theme package to be used in Qt5 applications.";
};
};
};
};
config = mkIf (cfg.enable && cfg.platformTheme != null) {
assertions = [{
assertion = (cfg.platformTheme == "gnome")
-> ((cfg.style.name != null) && (cfg.style.package != null));
message = ''
`qt.platformTheme` "gnome" must have `qt.style` set to a theme that
supports both Qt and Gtk, for example "adwaita" or "adwaita-dark".
'';
}];
# Necessary because home.sessionVariables is of types.attrs
home.sessionVariables = (filterAttrs (n: v: v != null) {
QT_QPA_PLATFORMTHEME =
if cfg.platformTheme == "gnome" then "gnome" else "gtk2";
QT_STYLE_OVERRIDE = cfg.style.name;
});
home.packages = if cfg.platformTheme == "gnome" then
[ pkgs.qgnomeplatform ]
++ lib.optionals (cfg.style.package != null) [ cfg.style.package ]
else
[ pkgs.libsForQt5.qtstyleplugins ];
xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ]
++ lib.optionals (cfg.style != null) [ "QT_STYLE_OVERRIDE" ];
# Enable GTK+ style for Qt4 in either case.
# It doesnt support the platform theme packages.
home.activation.useGtkThemeInQt4 = hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD ${pkgs.crudini}/bin/crudini $VERBOSE_ARG \
--set "${config.xdg.configHome}/Trolltech.conf" Qt style GTK+
'';
};
}

View File

@@ -0,0 +1,32 @@
{ lib, ... }:
with lib;
{
meta.maintainers = [ maintainers.rycee ];
options.submoduleSupport = {
enable = mkOption {
type = types.bool;
default = false;
internal = true;
description = ''
Whether the Home Manager module system is used as a submodule
in, for example, NixOS or nix-darwin.
'';
};
externalPackageInstall = mkOption {
type = types.bool;
default = false;
internal = true;
description = ''
Whether the packages of <option>home.packages</option> are
installed separately from the Home Manager activation script.
In NixOS, for example, this may be accomplished by installing
the packages through
<option>users.users.name?.packages</option>.
'';
};
};
}

54
modules/misc/tmpfiles.nix Normal file
View File

@@ -0,0 +1,54 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.systemd.user.tmpfiles;
in {
meta.maintainers = [ maintainers.dawidsowa ];
options.systemd.user.tmpfiles.rules = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "L /home/user/Documents - - - - /mnt/data/Documents" ];
description = ''
Rules for creating and cleaning up temporary files
automatically. See
<citerefentry>
<refentrytitle>tmpfiles.d</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry>
for the exact format.
'';
};
config = mkIf (cfg.rules != [ ]) {
assertions = [
(hm.assertions.assertPlatform "systemd.user.tmpfiles" pkgs
platforms.linux)
];
xdg = {
dataFile."user-tmpfiles.d/home-manager.conf" = {
text = ''
# This file is created automatically and should not be modified.
# Please change the option systemd.user.tmpfiles.rules instead.
${concatStringsSep "\n" cfg.rules}
'';
onChange = "${pkgs.systemd}/bin/systemd-tmpfiles --user --create";
};
configFile = {
"systemd/user/basic.target.wants/systemd-tmpfiles-setup.service".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
"systemd/user/systemd-tmpfiles-setup.service".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
"systemd/user/timers.target.wants/systemd-tmpfiles-clean.timer".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.timer";
"systemd/user/systemd-tmpfiles-clean.service".source =
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.service";
};
};
};
}

33
modules/misc/version.nix Normal file
View File

@@ -0,0 +1,33 @@
{ config, lib, ... }:
with lib;
{
options = {
home.stateVersion = mkOption {
type = types.enum [
"18.09"
"19.03"
"19.09"
"20.03"
"20.09"
"21.03"
"21.05"
"21.11"
];
default = "18.09";
description = ''
It is occasionally necessary for Home Manager to change
configuration defaults in a way that is incompatible with
stateful data. This could, for example, include switching the
default data format or location of a file.
</para><para>
The <emphasis>state version</emphasis> indicates which default
settings are in effect and will therefore help avoid breaking
program configurations. Switching to a higher state version
typically requires performing some manual steps, such as data
conversion or moving files.
'';
};
};
}

51
modules/misc/vte.nix Normal file
View File

@@ -0,0 +1,51 @@
{ config, lib, pkgs, ... }:
with lib;
{
meta.maintainers = [ maintainers.rycee ];
options.programs = let
description = ''
Whether to enable integration with terminals using the VTE
library. This will let the terminal track the current working
directory.
'';
in {
bash.enableVteIntegration = mkEnableOption "" // { inherit description; };
zsh.enableVteIntegration = mkEnableOption "" // { inherit description; };
};
config = mkMerge [
(mkIf config.programs.bash.enableVteIntegration {
# Unfortunately we have to do a little dance here to fix two
# problems with the upstream vte.sh file:
#
# - It does `PROMPT_COMMAND="__vte_prompt_command"` which
# clobbers any previously assigned prompt command.
#
# - Its `__vte_prompt_command` function runs commands that will
# overwrite the exit status of the command the user ran.
programs.bash.initExtra = ''
__HM_PROMPT_COMMAND="''${PROMPT_COMMAND:+''${PROMPT_COMMAND%;};}__hm_vte_prompt_command"
. ${pkgs.vte}/etc/profile.d/vte.sh
if [[ $(type -t __vte_prompt_command) = function ]]; then
__hm_vte_prompt_command() {
local old_exit_status=$?
__vte_prompt_command
return $old_exit_status
}
PROMPT_COMMAND="$__HM_PROMPT_COMMAND"
fi
unset __HM_PROMPT_COMMAND
'';
})
(mkIf config.programs.zsh.enableVteIntegration {
programs.zsh.initExtra = ''
. ${pkgs.vte}/etc/profile.d/vte.sh
'';
})
];
}

View File

@@ -0,0 +1,183 @@
{ config, lib, pkgs, ... }:
with lib;
let
desktopEntry = {
options = {
# Since this module uses the nixpkgs/pkgs/build-support/make-desktopitem function,
# our options and defaults follow its parameters, with the following exceptions:
# `desktopName` on makeDesktopItem is controlled by `name`.
# This is what we'd commonly consider the name of the application.
# `name` on makeDesktopItem is controlled by this module's key in the attrset.
# This is the file's filename excluding ".desktop".
# `extraEntries` on makeDesktopItem is controlled by `extraConfig`,
# and `extraDesktopEntries` by `settings`,
# to match what's commonly used by other home manager modules.
# `startupNotify` on makeDesktopItem asks for "true" or "false" strings,
# for usability's sake we ask for a boolean.
# `mimeType` and `categories` on makeDesktopItem ask for a string in the format "one;two;three;",
# for the same reason we ask for a list of strings.
# Descriptions are taken from the desktop entry spec:
# https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys
type = mkOption {
description = "The type of the desktop entry.";
default = "Application";
type = types.enum [ "Application" "Link" "Directory" ];
};
exec = mkOption {
description = "Program to execute, possibly with arguments.";
type = types.str;
};
icon = mkOption {
description = "Icon to display in file manager, menus, etc.";
type = types.nullOr types.str;
default = null;
};
comment = mkOption {
description = "Tooltip for the entry.";
type = types.nullOr types.str;
default = null;
};
terminal = mkOption {
description = "Whether the program runs in a terminal window.";
type = types.bool;
default = false;
};
name = mkOption {
description = "Specific name of the application.";
type = types.str;
};
genericName = mkOption {
description = "Generic name of the application.";
type = types.nullOr types.str;
default = null;
};
mimeType = mkOption {
description = "The MIME type(s) supported by this application.";
type = types.nullOr (types.listOf types.str);
default = null;
};
categories = mkOption {
description =
"Categories in which the entry should be shown in a menu.";
type = types.nullOr (types.listOf types.str);
default = null;
};
startupNotify = mkOption {
description = ''
If true, it is KNOWN that the application will send a "remove"
message when started with the <literal>DESKTOP_STARTUP_ID</literal>
environment variable set. If false, it is KNOWN that the application
does not work with startup notification at all.'';
type = types.nullOr types.bool;
default = null;
};
extraConfig = mkOption {
description = ''
Extra configuration. Will be appended to the end of the file and
may thus contain extra sections.
'';
type = types.lines;
default = "";
};
settings = mkOption {
type = types.attrsOf types.string;
description = ''
Extra key-value pairs to add to the <literal>[Desktop Entry]</literal> section.
This may override other values.
'';
default = { };
example = literalExample ''
{
Keywords = "calc;math";
DBusActivatable = "false";
}
'';
};
fileValidation = mkOption {
type = types.bool;
description = "Whether to validate the generated desktop file.";
default = true;
};
};
};
#formatting helpers
ifNotNull = a: a': if a == null then null else a';
stringBool = bool: if bool then "true" else "false";
semicolonList = list:
(concatStringsSep ";" list) + ";"; # requires trailing semicolon
#passes config options to makeDesktopItem in expected format
makeFile = name: config:
pkgs.makeDesktopItem {
name = name;
type = config.type;
exec = config.exec;
icon = config.icon;
comment = config.comment;
terminal = config.terminal;
desktopName = config.name;
genericName = config.genericName;
mimeType = ifNotNull config.mimeType (semicolonList config.mimeType);
categories =
ifNotNull config.categories (semicolonList config.categories);
startupNotify =
ifNotNull config.startupNotify (stringBool config.startupNotify);
extraEntries = config.extraConfig;
extraDesktopEntries = config.settings;
};
in {
meta.maintainers = with maintainers; [ cwyc ];
options.xdg.desktopEntries = mkOption {
description = ''
Desktop Entries allow applications to be shown in your desktop environment's app launcher. </para><para>
You can define entries for programs without entries or override existing entries. </para><para>
See <link xlink:href="https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys" /> for more information on options.
'';
default = { };
type = types.attrsOf (types.submodule desktopEntry);
example = literalExample ''
{
firefox = {
name = "Firefox";
genericName = "Web Browser";
exec = "firefox %U";
terminal = false;
categories = [ "Application" "Network" "WebBrowser" ];
mimeType = [ "text/html" "text/xml" ];
};
}
'';
};
config = mkIf (config.xdg.desktopEntries != { }) {
assertions = [
(hm.assertions.assertPlatform "xdg.desktopEntries" pkgs platforms.linux)
];
home.packages = (map hiPrio # we need hiPrio to override existing entries
(attrsets.mapAttrsToList makeFile config.xdg.desktopEntries));
};
}

View File

@@ -0,0 +1,91 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.xdg.mimeApps;
strListOrSingleton = with types;
coercedTo (either (listOf str) str) toList (listOf str);
in {
meta.maintainers = with maintainers; [ pacien ];
options.xdg.mimeApps = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to manage <filename>$XDG_CONFIG_HOME/mimeapps.list</filename>.
</para>
<para>
The generated file is read-only.
'';
};
# descriptions from
# https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.1.html
associations.added = mkOption {
type = types.attrsOf strListOrSingleton;
default = { };
example = literalExample ''
{
"mimetype1" = [ "foo1.desktop" "foo2.desktop" "foo3.desktop" ];
"mimetype2" = "foo4.desktop";
}
'';
description = ''
Defines additional associations of applications with
mimetypes, as if the .desktop file was listing this mimetype
in the first place.
'';
};
associations.removed = mkOption {
type = types.attrsOf strListOrSingleton;
default = { };
example = { "mimetype1" = "foo5.desktop"; };
description = ''
Removes associations of applications with mimetypes, as if the
.desktop file was <emphasis>not</emphasis> listing this
mimetype in the first place.
'';
};
defaultApplications = mkOption {
type = types.attrsOf strListOrSingleton;
default = { };
example = literalExample ''
{
"mimetype1" = [ "default1.desktop" "default2.desktop" ];
}
'';
description = ''
The default application to be used for a given mimetype. This
is, for instance, the one that will be started when
double-clicking on a file in a file manager. If the
application is no longer installed, the next application in
the list is attempted, and so on.
'';
};
};
config = mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "xdg.mimeApps" pkgs platforms.linux) ];
# Deprecated but still used by some applications.
xdg.dataFile."applications/mimeapps.list".source =
config.xdg.configFile."mimeapps.list".source;
xdg.configFile."mimeapps.list".text =
let joinValues = mapAttrs (n: concatStringsSep ";");
in generators.toINI { } {
"Added Associations" = joinValues cfg.associations.added;
"Removed Associations" = joinValues cfg.associations.removed;
"Default Applications" = joinValues cfg.defaultApplications;
};
};
}

60
modules/misc/xdg-mime.nix Normal file
View File

@@ -0,0 +1,60 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.xdg.mime;
in {
options = {
xdg.mime.enable = mkOption {
type = types.bool;
default = pkgs.hostPlatform.isLinux;
defaultText =
literalExample "true if host platform is Linux, false otherwise";
description = ''
Whether to install programs and files to support the
XDG Shared MIME-info specification and XDG MIME Applications
specification at
<link xlink:href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html"/>
and
<link xlink:href="https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html"/>,
respectively.
'';
};
};
config = mkIf config.xdg.mime.enable {
assertions =
[ (hm.assertions.assertPlatform "xdg.mime" pkgs platforms.linux) ];
home.packages = [
# Explicitly install package to provide basic mime types.
pkgs.shared-mime-info
# Make sure the target directories will be real directories.
(pkgs.runCommandLocal "dummy-xdg-mime-dirs1" { } ''
mkdir -p $out/share/{applications,mime/packages}
'')
(pkgs.runCommandLocal "dummy-xdg-mime-dirs2" { } ''
mkdir -p $out/share/{applications,mime/packages}
'')
];
home.extraProfileCommands = ''
if [[ -w $out/share/mime && -w $out/share/mime/packages && -d $out/share/mime/packages ]]; then
XDG_DATA_DIRS=$out/share \
PKGSYSTEM_ENABLE_FSYNC=0 \
${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \
-V $out/share/mime > /dev/null
fi
if [[ -w $out/share/applications ]]; then
${pkgs.buildPackages.desktop-file-utils}/bin/update-desktop-database \
$out/share/applications
fi
'';
};
}

View File

@@ -0,0 +1,61 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.xdg.systemDirs;
configDirs = concatStringsSep ":" cfg.config;
dataDirs = concatStringsSep ":" cfg.data;
in {
meta.maintainers = with maintainers; [ tadfisher ];
options.xdg.systemDirs = {
config = mkOption {
type = types.listOf types.str;
default = [ ];
example = literalExample ''[ "/etc/xdg" ]'';
description = ''
Directory names to add to <envar>XDG_CONFIG_DIRS</envar>
in the user session.
'';
};
data = mkOption {
type = types.listOf types.str;
default = [ ];
example = literalExample ''[ "/usr/share" "/usr/local/share" ]'';
description = ''
Directory names to add to <envar>XDG_DATA_DIRS</envar>
in the user session.
'';
};
};
config = mkMerge [
(mkIf (cfg.config != [ ] || cfg.data != [ ]) {
assertions = [
(hm.assertions.assertPlatform "xdg.systemDirs" pkgs platforms.linux)
];
})
(mkIf (cfg.config != [ ]) {
home.sessionVariables.XDG_CONFIG_DIRS =
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
systemd.user.sessionVariables.XDG_CONFIG_DIRS =
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
})
(mkIf (cfg.data != [ ]) {
home.sessionVariables.XDG_DATA_DIRS =
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
systemd.user.sessionVariables.XDG_DATA_DIRS =
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
})
];
}

View File

@@ -0,0 +1,124 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.xdg.userDirs;
in {
meta.maintainers = with maintainers; [ pacien ];
imports = [
(mkRenamedOptionModule [ "xdg" "userDirs" "publishShare" ] [
"xdg"
"userDirs"
"publicShare"
])
];
options.xdg.userDirs = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to manage <filename>$XDG_CONFIG_HOME/user-dirs.dirs</filename>.
</para>
<para>
The generated file is read-only.
'';
};
# Well-known directory list from
# https://gitlab.freedesktop.org/xdg/xdg-user-dirs/blob/master/man/user-dirs.dirs.xml
desktop = mkOption {
type = types.str;
default = "$HOME/Desktop";
description = "The Desktop directory.";
};
documents = mkOption {
type = types.str;
default = "$HOME/Documents";
description = "The Documents directory.";
};
download = mkOption {
type = types.str;
default = "$HOME/Downloads";
description = "The Downloads directory.";
};
music = mkOption {
type = types.str;
default = "$HOME/Music";
description = "The Music directory.";
};
pictures = mkOption {
type = types.str;
default = "$HOME/Pictures";
description = "The Pictures directory.";
};
publicShare = mkOption {
type = types.str;
default = "$HOME/Public";
description = "The Public share directory.";
};
templates = mkOption {
type = types.str;
default = "$HOME/Templates";
description = "The Templates directory.";
};
videos = mkOption {
type = types.str;
default = "$HOME/Videos";
description = "The Videos directory.";
};
extraConfig = mkOption {
type = with types; attrsOf str;
default = { };
example = { XDG_MISC_DIR = "$HOME/Misc"; };
description = "Other user directories.";
};
createDirectories =
mkEnableOption "automatic creation of the XDG user directories";
};
config = let
directories = {
XDG_DESKTOP_DIR = cfg.desktop;
XDG_DOCUMENTS_DIR = cfg.documents;
XDG_DOWNLOAD_DIR = cfg.download;
XDG_MUSIC_DIR = cfg.music;
XDG_PICTURES_DIR = cfg.pictures;
XDG_PUBLICSHARE_DIR = cfg.publicShare;
XDG_TEMPLATES_DIR = cfg.templates;
XDG_VIDEOS_DIR = cfg.videos;
} // cfg.extraConfig;
in mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "xdg.userDirs" pkgs platforms.linux) ];
xdg.configFile."user-dirs.dirs".text = let
# For some reason, these need to be wrapped with quotes to be valid.
wrapped = mapAttrs (_: value: ''"${value}"'') directories;
in generators.toKeyValue { } wrapped;
xdg.configFile."user-dirs.conf".text = "enabled=False";
home.activation = mkIf cfg.createDirectories {
createXdgUserDirectories = let
directoriesList = attrValues directories;
mkdir = (dir: ''$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "${dir}"'');
in lib.hm.dag.entryAfter [ "writeBoundary" ]
(strings.concatMapStringsSep "\n" mkdir directoriesList);
};
};
}

View File

@@ -16,14 +16,10 @@ let
defaultDataHome = "${config.home.homeDirectory}/.local/share";
getXdgDir = name: fallback:
let
value = builtins.getEnv name;
in
if value != "" then value else fallback;
let value = builtins.getEnv name;
in if value != "" then value else fallback;
in
{
in {
options.xdg = {
enable = mkEnableOption "management of XDG base directories";
@@ -37,7 +33,7 @@ in
configFile = mkOption {
type = fileType "<varname>xdg.configHome</varname>" cfg.configHome;
default = {};
default = { };
description = ''
Attribute set of files to link into the user's XDG
configuration home.
@@ -54,7 +50,7 @@ in
dataFile = mkOption {
type = fileType "<varname>xdg.dataHome</varname>" cfg.dataHome;
default = {};
default = { };
description = ''
Attribute set of files to link into the user's XDG
data home.
@@ -83,14 +79,30 @@ in
};
})
(mkIf (!cfg.enable) {
# Legacy non-deterministic setup.
(mkIf (!cfg.enable && versionOlder config.home.stateVersion "20.09") {
xdg.cacheHome = getXdgDir "XDG_CACHE_HOME" defaultCacheHome;
xdg.configHome = getXdgDir "XDG_CONFIG_HOME" defaultConfigHome;
xdg.dataHome = getXdgDir "XDG_DATA_HOME" defaultDataHome;
})
# "Modern" deterministic setup.
(mkIf (!cfg.enable && versionAtLeast config.home.stateVersion "20.09") {
xdg.cacheHome = mkDefault defaultCacheHome;
xdg.configHome = mkDefault defaultConfigHome;
xdg.dataHome = mkDefault defaultDataHome;
})
{
home.file = mkMerge [ cfg.configFile cfg.dataFile ];
home.file = mkMerge [
(mapAttrs'
(name: file: nameValuePair "${config.xdg.configHome}/${name}" file)
cfg.configFile)
(mapAttrs'
(name: file: nameValuePair "${config.xdg.dataHome}/${name}" file)
cfg.dataFile)
{ "${config.xdg.cacheHome}/.keep".text = ""; }
];
}
];
}

View File

@@ -1,100 +1,254 @@
{ pkgs
# Note, this should be "the standard library" + HM extensions.
, lib
# Whether to enable module type checking.
# Whether to enable module type checking.
, check ? true
# Whether these modules are inside a NixOS submodule.
, nixosSubmodule ? false
}:
# If disabled, the pkgs attribute passed to this function is used instead.
, useNixpkgsModule ? true }:
with lib;
let
modules = [
./accounts/email.nix
./config/i18n.nix
./files.nix
./home-environment.nix
./i18n/input-method/default.nix
./manual.nix
./misc/dconf.nix
./misc/debug.nix
./misc/fontconfig.nix
./misc/gtk.nix
./misc/lib.nix
./misc/news.nix
./misc/nixpkgs.nix
./misc/numlock.nix
./misc/pam.nix
./misc/qt.nix
./misc/submodule-support.nix
./misc/tmpfiles.nix
./misc/version.nix
./misc/vte.nix
./misc/xdg-desktop-entries.nix
./misc/xdg-mime-apps.nix
./misc/xdg-mime.nix
./misc/xdg-system-dirs.nix
./misc/xdg-user-dirs.nix
./misc/xdg.nix
./programs/abook.nix
./programs/afew.nix
./programs/alacritty.nix
./programs/alot.nix
./programs/aria2.nix
./programs/astroid.nix
./programs/autojump.nix
./programs/autorandr.nix
./programs/bash.nix
./programs/bat.nix
./programs/beets.nix
./programs/broot.nix
./programs/browserpass.nix
./programs/chromium.nix
./programs/command-not-found/command-not-found.nix
./programs/dircolors.nix
./programs/direnv.nix
./programs/eclipse.nix
./programs/emacs.nix
./programs/exa.nix
./programs/feh.nix
./programs/firefox.nix
./programs/fish.nix
./programs/foot.nix
./programs/fzf.nix
./programs/getmail.nix
./programs/gh.nix
./programs/git.nix
./programs/gnome-terminal.nix
./programs/go.nix
./programs/gpg.nix
./programs/himalaya.nix
./programs/home-manager.nix
./programs/htop.nix
./programs/i3status-rust.nix
./programs/i3status.nix
./programs/info.nix
./programs/irssi.nix
./programs/jq.nix
./programs/kakoune.nix
./programs/keychain.nix
./programs/kitty.nix
./programs/lazygit.nix
./programs/lesspipe.nix
./programs/lf.nix
./programs/lieer.nix
./programs/lsd.nix
./programs/man.nix
./programs/mangohud.nix
./programs/matplotlib.nix
./programs/mbsync.nix
./programs/mcfly.nix
./programs/mercurial.nix
./programs/mpv.nix
./programs/msmtp.nix
./programs/mu.nix
./programs/ncmpcpp.nix
./programs/ncspot.nix
./programs/ne.nix
./programs/neomutt.nix
./programs/neovim.nix
./programs/newsboat.nix
./programs/nix-index.nix
./programs/noti.nix
./programs/notmuch.nix
./programs/nushell.nix
./programs/obs-studio.nix
./programs/octant.nix
./programs/offlineimap.nix
./programs/opam.nix
./programs/password-store.nix
./programs/pazi.nix
./programs/pet.nix
./programs/pidgin.nix
./programs/piston-cli.nix
./programs/powerline-go.nix
./programs/qutebrowser.nix
./programs/rbw.nix
./programs/readline.nix
./programs/rofi-pass.nix
./programs/rofi.nix
./programs/rtorrent.nix
./programs/sbt.nix
./programs/scmpuff.nix
./programs/senpai.nix
./programs/skim.nix
./programs/sm64ex.nix
./programs/ssh.nix
./programs/starship.nix
./programs/taskwarrior.nix
./programs/terminator.nix
./programs/termite.nix
./programs/texlive.nix
./programs/tmux.nix
./programs/topgrade.nix
./programs/urxvt.nix
./programs/vim.nix
./programs/vscode.nix
./programs/vscode/haskell.nix
./programs/waybar.nix
./programs/xmobar.nix
./programs/z-lua.nix
./programs/zathura.nix
./programs/zoxide.nix
./programs/zplug.nix
./programs/zsh.nix
./programs/zsh/prezto.nix
./services/barrier.nix
./services/blueman-applet.nix
./services/caffeine.nix
./services/cbatticon.nix
./services/clipmenu.nix
./services/compton.nix
./services/devilspie2.nix
./services/dropbox.nix
./services/dunst.nix
./services/dwm-status.nix
./services/emacs.nix
./services/etesync-dav.nix
./services/flameshot.nix
./services/fluidsynth.nix
./services/getmail.nix
./services/gnome-keyring.nix
./services/gpg-agent.nix
./services/grobi.nix
./services/hound.nix
./services/imapnotify.nix
./services/kanshi.nix
./services/kbfs.nix
./services/kdeconnect.nix
./services/keepassx.nix
./services/keybase.nix
./services/keynav.nix
./services/lieer.nix
./services/lorri.nix
./services/mako.nix
./services/mbsync.nix
./services/mpd.nix
./services/mpdris2.nix
./services/mpris-proxy.nix
./services/muchsync.nix
./services/network-manager-applet.nix
./services/nextcloud-client.nix
./services/owncloud-client.nix
./services/pantalaimon.nix
./services/parcellite.nix
./services/pass-secret-service.nix
./services/password-store-sync.nix
./services/pasystray.nix
./services/pbgopy.nix
./services/picom.nix
./services/plan9port.nix
./services/playerctld.nix
./services/polybar.nix
./services/poweralertd.nix
./services/pulseeffects.nix
./services/random-background.nix
./services/redshift.nix
./services/redshift-gammastep/gammastep.nix
./services/redshift-gammastep/redshift.nix
./services/rsibreak.nix
./services/screen-locker.nix
./services/spotifyd.nix
./services/stalonetray.nix
./services/status-notifier-watcher.nix
./services/sxhkd.nix
./services/syncthing.nix
./services/taffybar.nix
./services/trayer.nix
./services/tahoe-lafs.nix
./services/taskwarrior-sync.nix
./services/udiskie.nix
./services/unclutter.nix
./services/window-managers/i3.nix
./services/unison.nix
./services/volnoti.nix
./services/window-managers/awesome.nix
./services/window-managers/bspwm/default.nix
./services/window-managers/i3-sway/i3.nix
./services/window-managers/i3-sway/sway.nix
./services/window-managers/xmonad.nix
./services/wlsunset.nix
./services/xcape.nix
./services/xembed-sni-proxy.nix
./services/xidlehook.nix
./services/xscreensaver.nix
./services/xsettingsd.nix
./services/xsuspender.nix
./systemd.nix
./targets/darwin
./targets/generic-linux.nix
./xcursor.nix
./xresources.nix
./xsession.nix
<nixpkgs/nixos/modules/misc/assertions.nix>
<nixpkgs/nixos/modules/misc/lib.nix>
<nixpkgs/nixos/modules/misc/meta.nix>
];
(pkgs.path + "/nixos/modules/misc/assertions.nix")
(pkgs.path + "/nixos/modules/misc/meta.nix")
] ++ optional useNixpkgsModule ./misc/nixpkgs.nix;
pkgsModule = {
options.nixosSubmodule = mkOption {
type = types.bool;
internal = true;
readOnly = true;
pkgsModule = { config, ... }: {
config = {
_module.args.baseModules = modules;
_module.args.pkgsPath = lib.mkDefault
(if versionAtLeast config.home.stateVersion "20.09" then
pkgs.path
else
<nixpkgs>);
_module.args.pkgs = lib.mkDefault pkgs;
_module.check = check;
lib = lib.hm;
} // optionalAttrs useNixpkgsModule {
nixpkgs.system = mkDefault pkgs.system;
};
config._module.args.baseModules = modules;
config._module.args.pkgs = lib.mkDefault pkgs;
config._module.check = check;
config.lib = import ./lib { inherit lib; };
config.nixosSubmodule = nixosSubmodule;
config.nixpkgs.system = mkDefault pkgs.system;
};
in
modules ++ [ pkgsModule ]
in modules ++ [ pkgsModule ]

View File

@@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.abook;
in {
options.programs.abook = {
enable = mkEnableOption "Abook";
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
field pager = Pager
view CONTACT = name, email
set autosave=true
'';
description = ''
Extra lines added to <filename>$HOME/.config/abook/abookrc</filename>.
Available configuration options are described in the abook repository:
<link xlink:href="https://sourceforge.net/p/abook/git/ci/master/tree/sample.abookrc" />.
'';
};
};
config = mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "programs.abook" pkgs platforms.linux) ];
home.packages = [ pkgs.abook ];
xdg.configFile."abook/abookrc" = mkIf (cfg.extraConfig != "") {
text = ''
# Generated by Home Manager.
# See http://abook.sourceforge.net/
${cfg.extraConfig}
'';
};
};
}

50
modules/programs/afew.nix Normal file
View File

@@ -0,0 +1,50 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.afew;
in {
options.programs.afew = {
enable = mkEnableOption "the afew initial tagging script for Notmuch";
extraConfig = mkOption {
type = types.lines;
default = ''
[SpamFilter]
[KillThreadsFilter]
[ListMailsFilter]
[ArchiveSentMailsFilter]
[InboxFilter]
'';
example = ''
[SpamFilter]
[Filter.0]
query = from:pointyheaded@boss.com
tags = -new;+boss
message = Message from above
[InboxFilter]
'';
description = ''
Extra lines added to afew configuration file. Available
configuration options are described in the afew manual:
<link xlink:href="https://afew.readthedocs.io/en/latest/configuration.html" />.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.afew ];
xdg.configFile."afew/config".text = ''
# Generated by Home Manager.
# See https://afew.readthedocs.io/
${cfg.extraConfig}
'';
};
}

View File

@@ -0,0 +1,63 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.alacritty;
yamlFormat = pkgs.formats.yaml { };
in {
options = {
programs.alacritty = {
enable = mkEnableOption "Alacritty";
package = mkOption {
type = types.package;
default = pkgs.alacritty;
defaultText = literalExample "pkgs.alacritty";
description = "The Alacritty package to install.";
};
settings = mkOption {
type = yamlFormat.type;
default = { };
example = literalExample ''
{
window.dimensions = {
lines = 3;
columns = 200;
};
key_bindings = [
{
key = "K";
mods = "Control";
chars = "\\x0c";
}
];
}
'';
description = ''
Configuration written to
<filename>~/.config/alacritty/alacritty.yml</filename>. See
<link xlink:href="https://github.com/jwilm/alacritty/blob/master/alacritty.yml"/>
for the default configuration.
'';
};
};
};
config = mkMerge [
(mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != { }) {
# TODO: Replace by the generate function but need to figure out how to
# handle the escaping first.
#
# source = yamlFormat.generate "alacritty.yml" cfg.settings;
text =
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings);
};
})
];
}

View File

@@ -0,0 +1,58 @@
pkgs:
{ config, lib, ... }:
with lib;
{
options.alot = {
sendMailCommand = mkOption {
type = types.nullOr types.str;
description = ''
Command to send a mail. If msmtp is enabled for the account,
then this is set to
<command>msmtpq --read-envelope-from --read-recipients</command>.
'';
};
contactCompletion = mkOption {
type = types.attrsOf types.str;
default = {
type = "shellcommand";
command =
"'${pkgs.notmuch}/bin/notmuch address --format=json --output=recipients date:6M..'";
regexp = "'\\[?{" + ''
"name": "(?P<name>.*)", "address": "(?P<email>.+)", "name-addr": ".*"''
+ "}[,\\]]?'";
shellcommand_external_filtering = "False";
};
example = literalExample ''
{
type = "shellcommand";
command = "abook --mutt-query";
regexp = "'^(?P<email>[^@]+@[^\t]+)\t+(?P<name>[^\t]+)'";
ignorecase = "True";
}
'';
description = ''
Contact completion configuration as expected per alot.
See <link xlink:href="http://alot.readthedocs.io/en/latest/configuration/contacts_completion.html">alot's wiki</link> for
explanation about possible values.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra settings to add to this Alot account configuration.
'';
};
};
config = mkIf config.notmuch.enable {
alot.sendMailCommand = mkOptionDefault (if config.msmtp.enable then
"msmtpq --read-envelope-from --read-recipients"
else
null);
};
}

240
modules/programs/alot.nix Normal file
View File

@@ -0,0 +1,240 @@
# alot config loader is sensitive to leading space !
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.alot;
enabledAccounts =
filter (a: a.notmuch.enable) (attrValues config.accounts.email.accounts);
# sorted: primary first
alotAccounts = sort (a: b: !(a.primary -> b.primary)) enabledAccounts;
boolStr = v: if v then "True" else "False";
mkKeyValue = key: value:
let value' = if isBool value then boolStr value else toString value;
in "${key} = ${value'}";
mk2ndLevelSectionName = name: "[" + name + "]";
tagSubmodule = types.submodule {
options = {
translated = mkOption {
type = types.nullOr types.str;
description = ''
Fixed string representation for this tag. The tag can be
hidden from view, if the key translated is set to
<literal>""</literal>, the empty string.
'';
};
translation = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
A pair of strings that define a regular substitution to
compute the string representation on the fly using
<literal>re.sub</literal>.
'';
};
normal = mkOption {
type = types.nullOr types.str;
default = null;
example = "'','', 'white','light red', 'white','#d66'";
description = ''
How to display the tag when unfocused.
See <link xlink:href="https://alot.readthedocs.io/en/latest/configuration/theming.html#tagstring-formatting"/>.
'';
};
focus = mkOption {
type = types.nullOr types.str;
default = null;
description = "How to display the tag when focused.";
};
};
};
accountStr = account:
with account;
concatStringsSep "\n" ([ "[[${name}]]" ]
++ mapAttrsToList (n: v: n + "=" + v) ({
address = address;
realname = realName;
sendmail_command =
optionalString (alot.sendMailCommand != null) alot.sendMailCommand;
sent_box = "maildir" + "://" + maildir.absPath + "/" + folders.sent;
draft_box = "maildir" + "://" + maildir.absPath + "/" + folders.drafts;
} // optionalAttrs (aliases != [ ]) {
aliases = concatStringsSep "," aliases;
} // optionalAttrs (gpg != null) {
gpg_key = gpg.key;
encrypt_by_default = if gpg.encryptByDefault then "all" else "none";
sign_by_default = boolStr gpg.signByDefault;
} // optionalAttrs (signature.showSignature != "none") {
signature = pkgs.writeText "signature.txt" signature.text;
signature_as_attachment = boolStr (signature.showSignature == "attach");
}) ++ [ alot.extraConfig ] ++ [ "[[[abook]]]" ]
++ mapAttrsToList (n: v: n + "=" + v) alot.contactCompletion);
configFile = let
bindingsToStr = attrSet:
concatStringsSep "\n" (mapAttrsToList (n: v: "${n} = ${v}") attrSet);
in ''
# Generated by Home Manager.
# See http://alot.readthedocs.io/en/latest/configuration/config_options.html
${generators.toKeyValue { inherit mkKeyValue; } cfg.settings}
${cfg.extraConfig}
[tags]
'' + (let
submoduleToAttrs = m:
filterAttrs (name: v: name != "_module" && v != null) m;
in generators.toINI { mkSectionName = mk2ndLevelSectionName; }
(mapAttrs (name: x: submoduleToAttrs x) cfg.tags)) + ''
[bindings]
${bindingsToStr cfg.bindings.global}
[[bufferlist]]
${bindingsToStr cfg.bindings.bufferlist}
[[search]]
${bindingsToStr cfg.bindings.search}
[[envelope]]
${bindingsToStr cfg.bindings.envelope}
[[taglist]]
${bindingsToStr cfg.bindings.taglist}
[[thread]]
${bindingsToStr cfg.bindings.thread}
[accounts]
${concatStringsSep "\n\n" (map accountStr alotAccounts)}
'';
in {
options = {
programs.alot = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether to enable the Alot mail user agent. Alot uses the
Notmuch email system and will therefore be automatically
enabled for each email account that is managed by Notmuch.
'';
};
hooks = mkOption {
type = types.lines;
default = "";
description = ''
Content of the hooks file.
'';
};
bindings = mkOption {
type = types.submodule {
options = {
global = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Global keybindings.";
};
bufferlist = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Bufferlist mode keybindings.";
};
search = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Search mode keybindings.";
};
envelope = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Envelope mode keybindings.";
};
taglist = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Taglist mode keybindings.";
};
thread = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Thread mode keybindings.";
};
};
};
default = { };
description = ''
Keybindings.
'';
};
tags = mkOption {
type = types.attrsOf tagSubmodule;
default = { };
description = "How to display the tags.";
};
settings = mkOption {
type = with types;
let primitive = either (either (either str int) bool) float;
in attrsOf primitive;
default = {
initial_command = "search tag:inbox AND NOT tag:killed";
auto_remove_unread = true;
handle_mouse = true;
prefer_plaintext = true;
};
example = literalExample ''
{
auto_remove_unread = true;
ask_subject = false;
thread_indent_replies = 2;
}
'';
description = ''
Configuration options added to alot configuration file.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra lines added to alot configuration file.
'';
};
};
accounts.email.accounts = mkOption {
type = with types; attrsOf (submodule (import ./alot-accounts.nix pkgs));
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.alot ];
xdg.configFile."alot/config".text = configFile;
xdg.configFile."alot/hooks.py" = mkIf (cfg.hooks != "") {
text = ''
# Generated by Home Manager.
'' + cfg.hooks;
};
};
}

View File

@@ -0,0 +1,61 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.aria2;
formatLine = n: v:
let
formatValue = v:
if builtins.isBool v then
(if v then "true" else "false")
else
toString v;
in "${n}=${formatValue v}";
in {
meta.maintainers = [ hm.maintainers.justinlovinger ];
options.programs.aria2 = {
enable = mkEnableOption "aria2";
settings = mkOption {
type = with types; attrsOf (oneOf [ bool float int str ]);
default = { };
description = ''
Options to add to <filename>aria2.conf</filename> file.
See
<citerefentry>
<refentrytitle>aria2c</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>
for options.
'';
example = literalExample ''
{
listen-port = 60000;
dht-listen-port = 60000;
seed-ratio = 1.0;
max-upload-limit = "50K";
ftp-pasv = true;
}
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra lines added to <filename>aria2.conf</filename> file.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.aria2 ];
xdg.configFile."aria2/aria2.conf".text = concatStringsSep "\n" ([ ]
++ mapAttrsToList formatLine cfg.settings
++ optional (cfg.extraConfig != "") cfg.extraConfig);
};
}

View File

@@ -0,0 +1,32 @@
{ config, lib, ... }:
with lib;
{
options.astroid = {
enable = mkEnableOption "Astroid";
sendMailCommand = mkOption {
type = types.str;
description = ''
Command to send a mail. If msmtp is enabled for the account,
then this is set to
<command>msmtpq --read-envelope-from --read-recipients</command>.
'';
};
extraConfig = mkOption {
type = types.attrsOf types.anything;
default = { };
example = { select_query = ""; };
description = ''
Extra settings to add to this astroid account configuration.
'';
};
};
config = mkIf config.notmuch.enable {
astroid.sendMailCommand = mkIf config.msmtp.enable
(mkOptionDefault "msmtpq --read-envelope-from --read-recipients");
};
}

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