Compare commits

...

308 Commits

Author SHA1 Message Date
dependabot[bot]
b372d7f8d5 ci: bump cachix/install-nix-action from 20 to 21
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 20 to 21.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v20...v21)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 02:04:35 +00:00
dependabot[bot]
f9edbedaf0 ci: bump DeterminateSystems/update-flake-lock from 18 to 19
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 18 to 19.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v18...v19)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 02:03:13 +00:00
dependabot[bot]
d6f3ba090e ci: bump cachix/install-nix-action from 19 to 20
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 19 to 20.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v19...v20)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-03 21:06:30 +00:00
dependabot[bot]
dd73caf55c ci: bump DeterminateSystems/update-flake-lock from 17 to 18
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 17 to 18.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v17...v18)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-03 20:45:35 +00:00
Robert Helgesson
7da74ff66d ci: use the right channel
Also revert bad backport of broot test.
2023-04-03 22:07:24 +02:00
Robert Helgesson
83110c2598 gpg: fix URL of key in test case
Fixes #3803

(cherry picked from commit a34aaad2ae)
2023-03-25 11:07:22 +01:00
Gaetan Lepage
97b452d868 gpg: update hash in test
(cherry picked from commit 054d9e3187)
2023-03-25 11:07:10 +01:00
Naïm Favier
9154cd519a Revert "[backport 22.11] starship: condition nushell integration on nushell 0.73+" (#3779)
This reverts commit 68163d27e9.
2023-03-17 16:31:41 +01:00
Naïm Favier
68163d27e9 [backport 22.11] starship: condition nushell integration on nushell 0.73+ (#3777)
Older versions are not supported: https://starship.rs/#nushell

(cherry picked from commit a3b90e5762)
2023-03-17 14:11:37 +01:00
dependabot[bot]
74e0b590c0 ci: bump DeterminateSystems/update-flake-lock from 16 to 17
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 16 to 17.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v16...v17)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 02:12:06 +00:00
Lord-Valen
b0be47978d [Backport release-22.11] starship: add nushell integration #3701 (#3697)
* starship: add nushell integration support

(cherry picked from commit 7ae7250df8)

* starship: fix nushell integration

Overwrite starship/init.nu if already exists, since this is a cache
file for sourcing in `init.nu`.

(cherry picked from commit 646ac0ad17)

* starship: re-add ion integration

which was apparently mistakenly removed in commit 7ae7250

(cherry picked from commit a62e4c88d7)

* starship: Use mkEnableOption (#3701)

---------

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>
Co-authored-by: Aidan Gauland <aidalgol@users.noreply.github.com>
Co-authored-by: Marcel Transier <34482842+marceltransier@users.noreply.github.com>
2023-03-08 15:24:16 +01:00
Naïm Favier
07b0b43a92 [backport 22.11] modules/git: make options passed to less(1) for diff-so-fancy configurable (#3751)
The `-X` prevents that screen is cleared when showing a diff that's
larger than my screen.

I.e. when running `git diff` and press `q`, the last thing I want to see
is the prompt with `git diff` and *not* the part of the diff I browsed,
to be clear

    $ git diff
    $ <cursor>

Considering that this is somewhat opinionated, I decided to build an
option which allows you to pass arbitrary commands to the less
invocation.

(cherry picked from commit cccd7622bd)

Co-authored-by: Maximilian Bosch <maximilian@mbosch.me>
2023-03-08 15:01:04 +01:00
Naïm Favier
86bb69b0b1 [backport 22.11] gpg: allow unsigned tags (#3730)
(cherry picked from commit d331cceec7)

Co-authored-by: Sylvain Fankhauser <sephi@fhtagn.top>
2023-03-02 12:45:46 +01:00
Wael Nasreddine
a7d3f51e9e [backport #3639] programs.neovim: add extraLuaConfig (#3727)
Co-authored-by: Guillaume Desforges <guillaume.desforges.pro@gmail.com>
2023-03-01 14:52:37 -08:00
Wael Nasreddine
71c6073ee0 [backport #3720] .github: pin nix 2.13 in workflows (#3728)
Co-authored-by: Naïm Favier <n@monade.li>
2023-03-01 13:43:44 -08:00
Thiago Kenji Okada
550809881b [Backport release-22.11] picom: add egl backend to options (#3452)
Mirrors: 2beff9375c

Co-authored-by: Leix b <abone9999@gmail.com>
2023-02-27 22:34:00 +01:00
Robert Helgesson
2928097823 Fix 22.11 tests (#3678)
* broot: update test to match upstream changes

Fixes #3527

(cherry picked from commit 18b56e3f7d)

* broot: simplify test slightly

(cherry picked from commit d7a3c26854)

* i3status-rust: fix tests

Nix 2.12.0 slightly changed the JSON output format. This updates the
i3status-rust test cases to match.

(cherry picked from commit 263f6e4523)
2023-02-25 01:27:04 +01:00
Naïm Favier
00efa2d4c2 [backport 22.11] tests: fix gnupg stub (#3702)
systemd now depends on `gnupg.override`, so we need a stub for systemd too.

(cherry picked from commit 7ff468105d)
2023-02-25 00:46:15 +01:00
dependabot[bot]
2cb27c7911 ci: bump cachix/install-nix-action from 18 to 19
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 18 to 19.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v18...v19)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 02:59:14 +00:00
dependabot[bot]
65c47ced08 ci: bump DeterminateSystems/update-flake-lock from 15 to 16
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 15 to 16.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v15...v16)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 02:28:53 +00:00
Anders Kaseorg
89a8ba0b5b home-manager: pass -L/--print-build-logs to nix build
When building from a flake, `nix build` hides the build output by
default, with a `-L`/`--print-build-logs` option to show it. Pass this
option along from `home-manager` if the user provides it.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
(cherry picked from commit c55fa26ce0)
2022-12-28 17:21:08 +01:00
Robert Helgesson
6b8836ce6c cachix-agent: add module
(cherry picked from commit 939731b8cb)
2022-12-28 17:21:05 +01:00
Robert Helgesson
2d5b55d23d home-environment: explicitly use coreutils
Before we used dirname and readlink from the ambient environment,
which caused problems when they don't behave as expected.

Fixes #3516

(cherry picked from commit d7eee202e5)
2022-12-28 17:20:03 +01:00
Kamal Al Marhubi
2bfcc6be42 home-manager: refine flake URI lookup
Depending on DHCP settings you might end up with different output from
running `hostname`. Eg, your local hostname is `mylaptop`, and your
home router is configured with a local domain of `.hoome.arpa`. In
this case:

    $ hostname
    mylaptop.home.arpa
    $ hostname -s
    mylaptop

If you then go to cafe which has its router configured with `.lan` as
its local domain. Then, if your DHCP settings accept the local domain
from the router,

    $ hostname
    myalaptop.lan
    $ hostname -s
    mylaptop

With the pre-existing behaviour, if you had a
`"me@mylaptop.home.arpa"` entry in `outputs.homeConfigurations`,
running `home-manager switch` would fail:

    $ home-manager switch
    error: flake 'git+file:///home/me/.config/nixpkgs' does not provide
    attribute 'packages.aarch64-darwin.homeConfigurations."me".activationPackage',
    'legacyPackages.aarch64-darwin.homeConfigurations."me".activationPackage'
    or 'homeConfigurations."me".activationPackage'

After this commit, you can put configuration in a `"me@mylaptop"`
entry in `outputs.homeConfigurations`, and everything will work on
either network.

(cherry picked from commit e7eba9cc46)
2022-12-28 17:19:40 +01:00
Norbert Melzer
d965d248aa java: remove IFD
The previous variant used IFD to generate the `JAVA_HOME` variable and relied on internal hooks of the `java` package, this failed for a user cross compiling their configuration.

This PR changes that and uses the `home` attribute, as documented in the very last sentence of the https://nixos.org/manual/nixpkgs/stable/#sec-language-java chapter.

(cherry picked from commit b3565b3447)
2022-12-28 17:19:23 +01:00
Robert Helgesson
d977182704 home-manager: use hostname from Nixpkgs
Before the home-manager tool got hostname from the system, which was
not declarative or reproducible.

(cherry picked from commit 2af0d07678)
2022-12-28 17:19:00 +01:00
Mario Rodas
0e8125916b treewide: fix typos
(cherry picked from commit b5c083300b)
2022-12-05 16:10:03 +01:00
Robert Helgesson
06fbc3a480 emacs: add note about inhibit-startup-message
(cherry picked from commit c3060ab937)
2022-12-05 16:10:02 +01:00
Mario Rodas
7eee2b197a treewide: use liberachat and OFTC in examples
Freenode was taken over by a wannabe bitcoin millionaire [1], which
prompted the migration of communities to Libera Chat and OFTC [2].

[1] https://blog.bofh.it/debian/id_461
[2] https://hackaday.com/2021/05/20/freenode-debacle-prompts-staff-exodus-new-network/

(cherry picked from commit 6ce326cef9)
2022-12-05 16:10:01 +01:00
Mario Rodas
9ad9dfe371 yt-dlp: fix settings example
The yt-dlp settings should be an attribute set.

(cherry picked from commit e3e2abaef5)
2022-12-05 16:10:00 +01:00
James Chen-Smith
44ca0df409 flake: correct nix-darwin flake description
Corrects copy/paste mistake in the nix-darwin flake description.

(cherry picked from commit 90b0e5f440)
2022-12-05 16:09:59 +01:00
Robert Helgesson
50cee5be70 firefox: fix expected bookmarks in test
(cherry picked from commit 7bfe3cd9b0)
2022-12-05 16:09:41 +01:00
dependabot[bot]
3cd5c21b80 ci: bump DeterminateSystems/update-flake-lock from 14 to 15
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 14 to 15.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v14...v15)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 12:43:36 +00:00
Robert Helgesson
e704ef9ec7 neovim: avoid aliased package
(cherry picked from commit 848ae0d6bb)
2022-12-04 13:15:15 +01:00
Loïc Reynier
3c3af4bbff pet: don't create file without snippets
(cherry picked from commit 15d94f3058)
2022-12-04 13:15:14 +01:00
Robert Helgesson
32c336c767 polybar: fix restart trigger
The old trigger would actually never cause a restart since the path
doesn't change. With this change the trigger is now using the actual
configuration path in the Nix store, which depends on the content.

(cherry picked from commit 65700a4fd1)
2022-12-04 13:15:03 +01:00
h7x4
6ee09246d9 polybar: don't generate config if no options are set (#3383)
* polybar: don't generate config if no options are set

* polybar: add h7x4 as maintainer

(cherry picked from commit 64f7a77517)
2022-12-04 13:14:55 +01:00
toastal
3bf287ef12 himalaya: 0.6.x config updates
Some properties were renamed. Big changes however include `backend` and
`sender` enum options.

(cherry picked from commit 9fb1bb9794)
2022-12-04 09:48:56 +01:00
toastal
c4c5ef1fa8 email: add signature delimiter
While this is created to match `himalaya`’s configuration API, this
could easly be reused for other programs that consume the email module
by concatination the strings.

(cherry picked from commit 05d71f517b)
2022-12-04 09:48:55 +01:00
toastal
e006495c15 maintainers: add toastal
I wish there there were a contribution option outside of the proprietary
closed-source, Microsoft GitHub platform :(

(cherry picked from commit 9e266ca2a7)
2022-12-04 09:48:54 +01:00
Kylie McClain
e66194675f mpd-discord-rpc: fix typo
(cherry picked from commit 518dca61c0)
2022-12-04 08:45:36 +01:00
maximsmol
6b71989c0d just: deprecate module
The module is no longer necessary since completions work out of the
box now.

(cherry picked from commit eb3598cf44)
2022-12-03 10:26:42 +01:00
Mario Rodas
6d3912c6db direnv: fix direnv configuration path
Direnv >=2.21.0 uses [1] $XDG_CONFIG_HOME/direnv/config.toml as
configuration path.

[1] 54cb3c5a91

(cherry picked from commit e38ce0ae16)
2022-12-02 18:29:49 +01:00
Robert Helgesson
8f26dec249 home-manager: update stable version to 22.11
(cherry picked from commit 71fa4cdf9c)
2022-12-02 15:52:14 +01:00
li
9cbe8a2888 pueue: fix for empty settings
PR #3230

(cherry picked from commit 63cef13e49)
2022-12-02 15:52:07 +01:00
Nick Cao
e891b060e7 dbus: fix dbus-run-session command
Specifically, inform the command about the absolute path of
dbus-daemon. Otherwise it will try running dbus-daemon from PATH,
which may not always work.

PR #3405

(cherry picked from commit 02c0546033)
2022-11-29 13:27:42 +01:00
Philipp Mildenberger
73dbcfbca6 nushell: add options 'extraConfig' and 'extraEnv'
(cherry picked from commit 4a12f304e0)
2022-11-29 13:27:31 +01:00
Phillip Cloud
f7641a3ff3 scmpuff: add fish integration flag 2022-11-21 23:51:05 +01:00
Pablo Bollansee
3ce1c4787a Translate using Weblate (Dutch)
Currently translated at 100.0% (14 of 14 strings)

Translate using Weblate (Dutch)

Currently translated at 100.0% (32 of 32 strings)

Co-authored-by: Pablo Bollansee <pablo.bollansee@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/nl/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/nl/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
2022-11-21 16:35:25 +01:00
Jakub Janczak
c3690701d1 Translate using Weblate (Polish)
Currently translated at 100.0% (14 of 14 strings)

Co-authored-by: Jakub Janczak <kubek2k@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/pl/
Translation: Home Manager/Home Manager Modules
2022-11-21 16:35:25 +01:00
Loïc Reynier
433e8de330 fzf: add colors option (#3206) 2022-11-21 08:35:18 -07:00
KFearsoff
c0f9cbcf93 newsboat: allow imperative "urls" management
This commit allows imperative management of "urls" file. It can be
useful if "urls" file is treated as a secret.

With this change, it's possible to provision "urls" via Syncthing,
agenix, sops-nix or other means, while still managing Newsboat
declaratively.
2022-11-20 00:26:42 +01:00
Matthieu Coudron
948d1f8a5c programs.zsh: generate a more compact config (#3170) 2022-11-18 09:27:43 -07:00
alois31
5589b28e66 opam: add fish integration (#3422) 2022-11-18 09:00:57 -07:00
Thiago Kenji Okada
c94c9c342f picom: remove experimentalBackends, add extraArgs (#3423)
`--experimental-backends` flag was removed in the recent released picom
v10. Using it now will result in the program exiting.

v10 also introduces its counter-part, `--legacy-backends`. However this
will be removed soon. Instead of adding this as an separate option, add
`extraArgs` option so for those that they want they can pass it manuall.
It is also more future proof.
2022-11-18 08:59:30 -07:00
Sumner Evans
fe85cc4c37 udiskie: add note about needing to enable system-wide config (#3424)
Closes #3153

Signed-off-by: Sumner Evans <me@sumnerevans.com>
2022-11-17 13:27:03 -07:00
Andrew Marshall
bc90de24d8 xdg-user-dirs: allow setting to null to skip setting
Previously, this module was all-or-nothing with its pre-defined user
dirs. This allows e.g. `xdg.userDirs.desktop = null;` to opt-out of
some configuration while still benefiting from the rest.
2022-11-13 10:38:54 +01:00
David
651db464dc thunderbird: allow using the module on Darwin
While the Nix packages for Thunderbird are not available for macOS,
the module can still be used to manage profiles and configuration.

Fixes #3407.
2022-11-13 10:06:36 +01:00
Xyz00777
6ce3493a3c kodi: fix syntax error in example 2022-11-09 09:16:50 +01:00
Robert Helgesson
d20e3d070c screen-locker: minor description fix 2022-11-08 10:15:54 +01:00
Eise Zimmerman
b0cf7245c4 Translate using Weblate (Dutch)
Currently translated at 40.6% (13 of 32 strings)

Co-authored-by: Eise Zimmerman <eiscomania@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/nl/
Translation: Home Manager/Home Manager CLI
2022-11-07 18:06:30 +01:00
Robert Helgesson
886675991b home-environment: reset PATH in activation script
Starting with state version 22.11 we completely reset the PATH
variable in the activation script. This is to avoid impurities and
unexpected results if the activation script accidentally uses a
command found in the user's PATH.
2022-11-07 15:09:36 +01:00
Robert Helgesson
d67776563e systemd: fix systemctlPath default text 2022-11-07 15:09:35 +01:00
Robert Helgesson
5dd3ce3f1e mu: use absolute path to mu in activation block 2022-11-07 15:09:31 +01:00
github-actions[bot]
1ef0da3212 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/fdebb81f45a1ba2c4afca5fd9f526e1653ad0949' (2022-10-29)
  → 'github:nixos/nixpkgs/3bacde6273b09a21a8ccfba15586fb165078fb62' (2022-11-05)
• Updated input 'utils':
    'github:numtide/flake-utils/6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817' (2022-10-29)
  → 'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f' (2022-11-02)
2022-11-06 04:14:41 +00:00
Guillaume Girol
c5adf29545 i3: fix reloading when there are several sockets
This can happen after logout/login.

Fixes #527
2022-11-06 00:41:10 +01:00
David Arnold
989d4fa536 home-environment: remove no-op commands 2022-11-06 00:15:35 +01:00
Ronny Pfannschmidt
ccc9164b76 home-environment: fix activation on new style profiles
When using the new style profiles we get conflicts when trying to
replace the old `home-path` derivation. To avoid this conflict we
delete the old `home-path` before the install.

Unfortunately, `nix profile` does not yet have a equivalent for
`nix-env --set` and we have to do this hackish workaround. See

  https://github.com/NixOS/nix/issues/6349

for the associated issue in Nix.

Fixes #2848
2022-11-06 00:12:08 +01:00
midchildan
c728307482 darwin: use full path to commands in activation script 2022-11-05 12:14:08 +09:00
David
b764068a50 thunderbird: add module
Add a new Thunderbird module that uses the configuration in
`accounts.email.accounts` to setup SMTP and IMAP accounts.

Multiple profiles are not supported at this point.
2022-11-04 16:12:12 +01:00
natsukium
9333581075 vscode: add userTasks test 2022-11-03 10:36:21 +01:00
natsukium
39c1e6704a vscode: fix invalid examples 2022-11-03 09:24:25 +01:00
Marin
f520832a47 darwin: re-enable ~/Applications symlinks (#3139)
Tested-by: supermarin@users.noreply.github.com
2022-11-02 13:41:53 -04:00
Chuang Zhu
916811c8f9 xfconf: add module 2022-11-02 12:01:17 +01:00
Arjan Schrijver
04e844090e oh-my-posh: add module 2022-11-02 01:04:42 +01:00
David Arnold
183a62f356 targets/generic-linux: use the correct nix package 2022-11-02 00:45:56 +01:00
pogobanane
824202b4c4 readme: add inofficial option search 2022-11-02 00:42:57 +01:00
Anton Bulakh
8957d53199 awesome: fix luaModules using pkgs.lua instead of awesome.lua (#3258)
Mirroring my change to awesome module in nixos:
b79f9e9b8a
2022-11-01 19:43:20 +01:00
zimbatm
722e8d65d3 ci: use the cachix auth token 2022-10-31 17:36:04 +01:00
dependabot[bot]
25344cb808 ci: bump cachix/cachix-action from 11 to 12 (#3368)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 11 to 12.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v11...v12)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-31 15:12:57 +00:00
polykernel
2464c21ab2 sway: import XDG_SESSION_TYPE in systemd user environment (#3328)
- The `XDG_SESSION_TYPE` environment variable is used by some applications and frameworks to
  detect wayland sessions (i.e qt5/6, electron/chromium). It is set by wlroots since version 0.13.0 [1].

- Propagating `XDG_SESSION_TYPE` to the systemd user environment is necessary when processes launched by
  services (e.g emacs) need to inherit the environment variable.

[1] - 90c8452959
2022-10-31 13:09:06 +01:00
github-actions[bot]
fad4e7c79c flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/5f326e2a403e1cebaec378e72ceaf5725983376d' (2022-09-12)
  → 'github:nixos/nixpkgs/fdebb81f45a1ba2c4afca5fd9f526e1653ad0949' (2022-10-29)
• Updated input 'utils':
    'github:numtide/flake-utils/c0e246b9b83f637f4681389ecabcb2681b4f3af0' (2022-08-07)
  → 'github:numtide/flake-utils/6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817' (2022-10-29)
2022-10-31 12:35:56 +01:00
David Morgan
160025ca46 irssi: add option for SASL external authentication 2022-10-31 09:28:49 +01:00
Robert Helgesson
423211401c home-environment: update hm-version generation
Instead of home-made script use the Nixpkgs library functions. This
will hopefully be more robust and give more accurate results.
2022-10-28 22:51:35 +02:00
Robert Helgesson
213a06295d ci: don't run tests in GitLab CI
It eats too many CI minutes.
2022-10-27 22:47:27 +02:00
Robert Helgesson
f67649307d home-environment: make getVersion more robust 2022-10-27 22:20:37 +02:00
Markus S. Wamser
d3f21617ac vscode: add options to disable update checks
Update notification popups are annoying when vscode/vscodium is
managed by Home Manager. However, as these settings also require the
configuration to be managed via `userSettings`, they are disabled by
default.
2022-10-27 18:16:03 +02:00
Robert Helgesson
32fe7d2ebb home-environment: add hm-version file
This commits adds a file `hm-version` to the generated generation
directory. This file will contain the release version, and if
available, the Git commit hash.
2022-10-27 14:51:48 +02:00
Paul Meyer
7dc4e4ebd7 k9s: add module 2022-10-25 00:05:50 +02:00
Damien Cassou
186d9399f9 borgmatic: specify where to find sleep (#3349)
Closes #3348.
2022-10-23 16:52:22 -04:00
Kira Bruneau
69d19b9839 firefox: support setting search engines
With this change, it's now possible to configure the default search
engine in Firefox with

  programs.firefox.profiles.<name>.search.default

and add custom engines with

  programs.firefox.profiles.<name>.search.engines.

It's also recommended to enable

  programs.firefox.profiles.<name>.search.force = true

since Firefox will replace the symlink for the search configuration on
every launch, but note that you'll loose any existing configuration by
enabling this.
2022-10-22 20:36:04 +02:00
David Warde-Farley
c485669ca5 i3status: add package attribute 2022-10-20 10:04:30 +02:00
Robert Helgesson
d1191c6d05 docs: bump nmd
Fixes #3342
2022-10-20 08:47:36 +02:00
j-brn
42f81ac107 looking-glass-client: add module 2022-10-18 10:12:15 +02:00
dependabot[bot]
e901c8d860 ci: bump cachix/cachix-action from 10 to 11
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 10 to 11.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v10...v11)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 07:28:06 +00:00
Robert Helgesson
a50c0c6fe0 dependabot: switch target from 21.11 to 22.05 2022-10-17 09:17:50 +02:00
dependabot[bot]
bc7432fbcc ci: bump cachix/install-nix-action from 17 to 18
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 17 to 18.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v17...v18)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 01:28:56 +00:00
Damien Cassou
04f5399978 borgmatic: add module 2022-10-16 21:51:52 +02:00
ElnuDev
da3b8049fd im/fcitx5: add GLFW_IM_MODULE session variable
This lets fcitx5 be used within the kitty terminal emulator. See
https://wiki.archlinux.org/title/Kitty#Enable_IME_support for more.
2022-10-16 21:42:32 +02:00
Robert Helgesson
86bc0e349f dconf: handle missing oldGenPath 2022-10-16 17:59:57 +02:00
Rohan Ferris
2ecb3ea990 firefox: rename chrome-gnome-shell suggestion to gnome.gnome-browser-connector (#3329)
gnome3.chrome-gnome-shell is now gnome.gnome-browser-connector
2022-10-15 15:49:11 -04:00
Robert Helgesson
8cbc6500df lib/bash: make call to tput more robust
Specifically, if `tput colors` fails with an error we treat that as if
the terminal does not support colors.

Fixes #423

Suggested-by: PhotonQuantum <self@lightquantum.me>
2022-10-13 11:56:47 +02:00
Robert Helgesson
8eaa3ba56e lib/bash: remove unused Bash library files
The color echo functions are provided by `lib/bash/home-manager.sh`.
2022-10-13 11:56:46 +02:00
Robert Helgesson
618ab0f882 discocss: fix attribute name 2022-10-13 11:52:24 +02:00
Ilan Joselevich
2d8e5a9934 discocss: add module
Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2022-10-13 01:11:01 +02:00
ilkecan
5597b3a742 dconf: reset keys that become unmanaged on switch 2022-10-11 22:41:39 +02:00
Matthieu Coudron
b37a909508 ci: specify files that should be tagged "mail" 2022-10-11 10:22:19 +02:00
Robert Helgesson
ebe6d2c747 home-manager: set state version when uninstalling
Otherwise the switch exits with an error.

Fixes #3320
2022-10-11 09:31:29 +02:00
arcnmx
e1f1160284 redshift/gammastep: add enableVerboseLogging option
This option controls whether the `-v` command line argument is given.

Co-authored-by: Sumner Evans <me@sumnerevans.com>
2022-10-09 01:21:05 +02:00
Gabriel Arazas
bd87a34bb4 sioyek: enable multiple bindings for the same command 2022-10-08 22:11:55 +02:00
Matthieu Coudron
3b5a8d3dc7 ci: introduce labeler workflow
Automatically tag PRs depending on touched files.
2022-10-08 12:52:18 +02:00
ralismark
9fcae11ff2 systemd: name slice unit correctly 2022-10-07 16:07:53 +11:00
AndersonTorres
be2cade373 havoc: add module 2022-10-07 01:21:11 +02:00
Mario Rodas
8c297e1816 ledger: add module
Add module for https://www.ledger-cli.org/
2022-10-07 01:06:40 +02:00
Philippe Laflamme
7fee13eb4c sbt: cache passwordCommand output
This will cache the output of `passwordCommand` per authentication
realm.

Context: the `credentials` key in `sbt` is a `TaskKey[Seq[Credentials]]`.
In `sbt`, tasks are evaluated on-demand and their output is not cached.
This particular key is referenced by all submodules in a project. When
the command is relatively expensive (e.g.: `pass show foo`), this
results in several seconds of delay when doing basic things like
`compile` or `test` which makes this unusable without some kind of
caching.
2022-10-07 00:40:50 +02:00
Philippe Laflamme
599e22b1c7 sbt: allow managing the ~/.sbt/repositories file
sbt allows overriding the default repositories to use to resolve
dependencies. This is often used with proxies and/or private
repositories to host internal packages.

This change adds a `repositories` attribute to `sbt` to allow
specifying the values that will go in `~/.sbt/repositories` file.

To support the above change we also deprecate the `baseConfigPath`
option in favour of `baseUserConfigPath` which points one level higher
by default. This allows not using relative paths to refer to the
top-level configuration directory.

Also adds tests for the new option and the deprecation of the previous
one.
2022-10-07 00:23:29 +02:00
wuyoli
6427ae9578 swayidle: fix examples
The example did not work before, since the systemd service does not
have swaylock in its PATH.

PR #3298
2022-10-06 19:52:37 +02:00
Naïm Favier
1a8e35d2e5 mpd: add package to home path (#3303)
It's always useful to have the man pages available.
2022-10-05 11:22:12 -04:00
Tad Fisher
e4e639dd4d programs/lieer: use lieer package (#3262)
The gmailieer attribute was aliased to lieer in nixpkgs.
2022-10-03 09:50:40 +02:00
Judson Lester
a7f0cc2d7b lorri: add nixPackage and enableNotifications options 2022-09-30 23:30:42 +02:00
Robert Helgesson
7a3384c796 syncthing: add platform assertion 2022-09-30 22:27:35 +02:00
Vanilla
9727190b80 mangohud: fix moved link of config file
PR #3278
2022-09-30 20:47:00 +02:00
superherointj
5c5a5b9b45 urxvt: fix package name 2022-09-30 15:08:02 -03:00
Anderson Torres
a053da0f22 fluxbox: use mkPackageOption instead of mkOption (#3286) 2022-09-30 12:54:55 -04:00
arjan-s
e7be7c4688 pls: add module (#3285) 2022-09-30 12:53:39 -04:00
Liam Petrie
864ff685fe lib: add two new gvariant types
Add GVariant variant and dictionary entry types
2022-09-29 13:05:51 +02:00
mtths
9da6c0232e docs: explain how to enable flakes on NixOS
Since `nix.conf` is generated when using NixOS, it cannot be edited.

Instead we add the instructions described by Xe in
https://xeiaso.net/blog/nix-flakes-1-2022-02-21
2022-09-29 12:15:38 +02:00
Sumner Evans
68ea28d330 kdeconnect: change package
Specifically, use pkgs.kdeconnect instead of
pkgs.plasma5Packages.kdeconnect-kde.

Closes #3274

Signed-off-by: Sumner Evans <me@sumnerevans.com>
2022-09-29 12:06:52 +02:00
Naïm Favier
28334988db picom: use types.numbers.between
Mirrors 77307fcff8
2022-09-29 11:34:00 +02:00
aameen-tulip
6dc8a43f39 flake: list deprecated args in throw
The use of `throwIf` was retained on the off chance that someone
intentionally overrides it.
2022-09-27 15:50:32 +02:00
Chan Siu Man
1f5ef2bb41 broot: fix config file location (#3273)
At commit [5666e6b9](5666e6b9fb),
broot refactored the content of the file `/resources/default-conf.hjson`
into multiple files under the directory `/resources/default-conf`, using
[`imports`](5666e6b9fb/resources/default-conf/conf.hjson (L152-L165))
to refer to other configurations.

This refactoring is effective since version 1.14.0 of broot.

After this refactoring, in `xdg.configFile.broot` (which defaults to
`~/.config/broot`):
- we need to copy all potentially referenced files (all files under
  `resources/default-conf`),
- except we need to leave out `conf.hjson` which conflicts with the
  `conf.toml` generated by home-manager (because broot [accepts both conf.toml and conf.hjson](https://dystroy.org/broot/conf_file/))

To implement this, we use `symlinkJoin` to create the content of
`xdg.configFile.broot` by merging multiple sources.
2022-09-27 12:19:02 +02:00
Robin Stumm
65b65ce5ef broot: use upstream defaults, allow all config options (#2644)
* broot: use freeformType for config

* broot: use defaults from upstream

closes #2395

* broot: generate shell function

* broot: add @dermetfan to CODEOWNERS

* broot: rename `config` option to `settings`

* broot: make example more idiomatic

Co-authored-by: Nicolas Berbiche <nic.berbiche@gmail.com>

Co-authored-by: Nicolas Berbiche <nic.berbiche@gmail.com>
2022-09-26 20:36:06 +02:00
dependabot[bot]
9e7394523e ci: bump DeterminateSystems/update-flake-lock from 13 to 14
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 13 to 14.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v13...v14)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-25 23:02:18 +00:00
José Luis Lafuente
707cb75ed3 tmate: add module 2022-09-26 00:28:00 +02:00
Rosario Pulella
9b91709899 safeeyes: add module
This adds a basic module for Safe Eyes based off of the one in
Nixpkgs.
2022-09-25 23:01:25 +02:00
Rosario Pulella
3eaadd82b8 maintainers: add Rosuavio 2022-09-25 22:51:50 +02:00
Joosep Jääger
de3758e31a neovim: fix a typo in the generated init.lua (#3252)
neovim complains when having both an init.lua and an init.vim
2022-09-23 13:33:17 +02:00
Matthieu Coudron
bd83eab622 programs.neovim: default to init.lua (#3233)
We change the current logic: instead of writing an init.vim which loads
lua/init-home-manager.lua, we write an init.lua that sources init.vim

This commit also avoids writing any of these files if the plugins have
no config.
2022-09-22 10:39:55 +02:00
AndersonTorres
f17819f4f1 fluxbox: add module 2022-09-22 00:43:09 +02:00
Loïc Reynier
f5e4614c11 yt-dlp: add settings option 2022-09-22 00:09:35 +02:00
David Baynard
41790ba656 mbsync: extend config type with list of strings
Some configuration options can take space separated strings; for
example `SSLVersions` can be configured with multiple allowed
versions.

    SSLVersions TLSv1.3 TLSv1.2

This can now be represented in Home Manager.

    SSLVersions = [ “TLSv1.3” “TLSv1.2” ];

In implementing this change, it uses oneOf for config type, as it is a
cleaner way to represent the union than the nested eithers
formulation.

Also add SSLVersions to test lists of strings in
`account.extraConfig`.
2022-09-20 01:24:21 +02:00
cafkafk
df79df8be1 Translate using Weblate (Danish)
Currently translated at 100.0% (14 of 14 strings)

Co-authored-by: cafkafk <christina@cafkafk.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/da/
Translation: Home Manager/Home Manager Modules
2022-09-19 22:24:39 +02:00
Weblate
22ef57a54c Add translation using Weblate (Danish)
Co-authored-by: Weblate <noreply@weblate.org>
2022-09-19 22:24:39 +02:00
cafkafk
b4bfe3b2d9 Translate using Weblate (Danish)
Currently translated at 100.0% (32 of 32 strings)

Add translation using Weblate (Danish)

Co-authored-by: cafkafk <christina@cafkafk.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/da/
Translation: Home Manager/Home Manager CLI
2022-09-19 22:24:39 +02:00
toonn
9555918151 nix-darwin: simplify activation script invocation
In #587, kalbasit introduce the `-i` flag so the sudo invocation would
run in an environment with `HOME` set to the correct value for the
target user. This was necessary to be able to set up multiple users
without interfering with the invoking user's `HOME`.

In #807, I switched to `-s` instead because I managed to get an
invalid shell set for my user by switching `useUserPackages` from
`true` to `false` which changes the location where packages are
installed and `~/.nix-profile/bin/<my-shell>` was no longer valid.
This was based on the assumption that `SHELL` would be set to some
sensible value by Home Manager at this point. This turned out to be
false as reported in #2900.

In 0ced6d6d (this commit's parent at this time), I explicitly set
`SHELL` to `${pkgs.bash}` so it is definitely set to a good shell when
invoking the activation script.

However, #807 broke activation for multiple users, the original
motivation for `-i`, as reported in #2856. I fixed this in #2857 by
additionally passing `--set-home`.

Further discussion with rycee in #3040 made me realize that the
activation script already has a good Nix store bash shebang. So all
the problems have been caused, not by the shell used for the
activation script but by sudo trying to use a different shell at all.
`-i` uses the shell set in the `passwd` file for the target user, but
this can become invalid as happened to me. `-s` uses either `SHELL` if
it's defined or the invoking user's shell as set in the `passwd` file.
By explicitly setting this to a shell provided by Nix we make sure
we're not trying to launch a non-existent shell. However, we're
clearly already running in an existing shell and because of
`--set-home` we can activate other users properly so there's not
actually any need to try to have sudo start a different shell first,
it just adds an extra process that then goes on to run the activation
script with a good bash because of the shebang.

Dropping `-s` altogether and keeping `--set-home` should avoid all of
these issues.
2022-09-19 22:02:58 +02:00
toonn
610b1d988c nix-darwin: improve invocation of activation script
In #807 I changed the flag passed to `sudo` from `-i` to `-s` so
`sudo` wouldn't use a non-existent shell defined in the `passwd` file.
kalbasit also reported in that PR that `-i` didn't work for them
anymore on an M1 Mac, presumably because Apple changed something in
newer versions of macOS.

Some users reported that this broke the behavior for them because
`SHELL` was set to a path that didn't even exist on their system. It's
unclear how this came to be but it shows that my assumption that
`SHELL` would be set to a reasonable shell by Home Manager at this
point in the activation is false.

As a way around this problem we can explicitly set `SHELL` when
running the activation script to a value that we know will be good,
like `${pkgs.bash}`.

One change in behavior this causes is that the activation script will
always be run by bash, not the user's shell. If the script is
generated by Home Manager this is fine since it can be generated
taking into account the supported set of functions and behaviors. If
the intent is for the activation script to possibly be run by non-bash
and even non-POSIX shells, like tcsh, ksh or Xonsh, then this fix will
not suffice. Turns out this is indeed an assumption made by Home
Manager, so this is the proper behavior.

Fixes #2900
2022-09-19 22:02:44 +02:00
Robert Helgesson
5427f3d1f0 mpd: use XDG music dir if XDG user dirs are enabled
If the user has enabled the XDG user directories module then we can
use the XDG music directory in the MPD module. Otherwise we'll leave
the option undefined so that the user is forced to define the
directory to use.

This applies to state version 22.11 and above.

Fixes #3225
2022-09-16 13:41:40 +02:00
Robert Helgesson
b0247ceedc xdg.userDirs: avoid using $HOME
Instead of referencing the `HOME` environment variable, use the
`home.homeDirectory` option. This allows other modules to reference an
XDG user directory without having to support shell syntax.
2022-09-16 13:41:39 +02:00
github-actions[bot]
5408e27961 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/90cd5459a1fd707819b9a3fb9c852beaaac3b79a' (2022-06-11)
  → 'github:nixos/nixpkgs/5f326e2a403e1cebaec378e72ceaf5725983376d' (2022-09-12)
• Updated input 'utils':
    'github:numtide/flake-utils/1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1' (2022-05-30)
  → 'github:numtide/flake-utils/c0e246b9b83f637f4681389ecabcb2681b4f3af0' (2022-08-07)
2022-09-15 09:37:01 +02:00
AndersonTorres
6745da6dce rtorrent: change settings to extraConfig
Per NixOS RFC #42, settings should be reserved to structured settings,
whereas extraConfig is used for stringly configuration.
2022-09-15 09:25:46 +02:00
janabhumi
ebd7830814 exa: add package option 2022-09-15 09:15:09 +02:00
Kiran
60c6bfe322 zsh: add option for zsh-history-substring-search (#3156) 2022-09-13 16:06:52 -04:00
DrRuhe
9f7fe353b6 docs: replace use of # by $ sudo
The hope is that this makes it more obvious that these commands should
be run as the root user.
2022-09-09 23:34:29 +02:00
aab
b92826d0c4 codeowners: fix typo (#3215) 2022-09-09 09:16:35 -06:00
Mario Rodas
f9f4c8e1e7 gallery-dl: add module
gallery-dl [1] is a cli to download image galleries from several image
hosting sites.

[1] https://github.com/mikf/gallery-dl
2022-09-09 11:56:37 +02:00
Mario Rodas
4cfc0a1e02 yt-dlp: add module
yt-dlp is a cli to download videos from YouTube.com and other sites.
2022-09-08 19:51:24 +02:00
Gabriel Volpe
6ec6b2e362 nheko: add module 2022-09-08 19:09:30 +02:00
Charlie Moog
340ec22f6f git: add config helper for hooks 2022-09-08 11:05:07 +02:00
arcnmx
2e41a1bab3 systemd: handle Install.RequiredBy
Units with

    Install.RequiredBy = [ target ]

set will now be linked in the

    ${target}.requires

directory. Similar to how `Install.WantedBy` already causes a link in
the

    ${target}.wants

directory.
2022-09-08 10:39:57 +02:00
dependabot[bot]
22113a3ae3 ci: bump DeterminateSystems/update-flake-lock from 9 to 13 (#3188)
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 9 to 13.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v9...v13)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-07 16:50:28 -04:00
Loïc Reynier
de94878b6b editorconfig: add module (#3204)
Add a module to generate `~/.editorconfig` configuration file.

Co-authored-by: Robert Helgesson <robert@rycee.net>
Co-authored-by: Sumner Evans <me@sumnerevans.com>
2022-09-06 07:50:36 -06:00
Erik Rodriguez
583a99f016 swayidle: allow wayland targets other than sway-session.target (#3202)
Allow another Wayland targets, as river-session.target or
hyprland-session.target, to use swayidle.service which is hard-coded to
sway-session.target.
2022-09-05 10:56:10 -06:00
Lily Foster
140aaed3df git: gpg sign tags with signing.signByDefault set
The `tag.gpgSign` config option was added in Git 2.23.0 and seems like
it should be set in addition to `commit.gpgSign` when
`programs.git.signing.signByDefault` is enabled
2022-09-05 14:52:39 +02:00
Gaetan Lepage
de079ec371 btop: add module 2022-09-05 14:34:37 +02:00
Robert Helgesson
960c009ce0 git-sync: minor test cleanup 2022-09-05 13:51:03 +02:00
cab
66cc5c7ef9 git-sync: add ssh to path
This fixes automated pushing to repository.
2022-09-05 13:15:40 +02:00
Linus Heckemann
f9a35cacdc msmtp: allow sending email from aliased addresses 2022-09-05 12:50:09 +02:00
Jim Fowler
7b512c94ff gpg-agent: invert grab and no-grab behavior
The GNU Privacy Guard 2.3 man page for `gpg-agent` describes the
`--grab` and `--no-grab` options as follows:

> Tell the pinentry to grab the keyboard and mouse. This option should
> be used on X-Servers to avoid X-sniffing attacks. Any use of the
> option --grab overrides an used option --no-grab. The default is
> --no-grab.

Therefore Home Manager should explicitly output `grab` when
`cfg.grabKeyboardAndMouse` is true. Previously Home Manager emitted
`no-grab` when `cfg.grabKeyboardAndMouse` was false.

PR #3192
2022-09-05 12:12:48 +02:00
pleshevskiy
5bd66dc6cd email: fix the office365 smtp host (#3191) 2022-08-29 21:48:12 -04:00
Matthew Toohey
d89bdff445 sway, bspwm: add extraConfigEarly (#2847) 2022-08-27 00:09:46 -04:00
MaxCan-Code
8e4220e6c6 flake: add templates (#2892)
Add example flakes from `docs/nix-flakes.adoc` as templates.
2022-08-26 22:37:16 -04:00
Ryan Horiguchi
375631f35b firefox: support nested folders in bookmarks (#3112) 2022-08-26 21:28:57 -04:00
Matthieu Coudron
0884d6c6e4 programs.neovim: remove 'configure' setting (#3177)
everything is now covered by other settings that are more user friendly
than this big opaque attrset.

Also 'configure' wont do anything with nixpkgs-unstable the way HM
configures neovim. so no need to keep it, the deprecation warning is > 1
year old.
2022-08-26 22:11:34 +02:00
Ronny Pfannschmidt
5bb1f67568 git: add option to define store names for generated include files (#3171)
This allows to use gitconfig/gitconfig-some-intent
as store path suffixes for the texts.
2022-08-26 15:48:50 -04:00
Loïc Reynier
3d3bbdfe95 clipmenu: add launcher option
This adds an option to set the launcher command for Clipmenu
(which is set with the `CM_LAUNCHER` session variable).
2022-08-26 00:52:29 +02:00
Matthieu Coudron
4c8c1c9977 kitty: produce fewer empty lines
This generates a more compact configuration file.
2022-08-26 00:17:05 +02:00
Robert Helgesson
76fbb1b15e treewide: replace <link> by <xref> where appropriate 2022-08-26 00:07:08 +02:00
AndersonTorres
7bb4576f46 pueue: add module 2022-08-25 23:09:25 +02:00
Dmitriy Pleshevskiy
ae474885f7 email: add yandex and office365 email flavors 2022-08-25 21:17:42 +02:00
Pedro Lara Campos
c5b4177bda i3-sway: allow "container" and "output" in focus.mouseWarping (#3154)
Allow specifying which kind of mouseWarping to use since sway
supports `mouse_warping output|container|none`.
2022-08-25 15:02:04 -04:00
Filippo Berto
b382b59faf service.xidlehook: add detect-sleep option (#3165)
Add detect sleep configuration option. Allows to execute the specified commands with more accurate timings if the system wakes from a sleep state.
2022-08-24 15:56:45 -04:00
Robert Helgesson
1d81e6295c udiskie: add test path to CODEOWNERS 2022-08-24 08:50:22 +02:00
Matthieu Coudron
353d21e108 neovim runtime (#3168) 2022-08-23 22:02:05 +02:00
Lily Foster
8ea0e4d6d8 udiskie: fix configuration file path typo 2022-08-23 20:11:41 +02:00
Lily Foster
991ff35249 udiskie: add tests 2022-08-23 20:11:40 +02:00
Lily Foster
ee8e99add5 udiskie: make dependency on tray.target conditional
Specifically, it is unnecessary to have the dependency when the
udiskie tray applet is disabled.
2022-08-23 20:11:04 +02:00
Imran Hossain
0160a0cef0 Add flake.lock & workflow to update it (#1934) 2022-08-22 22:49:13 +02:00
Sumner Evans
688e5c85b7 neovim: fix tests (#3147)
https://github.com/NixOS/nixpkgs/pull/184364 broke the tests

Closes #3146

Signed-off-by: Sumner Evans <me@sumnerevans.com>
2022-08-15 08:41:57 -06:00
Gaetan Lepage
ff5133843c zathura: add mappings option 2022-08-14 21:27:06 +02:00
Chua Hou
44dcad5604 wezterm: support color schemes
Allows users to specify TOML color schemes using Nix.
2022-08-14 20:57:22 +02:00
amesgen
8675cfa549 gh: add extensions option 2022-08-12 20:49:50 +02:00
amesgen
78f964347c tests.stubs: set pname 2022-08-12 20:49:49 +02:00
Lukas Nagel
324fedcf9f Add module for aerc (#3070)
This adds support for configuring email accounts, with automatic smtp, imap,
sendmail (msmpt) and maildir (mbsync, offlineimap) setup in aerc,
via `accounts.email`.
2022-08-11 23:08:28 +02:00
Bernardo Meurer
c1addfdad3 gammastep: wait on geoclue-agent when configured 2022-08-08 19:08:04 +02:00
AndersonTorres
389f2b2037 bashmount: add module 2022-08-08 18:13:21 +02:00
Robert Helgesson
f5e9879e74 bash: support bash completion 2022-08-07 15:25:44 +02:00
Hemanth Bollamreddi
d9e03b7f8c wezterm: add module 2022-08-07 11:11:56 +02:00
Robert Helgesson
91f26e0b0e polybar: use add .ini suffix to configuration file
The old name is deprecated and causes a warning to be logged.
2022-08-07 10:51:38 +02:00
Sky Leite
d8d9ff0b2d tint2: correctly reference the provided package (#3125) 2022-08-02 20:01:13 -04:00
Lily Foster
77648a07e4 hyfetch: prevent writing config with default/empty settings (#3124) 2022-08-01 19:58:38 -04:00
Lily Foster
d1c677ac25 hyfetch: add module 2022-08-01 18:38:42 +02:00
Moïse Valvassori
7146638e9e Fix typo. (#3118) 2022-07-30 18:49:20 -07:00
Gabriel Arazas
0e2f7876d2 recoll: add module 2022-07-27 14:25:27 +02:00
hab25
b13946438f docs: improve contributing documentation
- Fix name of file generated by `$ nix-build -A docs.manPages`.

- Note "Capitalize the subject line" as an exception to the seven
  rules. Not even the example commit message (closely below this
  change) follows this rule.
2022-07-27 14:10:32 +02:00
Naïm Favier
119febc464 vscode: avoid unnecessary IFD (again)
Fixed in https://github.com/nix-community/home-manager/pull/2506 then
unfixed in https://github.com/nix-community/home-manager/pull/2613
2022-07-27 13:51:19 +02:00
Tom Wieczorek
0b7fd187e2 xdg-mime-apps: fix regex in mimeAssociations
The XDG Desktop Entry spec mentions that multiple values per key may be
optionally terminated by a semicolon. An example for this is the Firefox
desktop file, which has no trailing semicolon. This breaks the sed regex
used in `mimeAssociations`.

Fix the regex by matching the end of string, optionally preceded by a
semicolon, or any other semicolon. This makes it work with both
semicolon-terminated and non-semicolon-terminated desktop files.
2022-07-26 10:08:25 +02:00
Naïm Favier
dbed4c794d xdg-user-dirs: create directories after linkGeneration
In the scenario where some XDG user directory is a symlink defined by
`home.file`, we want the symlink to be created before we try to
`mkdir -p` that directory, as it will then silently succeed. On the
other hand, if we create the directory first, creating the symlink
will fail.

We lose nothing by doing this as `linkGeneration` creates the
directories it needs.
2022-07-25 14:18:36 +02:00
linj
8419dfd39d fish: enable manpage completion
This patch follows a similar patch[1] in nixpkgs. With this patch,
fish can complete manpages for programs installed through
home-manager, e.g., using home.packages.

[1]: https://github.com/NixOS/nixpkgs/pull/91794
2022-07-25 13:54:51 +02:00
Loïc Reynier
a3b778e672 spectrwm: add module
PR #3077
2022-07-25 13:42:06 +02:00
midchildan
572f348a10 darwin: add support for 'defaults -currentHost' options
Closes #2615
2022-07-24 15:17:21 +02:00
Noah Fontes
1d3380afba flake: fix self referential lib output
In https://github.com/nix-community/home-manager/pull/2859, the
library became self-referential, so we need to use the stdlib-extended
helper instead of importing directly.
2022-07-24 14:38:51 +02:00
Ryan Horiguchi
d86c189158 firefox: support showing bookmarks on toolbar 2022-07-23 15:28:14 +02:00
rcerc
218cb3aee2 firefox: fix empty check of bookmarks list 2022-07-23 15:22:31 +02:00
rcerc
f91fb470bc firefox: use coercedTo to convert bookmarks to a list 2022-07-23 15:22:23 +02:00
Robert Helgesson
f47611fb17 github: fix line wrapping 2022-07-23 15:16:19 +02:00
Naïm Favier
9cf40a43fc github: ensure using the right branch of Home Manager 2022-07-23 15:14:45 +02:00
Naïm Favier
70d5929885 integration-common: set hmModule's description directly
Removes the hack after https://github.com/NixOS/nixpkgs/pull/173621
landed.

(cherry picked from commit 0434f8e4ca)
2022-07-19 15:44:01 +02:00
rcerc
4a724cb84c lib: improve DAG library
Specifically,

- directly export `modules/lib/dag.nix` instead of renaming
  attributes,

- run through utilities to reuse code where possible,

- expose `lib.hm.dag.isEntry` and reuse it in
  `modules/lib/types-dag.nix`,

- reuse utilities through `lib` set instead of passing imports to
  functions, and

- eta reduction of `map`, `entryAnywhere`, `entryAfter` and
  `entryBefore`.
2022-07-18 15:32:48 +02:00
Robert Helgesson
30dda628bc home-manager: add ncurses to PATH
Fixes #3097
2022-07-18 15:18:05 +02:00
h7x4
64c745fe1c firefox: add support for nested bookmarks
Change type of `firefox.profile.<name>.bookmarks` to allow for nested
bookmarks with user defined order.
2022-07-18 14:55:54 +02:00
rcerc
4c5106ed0f firefox: reuse escapeXML from Nixpkgs 2022-07-15 14:11:50 +02:00
Weblate
8385408c65 Add translation using Weblate (Dutch)
Co-authored-by: Weblate <noreply@weblate.org>
2022-07-13 15:34:00 +02:00
Frederik Engels
3b5330c80f Translate using Weblate (Dutch)
Currently translated at 25.0% (8 of 32 strings)

Translate using Weblate (German)

Currently translated at 100.0% (32 of 32 strings)

Add translation using Weblate (Dutch)

Co-authored-by: Frederik Engels <frederik.engels92@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/de/
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/nl/
Translation: Home Manager/Home Manager CLI
2022-07-13 15:34:00 +02:00
Jonas Heinrich
2c94b9801f librewolf: add module 2022-07-13 15:31:25 +02:00
ash
66d7007e43 mpv: prohibit string values in scripts
Strings as scripts don't currently work, and probably haven't worked
since b567d273 (mpv: use wrapMpv instead of mpv-with-scripts,
2020-05-31).
2022-07-13 14:52:46 +02:00
ash
241a375f49 keychain: set SHELL correctly in bash and zsh
bash and zsh apparently handle command substitution slightly differently
than fish. in bash/zsh:

$ export FOO=x
$ FOO=y echo $(sh -c 'echo $FOO')
x

whereas in fish:

$ export FOO=x
$ FOO=y echo $(sh -c 'echo $FOO')
y

so we have to assign $SHELL within the substitution for bash and zsh.
2022-07-13 14:35:52 +02:00
Robert Helgesson
602f2ce59c docs: note support for 2.4 or later for Flake 2022-07-12 23:35:46 +02:00
Fisher Sun
d6d600e76d docs: remove bit about Nix 2.4 not being supported
With #2840, Nix 2.4 is supported.
Resolves #3061.

Signed-off-by: Fisher Sun <fisher521.fs@gmail.com>
2022-07-12 23:32:47 +02:00
Sumner Evans
d4081057e5 codeowners: cleanup alphabetization
Signed-off-by: Sumner Evans <me@sumnerevans.com>
2022-07-12 22:43:24 +02:00
Bryton Hall
b8bb5f291a xdg-desktop-entries: allow icon path type 2022-07-12 22:13:34 +02:00
Sumner Evans
c5fc157554 picom: fix option name
The `services.picom.opacityRule` option was renamed to
`services.picom.opacityRules`.

This was missed in #2939

Signed-off-by: Sumner Evans <me@sumnerevans.com>
2022-07-12 21:26:31 +02:00
Nick Cao
1e66e035e1 gpg-agent: set Environment to a list 2022-07-12 12:26:36 +02:00
Robert Helgesson
45ef70cc73 swayidle: remove unnecessary config wrapper 2022-07-12 12:02:01 +02:00
Joe Neeman
43ea4c5123 swayidle: fix systemd service
swayidle executes commands using "sh -c" and so its PATH must contain
a shell. This adds such PATH entry to the environment of the systemd
service.

Fixes #2811.
2022-07-12 12:01:04 +02:00
Naïm Favier
6311f4adc3 lib/types: make DAG entries mergeable
Removes the `uniq` constraint on `after` and `before` so that we can
merge multiple definitions for the same DAG entry:

    {
      dag = mkMerge [
        {
          foo = lib.hm.dag.entryBefore [ "bar" ] {
            # definition 1
          };
        }
        {
          foo = lib.hm.dag.entryBefore [ "qux" ] {
            # definition 2
          };
        }
        {
          foo = {
            # definition 3
          };
        }
      ];
    }

In this example `foo` will come before `bar` and `qux`.
2022-07-12 11:47:38 +02:00
Thiago Kenji Okada
177f1887d4 compton: remove
This module was deprecated since release 20.03 according to the news, so
it can be removed.
2022-07-12 11:21:50 +02:00
Thiago Kenji Okada
b908e61dfa picom: sync module with the NixOS version
This brings a few advantages:

- Use of float instead of strings to represent float values,

- Use of structure settings, and

- Better type checking for some settings

Also add thiagokokada as codeowner of picom.
2022-07-12 11:21:49 +02:00
Congee
0639aa34f1 git: add option to set difftastic display setting 2022-07-12 10:48:26 +02:00
OKA, NETSURFER AND OBSERVER, FRONTEND, DEVELOPER (DOTFILES,OSINT,OSS), KEYBASE: (3B0E8E0895DAC8B8)
c645cc9f82 Translate using Weblate (Japanese)
Currently translated at 100.0% (32 of 32 strings)

Co-authored-by: OKA, NETSURFER AND OBSERVER, FRONTEND, DEVELOPER (DOTFILES,OSINT,OSS), KEYBASE: (3B0E8E0895DAC8B8) <tetrapasta02@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/
Translation: Home Manager/Home Manager CLI
2022-07-09 21:48:06 +02:00
Turmoil Nailsis
f2b216c320 Translate using Weblate (Japanese)
Currently translated at 100.0% (32 of 32 strings)

Co-authored-by: Turmoil Nailsis <indianrunner@duck.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/
Translation: Home Manager/Home Manager CLI
2022-07-09 21:48:06 +02:00
Shamrock Lee
8d5b07fc83 tests: fix impurity of _module.args.pkgsPath 2022-07-09 16:30:17 +02:00
Maxime Brunet
8160b3b45b zsh: source zsh-syntax-highlighting at the end of .zshrc (#3068)
zsh-syntax-highlighting.zsh must be sourced at the end of the .zshrc file, otherwise widgets created after are not properly highlighted (e.g. from oh-my-zsh): https://github.com/zsh-users/zsh-syntax-highlighting#faq
2022-07-07 18:57:27 -06:00
oxalica
25a9948361 sway: import dbus env vars and explicitly specify them (#3031)
- Importing all environment variables is considered deprecated for
  `systemdctl import-environment`. The list of variables are picked
  from:
  https://github.com/swaywm/sway/wiki/Systemd-integration#managing-user-applications-with-systemd

  The `XDG_CURRENT_DESKTOP` is said to be required for portals, see:
  https://github.com/nix-community/home-manager/pull/2385#issuecomment-1026454162

- DBus activation environment should also be updated. Otherwise, DBus
  activated programs, without a coresponding systemd service, cannot get a
  correct environment and would fail, eg. `mako`.
2022-07-07 11:03:58 -06:00
Julio Borja Barra
12cfcc1b9d fusuma: fix settings example (#3067) 2022-07-07 00:55:01 -06:00
Philipp Mildenberger
ef990143b6 nushell: fix non-nullable configFile and envFile, fixes #3050 (#3060) 2022-07-07 00:49:50 -06:00
Naïm Camille Favier
face4094d4 bspwm: add missing rule setting rectangle (#2974)
Also add a `freeformType` so that we don't have to do this in the
future.
2022-07-06 23:36:20 -04:00
Robert Helgesson
f2445620d1 redshift: remove petabyteboy from maintainers 2022-07-04 11:39:38 +02:00
Philipp Mildenberger
3bf16c0fd1 udiskie: add option settings
Adds option settings, which writes settings to
.config/udiskie/config.yml.

Note, the option takes precedence against other options like notify,
automount or tray if they are configured in settings.program_options.
2022-06-28 00:12:57 +02:00
Robert Helgesson
be3adf9920 Revert "integration-common: set hmModule's description directly"
This reverts commit 0434f8e4ca.
2022-06-27 08:58:54 +02:00
Robert Helgesson
9550595502 docs,tests: fetch nmd and nmt using fetchTarball
This simplifies the code a bit and avoids using experimental Flake
functionality. If Flakes become stable before NixOS 22.11 then we can
consider having nmd and nmt as Flake inputs. Maybe could then also
avoid the need for flake-compat.
2022-06-26 22:22:46 +02:00
Naïm Favier
0434f8e4ca integration-common: set hmModule's description directly
Removes the hack after https://github.com/NixOS/nixpkgs/pull/173621
landed.
2022-06-26 21:39:20 +02:00
Kylie McClain
0ca0b91088 sctd: add module
This adds a module for enabling the `sctd` daemon, as well as setting
the preferred base temperature.
2022-06-26 21:29:50 +02:00
Pol Dellaiera
72a135b093 docs: fix homeManagerConfiguration documentation 2022-06-26 20:05:31 +02:00
Ilan Joselevich
1dbac84b84 mpd-discord-rpc: restart on failure 2022-06-26 01:24:29 +02:00
Naïm Favier
f26946858e flake: remove superfluous arguments
Remove `stateVersion`, `username`, and `homeDirectory` as they can be
set in the configuration directly. Together with the previous commit,
this makes setting `stateVersion` explicitly mandatory.

Also replace `configuration` by `modules`, which expects a list of
Home Manager modules.

Also remove `system` which was made useless by #3028.
2022-06-26 01:01:57 +02:00
Naïm Favier
e0baf8ee0c docs: disable _module.check for nixos/nix-darwin modules
Currently we're maintaining a "mock" module made of sink options,
which requires updating whenever the definitions in the
nixos/nix-darwin modules change.

Instead, set `_module.check` to false so that definitions in those
modules are simply ignored.
2022-06-25 11:47:47 +02:00
David Baynard
da55d18ba2 docs: fix typo in nix-darwin flake
The nix-darwin documentation uses `darwin` not `nix-darwin` to refer
to its own flake, and so this is now consistent (and correct) and uses
`darwin`.
2022-06-25 11:17:37 +02:00
Matthew Toohey
223b9deead pistol: add module 2022-06-25 01:00:32 +02:00
Michael Forster
65bcfaccc5 micro: add module
This adds initial bare-bones support for the `micro` editor.
2022-06-24 19:19:11 +02:00
Samuel Tschiedel
fd047c84f7 mcfly: add fuzzy search factor option
Per the [docs], MCFLY_FUZZY is no longer a boolean, taking now a
positive integer that controls the fuzziness factor.

[docs]: https://github.com/cantino/mcfly#fuzzy-searching

Co-authored-by: Robert Helgesson <robert@rycee.net>
2022-06-24 18:22:15 +02:00
Nick Bathum
e622bad163 neovim/coc: fix withNodeJs value when enabling coc (#3048) 2022-06-22 14:14:18 -06:00
Alex Martens
06bb67ab24 flake.lock: use SRI hash for nmd 2022-06-21 17:46:39 -07:00
Robert Helgesson
77f1c7636a docs: bump nmd 2022-06-22 01:15:25 +02:00
Eliza Velasquez
d059b9448a mujmap: add module
mujmap is a tool that synchronizes mail between a mail server and
notmuch via JMAP. It's very similar to lieer, so I heavily based the
implementation of the notmuch module on lieer's. I did not include an
equivalent to lieer's periodic synchronization service, however,
because I plan to soon introduce a daemon mode to mujmap.

https://github.com/elizagamedev/mujmap
2022-06-22 00:33:10 +02:00
Robert Helgesson
467617947d email: add support for JMAP
Co-authored-by: Eliza Velasquez <4576666+elizagamedev@users.noreply.github.com>
2022-06-22 00:13:22 +02:00
Kritnich
1ebbef8642 barrier: change enableCrypto behaviour
`--enable-crypto` is deprecated because crypto is now enabled by default.
`--disable-crypto` should be used instead.
Fixes https://github.com/nix-community/home-manager/issues/3001
2022-06-21 21:59:19 +02:00
Dominik Schrempf
206ded407e dunst: fix settings example 2022-06-21 21:41:32 +02:00
Lily Foster
ce563f5911 mopidy: add support for extraConfigFiles 2022-06-21 01:04:56 +02:00
Shamrock Lee
60b064249d treewide: remove trailing white spaces and tabs 2022-06-21 00:55:32 +02:00
Philipp Mildenberger
931e610552 nushell: update configuration management
Recent versions of nushell uses a different configuration setup. This
commit adjusts the module to match.

Fixes #2952
Fixes #2837
2022-06-21 00:39:00 +02:00
Robert Helgesson
3c710201d5 version: remove default value
The user should always explicitly set the state version they wish to
use. Indeed, the configuration generated by the Home Manager install
script has set this option for a long time. This removal should
therefore not affect many users.
2022-06-21 00:06:53 +02:00
Robert Helgesson
3d8265c5ef email: minor formatting fix 2022-06-20 00:56:57 +02:00
Naïm Camille Favier
ce8266dedc docs: revert to # prompt on NixOS 2022-06-20 00:35:04 +02:00
Robert Helgesson
5197e5df7d Bump .release file
Fixes #3033
2022-06-19 01:27:57 +02:00
Damien Cassou
931653b99f emacs: optionally start service with the session
Add services.emacs.startWithUserSession boolean to indicate that Emacs
must be started with the systemd user session. This is true by default
unless socket activation is also true.

In the past, the user had to choose between socket activation (to get
the Emacs service started when the user uses emacsclient) and
immediate start with the user session. When choosing immediate start
over socket activation and if the Emacs service is stopped at some
point, using emacsclient would start a new Emacs daemon but the
service would still be turned off. This situation would prevent
`home-manager switch` from completing successfully because it wouldn't
be able to start the Emacs service as Emacs is already running.

This new setting makes it possible to have both socket activation and
immediate start at the same time. In this scenario, Emacs is started
with the user session and, after the Emacs service is stopped, using
emacsclient starts the service again.

This new settings also makes it possible to have neither socket
activation nor immediate start.
2022-06-19 01:09:41 +02:00
Naïm Favier
586ac1fd58 Move integration-common.nix to nixos/common.nix 2022-06-19 00:45:18 +02:00
Naïm Favier
69e804839e flake: don't reinstantiate nixpkgs
See https://zimbatm.com/notes/1000-instances-of-nixpkgs for
motivation.
2022-06-19 00:45:09 +02:00
Naïm Favier
2ff38c646f flake: make pkgs required in homeManagerConfiguration
Prevents Home Manager from pinning Nixpkgs on behalf of users, see

  https://github.com/nix-community/home-manager/pull/2971#discussion_r898556798
2022-06-19 00:44:29 +02:00
Naïm Favier
a0e7ffe7aa docs: use $ prompts for nix-channel commands
Channels should be added for the normal user, not for root, because the
home-manager configuration is not supposed to be evaluated as root.

Fixes https://github.com/nix-community/home-manager/issues/2985
2022-06-18 20:59:51 +02:00
Naïm Camille Favier
1de492f6f8 format: update and remove exceptions (#3029)
Switches to nixfmt 0.5.0 and removes exceptions for files without open
PRs.
2022-06-16 14:13:06 +02:00
Nikolay Korotkiy
504d6de6a0 Add translation using Weblate (Finnish)
Co-authored-by: Nikolay Korotkiy <sikmir@gmail.com>
2022-06-15 23:44:58 +02:00
Leix b
a9b027b826 Translate using Weblate (Catalan)
Currently translated at 100.0% (32 of 32 strings)

Translate using Weblate (Catalan)

Currently translated at 12.5% (4 of 32 strings)

Co-authored-by: Leix b <abone9999@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ca/
Translation: Home Manager/Home Manager CLI
2022-06-15 23:44:58 +02:00
Weblate
68edbc7f28 Add translation using Weblate (Finnish)
Add translation using Weblate (Catalan)

Co-authored-by: Weblate <noreply@weblate.org>
2022-06-15 23:44:57 +02:00
Leix b
1342f4a07c Translate using Weblate (Catalan)
Currently translated at 100.0% (14 of 14 strings)

Add translation using Weblate (Catalan)

Co-authored-by: Leix b <abone9999@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/ca/
Translation: Home Manager/Home Manager Modules
2022-06-15 23:44:57 +02:00
Matthieu Coudron
07dbd4c0dd pywal: fixed i3 config (#3002)
module was never imported and thus useless. This adds a neovim plugin too.
2022-06-15 23:44:52 +02:00
André Silva
87d30c1648 nixos: fix fontconfig mkDefault call (#3021) 2022-06-14 11:34:44 +02:00
Sandro
cd3dd2188c nixos: allow setting fonts.fontconfig.enable without mkForce (#3014) 2022-06-13 20:00:51 +02:00
Thiago Kenji Okada
935ecea67d neovim: add missing literalExpression in module docs (#3012) 2022-06-13 19:57:41 +02:00
rcerc
70824bb5c7 swaylock: Add module (#3003) 2022-06-07 21:01:14 +02:00
Naïm Camille Favier
64ab7d6e8d Prepare inclusion in nixos-search (#2971)
* Add flake.lock and clean up flake.nix

Add a lockfile to work around https://github.com/NixOS/nix/issues/6541
(and because it's a good idea anyway).

Also use flake-utils, and restrict ourselves to the five platforms
supported by nixpkgs. Otherwise, the IFD for nmd fails on weird
platforms. This fixes `nix flake check`.

Remove the redundant `apps` output, see https://github.com/nix-community/home-manager/pull/2442#issuecomment-1133670487

* nixos,nix-darwin: factor out into a common module

* nixos,nix-darwin: make `home-managers.users` shallowly visible

Make sure the option is included in the NixOS/nix-darwin manual (but the
HM submodule options aren't).

Also add a static description to the HM submodule type so that we don't need to
evaluate the submodules just to build the option manual. This makes
nixos-search able to index the home-manager flake.

Also clean up some TODOs.

* flake: add nmd and nmt

This avoids having to use `pkgs.fetchFromGitLab` in an IFD, which causes
issues when indexing packages with nixos-search because `pkgs` is
instantiated with every platform.
2022-06-07 20:45:06 +02:00
Kylie McClain
2070389247 htop: add missing fields (#2989)
These new fields were added in htop 3.0.3 (PERCENT_NORM_CPU) and
3.1.0 (ELAPSED).
2022-06-05 11:50:13 +02:00
Roman Joost
a3638db009 Use newer getmail6 over getmail package (#2982)
The `getmail` package will soon be removed from nixpkgs. The
`nixos-unstable` channel already has it removed and using the service
will result in:

    error: getmail has been removed from nixpkgs, migrate to getmail6

Upgrade to the getmail6 package which is already available and backwards
compatible.
2022-06-05 11:48:58 +02:00
Robert Helgesson
684e85d01d docs: set 22.11 as next version 2022-06-01 21:56:46 +02:00
Robert Helgesson
ac2287df5a docs: set 22.05 as stable version 2022-06-01 21:56:45 +02:00
Robert Helgesson
1808cb66aa news: remove a bunch of old (>1 year) entries 2022-06-01 21:56:45 +02:00
Robert Helgesson
acad715f78 docs: update copyright year 2022-06-01 21:42:55 +02:00
Jakub Kozłowski
8f3e267051 doc: make documentation links more visible 2022-05-30 22:48:07 +02:00
NomisIV
bda2c80b4c himalaya: fix account.folders to new config syntax 2022-05-30 21:06:52 +02:00
midchildan
64831f938b emacs: allow extraConfig to reference extraPackages
This fixes the issue described in

  https://github.com/nix-community/home-manager/pull/1758#issuecomment-1113706592
2022-05-26 00:34:17 +02:00
Kid
51ea4217f7 docs: fix README links 2022-05-25 21:49:42 +02:00
Robert Helgesson
2c8489e57a mpdris2: add basic test cases 2022-05-25 18:43:22 +02:00
Erwin Boskma
9042c756fa mpdris2: remove assertion on mpd module 2022-05-25 18:32:34 +02:00
Erwin Boskma
d73ba6a534 mpdris2: add password option 2022-05-25 18:32:33 +02:00
Robert Helgesson
e66f0ff69a docs: bump nmd 2022-05-23 23:09:24 +02:00
Sumner Evans
94780dd888 neovim/coc: add package option (#2972) 2022-05-21 11:12:29 -06:00
Naïm Camille Favier
02b15de8ad Translate using Weblate (French)
Currently translated at 100.0% (14 of 14 strings)

Co-authored-by: Naïm Camille Favier <n@monade.li>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/fr/
Translation: Home Manager/Home Manager Modules
2022-05-19 23:44:42 +02:00
Yubo-Cao
97fac4f282 Translate using Weblate (Chinese (Simplified))
Currently translated at 92.8% (13 of 14 strings)

Co-authored-by: Yubo-Cao <Cao2006721@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/zh_Hans/
Translation: Home Manager/Home Manager Modules
2022-05-19 23:44:42 +02:00
Roman Timushev
e6869735d2 htop: fix darwin defaults
M_SHARE is not a valid column on Darwin. It seems that previously htop
ignored unknown columns, but the current version does not display all
subsequent columns.
2022-05-19 23:33:20 +02:00
421 changed files with 11495 additions and 4170 deletions

149
.github/CODEOWNERS vendored
View File

@@ -2,6 +2,13 @@
/flake.nix @bqv @kisik21
Makefile @thiagokokada
/modules/config/home-cursor.nix @polykernel @league
/modules/config/i18n.nix @midchildan
/tests/modules/config/i18n @midchildan
/modules/home-environment.nix @rycee
/modules/i18n/input-method @Kranzes
@@ -11,16 +18,14 @@
/modules/misc/dconf.nix @rycee
/modules/misc/editorconfig.nix @loicreynier
/test/modules/misc/editorconfig @loicreynier
/modules/misc/fontconfig.nix @rycee
/tests/modules/misc/fontconfig @rycee
/modules/misc/gtk.nix @rycee
/modules/config/home-cursor.nix @polykernel @league
/modules/config/i18n.nix @midchildan
/tests/modules/config/i18n @midchildan
/modules/misc/news.nix @rycee
/modules/misc/nix.nix @polykernel
@@ -54,6 +59,12 @@
/tests/modules/misc/xdg/desktop-full-expected.desktop @cwyc
/tests/modules/misc/xdg/desktop-min-expected.desktop @cwyc
/modules/misc/xfconf.nix @chuangzhu
/modules/programs/aerc.nix @lukasngl
/modules/programs/aerc-accounts.nix @lukasngl
/tests/modules/programs/aerc @lukasngl
/modules/programs/aria2.nix @JustinLovinger
/modules/programs/autojump.nix @evanjs
@@ -66,6 +77,8 @@
/modules/programs/bash.nix @rycee
/modules/programs/bashmount.nix @AndersonTorres
/modules/programs/bat.nix @marsam
/modules/programs/beets.nix @rycee
@@ -73,12 +86,17 @@
/modules/programs/bottom.nix @polykernel
/tests/modules/programs/bottom @polykernel
/modules/programs/broot.nix @aheaume
/modules/programs/broot.nix @aheaume @dermetfan
/modules/programs/btop.nix @GaetanLepage
/tests/modules/programs/btop.nix @GaetanLepage
/modules/programs/dircolors.nix @JustinLovinger
/modules/programs/direnv.nix @rycee
/modules/programs/discocss.nix @Kranzes
/modules/programs/eclipse.nix @rycee
/modules/programs/emacs.nix @rycee
@@ -95,6 +113,9 @@
/modules/services/fusuma.nix @iosmanthus
/tests/modules/services/fusuma @iosmanthus
/modules/programs/gallery-dl.nix @marsam
/tests/modules/programs/gallery-dl @marsam
/modules/programs/gh.nix @Gerschtli @berbiche
/tests/modules/programs/gh @Gerschtli @berbiche
@@ -107,28 +128,38 @@
/modules/programs/go.nix @rvolosatovs
/modules/programs/havoc.nix @AndersonTorres
/modules/programs/helix.nix @Philipp-M
/tests/modules/programs/helix @Philipp-M
/modules/programs/hexchat.nix @thiagokokada
/tests/modules/programs/hexchat @thiagokokada
/modules/programs/himalaya.nix @ambroisie
/tests/modules/programs/himalaya @ambroisie
/modules/programs/himalaya.nix @toastal
/tests/modules/programs/himalaya @toastal
/modules/programs/home-manager.nix @rycee
/modules/programs/htop.nix @bjpbakker
/tests/modules/htop @bjpbakker
/modules/programs/hyfetch.nix @lilyinstarlight
/tests/modules/programs/hyfetch @lilyinstarlight
/modules/programs/i3status.nix @JustinLovinger
/modules/programs/i3status-rust.nix @workflow
/modules/programs/ion.nix @jo1gi
/modules/programs/java.nix @ShamrockLee
/modules/programs/just.nix @maximsmol
/modules/programs/k9s.nix @katexochen
/tests/modules/programs/k9s @katexochen
/modules/programs/keychain.nix @marsam
/modules/programs/kodi.nix @dwagenk
@@ -136,6 +167,8 @@
/modules/programs/lazygit.nix @kalhauge
/modules/programs/ledger.nix @marsam
/modules/programs/less.nix @pamplemousse
/tests/modules/programs/less @pamplemousse
@@ -144,8 +177,13 @@
/modules/programs/lf.nix @owm111
/tests/modules/programs/lf @owm111
/modules/programs/librewolf.nix @onny
/modules/programs/lieer.nix @tadfisher
/modules/programs/looking-glass-client.nix @j-brn
/tests/modules/programs/looking-glass-client @j-brn
/modules/programs/lsd.nix @marsam
/modules/programs/matplotlib.nix @rprospero
@@ -158,11 +196,17 @@
/modules/programs/mcfly.nix @marsam
/modules/programs/micro.nix @MForster
/tests/modules/programs/micro @MForster
/modules/programs/mpv.nix @tadeokondrak @thiagokokada
/tests/modules/programs/mpv @thiagokokada
/modules/programs/mu.nix @KarlJoad
/modules/programs/mujmap.nix @elizagamedev
/tests/modules/programs/mujmap @elizagamedev
/modules/programs/navi.nix @marsam
/modules/programs/ncmpcpp.nix @olmokramer
@@ -177,6 +221,9 @@
/modules/programs/newsboat.nix @sumnerevans
/tests/modules/programs/newsboat @sumnerevans
/modules/programs/nheko.nix @gvolpe
/tests/modules/programs/nheko @gvolpe
/modules/programs/nix-index.nix @ambroisie
/tests/modules/programs/nix-index @ambroisie
@@ -192,6 +239,9 @@
/modules/programs/octant.nix @06kellyjac
/modules/programs/oh-my-posh.nix @arjan-s
/tests/modules/programs/oh-my-posh @arjan-s
/modules/programs/opam.nix @marsam
/modules/programs/openssh.nix @rycee
@@ -205,8 +255,17 @@
/modules/programs/pidgin.nix @rycee
/modules/programs/pistol.nix @mtoohey31
/tests/modules/programs/pistol @mtoohey31
/modules/programs/piston-cli.nix @ethancedwards8
/modules/programs/pls.nix @arjan-s
/tests/modules/programs/pls @arjan-s
/modules/programs/polybar.nix @h7x4
/tests/modules/programs/polybar @h7x4
/modules/programs/powerline-go.nix @DamienCassou
/modules/programs/pubs.nix @loicreynier
@@ -247,28 +306,45 @@
/modules/programs/starship.nix @marsam
/modules/programs/swaylock.nix @rcerc
/tests/modules/programs/swaylock @rcerc
/modules/programs/tealdeer.nix @marsam
/modules/programs/terminator.nix @chisui
/modules/programs/texlive.nix @rycee
/modules/programs/thunderbird.nix @d-dervishi
/tests/modules/programs/thunderbird @d-dervishi
/modules/programs/timidity.nix @amesgen
/modules/programs/tint2.nix @CarlosLoboxyz
/modules/programs/tiny.nix @kmaasrud
/modules/programs/tmate.nix @jlesquembre
/tests/modules/programs/tmate @jlesquembre
/modules/programs/topgrade.nix @msfjarvis
/tests/modules/programs/topgrade @msfjarvis
/mdules/programs/watson.nix @polykernel
/modules/programs/watson.nix @polykernel
/tests/modules/programs/watson @polykernel
/modules/programs/waybar.nix @berbiche
/tests/modules/programs/waybar @berbiche
/modules/programs/wezterm.nix @blmhemu
/tests/modules/programs/wezterm @blmhemu
/modules/programs/xmobar.nix @t4ccer
/tests/modules/programs/xmobar @t4ccer
/modules/programs/yt-dlp.nix @marsam
/tests/modules/programs/yt-dlp @marsam
/modules/programs/z-lua.nix @marsam
/modules/programs/zathura.nix @rprospero
@@ -284,6 +360,11 @@
/modules/services/betterlockscreen.nix @SebTM
/modules/programs/borgmatic.nix @DamienCassou
/modules/services/borgmatic.nix @DamienCassou
/tests/modules/programs/borgmatic @DamienCassou
/tests/modules/services/borgmatic @DamienCassou
/modules/services/caffeine.nix @uvNikita
/modules/services/cbatticon.nix @pmiddend
@@ -313,7 +394,7 @@
/modules/services/fnott.nix @polykernel
/tests/modules/services/fnott @polykernel
/modules/services/git-sync.nix @IvanMalison
/modules/services/git-sync.nix @IvanMalison @cab404
/modules/services/gnome-keyring.nix @rycee
@@ -374,6 +455,9 @@
/modules/services/pasystray.nix @pltanton
/modules/services/picom.nix @thiagokokada
/tests/modules/services/picom @thiagokokada
/modules/services/pbgopy.nix @ivarwithoutbones
/tests/modules/services/pbgopy @ivarwithoutbones
@@ -382,22 +466,38 @@
/modules/services/playerctld.nix @fendse
/tests/modules/playerctld @fendse
/modules/services/plex-mpv-shim.nix @starcraft66
/modules/services/poweralertd.nix @ThibautMarty
/modules/services/pueue.nix @AndersonTorres
/modules/services/pulseeffects.nix @jonringer
/modules/services/random-background.nix @rycee
/modules/services/recoll.nix @foo-dogsquared
/tests/modules/recoll @foo-dogsquared
/modules/services/redshift-gammastep @rycee @petabyteboy @thiagokokada
/tests/modules/redshift-gammastep @thiagokokada
/modules/services/safeeyes @Rosuavio
/modules/services/screen-locker.nix @jrobsonchase @rszamszur
/tests/modules/services/screen-locker @jrobsonchase @rszamszur
/modules/services/sctd.nix @somasis
/modules/services/status-notifier-watcher.nix @pltanton
/modules/services/swayidle.nix @c0deaddict
/tests/modules/services/swayidle @c0deaddict
/modules/services/syncthing.nix @rycee
/modules/services/systembus-notify.nix @asymmetric
/modules/services/taffybar.nix @rycee
/modules/services/tahoe-lafs.nix @rycee
@@ -411,12 +511,17 @@
/tests/modules/services/twmn @Austreelis
/modules/services/udiskie.nix @rycee
/tests/modules/services/udiskie @rycee
/modules/services/unison.nix @pacien
/modules/services/volnoti.nix @IvanMalison
/modules/services/window-managers/bspwm @ncfavier
/tests/modules/services/window-managers/bspwm @ncfavier
/modules/services/window-managers/fluxbox.nix @AndersonTorres
/modules/services/window-managers/herbstluftwm @olmokramer
/tests/modules/services/window-managers/herbstluftwm @olmokramer
@@ -430,6 +535,9 @@
/modules/services/window-managers/i3-sway/swaynag.nix @polykernel
/modules/services/window-managers/spectrwm @loicreynier
/tests/modules/services/window-managers/spectrwm @loicreynier
/modules/services/wlsunset.nix @matrss
/tests/modules/services/wlsunset @matrss
@@ -437,7 +545,7 @@
/modules/services/xembed-sni-proxy.nix @rycee
/modules/services/xidlehook.nix @dschrempf
/modules/services/xidlehook.nix @dschrempf @bertof
/modules/services/xscreensaver.nix @rycee
@@ -445,24 +553,9 @@
/modules/systemd.nix @rycee
/modules/xresources.nix @rycee
/modules/xsession.nix @rycee
/modules/services/volnoti.nix @IvanMalison
/modules/services/systembus-notify.nix @asymmetric
/modules/targets/darwin @midchildan
/tests/modules/targets-darwin @midchildan
/modules/programs/tint2.nix @CarlosLoboxyz
/modules/xresources.nix @rycee
Makefile @thiagokokada
/modules/services/swayidle.nix @c0deaddict
/tests/modules/services/swayidle @c0deaddict
/modules/programs/ion.nix @jo1gi
/modules/services/plex-mpv-shim.nix @starcraft66
/modules/xsession.nix @rycee

View File

@@ -8,6 +8,15 @@ labels: [bug, triage]
assignees: [rycee, berbiche, sumnerevans]
body:
- type: checkboxes
attributes:
label: Are you following the right branch?
description: |
You should follow the branch of Home Manager that corresponds to your
version of Nixpkgs; see [the README](https://github.com/nix-community/home-manager#releases) for details.
options:
- label: My Nixpkgs and Home Manager versions are in sync
required: true
- type: checkboxes
attributes:
label: Is there an existing issue for this?

View File

@@ -10,7 +10,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-21.11"
target-branch: "release-22.05"
schedule:
interval: "weekly"
commit-message:

16
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
"mail":
- modules/programs/alot*.nix
- tests/modules/programs/alot/*
- modules/programs/mujmap.nix
- tests/modules/programs/mujmap/*
- modules/programs/notmuch.nix
- modules/programs/neomutt*
- tests/modules/programs/neomutt/*
- modules/programs/getmail*
- modules/*/mbsync*
- tests/modules/programs/mbsync/*
"neovim":
- modules/programs/neovim.nix
- tests/modules/programs/neovim/**/*

View File

@@ -11,13 +11,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- uses: cachix/install-nix-action@v21
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
- uses: cachix/cachix-action@v12
with:
name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix-build -A docs.html
cp -r result/share/doc/home-manager public

24
.github/workflows/labeler.yml vendored Normal file
View File

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

View File

@@ -12,13 +12,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- uses: cachix/install-nix-action@v21
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
nix_path: nixpkgs=channel:nixos-22.11
- uses: cachix/cachix-action@v12
with:
name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
if grep -R --exclude stdlib-extended.nix literalExample modules ; then
echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr

22
.github/workflows/update-flake.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Update flake inputs
on:
schedule:
# Update every Sunday and Wednesday
- cron: "51 3 * * 0,3"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v21
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v19
with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
pr-labels: dependencies

1
.gitignore vendored
View File

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

View File

@@ -4,17 +4,8 @@ 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:

View File

@@ -1 +1 @@
22.05
22.11

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017-2020 Home Manager contributors
Copyright (c) 2017-2022 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

View File

@@ -6,11 +6,17 @@ using the [Nix][] package manager together with the Nix libraries
found in [Nixpkgs][]. It allows declarative configuration of user
specific (non global) packages and dotfiles.
Usage
-----
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] and
[options][configuration options].
For a systematic overview of Home Manager and its available options,
please see
- the [Home Manager manual][manual],
- the [Home Manager configuration options][configuration options], and
- the 3rd party [Home Manager option search](https://mipmip.github.io/home-manager-option-search/).
If you would like to contribute to Home Manager
then please have a look at the [contributing][] chapter of the manual.
@@ -36,7 +42,7 @@ will write to your dconf store and cannot tell whether a configuration
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 21.11 (the
Home Manager targets [NixOS][] unstable and NixOS version 22.11 (the
current stable version), it may or may not work on other Linux
distributions and NixOS versions.
@@ -101,7 +107,7 @@ 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.11`). These branches get fixes, but usually not new
(e.g. `release-22.11`). These branches get fixes, but usually not new
modules. If you need a module to be backported, then feel free to open
an issue.
@@ -110,18 +116,18 @@ License
This project is licensed under the terms of the [MIT license](LICENSE).
[Nix]: https://nixos.org/nix/
[Nix]: https://nixos.org/explore.html
[NixOS]: https://nixos.org/
[Nixpkgs]: https://nixos.org/nixpkgs/
[manual]: https://nix-community.github.io/home-manager/
[Nixpkgs]: https://github.com/NixOS/nixpkgs
[manual]: https://nix-community.github.io/home-manager/index.html
[contributing]: https://nix-community.github.io/home-manager/#ch-contributing
[manual usage]: https://nix-community.github.io/home-manager/#ch-usage
[configuration options]: https://nix-community.github.io/home-manager/options.html
[#home-manager]: https://webchat.oftc.net/?channels=home-manager
[OFTC]: https://oftc.net/
[Nix Pills]: https://nixos.org/nixos/nix-pills/
[Nix Pills]: https://nixos.org/guides/nix-pills/
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
[nix-darwin]: https://github.com/LnL7/nix-darwin/
[nix-darwin]: https://github.com/LnL7/nix-darwin
[manual standalone install]: https://nix-community.github.io/home-manager/index.html#sec-install-standalone
[manual nixos install]: https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module
[manual nix-darwin install]: https://nix-community.github.io/home-manager/index.html#sec-install-nix-darwin-module

View File

@@ -105,7 +105,7 @@ When you have made changes to a module, it is a good idea to check that the man
[source,console]
$ nix-build -A docs.manPages
$ man ./result/share/man/man5/home-configuration.nix.5
$ man ./result/share/man/man5/home-configuration.nix.5.gz
==== Add yourself as a module maintainer
@@ -155,7 +155,7 @@ A potential gotcha with respect to licensing are option descriptions. Often it i
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
The commit messages should follow the {seven-rules}[seven rules], except for "Capitalize the subject line". We also ask you to include the affected code component or module in the first line. That is, a commit message should follow the template
----
{component}: {description}

View File

@@ -5,12 +5,10 @@
let
nmdSrc = pkgs.fetchFromGitLab {
name = "nmd";
owner = "rycee";
repo = "nmd";
rev = "de522bdd533350b3afb41e1ce9b3afb72922fba2";
sha256 = "1ji4q7b48nnicgpnnl6yb9xb9zfkmmzkch4yifinphw3ag38qrmd";
nmdSrc = fetchTarball {
url =
"https://gitlab.com/api/v4/projects/rycee%2Fnmd/repository/archive.tar.gz?sha=b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169";
sha256 = "0c2nq28rw4v559s3f1nf6y2p6fladgmbqgbsyf3vzs2przn5qn37";
};
nmd = import nmdSrc { inherit lib pkgs; };
@@ -26,6 +24,8 @@ let
}];
};
dontCheckDefinitions = { _module.check = false; };
buildModulesDocs = args:
nmd.buildModulesDocs ({
moduleRootPaths = [ ./.. ];
@@ -43,21 +43,7 @@ let
};
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
];
modules = [ ../nixos scrubbedPkgsModule dontCheckDefinitions ];
docBook = {
id = "nixos-options";
optionIdPrefix = "nixos-opt";
@@ -65,22 +51,7 @@ let
};
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
];
modules = [ ../nix-darwin scrubbedPkgsModule dontCheckDefinitions ];
docBook = {
id = "nix-darwin-options";
optionIdPrefix = "nix-darwin-opt";
@@ -89,6 +60,7 @@ let
docs = nmd.buildDocBookDocs {
pathName = "home-manager";
projectName = "Home Manager";
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
documentsDirectory = ./.;
documentType = "book";

View File

@@ -143,8 +143,8 @@ 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
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
$ nix-channel --update
----
Note, the package will not be affected by any package overrides, overlays, etc.

View File

@@ -41,9 +41,6 @@ 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.
+
Note that Nix 2.4 is not yet fully supported. Most significantly, Home
Manager is incompatible with the new `nix profile`.
2. Add the appropriate Home Manager channel. If you are following
Nixpkgs master or an unstable channel you can run
@@ -54,11 +51,11 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master
$ nix-channel --update
----
+
and if you follow a Nixpkgs version 21.11 channel you can run
and if you follow a Nixpkgs version 22.11 channel you can run
+
[source,console]
----
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
$ nix-channel --update
----
+
@@ -127,21 +124,21 @@ 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
Home Manager channel to the root user. 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
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ sudo nix-channel --update
----
and if you follow a Nixpkgs version 21.11 channel, you can run
and if you follow a Nixpkgs version 22.11 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager
# nix-channel --update
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
$ sudo nix-channel --update
----
It is then possible to add
@@ -164,7 +161,7 @@ home-manager.users.eve = { pkgs, ... }: {
};
----
and after a `nixos-rebuild switch` the user eve's environment should
and after a `sudo nixos-rebuild switch` the user eve's environment should
include a basic Bash configuration and the packages atool and httpie.
[NOTE]
@@ -243,16 +240,16 @@ 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
$ 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.11 channel, you can run
and if you follow a Nixpkgs version 22.11 channel, you can run
[source,console]
----
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager
# nix-channel --update
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
$ nix-channel --update
----
It is then possible to add
@@ -306,7 +303,7 @@ can be sourced directly by POSIX.2-like shells such as {bash}[Bash] or
[NOTE]
====
By default user packages will not be ignored in favor of
`environment.systemPackages`, but they will be intalled to
`environment.systemPackages`, but they will be installed to
`/etc/profiles/per-user/$USERNAME` if
[source,nix]

View File

@@ -155,6 +155,18 @@
--keep-going
</arg>
<arg>
<group choice="req">
<arg choice="plain">
-L
</arg>
<arg choice="plain">
--print-build-logs
</arg>
</group>
</arg>
<arg>
--show-trace
</arg>
@@ -546,6 +558,22 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-L</option>
</term>
<term>
<option>--print-build-logs</option>
</term>
<listitem>
<para>
Passed on to <citerefentry>
<refentrytitle>nix build</refentrytitle>
</citerefentry>
when building from a flake.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--show-trace</option>

View File

@@ -4,7 +4,7 @@
<title>Home Manager Reference Pages</title>
<info>
<author><personname>Home Manager contributors</personname></author>
<copyright><year>20172020</year><holder>Home Manager contributors</holder>
<copyright><year>20172022</year><holder>Home Manager contributors</holder>
</copyright>
</info>
<xi:include href="man-configuration.xml" />

View File

@@ -24,7 +24,7 @@
</para>
<note>
<para>
Commands prefixed with <literal>#</literal> have to be run as root, either
Commands prefixed with <literal>$ sudo</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>

View File

@@ -7,18 +7,30 @@ Home Manager includes a `flake.nix` file for compatibility with {nixos-wiki-flak
The support is still experimental and may change in backwards incompatible ways.
[[sec-flakes-prerequisties]]
=== Prerequisties
=== Prerequisites
* Install Nix 2.4 or have it in `nix-shell`.
* Install Nix 2.4 or later, or have it in `nix-shell`.
* Enable experimental features `nix-command` and `flakes`.
+
Either set in `nix.conf`
** When using NixOS, add the following to your `configuration.nix` and rebuild your system.
+
[source,nix]
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
+
** If you are not using NixOS, add the following to `nix.conf` (located at `~/.config/nix/` or `/etc/nix/nix.conf`).
+
[source,bash]
experimental-features = nix-command flakes
+
or pass them to `nix` and `home-manager` by
You may need to restart the Nix daemon with, for example, `sudo systemctl restart nix-daemon.service`.
+
** Alternatively, you can enable flakes on a per-command basis with the following additional flags to `nix` and `home-manager`:
+
[source,console]
----
@@ -33,13 +45,6 @@ Unlike the channel-based setup,
so it must be present before bootstrap of Home Manager from the flake.
See <<sec-usage-configuration>> for introduction about
writing a Home Manager configuration.
+
[NOTE]
====
The `stateVersion` will be specified in the flake instead of in the configuration file.
Remove the line containing `home.stateVersion` in the example.
====
[[sec-flakes-standalone]]
=== Standalone setup
@@ -52,27 +57,27 @@ Remove the line containing `home.stateVersion` in the example.
description = "Home Manager configuration of Jane Doe";
inputs = {
# Specify the source of Home Manager and Nixpkgs
home-manager.url = "github:nix-community/home-manager";
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { home-manager, ... }:
outputs = { nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
username = "jdoe";
pkgs = nixpkgs.legacyPackages.${system};
in {
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
# Specify the path to your home configuration here
configuration = import ./home.nix;
homeConfigurations.jdoe = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
inherit system username;
homeDirectory = "/home/${username}";
# Update the state version as needed.
# See the changelog here:
# https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05
stateVersion = "21.11";
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [
./home.nix
];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
@@ -85,13 +90,16 @@ Remove the line containing `home.stateVersion` in the example.
====
* The above example tracks the master branch of Home Manager
and nixos-unstable branch of Nixpkgs.
If you would like to use the `release-21.11` branch,
change the `home-manager` input url to `github:nix-community/home-manager/release-21.11`
and `nixpkgs` url to `github:NixOS/nixpkgs/nixos-21.11`.
Make sure to also update to the `stateVersion` option accordingly.
If you would like to use the `release-22.11` branch,
change the `home-manager` input url to `github:nix-community/home-manager/release-22.11`
and `nixpkgs` url to `github:NixOS/nixpkgs/nixos-22.11`.
* The Home Manager library is exported by the flake under
`lib.hm`.
* You can use the above `flake.nix` as a template in `~/.config/nixpkgs` by
[source,console]
$ nix flake new ~/.config/nixpkgs -t github:nix-community/home-manager
====
2. Install Home Manager and apply the configuration by
@@ -178,6 +186,11 @@ The Home Manager configuration is then part of the NixOS configuration
and is automatically rebuilt with the system when using the appropriate command
for the system, such as `nixos-rebuild switch --flake <flake-uri>`.
You can use the above `flake.nix` as a template in `/etc/nixos` by
[source,console]
$ nix flake new /etc/nixos -t github:nix-community/home-manager#nixos
[[sec-flakes-nix-darwin-module]]
=== nix-darwin module
@@ -187,19 +200,19 @@ is similar to that of NixOS. The `flake.nix` would be:
[source,nix]
----
{
description = "NixOS configuration";
description = "Darwin configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin.url = "github:lnl7/nix-darwin";
darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, nix-darwin, ... }: {
outputs = inputs@{ nixpkgs, home-manager, darwin, ... }: {
darwinConfigurations = {
hostname = nix-darwin.lib.darwinSystem {
hostname = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
./configuration.nix
@@ -221,3 +234,8 @@ is similar to that of NixOS. The `flake.nix` would be:
and it is also rebuilt with the nix-darwin generations.
The rebuild command here may be `darwin-rebuild switch --flake <flake-uri>`.
You can use the above `flake.nix` as a template in `~/.config/darwin` by
[source,console]
$ nix flake new ~/.config/darwin -t github:nix-community/home-manager#nix-darwin

View File

@@ -6,6 +6,8 @@ This section lists the release notes for stable versions of Home Manager and the
:leveloffset: 1
include::rl-2211.adoc[]
include::rl-2205.adoc[]
include::rl-2111.adoc[]

View File

@@ -8,7 +8,7 @@ The 21.05 release branch became the stable branch in May, 2021.
This release has the following notable changes:
* The <<opt-programs.broot.verbs>> option is now a list rather than an
* 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,
+

View File

@@ -1,7 +1,7 @@
[[sec-release-22.05]]
== Release 22.05
This is the current unstable branch and the information in this section is therefore not final.
The 22.05 release branch became the stable branch in May, 2022.
[[sec-release-22.05-highlights]]
=== Highlights

View File

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

View File

@@ -52,7 +52,7 @@ A fresh install of Home Manager will generate a minimal `~/.config/nixpkgs/home.
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
home.stateVersion = "22.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
@@ -92,7 +92,7 @@ To satisfy the above setup we should elaborate the `home.nix` file as follows:
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
home.stateVersion = "22.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

View File

@@ -167,9 +167,11 @@ Builds a GVariant array containing the given list of elements, where each elemen
- `hm.gvariant.type.int64`
- `hm.gvariant.type.uint64`
- `hm.gvariant.type.double`
- `hm.gvariant.type.variant`
- `hm.gvariant.type.arrayOf type`
- `hm.gvariant.type.maybeOf type`
- `hm.gvariant.type.tupleOf types`
- `hm.gvariant.type.dictionaryEntryOf types`
--
+
where `type` and `types` are themselves a type and list of types, respectively.
@@ -185,3 +187,9 @@ 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.
+
`hm.gvariant.mkVariant element`:::
Builds a GVariant variant which contains the value of a GVariant element.
+
`hm.gvariant.mkDictionaryEntry elements`:::
Builds a GVariant dictionary entry containing the given list of elements, where each element is a GVariant value.

43
flake.lock generated Normal file
View File

@@ -0,0 +1,43 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1667629849,
"narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3bacde6273b09a21a8ccfba15586fb165078fb62",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

136
flake.nix
View File

@@ -1,60 +1,102 @@
{
description = "Home Manager for Nix";
outputs = { self, nixpkgs }:
let
# List of systems supported by home-manager binary
supportedSystems = with nixpkgs.lib.platforms; linux ++ darwin;
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.utils.url = "github:numtide/flake-utils";
# Function to generate a set based on supported systems
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
outputs = { self, nixpkgs, utils, ... }:
{
nixosModules = rec {
home-manager = import ./nixos;
default = home-manager;
};
# deprecated in Nix 2.8
nixosModule = self.nixosModules.default;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in rec {
nixosModules.home-manager = import ./nixos;
nixosModule = self.nixosModules.home-manager;
darwinModules = rec {
home-manager = import ./nix-darwin;
default = home-manager;
};
# unofficial; deprecated in Nix 2.8
darwinModule = self.darwinModules.default;
darwinModules.home-manager = import ./nix-darwin;
darwinModule = self.darwinModules.home-manager;
templates = {
standalone = {
path = ./templates/standalone;
description = "Standalone setup";
};
nixos = {
path = ./templates/nixos;
description = "Home Manager as a NixOS module,";
};
nix-darwin = {
path = ./templates/nix-darwin;
description = "Home Manager as a nix-darwin module,";
};
};
packages = forAllSystems (system:
let docs = import ./docs { pkgs = nixpkgsFor.${system}; };
in {
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
defaultTemplate = self.templates.standalone;
lib = {
hm = (import ./modules/lib/stdlib-extended.nix nixpkgs.lib).hm;
homeManagerConfiguration = { modules ? [ ], pkgs, lib ? pkgs.lib
, extraSpecialArgs ? { }, check ? true
# Deprecated:
, configuration ? null, extraModules ? null, stateVersion ? null
, username ? null, homeDirectory ? null, system ? null }@args:
let
msgForRemovedArg = ''
The 'homeManagerConfiguration' arguments
- 'configuration',
- 'username',
- 'homeDirectory'
- 'stateVersion',
- 'extraModules', and
- 'system'
have been removed. Instead use the arguments 'pkgs' and
'modules'. See the 22.11 release notes for more.
'';
throwForRemovedArgs = v:
let
used = builtins.filter (n: (args.${n} or null) != null) [
"configuration"
"username"
"homeDirectory"
"stateVersion"
"extraModules"
"system"
];
msg = msgForRemovedArg + ''
Deprecated args passed: ''
+ builtins.concatStringsSep " " used;
in lib.throwIf (used != [ ]) msg v;
in throwForRemovedArgs (import ./modules {
inherit pkgs lib check extraSpecialArgs;
configuration = { ... }: {
imports = modules;
nixpkgs = { inherit (pkgs) config overlays; };
};
});
};
} // utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
docs = import ./docs { inherit pkgs; };
in {
packages = rec {
home-manager = pkgs.callPackage ./home-manager { };
docs-html = docs.manual.html;
docs-manpages = docs.manPages;
docs-json = docs.options.json;
default = self.packages.${system}.home-manager;
});
# defaultPackage is deprecated as of Nix 2.7.0
defaultPackage = forAllSystems (system: self.packages.${system}.default);
apps = forAllSystems (system: {
home-manager = {
type = "app";
program = "${defaultPackage.${system}}/bin/home-manager";
default = home-manager;
};
# deprecated in Nix 2.7
defaultPackage = self.packages.${system}.default;
});
defaultApp = forAllSystems (system: apps.${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
, lib ? pkgs.lib, check ? true, stateVersion ? "20.09" }@args:
assert nixpkgs.lib.versionAtLeast stateVersion "20.09";
import ./modules {
inherit pkgs lib check extraSpecialArgs;
configuration = { ... }: {
imports = [ configuration ] ++ extraModules;
home = { inherit homeDirectory stateVersion username; };
nixpkgs = { inherit (pkgs) config overlays; };
};
};
};
};
}

6
format
View File

@@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/5edf5b60c3d8f82b5fc5e73e822b6f7460584945.tar.gz -i bash -p findutils nixfmt
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6616de389ed55fba6eeba60377fc04732d5a207c.tar.gz -i bash -p findutils nixfmt
CHECK_ARG=
@@ -15,18 +15,14 @@ esac
# The excludes are for files touched by open pull requests and we want
# to avoid merge conflicts.
find . -name '*.nix' \
! -path ./home-manager/home-manager.nix \
! -path ./modules/default.nix \
! -path ./modules/files.nix \
! -path ./modules/home-environment.nix \
! -path ./modules/launchd/launchd.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/ssh.nix \
! -path ./modules/programs/zsh.nix \
! -path ./nix-darwin/default.nix \
! -path ./tests/default.nix \
-exec nixfmt $CHECK_ARG {} +

View File

@@ -293,6 +293,7 @@ _home-manager_completions ()
Options=( "-f" "--file" "-b" "-A" "-I" "-h" "--help" "-n" "--dry-run" "-v" \
"--verbose" "--cores" "--debug" "--impure" "--keep-failed" \
"--keep-going" "-j" "--max-jobs" "--no-substitute" "--no-out-link" \
"-L" "--print-build-logs" \
"--show-trace" "--substitute" "--builders" "--version" \
"--update-input" "--override-input" "--experimental-features" \
"--extra-experimental-features" )

View File

@@ -60,6 +60,7 @@ complete -c home-manager -f -l "keep-going" -d "Keep going in case of failed bui
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 -x -l "builders" -d "Remote builders"
complete -c home-manager -f -s L -l "print-build-logs" -d "Print full build logs on standard error"
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

@@ -19,6 +19,7 @@ _arguments \
'(-j --max-jobs)'{--max-jobs,-j}'[max jobs]:NUM:()' \
'--option[option]:NAME VALUE:()' \
'--builders[builders]:SPEC:()' \
'(-L --print-build-logs)'{--print-build-logs,-L}'[print build logs]' \
'--show-trace[show trace]' \
'--override-input[override flake input]:NAME VALUE:()' \
'--update-input[update flake input]:NAME:()' \

View File

@@ -1,5 +1,5 @@
{ runCommand, lib, bash, callPackage, coreutils, findutils, gettext, gnused
, less
, less, ncurses, unixtools
# used for pkgs.path for nixos-option
, pkgs
@@ -19,6 +19,7 @@ in runCommand "home-manager" {
preferLocalBuild = true;
nativeBuildInputs = [ gettext ];
meta = with lib; {
mainProgram = "home-manager";
description = "A user environment configurator";
maintainers = [ maintainers.rycee ];
platforms = platforms.unix;
@@ -30,7 +31,16 @@ in runCommand "home-manager" {
substituteInPlace $out/bin/home-manager \
--subst-var-by bash "${bash}" \
--subst-var-by DEP_PATH "${
lib.makeBinPath [ coreutils findutils gettext gnused less nixos-option ]
lib.makeBinPath [
coreutils
findutils
gettext
gnused
less
ncurses
nixos-option
unixtools.hostname
]
}" \
--subst-var-by HOME_MANAGER_LIB '${../lib/bash/home-manager.sh}' \
--subst-var-by HOME_MANAGER_PATH '${pathStr}' \

View File

@@ -106,10 +106,17 @@ function setFlakeAttribute() {
local name="${FLAKE_ARG#*#}"
;;
*)
local name="$USER@$(hostname)"
if [ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$name\"")" = "false" ]; then
name="$USER"
fi
local name="$USER"
# Check both long and short hostnames; long first to preserve
# pre-existing behaviour in case both happen to be defined.
for n in "$USER@$(hostname)" "$USER@$(hostname -s)"; do
if [[ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$n\"")" == "true" ]]; then
name="$n"
if [[ -v VERBOSE ]]; then
echo "Using flake homeConfiguration for $name"
fi
fi
done
;;
esac
export FLAKE_CONFIG_URI="$flake#homeConfigurations.\"$name\""
@@ -282,6 +289,7 @@ function doBuild() {
"$FLAKE_CONFIG_URI.activationPackage" \
${DRY_RUN+--dry-run} \
${NO_OUT_LINK+--no-link} \
${PRINT_BUILD_LOGS+--print-build-logs} \
|| return
else
doBuildAttr \
@@ -312,6 +320,7 @@ function doSwitch() {
doBuildFlake \
"$FLAKE_CONFIG_URI.activationPackage" \
--out-link "$generation" \
${PRINT_BUILD_LOGS+--print-build-logs} \
&& "$generation/activate" || return
else
doBuildAttr \
@@ -480,7 +489,10 @@ function doUninstall() {
y|Y)
_i "Switching to empty Home Manager configuration..."
HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)"
echo "{ lib, ... }: { home.file = lib.mkForce {}; }" > "$HOME_MANAGER_CONFIG"
echo "{ lib, ... }: {" > "$HOME_MANAGER_CONFIG"
echo " home.file = lib.mkForce {};" >> "$HOME_MANAGER_CONFIG"
echo " home.stateVersion = \"18.09\";" >> "$HOME_MANAGER_CONFIG"
echo "}" >> "$HOME_MANAGER_CONFIG"
doSwitch
$DRY_RUN_CMD $REMOVE_CMD home-manager-path || true
rm "$HOME_MANAGER_CONFIG"
@@ -541,6 +553,7 @@ function doHelp() {
echo " --keep-going"
echo " -j, --max-jobs NUM"
echo " --option NAME VALUE"
echo " -L, --print-build-logs"
echo " --show-trace"
echo " --(no-)substitute"
echo " --no-out-link Do not create a symlink to the output path"
@@ -638,6 +651,9 @@ while [[ $# -gt 0 ]]; do
--no-out-link)
NO_OUT_LINK=1
;;
-L|--print-build-logs)
PRINT_BUILD_LOGS=1
;;
-h|--help)
doHelp
exit 0
@@ -661,7 +677,7 @@ while [[ $# -gt 0 ]]; do
export VERBOSE=1
;;
--version)
echo 22.05
echo 22.11
exit 0
;;
*)

View File

@@ -1,9 +1,5 @@
{ pkgs ? import <nixpkgs> {}
, confPath
, confAttr ? null
, check ? true
, newsReadIdsFile ? null
}:
{ pkgs ? import <nixpkgs> { }, confPath, confAttr ? null, check ? true
, newsReadIdsFile ? null }:
let
inherit (pkgs.lib)
@@ -11,68 +7,58 @@ let
replaceStrings splitString;
env = import ../modules {
configuration =
if confAttr == "" || confAttr == null
then confPath
else (import confPath).${confAttr};
configuration = if confAttr == "" || confAttr == null then
confPath
else
(import confPath).${confAttr};
pkgs = pkgs;
check = check;
};
newsReadIds =
if newsReadIdsFile == null
then {}
else
let
ids = splitString "\n" (fileContents newsReadIdsFile);
in
builtins.listToAttrs (map (id: { name = id; value = null; }) ids);
newsReadIds = if newsReadIdsFile == null then
{ }
else
let ids = splitString "\n" (fileContents newsReadIdsFile);
in builtins.listToAttrs (map (id: {
name = id;
value = null;
}) ids);
newsIsRead = entry: builtins.hasAttr entry.id newsReadIds;
newsFiltered =
let
pred = entry: entry.condition && ! newsIsRead entry;
in
filter pred env.newsEntries;
newsFiltered = let pred = entry: entry.condition && !newsIsRead entry;
in filter pred env.newsEntries;
newsNumUnread = length newsFiltered;
newsFileUnread = pkgs.writeText "news-unread.txt" (
concatMapStringsSep "\n\n" (entry:
newsFileUnread = pkgs.writeText "news-unread.txt" (concatMapStringsSep "\n\n"
(entry:
let
time = replaceStrings ["T"] [" "] (removeSuffix "+00:00" entry.time);
in
''
* ${time}
time =
replaceStrings [ "T" ] [ " " ] (removeSuffix "+00:00" entry.time);
in ''
* ${time}
${replaceStrings ["\n"] ["\n "] entry.message}
''
) newsFiltered
);
${replaceStrings [ "\n" ] [ "\n " ] entry.message}
'') newsFiltered);
newsFileAll = pkgs.writeText "news-all.txt" (
concatMapStringsSep "\n\n" (entry:
newsFileAll = pkgs.writeText "news-all.txt" (concatMapStringsSep "\n\n"
(entry:
let
flag = if newsIsRead entry then "read" else "unread";
time = replaceStrings ["T"] [" "] (removeSuffix "+00:00" entry.time);
in
''
* ${time} [${flag}]
time =
replaceStrings [ "T" ] [ " " ] (removeSuffix "+00:00" entry.time);
in ''
* ${time} [${flag}]
${replaceStrings ["\n"] ["\n "] entry.message}
''
) env.newsEntries
);
${replaceStrings [ "\n" ] [ "\n " ] entry.message}
'') env.newsEntries);
# File where each line corresponds to an unread news entry
# identifier. If non-empty then the file ends in "\n".
newsUnreadIdsFile = pkgs.writeText "news-unread-ids" (
let
text = concatMapStringsSep "\n" (entry: entry.id) newsFiltered;
in
text + optionalString (text != "") "\n"
);
newsUnreadIdsFile = pkgs.writeText "news-unread-ids"
(let text = concatMapStringsSep "\n" (entry: entry.id) newsFiltered;
in text + optionalString (text != "") "\n");
newsInfo = pkgs.writeText "news-info.sh" ''
local newsNumUnread=${toString newsNumUnread}
@@ -82,8 +68,7 @@ let
local newsUnreadIdsFile="${newsUnreadIdsFile}"
'';
in
{
inherit (env) activationPackage;
inherit newsInfo;
}
in {
inherit (env) activationPackage;
inherit newsInfo;
}

View File

@@ -54,7 +54,7 @@ in runCommand "home-manager-install" {
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
home.stateVersion = "22.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

189
home-manager/po/ca.po Normal file
View File

@@ -0,0 +1,189 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-06-09 11:16+0000\n"
"Last-Translator: Leix b <abone9999@gmail.com>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/home-manager/cli/"
"ca/>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.13-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "No s'ha trobat cap fitxer de configuració a %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "No s'ha trobat cap fitxer de configuració. Si us plau, creeu un a %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "No s'han pogut inspeccionar les opcions de configuració de flake"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "No es pot instanciar una configuració flake"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Hi ha %d notícia rellevant no llegida.\n"
"Llegeix-la executant la comanda \"%s news\"."
msgstr[1] ""
"Hi han %d notícies rellevants no llegides.\n"
"Llegeix-les executant la comanda \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Configuració \"news.display\" no reconeguda \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Si us plau, defineix la variable d'entorn $EDITOR"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Impossible executar la compilació en un directori només lectura"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "No existeix la generació amb ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Impossible eliminar la generació actual %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Eliminant la generació %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "No s'han trobat generacions a expirar"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Cap paquet home-manager sembla estar instal·lat."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Argument desconegut %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Home Manager serà esborrat del sistema."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Això és un simulacre, res serà realment desinstal·lat."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Estàs segur que vols desinstal·lar Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Canviant a configuració buida de Home Manager..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Visca!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Eliminar totes les generacions de Home Manager?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr ""
"Totes les generacions són ara candidates per a la recol·lecció de brossa."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"Deixant generacions, però aquestes encara poden ser esborrades pel recol·"
"lector de brossa."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
"Home Manager ha estat desinstal·lat però el vostre home.nix es manté intacte."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%: opció desconeguda '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Executa '%s --help' per veure l'ajuda d'ús"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations espera un argument, obtinguts %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Comanda desconeguda: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Creant configuració inicial de Home Manager..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Creant generació inicial de Home Manager..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Tot fet! L'eina home-manager hauria de estar instal·lada i pots editar\n"
"\n"
" %s\n"
"\n"
"per a configurar Home Manager. Executa 'man home-configuration.nix' per\n"
"a veure totes les opcions disponibles."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Uh oh, la instal·lació ha fallat! Si us plau, notifica-ho a\n"
"\n"
" %s\n"
"\n"
"si l'error sembla culpa de Home Manager."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Aquesta derivació no es pot construir, si us plau executa-la utilitzant nix-"
"shell."

187
home-manager/po/da.po Normal file
View File

@@ -0,0 +1,187 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-09-19 18:22+0000\n"
"Last-Translator: cafkafk <christina@cafkafk.com>\n"
"Language-Team: Danish <https://hosted.weblate.org/projects/home-manager/cli/"
"da/>\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.14.1\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Ingen konfigurationsfiler fundet ved %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Ingen konfigurationsfiler fundet. Venligst lav en ved %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Kan ikke inspicere indstillinger af en flake konfiguration"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Kan ikke instantiere en flake konfiguration"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Der er %d ulæst og relavante nyheder.\n"
"Læs den ved at køre \"%s news\"."
msgstr[1] ""
"Der er %d ulæste og relavante nyheder.\n"
"Læs dem ved at køre \"%s news\"."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Ubekændt \"news.display\" indstilling \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Venligst sæt $EDITOR miljøvariablen"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Kan ikke bygge i en læs-kun folder"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Ingen generation med ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Kan ikke fjerne den nuværende generation %s"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Fjern generation %s"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Ingen generationer som skal udløbes"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr ""
"Det virker ikke som om der er nogle home-manager pakker der er installeret."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Ubekendt argument %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Dette vil fjerne Home Manager fra dit system."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Dette er en tør kørsel, intet vil rent faktisk blive uinstalleret."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Virkelig uinstaller Home Manager?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Skifter til tom Home Manager konfiguration..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Juhuu!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Fjern alle Home Manager generationer?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Alle generationer kan nu blive tjekket for overflødige filer."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
"Forlad generationer, men de kan stadig bliver fjernet som overflødige filer."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
"Home Manager bliver uinstalleret, men din home.nix bliver forladt uberørt."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: ukendt indstilling '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Kør '%s --help' for brugsvejledning"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations forventer et argument, fik %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Ubekendt kommando: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Laver initial Home Manager konfiguration..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Laver initial Home Manager generation..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Alt er færdigt! Home-manager værktøjet burde nu være installeret, og du kan "
"ændre\n"
"\n"
" %s\n"
" \n"
"For at konfigurere Home Manager. Kør 'man home-configuration.nix' for at \n"
"se alle de mulige indstillinger."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Åh nej, installationen fejlede! Venligst opret en fejlrapport ved\n"
"\n"
" %s\n"
" \n"
"hvis fejlen fremstår som forskyldt af Home Manager."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr "Denne derivation er ikke bygbar, venligst kør den gennem nix-shell."

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-03-23 18:56+0000\n"
"Last-Translator: Manu [tennox] <tennox@posteo.de>\n"
"PO-Revision-Date: 2022-07-12 19:40+0000\n"
"Last-Translator: Frederik Engels <frederik.engels92@gmail.com>\n"
"Language-Team: German <https://hosted.weblate.org/projects/home-manager/cli/"
"de/>\n"
"Language: de\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.12-dev\n"
"X-Generator: Weblate 4.14-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
@@ -29,8 +29,7 @@ msgstr "Keine Konfigurationsdatei gefunden. Bitte erstellen Sie eine unter %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr ""
"Die Optionen einer Flake-Konfigurationen können nicht inspizieren werden"
msgstr "Die Optionen einer Flake-Konfiguration können nicht inspiziert werden"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"

166
home-manager/po/fi.po Normal file
View File

@@ -0,0 +1,166 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr ""
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr ""
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr ""
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr ""
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
msgstr[1] ""
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr ""
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr ""
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr ""
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr ""
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr ""
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr ""
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr ""
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr ""
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr ""
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr ""
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr ""
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr ""
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr ""
#: home-manager/home-manager:493
msgid "Yay!"
msgstr ""
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr ""
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr ""
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr ""
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr ""
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr ""
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr ""
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr ""
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr ""
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr ""
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""

View File

@@ -8,8 +8,9 @@ msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-02-10 04:55+0000\n"
"Last-Translator: Heman Gandhi <hemangandhi@gmail.com>\n"
"PO-Revision-Date: 2022-07-02 02:18+0000\n"
"Last-Translator: OKA, NETSURFER AND OBSERVER, FRONTEND, DEVELOPER "
"(DOTFILES,OSINT,OSS), KEYBASE: (3B0E8E0895DAC8B8) <tetrapasta02@gmail.com>\n"
"Language-Team: Japanese <https://hosted.weblate.org/projects/home-manager/"
"cli/ja/>\n"
"Language: ja\n"
@@ -17,11 +18,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.11-dev\n"
"X-Generator: Weblate 4.13.1-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "%s に設定ファイル見つかりません"
msgstr "%s に設定ファイル見つかりません"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
@@ -43,8 +44,8 @@ msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"未読の関連ニュースが%d件あります\n"
"\"%s news\"コマンドを使って読んでください。"
"未読のお知らせが%d件あります\n"
"\"%s news\"コマンドで確認できます。"
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
@@ -145,7 +146,7 @@ msgstr "Home Managerの初期設定を生成しています..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Home Managertの最初の世代を生成しています..."
msgstr "Home Managerの最初の世代を生成しています..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71

187
home-manager/po/nl.po Normal file
View File

@@ -0,0 +1,187 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-11-16 13:47+0000\n"
"Last-Translator: Pablo Bollansee <pablo.bollansee@gmail.com>\n"
"Language-Team: Dutch <https://hosted.weblate.org/projects/home-manager/cli/"
"nl/>\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.15-dev\n"
#: home-manager/home-manager:60
msgid "No configuration file found at %s"
msgstr "Geen configuratiebestand gevonden op %s"
#: home-manager/home-manager:79
msgid "No configuration file found. Please create one at %s"
msgstr "Geen configuratiebestand gevonden, maak er alstublieft een aan op %s"
#: home-manager/home-manager:122
msgid "Can't inspect options of a flake configuration"
msgstr "Kan de opties van een flake configuratie niet inspecteren"
#: home-manager/home-manager:162
msgid "Can't instantiate a flake configuration"
msgstr "Het is niet gelukt om de vlok-configuratie te creëren"
#: home-manager/home-manager:237
msgid ""
"There is %d unread and relevant news item.\n"
"Read it by running the command \"%s news\"."
msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Er is %d ongelezen and relevant nieuws artikel.\n"
"Lees het door het commando \"%s news\" uit te voeren."
msgstr[1] ""
"Er zijn %d ongelezen and relevante nieuws artikelen.\n"
"Lees ze door het commando \"%s news\" uit te voeren."
#: home-manager/home-manager:251
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Onbekende \"new.display\" instelling \"%s\"."
#: home-manager/home-manager:258
#, sh-format
msgid "Please set the $EDITOR environment variable"
msgstr "Gelieve de $EDITOR omgevingsvariabele in te stellen"
#: home-manager/home-manager:273
msgid "Cannot run build in read-only directory"
msgstr "Het is niet mogelijk om te bouwen in een read-only map"
#: home-manager/home-manager:355
msgid "No generation with ID %s"
msgstr "Geen generatie met de ID %s"
#: home-manager/home-manager:357
msgid "Cannot remove the current generation %s"
msgstr "Het is niet mogelijk om de huidige generatie %s te verwijderen"
#: home-manager/home-manager:359
msgid "Removing generation %s"
msgstr "Generatie %s aan het verwijderen"
#: home-manager/home-manager:385
msgid "No generations to expire"
msgstr "Geen generatie om te beëindigen"
#: home-manager/home-manager:396
msgid "No home-manager packages seem to be installed."
msgstr "Er lijkt geen home-manager pakket geïnstalleerd te zijn."
#: home-manager/home-manager:453
msgid "Unknown argument %s"
msgstr "Onbekend argument %s"
#: home-manager/home-manager:469
msgid "This will remove Home Manager from your system."
msgstr "Dit zal Home Manager van jouw systeem verwijderen."
#: home-manager/home-manager:472
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Dit is een oefening, niets wordt werkelijk geïnstalleerd."
#: home-manager/home-manager:476
msgid "Really uninstall Home Manager?"
msgstr "Wilt u zeker Home Manager verwijderen?"
#: home-manager/home-manager:481
msgid "Switching to empty Home Manager configuration..."
msgstr "Naar een lege Home Manager configuratie aan het veranderen..."
#: home-manager/home-manager:493
msgid "Yay!"
msgstr "Joepie!"
#: home-manager/home-manager:500
msgid "Remove all Home Manager generations?"
msgstr "Alle Home Manager generaties verwijderen?"
#: home-manager/home-manager:507
msgid "All generations are now eligible for garbage collection."
msgstr "Alle generaties zijn nu in aanmerking voor afvalinzameling."
#: home-manager/home-manager:510
msgid "Leaving generations but they may still be garbage collected."
msgstr "Generaties blijven momenteel bestaan maar worden later opgekuist."
#: home-manager/home-manager:514
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager is verwijdert maar jouw home.nix is onaangeraakt."
#: home-manager/home-manager:673
msgid "%s: unknown option '%s'"
msgstr "%s: onbekende keuze '%s'"
#: home-manager/home-manager:674
msgid "Run '%s --help' for usage help"
msgstr "Voer '%s --help' in om gebruiksinfo te zien"
#: home-manager/home-manager:708
msgid "expire-generations expects one argument, got %d."
msgstr "expire-generations verwacht één argument, maar kreeg er %d."
#: home-manager/home-manager:730
msgid "Unknown command: %s"
msgstr "Onbekende opdracht: %s"
#: home-manager/install.nix:22
msgid "Creating initial Home Manager configuration..."
msgstr "Initiële Home Manager configuratie aan het maken..."
#: home-manager/install.nix:66
msgid "Creating initial Home Manager generation..."
msgstr "Initiële Home Manager generatie aan het maken..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/install.nix:71
msgid ""
"All done! The home-manager tool should now be installed and you can edit\n"
"\n"
" %s\n"
"\n"
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Helemaal klaar! De home-manager tool zou nu geïnstalleerd moeten zijn en je "
"kan\n"
"\n"
" %s\n"
"\n"
"aanpassen om Home Manager te configureren. Draai 'man home-"
"configuration.nix' om\n"
"alle opties te zien."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/install.nix:76
msgid ""
"Uh oh, the installation failed! Please create an issue at\n"
"\n"
" %s\n"
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Oh nee, de installatie is mislukt. Gelieve een ticket aan te maken in\n"
"\n"
" %s\n"
"\n"
"als de error de schuld van Home Manager lijkt te zijn."
#: home-manager/install.nix:83
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Deze afleiding kan niet gebouwd worden, voer het alstublieft uit met nix-"
"shell."

View File

@@ -1,41 +0,0 @@
#!/usr/bin/env bash
# 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=""
errorColor=""
warnColor=""
noteColor=""
# 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)
if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then
normalColor="$(tput sgr0)"
errorColor="$(tput bold)$(tput setaf 1)"
warnColor="$(tput setaf 3)"
noteColor="$(tput bold)$(tput setaf 6)"
fi
fi
}
setupColors
function errorEcho() {
echo "${errorColor}$*${normalColor}"
}
function warnEcho() {
echo "${warnColor}$*${normalColor}"
}
function noteEcho() {
echo "${noteColor}$*${normalColor}"
}

View File

@@ -23,7 +23,7 @@ function setupColors() {
if [[ ! -v NO_COLOR && -t 1 ]]; then
# See if it supports colors.
local ncolors
ncolors=$(tput colors)
ncolors=$(tput colors 2> /dev/null || echo 0)
if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then
normalColor="$(tput sgr0)"

View File

@@ -44,6 +44,19 @@ let
'';
};
delimiter = mkOption {
type = types.str;
default = ''
--
'';
example = literalExpression ''
~*~*~*~*~*~*~*~*~*~*~*~
'';
description = ''
The delimiter used between the document and the signature.
'';
};
command = mkOption {
type = with types; nullOr path;
default = null;
@@ -123,6 +136,38 @@ let
};
};
jmapModule = types.submodule {
options = {
host = mkOption {
type = types.nullOr types.str;
default = null;
example = "jmap.example.org";
description = ''
Hostname of JMAP server.
</para><para>
If both this option and <xref
linkend="opt-accounts.email.accounts._name_.jmap.sessionUrl"/> are specified,
<code>host</code> is preferred by applications when establishing a
session.
'';
};
sessionUrl = mkOption {
type = types.nullOr types.str;
default = null;
example = "https://jmap.example.org:443/.well-known/jmap";
description = ''
URL for the JMAP Session resource.
</para><para>
If both this option and <xref
linkend="opt-accounts.email.accounts._name_.jmap.host"/> are specified,
<code>host</code> is preferred by applications when establishing a
session.
'';
};
};
};
smtpModule = types.submodule {
options = {
host = mkOption {
@@ -197,7 +242,14 @@ let
};
flavor = mkOption {
type = types.enum [ "plain" "gmail.com" "runbox.com" "fastmail.com" ];
type = types.enum [
"plain"
"gmail.com"
"runbox.com"
"fastmail.com"
"yandex.com"
"outlook.office365.com"
];
default = "plain";
description = ''
Some email providers have peculiar behavior that require
@@ -205,7 +257,7 @@ let
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
the IMAP, SMTP, and JMAP server configuration may be set
automatically.
'';
};
@@ -234,7 +286,7 @@ let
default = null;
description = ''
The server username of this account. This will be used as
the SMTP and IMAP user name.
the SMTP, IMAP, and JMAP user name.
'';
};
@@ -299,6 +351,14 @@ let
'';
};
jmap = mkOption {
type = types.nullOr jmapModule;
default = null;
description = ''
The JMAP configuration to use for this account.
'';
};
signature = mkOption {
type = signatureModule;
default = { };
@@ -337,17 +397,61 @@ let
name = name;
maildir = mkOptionDefault { path = "${name}"; };
}
(mkIf (config.flavor == "yandex.com") {
userName = mkDefault config.address;
imap = {
host = "imap.yandex.com";
port = 993;
tls.enable = true;
};
smtp = {
host = "smtp.yandex.com";
port = 465;
tls.enable = true;
};
})
(mkIf (config.flavor == "outlook.office365.com") {
userName = mkDefault config.address;
imap = {
host = "outlook.office365.com";
port = 993;
tls.enable = true;
};
smtp = {
host = "smtp.office365.com";
port = 587;
tls = {
enable = true;
useStartTls = true;
};
};
})
(mkIf (config.flavor == "fastmail.com") {
userName = mkDefault config.address;
smtp = {
host = "smtp.fastmail.com";
port = if config.smtp.tls.useStartTls then 587 else 465;
};
imap = {
host = "imap.fastmail.com";
port = 993;
};
smtp = {
host = "smtp.fastmail.com";
port = if config.smtp.tls.useStartTls then 587 else 465;
};
jmap = {
host = "fastmail.com";
sessionUrl = "https://jmap.fastmail.com/.well-known/jmap";
};
})
(mkIf (config.flavor == "gmail.com") {
userName = mkDefault config.address;

View File

@@ -101,9 +101,9 @@ in {
options. Options declared under namespaces such as <literal>x11</literal>
are backend specific options. By default, only backend independent cursor
configurations are generated. If you need configurations for specific
backends, you can toggle them via the enable option. For example, <varname>
<link linkend="opt-home.pointerCursor.x11.enable">home.pointerCursor.x11.enable</link>
</varname> will enable x11 cursor configurations.
backends, you can toggle them via the enable option. For example,
<xref linkend="opt-home.pointerCursor.x11.enable"/>
will enable x11 cursor configurations.
'';
};
};

View File

@@ -346,12 +346,18 @@ in
home.emptyActivationPath = mkOption {
internal = true;
default = false;
type = types.bool;
default = versionAtLeast stateVersion "22.11";
defaultText = literalExpression ''
false for state version < 22.11,
true for state version 22.11
'';
description = ''
Whether the activation script should start with an empty
<envar>PATH</envar> variable. When <literal>false</literal>
then the user's <envar>PATH</envar> will be used.
<envar>PATH</envar> variable. When <literal>false</literal> then the
user's <envar>PATH</envar> will be accessible in the script. It is
recommended to keep this at <literal>true</literal> to avoid
uncontrolled use of tools found in PATH.
'';
};
@@ -383,7 +389,7 @@ in
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>.
<xref linkend="opt-home.file"/>.
</para><para>
@@ -581,7 +587,6 @@ in
if [[ -e "$nixProfilePath"/manifest.json ]] ; then
nix profile list \
| { grep 'home-manager-path$' || test $? = 1; } \
| awk -F ' ' '{ print $4 }' \
| cut -d ' ' -f 4 \
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
else
@@ -592,22 +597,36 @@ in
''
else
''
function nixReplaceProfile() {
local oldNix="$(command -v nix)"
nix profile list \
| { grep 'home-manager-path$' || test $? = 1; } \
| cut -d ' ' -f 4 \
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
$DRY_RUN_CMD $oldNix profile install $1
}
if [[ -e "$nixProfilePath"/manifest.json ]] ; then
INSTALL_CMD="nix profile install"
INSTALL_CMD_ACTUAL="nixReplaceProfile"
LIST_CMD="nix profile list"
REMOVE_CMD_SYNTAX='nix profile remove {number | store path}'
else
INSTALL_CMD="nix-env -i"
INSTALL_CMD_ACTUAL="$DRY_RUN_CMD nix-env -i"
LIST_CMD="nix-env -q"
REMOVE_CMD_SYNTAX='nix-env -e {package name}'
fi
if ! $DRY_RUN_CMD $INSTALL_CMD ${cfg.path} ; then
if ! $INSTALL_CMD_ACTUAL ${cfg.path} ; then
echo
_iError $'Oops, Nix failed to install your new Home Manager profile!\n\nPerhaps there is a conflict with a package that was installed using\n"%s"? Try running\n\n %s\n\nand if there is a conflicting package you can remove it with\n\n %s\n\nThen try activating your Home Manager configuration again.' "$INSTALL_CMD" "$LIST_CMD" "$REMOVE_CMD_SYNTAX"
exit 1
fi
unset INSTALL_CMD LIST_CMD REMOVE_CMD_SYNTAX
unset -f nixReplaceProfile
unset INSTALL_CMD INSTALL_CMD_ACTUAL LIST_CMD REMOVE_CMD_SYNTAX
''
);
@@ -659,7 +678,16 @@ in
gnugrep
gnused
ncurses # For `tput`.
] ++ config.home.extraActivationPath
]
++ config.home.extraActivationPath
)
+ (
# Add path of the Nix binaries, if a Nix package is configured, then
# use that one, otherwise grab the path of the nix-env tool.
if config.nix.enable && config.nix.package != null then
":${config.nix.package}/bin"
else
":$(${pkgs.coreutils}/bin/dirname $(${pkgs.coreutils}/bin/readlink -m $(type -p nix-env)))"
)
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
@@ -685,6 +713,8 @@ in
''
mkdir -p $out
echo "${config.home.version.full}" > $out/hm-version
cp ${activationScript} $out/activate
mkdir $out/bin

View File

@@ -24,6 +24,7 @@ in {
i18n.inputMethod.package = fcitx5Package;
home.sessionVariables = {
GLFW_IM_MODULE = "ibus"; # IME support in kitty
GTK_IM_MODULE = "fcitx";
QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";

View File

@@ -162,12 +162,12 @@ in {
fi
if [[ -f "$dstPath" ]]; then
for (( i = 0; i < bootout_retries; i++ )); do
$DRY_RUN_CMD launchctl bootout "$domain/$agentName" || err=$?
$DRY_RUN_CMD /bin/launchctl bootout "$domain/$agentName" || err=$?
if [[ -v DRY_RUN ]]; then
break
fi
if (( err != 9216 )) &&
! launchctl print "$domain/$agentName" &> /dev/null; then
! /bin/launchctl print "$domain/$agentName" &> /dev/null; then
break
fi
sleep 1
@@ -178,7 +178,7 @@ in {
fi
fi
$DRY_RUN_CMD install -Dm444 -T "$srcPath" "$dstPath"
$DRY_RUN_CMD launchctl bootstrap "$domain" "$dstPath"
$DRY_RUN_CMD /bin/launchctl bootstrap "$domain" "$dstPath"
done
if [[ ! -e "$oldDir" ]]; then
@@ -194,7 +194,7 @@ in {
continue
fi
$DRY_RUN_CMD launchctl bootout "$domain/$agentName" || :
$DRY_RUN_CMD /bin/launchctl bootout "$domain/$agentName" || :
if [[ ! -e "$dstPath" ]]; then
continue
fi

View File

@@ -39,19 +39,19 @@ with lib;
default = null;
description = ''
This optional key is used as a hint to <literal>launchctl(1)</literal> that it should not submit this job to launchd when
loading a job or jobs. The value of this key does NOT reflect the current state of the job on the run-ning running
ning system. If you wish to know whether a job is loaded in launchd, reading this key from a configura-tion configuration
tion file yourself is not a sufficient test. You should query launchd for the presence of the job using
loading a job or jobs. The value of this key does NOT reflect the current state of the job on the running
system. If you wish to know whether a job is loaded in launchd, reading this key from a configuration
file yourself is not a sufficient test. You should query launchd for the presence of the job using
the <literal>launchctl(1)</literal> list subcommand or use the ServiceManagement framework's
<literal>SMJobCopyDictionary()</literal> method.
Note that as of Mac OS X v10.6, this key's value in a configuration file conveys a default value, which
is changed with the [-w] option of the <literal>launchctl(1)</literal> load and unload subcommands. These subcommands no
longer modify the configuration file, so the value displayed in the configuration file is not necessar-ily necessarily
ily the value that <literal>launchctl(1)</literal> will apply. See <literal>launchctl(1)</literal> for more information.
longer modify the configuration file, so the value displayed in the configuration file is not necessarily
the value that <literal>launchctl(1)</literal> will apply. See <literal>launchctl(1)</literal> for more information.
Please also be mindful that you should only use this key if the provided on-demand and KeepAlive crite-ria criteria
ria are insufficient to describe the conditions under which your job needs to run. The cost to have a
Please also be mindful that you should only use this key if the provided on-demand and KeepAlive criteria
are insufficient to describe the conditions under which your job needs to run. The cost to have a
job loaded in launchd is negligible, so there is no harm in loading a job which only runs once or very
rarely.
'';
@@ -147,8 +147,7 @@ with lib;
type = types.nullOr types.bool;
default = null;
description = ''
This flag causes launchd to use the <literal>glob(3)</literal> mechanism to update the program arguments before invoca-tion. invocation.
tion.
This flag causes launchd to use the <literal>glob(3)</literal> mechanism to update the program arguments before invocation.
'';
};
@@ -236,12 +235,12 @@ with lib;
description = ''
This optional key is used to control whether your job is to be kept continuously running or to let
demand and conditions control the invocation. The default is false and therefore only demand will start
the job. The value may be set to true to unconditionally keep the job alive. Alternatively, a dictio-nary dictionary
nary of conditions may be specified to selectively control whether launchd keeps a job alive or not. If
the job. The value may be set to true to unconditionally keep the job alive. Alternatively, a dictionary
of conditions may be specified to selectively control whether launchd keeps a job alive or not. If
multiple keys are provided, launchd ORs them, thus providing maximum flexibility to the job to refine
the logic and stall if necessary. If launchd finds no reason to restart the job, it falls back on
demand based invocation. Jobs that exit quickly and frequently when configured to be kept alive will
be throttled to converve system resources.
be throttled to conserve system resources.
'';
};
@@ -364,7 +363,10 @@ with lib;
StartCalendarInterval = mkOption {
default = null;
example = { Hour = 2; Minute = 30; };
example = {
Hour = 2;
Minute = 30;
};
description = ''
This optional key causes the job to be started every calendar interval as specified. Missing arguments
are considered to be wildcard. The semantics are much like <literal>crontab(5)</literal>. Unlike cron which skips job
@@ -652,7 +654,8 @@ with lib;
};
ProcessType = mkOption {
type = types.nullOr (types.enum [ "Background" "Standard" "Adaptive" "Interactive" ]);
type = types.nullOr
(types.enum [ "Background" "Standard" "Adaptive" "Interactive" ]);
default = null;
example = "Background";
description = ''
@@ -673,8 +676,8 @@ with lib;
XPC connections. See <literal>xpc_transaction_begin(3)</literal> for details.
Interactive
Interactive jobs run with the same resource limitations as apps, that is to say, none. Interac-tive Interactive
tive jobs are critical to maintaining a responsive user experience, and this key should only be
Interactive jobs run with the same resource limitations as apps, that is to say, none. Interactive
jobs are critical to maintaining a responsive user experience, and this key should only be
used if an app's ability to be responsive depends on it, and cannot be made Adaptive.
'';
};
@@ -683,8 +686,8 @@ with lib;
type = types.nullOr types.bool;
default = null;
description = ''
When a job dies, launchd kills any remaining processes with the same process group ID as the job. Set-ting Setting
ting this key to true disables that behavior.
When a job dies, launchd kills any remaining processes with the same process group ID as the job. Setting
this key to true disables that behavior.
'';
};
@@ -749,9 +752,9 @@ with lib;
description = ''
This optional key is used to specify launch on demand sockets that can be used to let launchd know when
to run the job. The job must check-in to get a copy of the file descriptors using APIs outlined in
launch(3). The keys of the top level Sockets dictionary can be anything. They are meant for the appli-cation application
cation developer to use to differentiate which descriptors correspond to which application level proto-cols protocols
cols (e.g. http vs. ftp vs. DNS...). At check-in time, the value of each Sockets dictionary key will
launch(3). The keys of the top level Sockets dictionary can be anything. They are meant for the application
developer to use to differentiate which descriptors correspond to which application level protocols
(e.g. http vs. ftp vs. DNS...). At check-in time, the value of each Sockets dictionary key will
be an array of descriptors. Daemon/Agent writers should consider all descriptors of a given key to be
to be effectively equivalent, even though each file descriptor likely represents a different networking
protocol which conforms to the criteria specified in the job configuration file.
@@ -825,8 +828,8 @@ with lib;
default = null;
description = ''
This optional key is a variant of SockPathName. Instead of binding to a known path, a securely
generated socket is created and the path is assigned to the environment variable that is inher-ited inherited
ited by all jobs spawned by launchd.
generated socket is created and the path is assigned to the environment variable that is inherited
by all jobs spawned by launchd.
'';
};
@@ -840,7 +843,8 @@ with lib;
};
Bonjour = mkOption {
type = types.nullOr (types.either types.bool (types.listOf types.str));
type =
types.nullOr (types.either types.bool (types.listOf types.str));
default = null;
description = ''
This optional key can be used to request that the service be registered with the
@@ -864,6 +868,5 @@ with lib;
};
};
config = {
};
config = { };
}

View File

@@ -1,39 +0,0 @@
# 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=""
errorColor=""
warnColor=""
noteColor=""
# 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)
if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then
normalColor="$(tput sgr0)"
errorColor="$(tput bold)$(tput setaf 1)"
warnColor="$(tput setaf 3)"
noteColor="$(tput bold)$(tput setaf 6)"
fi
fi
}
setupColors
function errorEcho() {
echo "${errorColor}$*${normalColor}"
}
function warnEcho() {
echo "${warnColor}$*${normalColor}"
}
function noteEcho() {
echo "${noteColor}$*${normalColor}"
}

View File

@@ -4,39 +4,38 @@
#
# - not specific to strings, i.e., any payload is OK,
#
# - the addition of the function `dagEntryBefore` indicating a
# "wanted by" relationship.
# - the addition of the function `entryBefore` indicating a "wanted
# by" relationship.
{ lib }:
let inherit (lib) all any filterAttrs mapAttrs mapAttrsToList toposort;
in rec {
emptyDag = { };
let inherit (lib) all filterAttrs hm mapAttrs toposort;
in {
empty = { };
isEntry = e: e ? data && e ? after && e ? before;
isDag = dag:
let isEntry = e: (e ? data) && (e ? after) && (e ? before);
in builtins.isAttrs dag && all (x: x) (mapAttrsToList (n: isEntry) dag);
builtins.isAttrs dag && all hm.dag.isEntry (builtins.attrValues dag);
# Takes an attribute set containing entries built by
# dagEntryAnywhere, dagEntryAfter, and dagEntryBefore to a
# topologically sorted list of entries.
# Takes an attribute set containing entries built by entryAnywhere,
# entryAfter, and entryBefore to a topologically sorted list of
# entries.
#
# Internally this function uses the `toposort` function in
# `<nixpkgs/lib/lists.nix>` and its value is accordingly.
#
# Specifically, the result on success is
#
# { result = [{name = ?; data = ?;} …] }
# { result = [ { name = ?; data = ?; } … ] }
#
# For example
#
# nix-repl> dagTopoSort {
# a = dagEntryAnywhere "1";
# b = dagEntryAfter ["a" "c"] "2";
# c = dagEntryBefore ["d"] "3";
# d = dagEntryBefore ["e"] "4";
# e = dagEntryAnywhere "5";
# nix-repl> topoSort {
# a = entryAnywhere "1";
# b = entryAfter [ "a" "c" ] "2";
# c = entryBefore [ "d" ] "3";
# d = entryBefore [ "e" ] "4";
# e = entryAnywhere "5";
# } == {
# result = [
# { data = "1"; name = "a"; }
@@ -51,66 +50,54 @@ in rec {
# And the result on error is
#
# {
# cycle = [ {after = ?; name = ?; data = ?} … ];
# loops = [ {after = ?; name = ?; data = ?} … ];
# cycle = [ { after = ?; name = ?; data = ? } … ];
# loops = [ { after = ?; name = ?; data = ? } … ];
# }
#
# For example
#
# nix-repl> dagTopoSort {
# a = dagEntryAnywhere "1";
# b = dagEntryAfter ["a" "c"] "2";
# c = dagEntryAfter ["d"] "3";
# d = dagEntryAfter ["b"] "4";
# e = dagEntryAnywhere "5";
# nix-repl> topoSort {
# a = entryAnywhere "1";
# b = entryAfter [ "a" "c" ] "2";
# c = entryAfter [ "d" ] "3";
# d = entryAfter [ "b" ] "4";
# e = entryAnywhere "5";
# } == {
# cycle = [
# { after = ["a" "c"]; data = "2"; name = "b"; }
# { after = ["d"]; data = "3"; name = "c"; }
# { after = ["b"]; data = "4"; name = "d"; }
# { after = [ "a" "c" ]; data = "2"; name = "b"; }
# { after = [ "d" ]; data = "3"; name = "c"; }
# { after = [ "b" ]; data = "4"; name = "d"; }
# ];
# loops = [
# { after = ["a" "c"]; data = "2"; name = "b"; }
# { after = [ "a" "c" ]; data = "2"; name = "b"; }
# ];
# } == {}
# }
# true
dagTopoSort = dag:
topoSort = dag:
let
dagBefore = dag: name:
mapAttrsToList (n: v: n)
(filterAttrs (n: v: any (a: a == name) v.before) dag);
builtins.attrNames
(filterAttrs (n: v: builtins.elem 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);
before = a: b: builtins.elem a.name b.after;
sorted = toposort before (builtins.attrValues normalizedDag);
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;
map = f: mapAttrs (n: v: v // { data = f n v.data; });
entryBetween = before: after: data: { inherit data before after; };
# Create a DAG entry with no particular dependency information.
dagEntryAnywhere = data: {
inherit data;
before = [ ];
after = [ ];
};
dagEntryBetween = before: after: data: { inherit data before after; };
dagEntryAfter = after: data: {
inherit data after;
before = [ ];
};
dagEntryBefore = before: data: {
inherit data before;
after = [ ];
};
entryAnywhere = hm.dag.entryBetween [ ] [ ];
entryAfter = hm.dag.entryBetween [ ];
entryBefore = before: hm.dag.entryBetween before [ ];
}

View File

@@ -1,20 +1,7 @@
{ lib }:
rec {
dag =
let
d = import ./dag.nix { inherit lib; };
in
{
empty = d.emptyDag;
isDag = d.isDag;
topoSort = d.dagTopoSort;
map = d.dagMap;
entryAnywhere = d.dagEntryAnywhere;
entryBetween = d.dagEntryBetween;
entryAfter = d.dagEntryAfter;
entryBefore = d.dagEntryBefore;
};
dag = import ./dag.nix { inherit lib; };
assertions = import ./assertions.nix { inherit lib; };
@@ -22,7 +9,7 @@ rec {
gvariant = import ./gvariant.nix { inherit lib; };
maintainers = import ./maintainers.nix;
strings = import ./strings.nix { inherit lib; };
types = import ./types.nix { inherit dag gvariant lib; };
types = import ./types.nix { inherit gvariant lib; };
shell = import ./shell.nix { inherit lib; };
zsh = import ./zsh.nix { inherit lib; };

View File

@@ -33,7 +33,7 @@ in
type = types.nullOr types.lines;
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>
<xref linkend="opt-home.file._name_.source"/>
must be set.
'';
};
@@ -42,7 +42,7 @@ in
type = types.path;
description = ''
Path of the source file or directory. If
<link linkend="opt-home.file._name_.text">home.file.&lt;name?&gt;.text</link>
<xref linkend="opt-home.file._name_.text"/>
is non-null then this option will automatically point to a file
containing that text.
'';

View File

@@ -20,6 +20,7 @@ let
arrayOf = t: "a${t}";
maybeOf = t: "m${t}";
tupleOf = ts: "(${concatStrings ts})";
dictionaryEntryOf = ts: "{${concatStrings ts}}";
string = "s";
boolean = "b";
uchar = "y";
@@ -30,6 +31,7 @@ let
int64 = "x";
uint64 = "t";
double = "d";
variant = "v";
};
# Returns the GVariant type of a given Nix value. If no type can be
@@ -74,13 +76,13 @@ in rec {
isGVariant = v: v._type or "" == "gvariant";
isArray = hasPrefix "a";
isDictionaryEntry = hasPrefix "{";
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
@@ -105,6 +107,21 @@ in rec {
mkEmptyArray = elemType: mkArray elemType [ ];
mkVariant = elem:
let gvarElem = mkValue elem;
in mkPrimitive type.variant gvarElem // {
__toString = self: "@${self.type} <${toString self.value}>";
};
mkDictionaryEntry = elems:
let
gvarElems = map mkValue elems;
dictionaryType = type.dictionaryEntryOf (map (e: e.type) gvarElems);
in mkPrimitive dictionaryType gvarElems // {
__toString = self:
"@${self.type} {${concatMapStringsSep "," toString self.value}}";
};
mkNothing = elemType: mkMaybe elemType null;
mkJust = elem: let gvarElem = mkValue elem; in mkMaybe gvarElem.type gvarElem;

View File

@@ -19,18 +19,46 @@
githubId = 56743515;
name = "Morgane Austreelis";
};
blmhemu = {
name = "blmhemu";
email = "19410501+blmhemu@users.noreply.github.com";
github = "blmhemu";
githubId = 19410501;
};
bertof = {
name = "bertof";
email = "berto.f@protonmail.com";
github = "bertof";
githubId = 9915675;
};
CarlosLoboxyz = {
name = "Carlos Lobo";
email = "86011416+CarlosLoboxyz@users.noreply.github.com";
github = "CarlosLoboxyz";
githubId = 86011416;
};
d-dervishi = {
email = "david.dervishi@epfl.ch";
github = "d-dervishi";
githubId = 61125355;
name = "David Dervishi";
keys = [{
longKeyId = "rsa4096/0xB1C012F0E7697195";
fingerprint = "4C92 E3B0 21B5 5562 A1E0 CE3D B1C0 12F0 E769 7195";
}];
};
dwagenk = {
email = "dwagenk@mailbox.org";
github = "dwagenk";
githubId = 32838899;
name = "Daniel Wagenknecht";
};
jkarlson = {
email = "jekarlson@gmail.com";
github = "jkarlson";
githubId = 1204734;
name = "Emil Karlson";
};
justinlovinger = {
name = "Justin Lovinger";
email = "git@justinlovinger.com";
@@ -89,6 +117,12 @@
fingerprint = "2BE3 BAFD 793E A349 ED1F F00F 04D0 CEAF 916A 9A40";
}];
};
katexochen = {
name = "Paul Meyer";
email = "49727155+katexochen@users.noreply.github.com";
github = "katexochen";
githubId = 49727155;
};
kubukoz = {
name = "Jakub Kozłowski";
email = "kubukoz@users.noreply.github.com";
@@ -107,6 +141,12 @@
github = "matrss";
githubId = 9308656;
};
mforster = {
name = "Michael Forster";
email = "email@michael-forster.de";
github = "MForster";
githubId = 4067975;
};
mifom = {
name = "mifom";
email = "mifom@users.noreply.github.com";
@@ -135,6 +175,12 @@
githubId = 53856373;
name = "Jens Krewald";
};
GaetanLepage = {
email = "gaetan@glepage.com";
github = "GaetanLepage";
githubId = 33058747;
name = "Gaetan Lepage";
};
maximsmol = {
email = "maximsmol@gmail.com";
github = "maximsmol";
@@ -265,10 +311,47 @@
github = "sebtm";
githubId = 17243347;
};
rosuavio = {
name = "Rosario Pulella";
email = "RosarioPulella@gmail.com";
github = "Rosuavio";
githubId = 7164552;
};
rszamszur = {
name = "Radosław Szamszur";
email = "radoslawszamszur@gmail.com";
github = "rszamszur";
githubId = 10353018;
};
rcerc = {
name = "rcerc";
email = "88944439+rcerc@users.noreply.github.com";
github = "rcerc";
githubId = 88944439;
keys = [{
longkeyid = "ed25519/0x3F98EC7EC2B87ED1";
fingerprint = "D5D6 FD1F 0D9A 3284 FB9B C26D 3F98 EC7E C2B8 7ED1";
}];
};
mtoohey = {
name = "Matthew Toohey";
email = "contact@mtoohey.com";
github = "mtoohey31";
githubId = 36740602;
};
lukasngl = {
name = "Lukas Nagel";
email = "69244516+lukasngl@users.noreply.github.com";
github = "lukasngl";
githubId = 69244516;
};
toastal = {
email = "toastal+nix@posteo.net";
matrix = "@toastal:matrix.org";
github = "toastal";
githubId = 561087;
name = "toastal";
keys =
[{ fingerprint = "7944 74B7 D236 DAB9 C9EF E7F9 5CCE 6F14 66D4 7C9E"; }];
};
}

View File

@@ -1,33 +1,40 @@
{ dag, lib }:
{ lib }:
let
inherit (lib)
concatStringsSep defaultFunctor fixedWidthNumber imap1 isAttrs isList length
listToAttrs mapAttrs mkIf mkOption mkOptionType nameValuePair stringLength
types warn;
isDagEntry = e: isAttrs e && (e ? data) && (e ? after) && (e ? before);
concatStringsSep defaultFunctor fixedWidthNumber hm imap1 isAttrs isList
length listToAttrs mapAttrs mkIf mkOrder mkOption mkOptionType nameValuePair
stringLength types warn;
dagEntryOf = elemType:
let
submoduleType = types.submodule ({ name, ... }: {
options = {
data = mkOption { type = elemType; };
after = mkOption { type = with types; uniq (listOf str); };
before = mkOption { type = with types; uniq (listOf str); };
after = mkOption { type = with types; listOf str; };
before = mkOption { type = with types; listOf str; };
};
config = mkIf (elemType.name == "submodule") {
data._module.args.dagName = name;
};
});
maybeConvert = v: if isDagEntry v then v else dag.entryAnywhere v;
maybeConvert = def:
if hm.dag.isEntry def.value then
def.value
else
hm.dag.entryAnywhere (if def ? priority then
mkOrder def.priority def.value
else
def.value);
in mkOptionType {
name = "dagEntryOf";
description = "DAG entry of ${elemType.description}";
# leave the checking to the submodule type
merge = loc: defs:
submoduleType.merge loc
(map (def: def // { value = maybeConvert def.value; }) defs);
submoduleType.merge loc (map (def: {
inherit (def) file;
value = maybeConvert def;
}) defs);
};
in rec {
@@ -42,7 +49,7 @@ in rec {
let attrEquivalent = types.attrsOf (dagEntryOf elemType);
in mkOptionType rec {
name = "dagOf";
description = "DAG of ${elemType.description}s";
description = "DAG of ${elemType.description}";
inherit (attrEquivalent) check merge emptyValue;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<name>" ]);
getSubModules = elemType.getSubModules;

View File

@@ -1,5 +1,4 @@
{ lib, dag ? import ./dag.nix { inherit lib; }
, gvariant ? import ./gvariant.nix { inherit lib; } }:
{ lib, gvariant ? import ./gvariant.nix { inherit lib; } }:
let
inherit (lib)
@@ -7,7 +6,7 @@ let
mergeAttrs mergeDefaultOption mergeOneOption mergeOptions mkOption
mkOptionType showFiles showOption types;
typesDag = import ./types-dag.nix { inherit dag lib; };
typesDag = import ./types-dag.nix { inherit lib; };
# Needed since the type is called gvariant and its merge attribute
# must refer back to the type.
@@ -96,6 +95,10 @@ in rec {
mergeOneOption loc defs
else if gvar.isMaybe sharedDefType && allChecked then
mergeOneOption loc defs
else if gvar.isDictionaryEntry sharedDefType && allChecked then
mergeOneOption loc defs
else if gvar.type.variant == 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

View File

@@ -8,9 +8,7 @@ let
docs = import ../docs { inherit lib pkgs; };
in
{
in {
options = {
manual.html.enable = mkOption {
type = types.bool;

View File

@@ -10,6 +10,14 @@ let
mkIniKeyValue = key: value: "${key}=${toString (hm.gvariant.mkValue value)}";
# The dconf keys managed by this configuration. We store this as part of the
# generation state to be able to reset keys that become unmanaged during
# switch.
stateDconfKeys = pkgs.writeText "dconf-keys.json" (builtins.toJSON
(concatLists (mapAttrsToList
(dir: entries: mapAttrsToList (key: _: "/${dir}/${key}") entries)
cfg.settings)));
in {
meta.maintainers = [ maintainers.rycee ];
@@ -54,22 +62,58 @@ in {
# 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"
home.extraBuilderCommands = ''
mkdir -p $out/state/
ln -s ${stateDconfKeys} $out/state/${stateDconfKeys.name}
'';
home.activation.dconfSettings = hm.dag.entryAfter [ "installPackages" ] (let
iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
statePath = "state/${stateDconfKeys.name}";
cleanup = pkgs.writeShellScript "dconf-cleanup" ''
set -euo pipefail
${config.lib.bash.initHomeManagerLib}
PATH=${makeBinPath [ pkgs.dconf pkgs.jq ]}''${PATH:+:}$PATH
oldState="$1"
newState="$2"
# Can't do cleanup if we don't know the old state.
if [[ ! -f $oldState ]]; then
exit 0
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
# Reset all keys that are present in the old generation but not the new
# one.
jq -r -n \
--slurpfile old "$oldState" \
--slurpfile new "$newState" \
'($old[] - $new[])[]' \
| while read -r key; do
$VERBOSE_ECHO "Resetting dconf key \"$key\""
$DRY_RUN_CMD $DCONF_DBUS_RUN_SESSION dconf reset "$key"
done
'';
in ''
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
export DCONF_DBUS_RUN_SESSION=""
else
export DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session --dbus-daemon=${pkgs.dbus}/bin/dbus-daemon"
fi
unset DCONF_DBUS_RUN_SESSION
'');
if [[ -v oldGenPath ]]; then
${cleanup} \
"$oldGenPath/${statePath}" \
"$newGenPath/${statePath}"
fi
$DRY_RUN_CMD $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
unset DCONF_DBUS_RUN_SESSION
'');
};
}

View File

@@ -0,0 +1,53 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.editorconfig;
iniFormat = pkgs.formats.ini { };
in {
meta.maintainers = with maintainers; [ loicreynier ];
options.editorconfig = {
enable = mkEnableOption "EditorConfig home configuration file";
settings = mkOption {
type = iniFormat.type;
default = { };
description = ''
Configuration written to <filename>$HOME/.editorconfig</filename>.
<code>root = true</code> is automatically added to the file,
it must not be added here.
See <link xlink:href="https://editorconfig.org"/> for documentation.
'';
example = literalExpression ''
{
"*" = {
charset = "utf-8";
end_of_line = "lf";
trim_trailing_whitespace = true;
insert_final_newline = true;
max_line_width = 78;
indent_style = "space";
indent_size = 4;
};
};
'';
};
};
config = mkIf (cfg.enable && cfg.settings != { }) {
home.file.".editorconfig".text = let
renderedSettings = generators.toINIWithGlobalSection { } {
globalSection = { root = true; };
sections = cfg.settings;
};
in ''
# Generated by Home Manager
${renderedSettings}
'';
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -202,7 +202,7 @@ in {
<citerefentry>
<refentrytitle>nix.conf</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry> for avalaible options.
</citerefentry> for available options.
The value declared here will be translated directly to the key-value pairs Nix expects.
</para>
<para>

View File

@@ -15,8 +15,8 @@ with lib;
"21.05"
"21.11"
"22.05"
"22.11"
];
default = "18.09";
description = ''
It is occasionally necessary for Home Manager to change
configuration defaults in a way that is incompatible with
@@ -30,5 +30,39 @@ with lib;
conversion or moving files.
'';
};
home.version = {
full = mkOption {
internal = true;
readOnly = true;
type = types.str;
default = let
inherit (config.home.version) release revision;
suffix =
optionalString (revision != null) "+${substring 0 8 revision}";
in "${release}${suffix}";
example = "22.11+213a0629";
description = "The full Home Manager version.";
};
release = mkOption {
internal = true;
readOnly = true;
type = types.str;
default = fileContents ../../.release;
example = "22.11";
description = "The Home Manager release.";
};
revision = mkOption {
internal = true;
type = types.nullOr types.str;
default = let gitRepo = "${toString ./../..}/.git";
in if pathIsGitRepo gitRepo then commitIdFromGitRepo gitRepo else null;
description = ''
The Git revision from which this Home Manager configuration was built.
'';
};
};
};
}

View File

@@ -38,7 +38,7 @@ let
icon = mkOption {
description = "Icon to display in file manager, menus, etc.";
type = types.nullOr types.str;
type = with types; nullOr (either str path);
default = null;
};
@@ -133,7 +133,7 @@ let
description = "Program to execute, possibly with arguments.";
};
options.icon = mkOption {
type = types.nullOr types.str;
type = with types; nullOr (either str path);
default = null;
description = "Icon to display in file manager, menus, etc.";
};
@@ -152,7 +152,7 @@ let
};
# Required for the assertions
# TODO: Remove me once `mkRemovedOptionModule` works correctly with submodules
# TODO: Remove me once https://github.com/NixOS/nixpkgs/issues/96006 is fixed
assertions = mkOption {
type = types.listOf types.unspecified;
default = [ ];

View File

@@ -94,7 +94,7 @@ in {
for p in $ps ; do
for path in "$p"/share/applications/*.desktop ; do
name="''${path##*/}"
sed -n "/^MimeType=/ { s/.*=//; s/;/;$name\n/g; p; }" "$path"
sed -n -E "/^MimeType=/ { s/.*=//; s/;?$|;/;$name\n/g; p; }" "$path"
done
done > "$out"
'';

View File

@@ -33,50 +33,66 @@ in {
# https://gitlab.freedesktop.org/xdg/xdg-user-dirs/blob/master/man/user-dirs.dirs.xml
desktop = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Desktop";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Desktop";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Desktop"'';
description = "The Desktop directory.";
};
documents = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Documents";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Documents";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Documents"'';
description = "The Documents directory.";
};
download = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Downloads";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Downloads";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Downloads"'';
description = "The Downloads directory.";
};
music = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Music";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Music";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Music"'';
description = "The Music directory.";
};
pictures = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Pictures";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Pictures";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Pictures"'';
description = "The Pictures directory.";
};
publicShare = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Public";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Public";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Public"'';
description = "The Public share directory.";
};
templates = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Templates";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Templates";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Templates"'';
description = "The Templates directory.";
};
videos = mkOption {
type = with types; coercedTo path toString str;
default = "$HOME/Videos";
type = with types; nullOr (coercedTo path toString str);
default = "${config.home.homeDirectory}/Videos";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/Videos"'';
description = "The Videos directory.";
};
@@ -86,7 +102,7 @@ in {
defaultText = literalExpression "{ }";
example = literalExpression ''
{
XDG_MISC_DIR = "$HOME/Misc";
XDG_MISC_DIR = "''${config.home.homeDirectory}/Misc";
}
'';
description = "Other user directories.";
@@ -97,7 +113,7 @@ in {
};
config = let
directories = {
directories = (filterAttrs (n: v: !isNull v) {
XDG_DESKTOP_DIR = cfg.desktop;
XDG_DOCUMENTS_DIR = cfg.documents;
XDG_DOWNLOAD_DIR = cfg.download;
@@ -106,7 +122,7 @@ in {
XDG_PUBLICSHARE_DIR = cfg.publicShare;
XDG_TEMPLATES_DIR = cfg.templates;
XDG_VIDEOS_DIR = cfg.videos;
} // cfg.extraConfig;
}) // cfg.extraConfig;
in mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "xdg.userDirs" pkgs platforms.linux) ];
@@ -120,12 +136,10 @@ in {
home.sessionVariables = directories;
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);
};
home.activation.createXdgUserDirectories = mkIf cfg.createDirectories (let
directoriesList = attrValues directories;
mkdir = (dir: ''$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "${dir}"'');
in lib.hm.dag.entryAfter [ "linkGeneration" ]
(strings.concatMapStringsSep "\n" mkdir directoriesList));
};
}

102
modules/misc/xfconf.nix Normal file
View File

@@ -0,0 +1,102 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.xfconf;
withType = v:
if builtins.isBool v then [
"-t"
"bool"
"-s"
(if v then "true" else "false")
] else if builtins.isInt v then [
"-t"
"int"
"-s"
(toString v)
] else if builtins.isFloat v then [
"-t"
"double"
"-s"
(toString v)
] else if builtins.isString v then [
"-t"
"string"
"-s"
v
] else if builtins.isList v then
[ "-a" ] ++ concatMap withType v
else
throw "unexpected xfconf type: ${builtins.typeOf v}";
in {
meta.maintainers = [ maintainers.chuangzhu ];
options.xfconf = {
enable = mkOption {
type = types.bool;
default = true;
visible = false;
description = ''
Whether to enable Xfconf settings.
</para><para>
Note, if you use NixOS then you must add
<code>programs.xfconf.enable = true</code>
to your system configuration. Otherwise you will see a systemd error
message when your configuration is activated.
'';
};
settings = mkOption {
type = with types;
attrsOf (attrsOf (oneOf [
bool
int
float
str
(listOf (oneOf [ bool int float str ]))
])) // {
description = "xfconf settings";
};
default = { };
example = literalExpression ''
{
xfce4-session = {
"startup/ssh-agent/enabled" = false;
"general/LockCommand" = "''${pkgs.lightdm}/bin/dm-tool lock";
};
xfce4-desktop = {
"backdrop/screen0/monitorLVDS-1/workspace0/last-image" =
"''${pkgs.nixos-artwork.wallpapers.stripes-logo.gnomeFilePath}";
};
}
'';
description = ''
Settings to write to the Xfconf configuration system.
'';
};
};
config = mkIf (cfg.enable && cfg.settings != { }) {
assertions =
[ (hm.assertions.assertPlatform "xfconf" pkgs platforms.linux) ];
home.activation.xfconfSettings = hm.dag.entryAfter [ "installPackages" ]
(let
mkCommand = channel: property: value: ''
$DRY_RUN_CMD ${pkgs.xfce.xfconf}/bin/xfconf-query \
${
escapeShellArgs
([ "-n" "-c" channel "-p" "/${property}" ] ++ withType value)
}
'';
commands = mapAttrsToList
(channel: properties: mapAttrsToList (mkCommand channel) properties)
cfg.settings;
in concatMapStrings concatStrings commands);
};
}

View File

@@ -24,6 +24,7 @@ let
./manual.nix
./misc/dconf.nix
./misc/debug.nix
./misc/editorconfig.nix
./misc/fontconfig.nix
./misc/gtk.nix
./misc/lib.nix
@@ -42,7 +43,9 @@ let
./misc/xdg-system-dirs.nix
./misc/xdg-user-dirs.nix
./misc/xdg.nix
./misc/xfconf.nix
./programs/abook.nix
./programs/aerc.nix
./programs/afew.nix
./programs/alacritty.nix
./programs/alot.nix
@@ -52,15 +55,19 @@ let
./programs/autojump.nix
./programs/autorandr.nix
./programs/bash.nix
./programs/bashmount.nix
./programs/bat.nix
./programs/beets.nix
./programs/borgmatic.nix
./programs/bottom.nix
./programs/broot.nix
./programs/browserpass.nix
./programs/btop.nix
./programs/chromium.nix
./programs/command-not-found/command-not-found.nix
./programs/dircolors.nix
./programs/direnv.nix
./programs/discocss.nix
./programs/eclipse.nix
./programs/emacs.nix
./programs/eww.nix
@@ -70,6 +77,7 @@ let
./programs/fish.nix
./programs/foot.nix
./programs/fzf.nix
./programs/gallery-dl.nix
./programs/getmail.nix
./programs/gh.nix
./programs/git.nix
@@ -77,11 +85,13 @@ let
./programs/gnome-terminal.nix
./programs/go.nix
./programs/gpg.nix
./programs/havoc.nix
./programs/helix.nix
./programs/hexchat.nix
./programs/himalaya.nix
./programs/home-manager.nix
./programs/htop.nix
./programs/hyfetch.nix
./programs/i3status-rust.nix
./programs/i3status.nix
./programs/info.nix
@@ -90,15 +100,19 @@ let
./programs/java.nix
./programs/jq.nix
./programs/just.nix
./programs/k9s.nix
./programs/kakoune.nix
./programs/keychain.nix
./programs/kitty.nix
./programs/kodi.nix
./programs/lazygit.nix
./programs/ledger.nix
./programs/less.nix
./programs/lesspipe.nix
./programs/lf.nix
./programs/librewolf.nix
./programs/lieer.nix
./programs/looking-glass-client.nix
./programs/lsd.nix
./programs/man.nix
./programs/mangohud.nix
@@ -106,9 +120,11 @@ let
./programs/mbsync.nix
./programs/mcfly.nix
./programs/mercurial.nix
./programs/micro.nix
./programs/mpv.nix
./programs/msmtp.nix
./programs/mu.nix
./programs/mujmap.nix
./programs/navi.nix
./programs/ncmpcpp.nix
./programs/ncspot.nix
@@ -116,6 +132,7 @@ let
./programs/neomutt.nix
./programs/neovim.nix
./programs/newsboat.nix
./programs/nheko.nix
./programs/nix-index.nix
./programs/nnn.nix
./programs/noti.nix
@@ -124,13 +141,16 @@ let
./programs/obs-studio.nix
./programs/octant.nix
./programs/offlineimap.nix
./programs/oh-my-posh.nix
./programs/opam.nix
./programs/pandoc.nix
./programs/password-store.nix
./programs/pazi.nix
./programs/pet.nix
./programs/pidgin.nix
./programs/pistol.nix
./programs/piston-cli.nix
./programs/pls.nix
./programs/powerline-go.nix
./programs/pubs.nix
./programs/pylint.nix
@@ -150,23 +170,29 @@ let
./programs/sqls.nix
./programs/ssh.nix
./programs/starship.nix
./programs/swaylock.nix
./programs/taskwarrior.nix
./programs/tealdeer.nix
./programs/terminator.nix
./programs/termite.nix
./programs/texlive.nix
./programs/thunderbird.nix
./programs/timidity.nix
./programs/tint2.nix
./programs/tiny.nix
./programs/tmate.nix
./programs/tmux.nix
./programs/topgrade.nix
./programs/urxvt.nix
./programs/vim.nix
./programs/vscode.nix
./programs/vscode/haskell.nix
./programs/pywal.nix
./programs/watson.nix
./programs/waybar.nix
./programs/wezterm.nix
./programs/xmobar.nix
./programs/yt-dlp.nix
./programs/z-lua.nix
./programs/zathura.nix
./programs/zellij.nix
@@ -177,10 +203,11 @@ let
./services/barrier.nix
./services/betterlockscreen.nix
./services/blueman-applet.nix
./services/borgmatic.nix
./services/cachix-agent.nix
./services/caffeine.nix
./services/cbatticon.nix
./services/clipmenu.nix
./services/compton.nix
./services/devilspie2.nix
./services/dropbox.nix
./services/dunst.nix
@@ -235,12 +262,16 @@ let
./services/plex-mpv-shim.nix
./services/polybar.nix
./services/poweralertd.nix
./services/pueue.nix
./services/pulseeffects.nix
./services/random-background.nix
./services/recoll.nix
./services/redshift-gammastep/gammastep.nix
./services/redshift-gammastep/redshift.nix
./services/rsibreak.nix
./services/safeeyes.nix
./services/screen-locker.nix
./services/sctd.nix
./services/spotifyd.nix
./services/stalonetray.nix
./services/status-notifier-watcher.nix
@@ -259,10 +290,12 @@ let
./services/volnoti.nix
./services/window-managers/awesome.nix
./services/window-managers/bspwm/default.nix
./services/window-managers/fluxbox.nix
./services/window-managers/herbstluftwm.nix
./services/window-managers/i3-sway/i3.nix
./services/window-managers/i3-sway/sway.nix
./services/window-managers/i3-sway/swaynag.nix
./services/window-managers/spectrwm.nix
./services/window-managers/xmonad.nix
./services/wlsunset.nix
./services/xcape.nix

124
modules/po/ca.po Normal file
View File

@@ -0,0 +1,124 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager Modules package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-06-08 10:18+0000\n"
"Last-Translator: Leix b <abone9999@gmail.com>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/home-manager/"
"modules/ca/>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.13-dev\n"
#: modules/files.nix:233
msgid "Creating home file links in %s"
msgstr "Creant enllaços dels fitxers personals a %s"
#: modules/files.nix:246
msgid "Cleaning up orphan links from %s"
msgstr "Netejant enllaços orfes de %s"
#: modules/files.nix:262
msgid "Creating profile generation %s"
msgstr "Creant generació de perfil %s"
#: modules/files.nix:276
msgid "No change so reusing latest profile generation %s"
msgstr "No hi ha canvis, reutilitzant últim perfil generat %s"
#: modules/home-environment.nix:607
msgid ""
"Oops, Nix failed to install your new Home Manager profile!\n"
"\n"
"Perhaps there is a conflict with a package that was installed using\n"
"\"%s\"? Try running\n"
"\n"
" %s\n"
"\n"
"and if there is a conflicting package you can remove it with\n"
"\n"
" %s\n"
"\n"
"Then try activating your Home Manager configuration again."
msgstr ""
"Oops, Nix no ha pogut instal·lar el teu nou perfil de Home Manager.\n"
"\n"
"Potser hi ha un conflicte amb un paquet instal·lat mitjançant\n"
"\"%s\"? Prova d'executar\n"
"\n"
" %s\n"
"\n"
"i si hi ha un paquet conflictiu el pots eliminar amb\n"
"\n"
" %s\n"
"\n"
"i després provar d'activar la teva configuració de Home Manager de nou."
#: modules/home-environment.nix:639
msgid "Activating %s"
msgstr "Activant %s"
#: modules/lib-bash/activation-init.sh:31
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr "Comprovant oldGenNum i oldGenPath"
#: modules/lib-bash/activation-init.sh:34
msgid ""
"The previous generation number and path are in conflict! These\n"
"must be either both empty or both set but are now set to\n"
"\n"
" '%s' and '%s'\n"
"\n"
"If you don't mind losing previous profile generations then\n"
"the easiest solution is probably to run\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"and trying home-manager switch again. Good luck!"
msgstr ""
"Conflicte entre el número de generació prèvia i el camí! Aquests\n"
"han de ser o bé ambdós buits o definits com a:\n"
"\n"
" '%s' i '%s'\n"
"\n"
"Si no t'importa perdre les generacions de perfil prèvies,\n"
"la solució més fàcil probablement és executar:\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"i provar home-manager switch de nou. Bona Sort!"
#: modules/lib-bash/activation-init.sh:51
msgid "Starting Home Manager activation"
msgstr "Començant activació de Home Manager"
#: modules/lib-bash/activation-init.sh:55
msgid "Sanity checking Nix"
msgstr "Comprovant Nix"
#: modules/lib-bash/activation-init.sh:61
msgid "This is a dry run"
msgstr "Execució de simulacre"
#: modules/lib-bash/activation-init.sh:64
msgid "This is a live run"
msgstr "Execució en viu"
#: modules/lib-bash/activation-init.sh:69
msgid "Using Nix version: %s"
msgstr "Utilitzant versió de Nix: %s"
#: modules/lib-bash/activation-init.sh:72
msgid "Activation variables:"
msgstr "Variables d'activació:"

124
modules/po/da.po Normal file
View File

@@ -0,0 +1,124 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager Modules package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-09-19 18:22+0000\n"
"Last-Translator: cafkafk <christina@cafkafk.com>\n"
"Language-Team: Danish <https://hosted.weblate.org/projects/home-manager/"
"modules/da/>\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.14.1\n"
#: modules/files.nix:233
msgid "Creating home file links in %s"
msgstr "Skaber hjemme fil links i %s"
#: modules/files.nix:246
msgid "Cleaning up orphan links from %s"
msgstr "Opryder forældreløse links fra %s"
#: modules/files.nix:262
msgid "Creating profile generation %s"
msgstr "Kreere profil generation %s"
#: modules/files.nix:276
msgid "No change so reusing latest profile generation %s"
msgstr "Ingen ændring så genbrug den seneste profil generation %s"
#: modules/home-environment.nix:607
msgid ""
"Oops, Nix failed to install your new Home Manager profile!\n"
"\n"
"Perhaps there is a conflict with a package that was installed using\n"
"\"%s\"? Try running\n"
"\n"
" %s\n"
"\n"
"and if there is a conflicting package you can remove it with\n"
"\n"
" %s\n"
"\n"
"Then try activating your Home Manager configuration again."
msgstr ""
"Åh nej, Nix fejlede i at installere din nye Home Manager profil! \n"
" \n"
"Måske er der en konflikt med en pakke der blev installeret gennem\n"
"\"%s\"? Prøv at køre \n"
"\n"
" %s\n"
" \n"
"og hvis der er en pakke konflikt, kan du fjerne pakken med \n"
" \n"
" %s\n"
" \n"
"og så prøve at genaktivere din Home Manager konfiguration igen."
#: modules/home-environment.nix:639
msgid "Activating %s"
msgstr "Aktivere %s"
#: modules/lib-bash/activation-init.sh:31
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr "Tjekker fornuften af oldGenNum and oldGenPath"
#: modules/lib-bash/activation-init.sh:34
msgid ""
"The previous generation number and path are in conflict! These\n"
"must be either both empty or both set but are now set to\n"
"\n"
" '%s' and '%s'\n"
"\n"
"If you don't mind losing previous profile generations then\n"
"the easiest solution is probably to run\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"and trying home-manager switch again. Good luck!"
msgstr ""
"Den forrige generations nummer og sti er i konflikt! Disse\n"
"skal enten begge være tomme, eller begge være sat, men er nu sat til \n"
" \n"
" '%s' and '%s'\n"
" \n"
"Hvis du ikke har noget mod at miste tidligere profil generationer så\n"
"er den nemmeste løsning nok at køre \n"
" \n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
" \n"
"og så prøve at køre home-manager switch igen. Held og lykke!"
#: modules/lib-bash/activation-init.sh:51
msgid "Starting Home Manager activation"
msgstr "Starter Home Manager aktivation"
#: modules/lib-bash/activation-init.sh:55
msgid "Sanity checking Nix"
msgstr "Udføre fornuft check af Nix"
#: modules/lib-bash/activation-init.sh:61
msgid "This is a dry run"
msgstr "Dette er en tør kørsel"
#: modules/lib-bash/activation-init.sh:64
msgid "This is a live run"
msgstr "Dette er en direkte kørsel"
#: modules/lib-bash/activation-init.sh:69
msgid "Using Nix version: %s"
msgstr "Bruger Nix version: %s"
#: modules/lib-bash/activation-init.sh:72
msgid "Activation variables:"
msgstr "Aktivere variable:"

97
modules/po/fi.po Normal file
View File

@@ -0,0 +1,97 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager Modules package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: modules/files.nix:233
msgid "Creating home file links in %s"
msgstr ""
#: modules/files.nix:246
msgid "Cleaning up orphan links from %s"
msgstr ""
#: modules/files.nix:262
msgid "Creating profile generation %s"
msgstr ""
#: modules/files.nix:276
msgid "No change so reusing latest profile generation %s"
msgstr ""
#: modules/home-environment.nix:607
msgid ""
"Oops, Nix failed to install your new Home Manager profile!\n"
"\n"
"Perhaps there is a conflict with a package that was installed using\n"
"\"%s\"? Try running\n"
"\n"
" %s\n"
"\n"
"and if there is a conflicting package you can remove it with\n"
"\n"
" %s\n"
"\n"
"Then try activating your Home Manager configuration again."
msgstr ""
#: modules/home-environment.nix:639
msgid "Activating %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:31
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr ""
#: modules/lib-bash/activation-init.sh:34
msgid ""
"The previous generation number and path are in conflict! These\n"
"must be either both empty or both set but are now set to\n"
"\n"
" '%s' and '%s'\n"
"\n"
"If you don't mind losing previous profile generations then\n"
"the easiest solution is probably to run\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"and trying home-manager switch again. Good luck!"
msgstr ""
#: modules/lib-bash/activation-init.sh:51
msgid "Starting Home Manager activation"
msgstr ""
#: modules/lib-bash/activation-init.sh:55
msgid "Sanity checking Nix"
msgstr ""
#: modules/lib-bash/activation-init.sh:61
msgid "This is a dry run"
msgstr ""
#: modules/lib-bash/activation-init.sh:64
msgid "This is a live run"
msgstr ""
#: modules/lib-bash/activation-init.sh:69
msgid "Using Nix version: %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:72
msgid "Activation variables:"
msgstr ""

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-03-26 23:57+0000\n"
"Last-Translator: Robert Helgesson <robert@rycee.net>\n"
"PO-Revision-Date: 2022-05-18 23:12+0000\n"
"Last-Translator: Naïm Camille Favier <n@monade.li>\n"
"Language-Team: French <https://hosted.weblate.org/projects/home-manager/"
"modules/fr/>\n"
"Language: fr\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.12-dev\n"
"X-Generator: Weblate 4.13-dev\n"
#: modules/files.nix:233
msgid "Creating home file links in %s"
@@ -53,11 +53,11 @@ msgstr ""
"Oups, Nix n'a pas réussi à installer votre nouveau profil de Home Manager!\n"
"\n"
"Il y a peut-être un conflit avec un autre paquet qui a été installé avec\n"
"« %s » ? Essayez d'éxecuter\n"
"« %s » ? Essayez d'exécuter\n"
"\n"
" %s\n"
"\n"
"et s'il y a un paquet en conflict, vous pourrez le supprimer avec\n"
"et s'il y a un paquet en conflit, vous pourrez le supprimer avec\n"
"\n"
" %s\n"
"\n"
@@ -69,7 +69,7 @@ msgstr "Activation de %s"
#: modules/lib-bash/activation-init.sh:31
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr "Vérification rationnelle de oldGenNum et oldGenPath"
msgstr "Vérification de oldGenNum et oldGenPath"
#: modules/lib-bash/activation-init.sh:34
msgid ""
@@ -86,20 +86,20 @@ msgid ""
"\n"
"and trying home-manager switch again. Good luck!"
msgstr ""
"Le numéro et le chemin de la génération dernière sont en conflit ! Ils "
"Le numéro et le chemin de la génération précédente sont en conflit ! Ils "
"doivent\n"
"être vides ou les deux mis à\n"
"\n"
" '%s' et '%s'\n"
"\n"
"Si ça ne vous dérange pas de perdre la génération dernière, la solution la "
"plus\n"
"Si ça ne vous dérange pas de perdre les générations précédentes, la solution "
"la plus\n"
"simple est probablement d'exécuter\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"et d'essayer encore home-manager switch. Bonne chance !"
"et de réessayer home-manager switch. Bonne chance !"
#: modules/lib-bash/activation-init.sh:51
msgid "Starting Home Manager activation"
@@ -107,19 +107,19 @@ msgstr "Démarrage de l'activation de Home Manager"
#: modules/lib-bash/activation-init.sh:55
msgid "Sanity checking Nix"
msgstr "Vérification rationnelle de Nix"
msgstr "Vérification de Nix"
#: modules/lib-bash/activation-init.sh:61
msgid "This is a dry run"
msgstr "Ceci est une course à sec"
msgstr "Ceci est une fausse activation (essai à blanc)"
#: modules/lib-bash/activation-init.sh:64
msgid "This is a live run"
msgstr "Ceci est une course réelle"
msgstr "Ceci est une vraie activation"
#: modules/lib-bash/activation-init.sh:69
msgid "Using Nix version: %s"
msgstr "Usage de la version de Nix : %s"
msgstr "Version de Nix : %s"
#: modules/lib-bash/activation-init.sh:72
msgid "Activation variables:"

126
modules/po/nl.po Normal file
View File

@@ -0,0 +1,126 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Home Manager contributors
# This file is distributed under the same license as the Home Manager Modules package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-11-16 13:47+0000\n"
"Last-Translator: Pablo Bollansee <pablo.bollansee@gmail.com>\n"
"Language-Team: Dutch <https://hosted.weblate.org/projects/home-manager/"
"modules/nl/>\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.15-dev\n"
#: modules/files.nix:233
msgid "Creating home file links in %s"
msgstr "Home-bestandskoppelingen aan het maken in %s"
#: modules/files.nix:246
msgid "Cleaning up orphan links from %s"
msgstr "Wees links van %s aan het opkuisen"
#: modules/files.nix:262
msgid "Creating profile generation %s"
msgstr "Profiel generatie %s aan het maken"
#: modules/files.nix:276
msgid "No change so reusing latest profile generation %s"
msgstr ""
"Geen veranderingen dus de laatste profiel generatie %s wordt hergebruikt"
#: modules/home-environment.nix:607
msgid ""
"Oops, Nix failed to install your new Home Manager profile!\n"
"\n"
"Perhaps there is a conflict with a package that was installed using\n"
"\"%s\"? Try running\n"
"\n"
" %s\n"
"\n"
"and if there is a conflicting package you can remove it with\n"
"\n"
" %s\n"
"\n"
"Then try activating your Home Manager configuration again."
msgstr ""
"Oei, het is Nix niet gelukt om je nieuwe Home Manager profiel te installeren!"
"\n"
"\n"
"Misschien is er een conflict met het pakket dat geïnstalleerd was met\n"
"\"%s\"? Probeer het volgende te draaien\n"
"\n"
" %s\n"
"\n"
"en als er een pakket is dat een conflict geeft kan je dat verwijderen met\n"
"\n"
" %s\n"
"\n"
"Probeer daarna je Home Manager configuratie opnieuw te activeren."
#: modules/home-environment.nix:639
msgid "Activating %s"
msgstr "%s aan het activeren"
#: modules/lib-bash/activation-init.sh:31
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr "oldGenNum en oldGenPath aan het sanity checken"
#: modules/lib-bash/activation-init.sh:34
msgid ""
"The previous generation number and path are in conflict! These\n"
"must be either both empty or both set but are now set to\n"
"\n"
" '%s' and '%s'\n"
"\n"
"If you don't mind losing previous profile generations then\n"
"the easiest solution is probably to run\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"and trying home-manager switch again. Good luck!"
msgstr ""
"Er is een conflict met de generatie nummer en pad! Deze\n"
"moeten beide leeg of beide ingevuld zijn, maar zijn nu\n"
"\n"
" '%s' en '%s'\n"
"\n"
"Als je het niet erg vindt je vorige profiel generaties te verliezen dan\n"
"is waarschijnlijk de eenvoudigste oplossing om het volgende te draaien\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"en dan opnieuw 'home-manager switch' te proberen. Veel succes!"
#: modules/lib-bash/activation-init.sh:51
msgid "Starting Home Manager activation"
msgstr "Home manager activatie aan het starten"
#: modules/lib-bash/activation-init.sh:55
msgid "Sanity checking Nix"
msgstr "Nix aan het sanity checken"
#: modules/lib-bash/activation-init.sh:61
msgid "This is a dry run"
msgstr "Dit is een oefening"
#: modules/lib-bash/activation-init.sh:64
msgid "This is a live run"
msgstr "Dit is voor echt"
#: modules/lib-bash/activation-init.sh:69
msgid "Using Nix version: %s"
msgstr "Nix versie %s wordt gebruikt"
#: modules/lib-bash/activation-init.sh:72
msgid "Activation variables:"
msgstr "Activatie variabelen:"

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-03-01 13:58+0000\n"
"Last-Translator: Anon Ymous <mivon27841@shackvine.com>\n"
"PO-Revision-Date: 2022-11-16 13:47+0000\n"
"Last-Translator: Jakub Janczak <kubek2k@gmail.com>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/home-manager/"
"modules/pl/>\n"
"Language: pl\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.11.1-dev\n"
"X-Generator: Weblate 4.15-dev\n"
#: modules/files.nix:233
msgid "Creating home file links in %s"
@@ -51,6 +51,18 @@ msgid ""
"\n"
"Then try activating your Home Manager configuration again."
msgstr ""
"Oops, Nix nie zdołał zainstalować twojego profilu Home Manager'a!\n"
"\n"
"Być może zaistniał konflikt z pakietem zainstalowanym przez\n"
"\"%s\"? Spróbuj uruchomić\n"
"\n"
" %s\n"
"\n"
"i jeśli istnieje konflikt możesz spróbować go rozwiązać uruchamiając\n"
"\n"
" %s\n"
"\n"
"Następnie spróbuj aktywować konfigurację Home Manager'a ponownie."
#: modules/home-environment.nix:639
msgid "Activating %s"
@@ -75,6 +87,18 @@ msgid ""
"\n"
"and trying home-manager switch again. Good luck!"
msgstr ""
"Istnieje konflikt pomiędzy poprzednią generacją i ścieżką! Powinny\n"
"być obie puste lub ustawione, a efektywnie są ustawione na:\n"
"\n"
" '%s' i '%s'\n"
"\n"
"Jeśli możesz sobie pozwolić na utratę poprzednich generacji,\n"
"możesz uruchomić\n"
"\n"
" rm %s/home-manager*\n"
" rm %s/current-home\n"
"\n"
"i spróbować uruchomić home-manager switch raz jeszcze. Powodzenia!"
#: modules/lib-bash/activation-init.sh:51
msgid "Starting Home Manager activation"
@@ -85,19 +109,17 @@ msgid "Sanity checking Nix"
msgstr "Sprawdzanie poprawności Nix"
#: modules/lib-bash/activation-init.sh:61
#, fuzzy
msgid "This is a dry run"
msgstr "To jest próbne wykonanie"
msgstr "To jest wykonanie testowe"
#: modules/lib-bash/activation-init.sh:64
msgid "This is a live run"
msgstr ""
msgstr "To jest wykonanie właściwe"
#: modules/lib-bash/activation-init.sh:69
msgid "Using Nix version: %s"
msgstr "Używając wersji Nix: %s"
#: modules/lib-bash/activation-init.sh:72
#, fuzzy
msgid "Activation variables:"
msgstr "Zmienne aktywacyjne:"

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
"PO-Revision-Date: 2022-05-05 07:14+0000\n"
"Last-Translator: Peng Guanwen <pg999w@outlook.com>\n"
"PO-Revision-Date: 2022-05-16 13:18+0000\n"
"Last-Translator: Yubo-Cao <Cao2006721@gmail.com>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
"home-manager/modules/zh_Hans/>\n"
"Language: zh_Hans\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.12.1\n"
"X-Generator: Weblate 4.13-dev\n"
#: modules/files.nix:233
msgid "Creating home file links in %s"
@@ -50,6 +50,18 @@ msgid ""
"\n"
"Then try activating your Home Manager configuration again."
msgstr ""
"糟糕Nix 未能安装您的新 Home Manager 配置文件!\n"
"\n"
"也许这里和使用 \"%s\" 安装的包有冲突?\n"
"尝试运行\n"
"\n"
" %s\n"
"\n"
"如果有冲突的包,你可以用\n"
"\n"
" %s\n"
"\n"
"来移除。然后尝试再次激活您的 Home Manager 配置。"
#: modules/home-environment.nix:639
msgid "Activating %s"

View File

@@ -0,0 +1,131 @@
{ config, lib, pkgs, confSections, confSection, ... }:
with lib;
let
mapAttrNames = f: attr:
with builtins;
listToAttrs (attrValues (mapAttrs (k: v: {
name = f k;
value = v;
}) attr));
addAccountName = name: k: "${k}:account=${name}";
in {
type = mkOption {
type = types.attrsOf (types.submodule {
options.aerc = {
enable = mkEnableOption "aerc";
extraAccounts = mkOption {
type = confSection;
default = { };
example =
literalExpression ''{ source = "maildir://~/Maildir/example"; }'';
description = ''
Extra config added to the configuration of this account in
<filename>$HOME/.config/aerc/accounts.conf</filename>.
See aerc-config(5).
'';
};
extraBinds = mkOption {
type = confSections;
default = { };
example = literalExpression
''{ messages = { d = ":move ''${folder.trash}<Enter>"; }; }'';
description = ''
Extra bindings specific to this account, added to
<filename>$HOME/.config/aerc/accounts.conf</filename>.
See aerc-config(5).
'';
};
extraConfig = mkOption {
type = confSections;
default = { };
example = literalExpression "{ ui = { sidebar-width = 42; }; }";
description = ''
Extra config specific to this account, added to
<filename>$HOME/.config/aerc/aerc.conf</filename>.
See aerc-config(5).
'';
};
smtpAuth = mkOption {
type = with types; nullOr (enum [ "none" "plain" "login" ]);
default = "plain";
example = "auth";
description = ''
Sets the authentication mechanism if smtp is used as the outgoing
method.
See aerc-smtp(5).
'';
};
};
});
};
mkAccount = name: account:
let
nullOrMap = f: v: if v == null then v else f v;
optPort = port: if port != null then ":${toString port}" else "";
optAttr = k: v:
if v != null && v != [ ] && v != "" then { ${k} = v; } else { };
optPwCmd = k: p:
optAttr "${k}-cred-cmd" (nullOrMap (builtins.concatStringsSep " ") p);
mkConfig = {
maildir = cfg: {
source =
"maildir://${config.accounts.email.maildirBasePath}/${cfg.maildir.path}";
};
imap = { userName, imap, passwordCommand, aerc, ... }@cfg:
let
protocol = if imap.tls.enable then
if imap.tls.useStartTls then "imap" else "imaps"
else
"imap+insecure";
port' = optPort imap.port;
in {
source = "${protocol}://${userName}@${imap.host}${port'}";
} // optPwCmd "source" passwordCommand;
smtp = { userName, smtp, passwordCommand, ... }@cfg:
let
loginMethod' =
if cfg.aerc.smtpAuth != null then "+${cfg.aerc.smtpAuth}" else "";
protocol = if smtp.tls.enable && !smtp.tls.useStartTls then
"smtps${loginMethod'}"
else
"smtp${loginMethod'}";
port' = optPort smtp.port;
smtp-starttls =
if smtp.tls.enable && smtp.tls.useStartTls then "yes" else null;
in {
outgoing = "${protocol}://${userName}@${smtp.host}${port'}";
} // optPwCmd "outgoing" passwordCommand
// optAttr "smtp-starttls" smtp-starttls;
msmtp = cfg: {
outgoing = "msmtpq --read-envelope-from --read-recipients";
};
};
basicCfg = account:
{
from = "${account.realName} <${account.address}>";
} // (optAttr "copy-to" account.folders.sent)
// (optAttr "default" account.folders.inbox)
// (optAttr "postpone" account.folders.drafts)
// (optAttr "aliases" account.aliases) // account.aerc.extraAccounts;
sourceCfg = account:
if account.mbsync.enable || account.offlineimap.enable then
mkConfig.maildir account
else if account.imap != null then
mkConfig.imap account
else
{ };
outgoingCfg = account:
if account.msmtp.enable then
mkConfig.msmtp account
else if account.smtp != null then
mkConfig.smtp account
else
{ };
in (basicCfg account) // (sourceCfg account) // (outgoingCfg account);
mkAccountConfig = name: account:
mapAttrNames (addAccountName name) account.aerc.extraConfig;
mkAccountBinds = name: account:
mapAttrNames (addAccountName name) account.aerc.extraBinds;
}

165
modules/programs/aerc.nix Normal file
View File

@@ -0,0 +1,165 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.aerc;
primitive = with types;
((type: either type (listOf type)) (nullOr (oneOf [ str int bool float ])))
// {
description =
"values (null, bool, int, string of float) or a list of values, that will be joined with a comma";
};
confSection = types.attrsOf primitive;
confSections = types.attrsOf confSection;
sectionsOrLines = types.either types.lines confSections;
accounts = import ./aerc-accounts.nix {
inherit config pkgs lib confSection confSections;
};
aerc-accounts =
attrsets.filterAttrs (_: v: v.aerc.enable) config.accounts.email.accounts;
in {
meta.maintainers = with lib.hm.maintainers; [ lukasngl ];
options.accounts.email.accounts = accounts.type;
options.programs.aerc = {
enable = mkEnableOption "aerc";
extraAccounts = mkOption {
type = sectionsOrLines;
default = { };
example = literalExpression
''{ Work = { source = "maildir://~/Maildir/work"; }; }'';
description = ''
Extra lines added to <filename>$HOME/.config/aerc/accounts.conf</filename>.
See aerc-config(5).
'';
};
extraBinds = mkOption {
type = sectionsOrLines;
default = { };
example = literalExpression ''{ messages = { q = ":quit<Enter>"; }; }'';
description = ''
Extra lines added to <filename>$HOME/.config/aerc/binds.conf</filename>.
Global keybindings can be set in the `global` section.
See aerc-config(5).
'';
};
extraConfig = mkOption {
type = sectionsOrLines;
default = { };
example = literalExpression ''{ ui = { sort = "-r date"; }; }'';
description = ''
Extra lines added to <filename>$HOME/.config/aerc/aerc.conf</filename>.
See aerc-config(5).
'';
};
stylesets = mkOption {
type = with types; attrsOf (either confSection lines);
default = { };
example = literalExpression ''
{ default = { ui = { "tab.selected.reverse" = toggle; }; }; };
'';
description = ''
Stylesets added to <filename>$HOME/.config/aerc/stylesets/</filename>.
See aerc-stylesets(7).
'';
};
templates = mkOption {
type = with types; attrsOf lines;
default = { };
example = literalExpression ''
{ new_message = "Hello!"; };
'';
description = ''
Templates added to <filename>$HOME/.config/aerc/templates/</filename>.
See aerc-templates(7).
'';
};
};
config = let
joinCfg = cfgs:
with builtins;
concatStringsSep "\n" (filter (v: v != "") cfgs);
toINI = conf: # quirk: global section is prepended w/o section heading
let
global = conf.global or { };
local = removeAttrs conf [ "global" ];
optNewLine = if global != { } && local != { } then "\n" else "";
mkValueString = v:
with builtins;
if isList v then # join with comma
concatStringsSep "," (map (generators.mkValueStringDefault { }) v)
else
generators.mkValueStringDefault { } v;
mkKeyValue =
generators.mkKeyValueDefault { inherit mkValueString; } " = ";
in joinCfg [
(generators.toKeyValue { inherit mkKeyValue; } global)
(generators.toINI { inherit mkKeyValue; } local)
];
mkINI = conf: if builtins.isString conf then conf else toINI conf;
mkStyleset = attrsets.mapAttrs' (k: v:
let value = if builtins.isString v then v else toINI { global = v; };
in {
name = "aerc/stylesets/${k}";
value.text = joinCfg [ header value ];
});
mkTemplates = attrsets.mapAttrs' (k: v: {
name = "aerc/templates/${k}";
value.text = v;
});
accountsExtraAccounts = builtins.mapAttrs accounts.mkAccount aerc-accounts;
accountsExtraConfig =
builtins.mapAttrs accounts.mkAccountConfig aerc-accounts;
accountsExtraBinds =
builtins.mapAttrs accounts.mkAccountBinds aerc-accounts;
joinContextual = contextual:
with builtins;
joinCfg (map mkINI (attrValues contextual));
header = ''
# Generated by Home Manager.
'';
in mkIf cfg.enable {
warnings = if ((cfg.extraAccounts != "" && cfg.extraAccounts != { })
|| accountsExtraAccounts != { })
&& (cfg.extraConfig.general.unsafe-accounts-conf or false) == false then [''
aerc: An email account was configured, but `extraConfig.general.unsafe-accounts-conf` is set to false or unset.
This will prevent aerc from starting, see `unsafe-accounts-conf` in aerc-config(5) for details.
Consider setting the option `extraConfig.general.unsafe-accounts-conf` to true.
''] else
[ ];
home.packages = [ pkgs.aerc ];
xdg.configFile = {
"aerc/accounts.conf" = mkIf
((cfg.extraAccounts != "" && cfg.extraAccounts != { })
|| accountsExtraAccounts != { }) {
text = joinCfg [
header
(mkINI cfg.extraAccounts)
(mkINI accountsExtraAccounts)
];
};
"aerc/aerc.conf" =
mkIf (cfg.extraConfig != "" && cfg.extraConfig != { }) {
text = joinCfg [
header
(mkINI cfg.extraConfig)
(joinContextual accountsExtraConfig)
];
};
"aerc/binds.conf" = mkIf ((cfg.extraBinds != "" && cfg.extraBinds != { })
|| accountsExtraBinds != { }) {
text = joinCfg [
header
(mkINI cfg.extraBinds)
(joinContextual accountsExtraBinds)
];
};
} // (mkStyleset cfg.stylesets) // (mkTemplates cfg.templates);
};
}

View File

@@ -305,7 +305,7 @@ in {
DPI=144
;;
*)
echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE"
echo "Unknown profile: $AUTORANDR_CURRENT_PROFILE"
exit 1
esac

View File

@@ -30,6 +30,27 @@ in
programs.bash = {
enable = mkEnableOption "GNU Bourne-Again SHell";
enableCompletion = mkOption {
type = types.bool;
default = true;
description = ''
Whether to enable Bash completion for all interactive Bash shells.
</para><para>
Note, if you use NixOS or nix-darwin and do not have Bash completion
enabled in the system configuration, then make sure to add
<programlisting language="nix">
environment.pathsToLink = [ "/share/bash-completion" ];
</programlisting>
to your system configuration to get completion for system packages.
Note, the legacy <filename>/etc/bash_completion.d</filename> path is
not supported by Home Manager.
'';
};
historySize = mkOption {
type = types.int;
default = 10000;
@@ -193,6 +214,15 @@ in
[[ -f ~/.bashrc ]] && . ~/.bashrc
'';
# If completion is enabled then make sure it is sourced very early. This
# is to avoid problems if any other initialization code attempts to set up
# completion.
programs.bash.initExtra = mkIf cfg.enableCompletion (mkOrder 100 ''
if [[ ! -v BASH_COMPLETION_VERSINFO ]]; then
. "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
fi
'');
home.file.".profile".source = writeBashScript "profile" ''
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"

View File

@@ -0,0 +1,34 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.bashmount;
in {
meta.maintainers = [ maintainers.AndersonTorres ];
options.programs.bashmount = {
enable = mkEnableOption "bashmount";
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/bashmount/config</filename>. Look at
<link xlink:href="https://github.com/jamielinux/bashmount/blob/master/bashmount.conf" />
for explanation about possible values.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.bashmount ];
xdg.configFile."bashmount/config" =
mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; };
};
}

View File

@@ -0,0 +1,196 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.borgmatic;
mkNullableOption = args:
lib.mkOption (args // {
type = lib.types.nullOr args.type;
default = null;
});
mkRetentionOption = frequency:
mkNullableOption {
type = types.int;
description =
"Number of ${frequency} archives to keep. Use -1 for no limit.";
example = 3;
};
extraConfigOption = mkOption {
type = with types; attrsOf (oneOf [ str bool path int ]);
default = { };
description = "Extra settings.";
};
consistencyCheckModule = types.submodule {
options = {
name = mkOption {
type = types.enum [ "repository" "archives" "data" "extract" ];
description = "Name of consistency check to run.";
example = "repository";
};
frequency = mkNullableOption {
type = types.strMatching "([[:digit:]]+ .*)|always";
description = "Frequency of this type of check";
example = "2 weeks";
};
};
};
configModule = types.submodule {
options = {
location = {
sourceDirectories = mkOption {
type = types.listOf types.str;
description = "Directories to backup.";
example = literalExpression "[config.home.homeDirectory]";
};
repositories = mkOption {
type = types.listOf types.str;
description = "Paths to repositories.";
example =
literalExpression ''["ssh://myuser@myrepo.myserver.com/./repo"]'';
};
extraConfig = extraConfigOption;
};
storage = {
encryptionPasscommand = mkNullableOption {
type = types.str;
description = "Command writing the passphrase to standard output.";
example =
literalExpression ''"''${pkgs.password-store}/bin/pass borg-repo"'';
};
extraConfig = extraConfigOption;
};
retention = {
keepWithin = mkNullableOption {
type = types.strMatching "[[:digit:]]+[Hdwmy]";
description = "Keep all archives within this time interval.";
example = "2d";
};
keepSecondly = mkRetentionOption "secondly";
keepMinutely = mkRetentionOption "minutely";
keepHourly = mkRetentionOption "hourly";
keepDaily = mkRetentionOption "daily";
keepWeekly = mkRetentionOption "weekly";
keepMonthly = mkRetentionOption "monthly";
keepYearly = mkRetentionOption "yearly";
extraConfig = extraConfigOption;
};
consistency = {
checks = mkOption {
type = types.listOf consistencyCheckModule;
default = [ ];
description = "Consistency checks to run";
example = literalExpression ''
[
{
name = "repository";
frequency = "2 weeks";
}
{
name = "archives";
frequency = "4 weeks";
}
{
name = "data";
frequency = "6 weeks";
}
{
name = "extract";
frequency = "6 weeks";
}
];
'';
};
extraConfig = extraConfigOption;
};
};
};
removeNullValues = attrSet: filterAttrs (key: value: value != null) attrSet;
writeConfig = config:
generators.toYAML { } {
location = removeNullValues {
source_directories = config.location.sourceDirectories;
repositories = config.location.repositories;
} // config.location.extraConfig;
storage = removeNullValues {
encryption_passcommand = config.storage.encryptionPasscommand;
} // config.storage.extraConfig;
retention = removeNullValues {
keep_within = config.retention.keepWithin;
keep_secondly = config.retention.keepSecondly;
keep_minutely = config.retention.keepMinutely;
keep_hourly = config.retention.keepHourly;
keep_daily = config.retention.keepDaily;
keep_weekly = config.retention.keepWeekly;
keep_monthly = config.retention.keepMonthly;
keep_yearly = config.retention.keepYearly;
} // config.retention.extraConfig;
consistency = removeNullValues { checks = config.consistency.checks; }
// config.consistency.extraConfig;
};
in {
meta.maintainers = [ maintainers.DamienCassou ];
options = {
programs.borgmatic = {
enable = mkEnableOption "Borgmatic";
package = mkPackageOption pkgs "borgmatic" { };
backups = mkOption {
type = types.attrsOf configModule;
description = ''
Borgmatic allows for several named backup configurations,
each with its own source directories and repositories.
'';
example = literalExpression ''
{
personal = {
location = {
sourceDirectories = [ "/home/me/personal" ];
repositories = [ "ssh://myuser@myserver.com/./personal-repo" ];
};
};
work = {
location = {
sourceDirectories = [ "/home/me/work" ];
repositories = [ "ssh://myuser@myserver.com/./work-repo" ];
};
};
};
'';
};
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "programs.borgmatic" pkgs
lib.platforms.linux)
];
xdg.configFile = with lib.attrsets;
mapAttrs' (configName: config:
nameValuePair ("borgmatic.d/" + configName + ".yaml") {
text = writeConfig config;
}) cfg.backups;
home.packages = [ cfg.package ];
};
}

View File

@@ -8,15 +8,160 @@ let
tomlFormat = pkgs.formats.toml { };
brootConf = {
verbs = cfg.verbs;
skin = cfg.skin;
modal = cfg.modal;
settingsModule = {
freeformType = tomlFormat.type;
options = {
modal = mkEnableOption "modal (vim) mode";
verbs = mkOption {
type = with types; listOf (attrsOf (either bool str));
default = [ ];
example = literalExpression ''
[
{ invocation = "p"; execution = ":parent"; }
{ invocation = "edit"; shortcut = "e"; execution = "$EDITOR {file}" ; }
{ invocation = "create {subpath}"; execution = "$EDITOR {directory}/{subpath}"; }
{ invocation = "view"; execution = "less {file}"; }
{
invocation = "blop {name}\\.{type}";
execution = "mkdir {parent}/{type} && ''${pkgs.neovim}/bin/nvim {parent}/{type}/{name}.{type}";
from_shell = true;
}
]
'';
description = ''
Define new verbs. For more information, see
<link xlink:href="https://dystroy.org/broot/documentation/configuration/#verb-definition-attributes"/>.
</para><para>
The possible attributes are:
</para>
<para>
<variablelist>
<varlistentry>
<term><literal>invocation</literal> (optional)</term>
<listitem><para>how the verb is called by the user, with placeholders for arguments</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>execution</literal> (mandatory)</term>
<listitem><para>how the verb is executed</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>key</literal> (optional)</term>
<listitem><para>a keyboard key triggering execution</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>shortcut</literal> (optional)</term>
<listitem><para>an alternate way to call the verb (without
the arguments part)</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>leave_broot</literal> (optional)</term>
<listitem><para>whether to quit broot on execution
(default: <literal>true</literal>)</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>from_shell</literal> (optional)</term>
<listitem><para>whether the verb must be executed from the
parent shell (default:
<literal>false</literal>)</para></listitem>
</varlistentry>
</variablelist>
'';
};
skin = mkOption {
type = types.attrsOf types.str;
default = { };
example = literalExpression ''
{
status_normal_fg = "grayscale(18)";
status_normal_bg = "grayscale(3)";
status_error_fg = "red";
status_error_bg = "yellow";
tree_fg = "red";
selected_line_bg = "grayscale(7)";
permissions_fg = "grayscale(12)";
size_bar_full_bg = "red";
size_bar_void_bg = "black";
directory_fg = "lightyellow";
input_fg = "cyan";
flag_value_fg = "lightyellow";
table_border_fg = "red";
code_fg = "lightyellow";
}
'';
description = ''
Color configuration.
</para><para>
Complete list of keys (expected to change before the v1 of broot):
<itemizedlist>
<listitem><para><literal>char_match</literal></para></listitem>
<listitem><para><literal>code</literal></para></listitem>
<listitem><para><literal>directory</literal></para></listitem>
<listitem><para><literal>exe</literal></para></listitem>
<listitem><para><literal>file</literal></para></listitem>
<listitem><para><literal>file_error</literal></para></listitem>
<listitem><para><literal>flag_label</literal></para></listitem>
<listitem><para><literal>flag_value</literal></para></listitem>
<listitem><para><literal>input</literal></para></listitem>
<listitem><para><literal>link</literal></para></listitem>
<listitem><para><literal>permissions</literal></para></listitem>
<listitem><para><literal>selected_line</literal></para></listitem>
<listitem><para><literal>size_bar_full</literal></para></listitem>
<listitem><para><literal>size_bar_void</literal></para></listitem>
<listitem><para><literal>size_text</literal></para></listitem>
<listitem><para><literal>spinner</literal></para></listitem>
<listitem><para><literal>status_error</literal></para></listitem>
<listitem><para><literal>status_normal</literal></para></listitem>
<listitem><para><literal>table_border</literal></para></listitem>
<listitem><para><literal>tree</literal></para></listitem>
<listitem><para><literal>unlisted</literal></para></listitem>
</itemizedlist></para>
<para>
Add <literal>_fg</literal> for a foreground color and
<literal>_bg</literal> for a background colors.
'';
};
};
};
shellInit = shell:
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
mkAfter ''
source ${
pkgs.runCommand "br.${shell}" { nativeBuildInputs = [ cfg.package ]; }
"broot --print-shell-function ${shell} > $out"
}
'';
in {
meta.maintainers = [ hm.maintainers.aheaume ];
imports = [
(mkRenamedOptionModule [ "programs" "broot" "modal" ] [
"programs"
"broot"
"settings"
"modal"
])
(mkRenamedOptionModule [ "programs" "broot" "verbs" ] [
"programs"
"broot"
"settings"
"verbs"
])
(mkRenamedOptionModule [ "programs" "broot" "skin" ] [
"programs"
"broot"
"settings"
"skin"
])
];
options.programs.broot = {
enable = mkEnableOption "Broot, a better way to navigate directories";
@@ -44,83 +189,6 @@ in {
'';
};
modal = mkEnableOption "modal (vim) mode";
verbs = mkOption {
type = with types; listOf (attrsOf (either bool str));
default = [
{
invocation = "p";
execution = ":parent";
}
{
invocation = "edit";
shortcut = "e";
execution = "$EDITOR {file}";
}
{
invocation = "create {subpath}";
execution = "$EDITOR {directory}/{subpath}";
}
{
invocation = "view";
execution = "less {file}";
}
];
example = literalExpression ''
[
{ invocation = "p"; execution = ":parent"; }
{ invocation = "edit"; shortcut = "e"; execution = "$EDITOR {file}" ; }
{ invocation = "create {subpath}"; execution = "$EDITOR {directory}/{subpath}"; }
{ invocation = "view"; execution = "less {file}"; }
{
invocation = "blop {name}\\.{type}";
execution = "/bin/mkdir {parent}/{type} && /usr/bin/nvim {parent}/{type}/{name}.{type}";
from_shell = true;
}
]
'';
description = ''
Define new verbs. For more information, see
<link xlink:href="https://dystroy.org/broot/documentation/configuration/#verb-definition-attributes"/>.
</para><para>
The possible attributes are:
</para>
<para>
<variablelist>
<varlistentry>
<term><literal>invocation</literal> (optional)</term>
<listitem><para>how the verb is called by the user, with placeholders for arguments</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>execution</literal> (mandatory)</term>
<listitem><para>how the verb is executed</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>key</literal> (optional)</term>
<listitem><para>a keyboard key triggering execution</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>shortcut</literal> (optional)</term>
<listitem><para>an alternate way to call the verb (without
the arguments part)</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>leave_broot</literal> (optional)</term>
<listitem><para>whether to quit broot on execution
(default: <literal>true</literal>)</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>from_shell</literal> (optional)</term>
<listitem><para>whether the verb must be executed from the
parent shell (default:
<literal>false</literal>)</para></listitem>
</varlistentry>
</variablelist>
'';
};
package = mkOption {
type = types.package;
default = pkgs.broot;
@@ -128,149 +196,48 @@ in {
description = "Package providing broot";
};
skin = mkOption {
type = types.attrsOf types.str;
settings = mkOption {
type = types.submodule settingsModule;
default = { };
example = literalExpression ''
{
status_normal_fg = "grayscale(18)";
status_normal_bg = "grayscale(3)";
status_error_fg = "red";
status_error_bg = "yellow";
tree_fg = "red";
selected_line_bg = "grayscale(7)";
permissions_fg = "grayscale(12)";
size_bar_full_bg = "red";
size_bar_void_bg = "black";
directory_fg = "lightyellow";
input_fg = "cyan";
flag_value_fg = "lightyellow";
table_border_fg = "red";
code_fg = "lightyellow";
}
'';
description = ''
Color configuration.
</para><para>
Complete list of keys (expected to change before the v1 of broot):
<itemizedlist>
<listitem><para><literal>char_match</literal></para></listitem>
<listitem><para><literal>code</literal></para></listitem>
<listitem><para><literal>directory</literal></para></listitem>
<listitem><para><literal>exe</literal></para></listitem>
<listitem><para><literal>file</literal></para></listitem>
<listitem><para><literal>file_error</literal></para></listitem>
<listitem><para><literal>flag_label</literal></para></listitem>
<listitem><para><literal>flag_value</literal></para></listitem>
<listitem><para><literal>input</literal></para></listitem>
<listitem><para><literal>link</literal></para></listitem>
<listitem><para><literal>permissions</literal></para></listitem>
<listitem><para><literal>selected_line</literal></para></listitem>
<listitem><para><literal>size_bar_full</literal></para></listitem>
<listitem><para><literal>size_bar_void</literal></para></listitem>
<listitem><para><literal>size_text</literal></para></listitem>
<listitem><para><literal>spinner</literal></para></listitem>
<listitem><para><literal>status_error</literal></para></listitem>
<listitem><para><literal>status_normal</literal></para></listitem>
<listitem><para><literal>table_border</literal></para></listitem>
<listitem><para><literal>tree</literal></para></listitem>
<listitem><para><literal>unlisted</literal></para></listitem>
</itemizedlist></para>
<para>
Add <literal>_fg</literal> for a foreground color and
<literal>_bg</literal> for a background colors.
'';
description = "Verbatim config entries";
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."broot/conf.toml".source =
tomlFormat.generate "broot-config" brootConf;
xdg.configFile."broot" = {
recursive = true;
source = pkgs.symlinkJoin {
name = "xdg.configFile.broot";
paths = [
(pkgs.writeTextDir "conf.toml" (builtins.readFile
(tomlFormat.generate "broot-config" cfg.settings)))
# Dummy file to prevent broot from trying to reinstall itself
xdg.configFile."broot/launcher/installed-v1".text = "";
# Copy all files under /resources/default-conf
"${cfg.package.src}/resources/default-conf"
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
mkAfter ''
# This script was automatically generated by the broot function
# More information can be found in https://github.com/Canop/broot
# This function starts broot and executes the command
# it produces, if any.
# It's needed because some shell commands, like `cd`,
# have no useful effect if executed in a subshell.
function br {
f=$(mktemp)
(
set +e
broot --outcmd "$f" "$@"
code=$?
if [ "$code" != 0 ]; then
rm -f "$f"
exit "$code"
fi
)
code=$?
if [ "$code" != 0 ]; then
return "$code"
fi
d=$(cat "$f")
rm -f "$f"
eval "$d"
}
'');
# Dummy file to prevent broot from trying to reinstall itself
(pkgs.writeTextDir "launcher/installed-v1" "")
];
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
# This script was automatically generated by the broot function
# More information can be found in https://github.com/Canop/broot
# This function starts broot and executes the command
# it produces, if any.
# It's needed because some shell commands, like `cd`,
# have no useful effect if executed in a subshell.
function br {
f=$(mktemp)
(
set +e
broot --outcmd "$f" "$@"
code=$?
if [ "$code" != 0 ]; then
rm -f "$f"
exit "$code"
fi
)
code=$?
if [ "$code" != 0 ]; then
return "$code"
fi
d=$(cat "$f")
rm -f "$f"
eval "$d"
# Remove conf.hjson, whose content has been merged into programs.broot.settings
postBuild = ''
rm $out/conf.hjson
'';
};
};
programs.broot.settings = builtins.fromJSON (builtins.readFile
(pkgs.runCommand "default-conf.json" {
nativeBuildInputs = [ pkgs.hjson ];
}
'';
"hjson -c ${cfg.package.src}/resources/default-conf/conf.hjson > $out"));
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
# This script was automatically generated by the broot function
# More information can be found in https://github.com/Canop/broot
# This function starts broot and executes the command
# it produces, if any.
# It's needed because some shell commands, like `cd`,
# have no useful effect if executed in a subshell.
function br
set f (mktemp)
broot --outcmd $f $argv
if test $status -ne 0
rm -f "$f"
return "$code"
end
set d (cat "$f")
rm -f "$f"
eval "$d"
end
'';
programs.bash.initExtra = mkIf cfg.enableBashIntegration (shellInit "bash");
programs.zsh.initExtra = mkIf cfg.enableZshIntegration (shellInit "zsh");
programs.fish.shellInit = mkIf cfg.enableFishIntegration (shellInit "fish");
};
}

64
modules/programs/btop.nix Normal file
View File

@@ -0,0 +1,64 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.btop;
finalConfig = let
toKeyValue = generators.toKeyValue {
mkKeyValue = generators.mkKeyValueDefault {
mkValueString = v:
with builtins;
if isBool v then
(if v then "True" else "False")
else if isString v then
''"${v}"''
else
toString v;
} " = ";
};
in ''
${toKeyValue cfg.settings}
${optionalString (cfg.extraConfig != "") cfg.extraConfig}
'';
in {
meta.maintainers = [ hm.maintainers.GaetanLepage ];
options.programs.btop = {
enable = mkEnableOption "btop";
package = mkPackageOption pkgs "btop" { };
settings = mkOption {
type = with types; attrsOf (oneOf [ bool float int str ]);
default = { };
example = {
color_theme = "Default";
theme_background = false;
};
description = ''
Options to add to <filename>btop.conf</filename> file.
See <link xlink:href="https://github.com/aristocratos/btop#configurability"/>
for options.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra lines added to the <filename>btop.conf</filename> file.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."btop/btop.conf" =
mkIf (cfg.settings != { }) { text = finalConfig; };
};
}

View File

@@ -64,7 +64,7 @@ let
id = mkOption {
type = strMatching "[a-zA-Z]{32}";
description = ''
The extension's ID from the Chome Web Store url or the unpacked crx.
The extension's ID from the Chrome Web Store url or the unpacked crx.
'';
default = "";
};

View File

@@ -29,7 +29,7 @@ in {
default = { };
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/direnv/config.toml</filename>.
<filename>$XDG_CONFIG_HOME/direnv/direnv.toml</filename>.
</para><para>
See
<citerefentry>
@@ -92,7 +92,7 @@ in {
config = mkIf cfg.enable {
home.packages = [ pkgs.direnv ];
xdg.configFile."direnv/config.toml" = mkIf (cfg.config != { }) {
xdg.configFile."direnv/direnv.toml" = mkIf (cfg.config != { }) {
source = tomlFormat.generate "direnv-config" cfg.config;
};

View File

@@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.programs.discocss;
in {
meta.maintainers = with maintainers; [ kranzes ];
options = {
programs.discocss = {
enable = mkEnableOption
"discocss, a tiny Discord CSS injector for Linux and MacOS";
package = mkPackageOption pkgs "discocss" { };
discordPackage = mkPackageOption pkgs "discord" { };
discordAlias = mkOption {
type = types.bool;
default = true;
description = "Whether to alias discocss to discord.";
};
css = mkOption {
type = types.str;
default = "";
description = "The custom CSS for discocss to use.";
};
};
};
config = mkIf cfg.enable {
assertions = [{
assertion = cfg.discordAlias
-> !(any (p: p.name == cfg.discordPackage.name) config.home.packages);
message =
"To use discocss with discordAlias you have to remove discord from home.packages, or set discordAlias to false.";
}];
home.packages = [
(cfg.package.override {
discordAlias = cfg.discordAlias;
discord = cfg.discordPackage;
})
];
xdg.configFile."discocss/custom.css".text = cfg.css;
};
}

View File

@@ -13,11 +13,15 @@ let
emacsWithPackages = emacsPackages.emacsWithPackages;
createConfPackage = epkgs:
epkgs.trivialBuild {
pname = "default";
src = pkgs.writeText "default.el" cfg.extraConfig;
};
extraPackages = epkgs:
let
packages = cfg.extraPackages epkgs;
userConfig = epkgs.trivialBuild {
pname = "default";
src = pkgs.writeText "default.el" cfg.extraConfig;
packageRequires = packages;
};
in packages ++ optional (cfg.extraConfig != "") userConfig;
in {
meta.maintainers = [ maintainers.rycee ];
@@ -48,6 +52,10 @@ in {
Configuration to include in the Emacs default init file. See
<link xlink:href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Init-File.html"/>
for more.
</para><para>
Note, the <literal>inhibit-startup-message</literal> Emacs option
cannot be set here since Emacs disallows setting it from the default
initialization file.
'';
};
@@ -91,10 +99,6 @@ in {
config = mkIf cfg.enable {
home.packages = [ cfg.finalPackage ];
programs.emacs = {
finalPackage = emacsWithPackages cfg.extraPackages;
extraPackages = epkgs:
optional (cfg.extraConfig != "") (createConfPackage epkgs);
};
programs.emacs.finalPackage = emacsWithPackages extraPackages;
};
}

View File

@@ -20,11 +20,14 @@ in {
options.programs.exa = {
enable =
mkEnableOption "exa, a modern replacement for <command>ls</command>";
enableAliases = mkEnableOption "recommended exa aliases";
package = mkPackageOption pkgs "exa" { };
};
config = mkIf cfg.enable {
home.packages = [ pkgs.exa ];
home.packages = [ cfg.package ];
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;

View File

@@ -8,6 +8,8 @@ let
cfg = config.programs.firefox;
jsonFormat = pkgs.formats.json { };
mozillaConfigPath =
if isDarwin then "Library/Application Support/Mozilla" else ".mozilla";
@@ -42,7 +44,7 @@ let
mkUserJs = prefs: extraPrefs: bookmarks:
let
prefs' = lib.optionalAttrs ({ } != bookmarks) {
prefs' = lib.optionalAttrs ([ ] != bookmarks) {
"browser.bookmarks.file" = toString (firefoxBookmarksFile bookmarks);
"browser.places.importBookmarksHTML" = true;
} // prefs;
@@ -58,20 +60,40 @@ let
firefoxBookmarksFile = bookmarks:
let
escapeXML = replaceStrings [ ''"'' "'" "<" ">" "&" ] [
"&quot;"
"&apos;"
"&lt;"
"&gt;"
"&amp;"
];
mapper = _: entry: ''
<DT><A HREF="${escapeXML entry.url}" ADD_DATE="0" LAST_MODIFIED="0"${
lib.optionalString (entry.keyword != null)
" SHORTCUTURL=\"${escapeXML entry.keyword}\""
}>${escapeXML entry.name}</A>
'';
bookmarksEntries = lib.attrsets.mapAttrsToList mapper bookmarks;
indent = level:
lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level));
bookmarkToHTML = indentLevel: bookmark:
''
${indent indentLevel}<DT><A HREF="${
escapeXML bookmark.url
}" ADD_DATE="0" LAST_MODIFIED="0"${
lib.optionalString (bookmark.keyword != null)
" SHORTCUTURL=\"${escapeXML bookmark.keyword}\""
}>${escapeXML bookmark.name}</A>'';
directoryToHTML = indentLevel: directory: ''
${indent indentLevel}<DT>${
if directory.toolbar then
''<H3 PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar''
else
"<H3>${escapeXML directory.name}"
}</H3>
${indent indentLevel}<DL><p>
${allItemsToHTML (indentLevel + 1) directory.bookmarks}
${indent indentLevel}</p></DL>'';
itemToHTMLOrRecurse = indentLevel: item:
if item ? "url" then
bookmarkToHTML indentLevel item
else
directoryToHTML indentLevel item;
allItemsToHTML = indentLevel: bookmarks:
lib.concatStringsSep "\n"
(map (itemToHTMLOrRecurse indentLevel) bookmarks);
bookmarkEntries = allItemsToHTML 1 bookmarks;
in pkgs.writeText "firefox-bookmarks.html" ''
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
@@ -81,12 +103,12 @@ let
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>
<DL><p>
${concatStrings bookmarksEntries}
${bookmarkEntries}
</p></DL>
'';
in {
meta.maintainers = [ maintainers.rycee ];
meta.maintainers = [ maintainers.rycee maintainers.kira-bruneau ];
imports = [
(mkRemovedOptionModule [ "programs" "firefox" "enableAdobeFlash" ]
@@ -156,7 +178,7 @@ in {
Extensions listed here will only be available in Firefox
profiles managed through the
<link linkend="opt-programs.firefox.profiles">programs.firefox.profiles</link>
<xref linkend="opt-programs.firefox.profiles"/>
option. This is due to recent changes in the way Firefox
handles extension side-loading.
'';
@@ -233,37 +255,85 @@ in {
};
bookmarks = mkOption {
type = types.attrsOf (types.submodule ({ config, name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Bookmark name.";
};
type = let
bookmarkSubmodule = types.submodule ({ config, name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Bookmark name.";
};
keyword = mkOption {
type = types.nullOr types.str;
default = null;
description = "Bookmark search keyword.";
};
keyword = mkOption {
type = types.nullOr types.str;
default = null;
description = "Bookmark search keyword.";
};
url = mkOption {
type = types.str;
description = "Bookmark url, use %s for search terms.";
url = mkOption {
type = types.str;
description = "Bookmark url, use %s for search terms.";
};
};
}) // {
description = "bookmark submodule";
};
}));
default = { };
bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url");
directoryType = types.submodule ({ config, name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Directory name.";
};
bookmarks = mkOption {
type = types.listOf nodeType;
default = [ ];
description = "Bookmarks within directory.";
};
toolbar = mkOption {
type = types.bool;
default = false;
description = "If directory should be shown in toolbar.";
};
};
}) // {
description = "directory submodule";
};
nodeType = types.either bookmarkType directoryType;
in with types;
coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
default = [ ];
example = literalExpression ''
{
wikipedia = {
[
{
name = "wikipedia";
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
};
"kernel.org" = {
}
{
name = "kernel.org";
url = "https://www.kernel.org";
};
}
}
{
name = "Nix sites";
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
url = "https://nixos.wiki/";
}
];
}
]
'';
description = ''
Preloaded bookmarks. Note, this may silently overwrite any
@@ -283,6 +353,87 @@ in {
defaultText = "true if profile ID is 0";
description = "Whether this is a default profile.";
};
search = {
force = mkOption {
type = with types; bool;
default = false;
description = ''
Whether to force replace the existing search
configuration. This is recommended since Firefox will
replace the symlink for the search configuration on every
launch, but note that you'll lose any existing
configuration by enabling this.
'';
};
default = mkOption {
type = with types; nullOr str;
default = null;
example = "DuckDuckGo";
description = ''
The default search engine used in the address bar and search bar.
'';
};
order = mkOption {
type = with types; uniq (listOf str);
default = [ ];
example = [ "DuckDuckGo" "Google" ];
description = ''
The order the search engines are listed in. Any engines
that aren't included in this list will be listed after
these in an unspecified order.
'';
};
engines = mkOption {
type = with types; attrsOf (attrsOf jsonFormat.type);
default = { };
example = literalExpression ''
{
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias
}
'';
description = ''
Attribute set of search engine configurations. Engines
that only have <varname>metaData</varname> specified will
be treated as builtin to Firefox.
</para><para>
See <link xlink:href=
"https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177">SearchEngine.jsm</link>
in Firefox's source for available options. We maintain a
mapping to let you specify all options in the referenced
link without underscores, but it may fall out of date with
future options.
</para><para>
Note, <varname>icon</varname> is also a special option
added by Home Manager to make it convenient to specify
absolute icon paths.
'';
};
};
};
}));
default = { };
@@ -295,7 +446,7 @@ in {
description = ''
Whether to enable the GNOME Shell native host connector. Note, you
also need to set the NixOS option
<literal>services.gnome3.chrome-gnome-shell.enable</literal> to
<literal>services.gnome.gnome-browser-connector.enable</literal> to
<literal>true</literal>.
'';
};
@@ -371,11 +522,124 @@ in {
mkIf (profile.userContent != "") { text = profile.userContent; };
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings != { }
|| profile.extraConfig != "" || profile.bookmarks != { }) {
|| profile.extraConfig != "" || profile.bookmarks != [ ]) {
text =
mkUserJs profile.settings profile.extraConfig profile.bookmarks;
};
"${profilesPath}/${profile.path}/search.json.mozlz4" = mkIf
(profile.search.default != null || profile.search.order != [ ]
|| profile.search.engines != { }) {
force = profile.search.force;
source = let
settings = {
version = 6;
engines = let
allEngines = (profile.search.engines //
# If search.default isn't in search.engines, assume it's app
# provided and include it in the set of all engines
optionalAttrs (profile.search.default != null
&& !(hasAttr profile.search.default
profile.search.engines)) {
${profile.search.default} = { };
});
# Map allEngines to a list and order by search.order
orderedEngineList = (imap (order: name:
let engine = allEngines.${name} or { };
in engine // {
inherit name;
metaData = (engine.metaData or { }) // { inherit order; };
}) profile.search.order) ++ (mapAttrsToList
(name: config: config // { inherit name; })
(removeAttrs allEngines profile.search.order));
engines = map (config:
let
name = config.name;
isAppProvided = removeAttrs config [ "name" "metaData" ]
== { };
metaData = config.metaData or { };
in mapAttrs' (name: value: {
# Map nice field names to internal field names. This is
# intended to be exhaustive, but any future fields will
# either have to be specified with an underscore, or added
# to this map.
name = ((genAttrs [
"name"
"isAppProvided"
"loadPath"
"hasPreferredIcon"
"updateInterval"
"updateURL"
"iconUpdateURL"
"iconURL"
"iconMapObj"
"metaData"
"orderHint"
"definedAliases"
"urls"
] (name: "_${name}")) // {
"searchForm" = "__searchForm";
}).${name} or name;
inherit value;
}) ((removeAttrs config [ "icon" ])
// (optionalAttrs (!isAppProvided)
(optionalAttrs (config ? iconUpdateURL) {
# Convenience to default iconURL to iconUpdateURL so
# the icon is immediately downloaded from the URL
iconURL = config.iconURL or config.iconUpdateURL;
} // optionalAttrs (config ? icon) {
# Convenience to specify absolute path to icon
iconURL = "file://${config.icon}";
} // {
# Required for custom engine configurations, loadPaths
# are unique identifiers that are generally formatted
# like: [source]/path/to/engine.xml
loadPath = ''
[home-manager]/programs.firefox.profiles.${profile.name}.search.engines."${
replaceChars [ "\\" ] [ "\\\\" ] name
}"'';
})) // {
# Required fields for all engine configurations
inherit name isAppProvided metaData;
})) orderedEngineList;
in engines;
metaData = optionalAttrs (profile.search.default != null) {
current = profile.search.default;
hash = "@hash@";
} // {
useSavedOrder = profile.search.order != [ ];
};
};
# Home Manager doesn't circumvent user consent and isn't acting
# maliciously. We're modifying the search outside of Firefox, but
# a claim by Mozilla to remove this would be very anti-user, and
# is unlikely to be an issue for our use case.
disclaimer = appName:
"By modifying this file, I agree that I am doing so "
+ "only within ${appName} itself, using official, user-driven search "
+ "engine selection processes, and in a way which does not circumvent "
+ "user consent. I acknowledge that any attempt to change this file "
+ "from outside of ${appName} is a malicious act, and will be responded "
+ "to accordingly.";
salt = profile.path + profile.search.default
+ disclaimer "Firefox";
in pkgs.runCommand "search.json.mozlz4" {
nativeBuildInputs = with pkgs; [ mozlz4a openssl ];
json = builtins.toJSON settings;
inherit salt;
} ''
export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64)
mozlz4a <(substituteStream json search.json.in --subst-var hash) "$out"
'';
};
"${profilesPath}/${profile.path}/extensions" =
mkIf (cfg.extensions != [ ]) {
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";

View File

@@ -285,6 +285,9 @@ in {
{
home.packages = [ cfg.package ];
# Support completion for `man` by building a cache for `apropos`.
programs.man.generateCaches = mkDefault true;
xdg.dataFile."fish/home-manager_generated_completions".source = let
# paths later in the list will overwrite those already linked
destructiveSymlinkJoin = args_@{ name, paths, preferLocalBuild ? true

View File

@@ -6,6 +6,10 @@ let
cfg = config.programs.fzf;
renderedColors = colors:
concatStringsSep ","
(mapAttrsToList (name: value: "${name}:${value}") colors);
in {
imports = [
(mkRemovedOptionModule [ "programs" "fzf" "historyWidgetCommand" ]
@@ -88,6 +92,24 @@ in {
'';
};
colors = mkOption {
type = types.attrsOf types.str;
default = { };
example = literalExpression ''
{
bg = "#1e1e1e";
"bg+" = "#1e1e1e";
fg = "#d4d4d4";
"fg+" = "#d4d4d4";
}
'';
description = ''
Color scheme options added to <code>FZF_DEFAULT_OPTS</code>. See
<link xlink:href="https://github.com/junegunn/fzf/wiki/Color-schemes"/>
for documentation.
'';
};
tmux = {
enableShellIntegration = mkEnableOption ''
setting <literal>FZF_TMUX=1</literal> which causes shell integration to use fzf-tmux
@@ -141,7 +163,9 @@ in {
FZF_CTRL_T_COMMAND = cfg.fileWidgetCommand;
FZF_CTRL_T_OPTS = cfg.fileWidgetOptions;
FZF_DEFAULT_COMMAND = cfg.defaultCommand;
FZF_DEFAULT_OPTS = cfg.defaultOptions;
FZF_DEFAULT_OPTS = cfg.defaultOptions
++ lib.optionals (cfg.colors != { })
[ "--color ${renderedColors cfg.colors}" ];
FZF_TMUX = if cfg.tmux.enableShellIntegration then "1" else null;
FZF_TMUX_OPTS = cfg.tmux.shellIntegrationOptions;
});

View File

@@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.gallery-dl;
jsonFormat = pkgs.formats.json { };
in {
meta.maintainers = [ maintainers.marsam ];
options.programs.gallery-dl = {
enable = mkEnableOption "gallery-dl";
settings = mkOption {
type = jsonFormat.type;
default = { };
example = literalExpression ''
{
extractor.base-directory = "~/Downloads";
}
'';
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/gallery-dl/config.json</filename>. See
<link xlink:href="https://github.com/mikf/gallery-dl#configuration"/>
for supported values.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.gallery-dl ];
xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) {
source = jsonFormat.generate "gallery-dl-settings" cfg.settings;
};
};
}

View File

@@ -95,6 +95,15 @@ in {
mkEnableOption "the gh git credential helper for github.com" // {
default = true;
};
extensions = mkOption {
type = types.listOf types.package;
default = [ ];
description = ''
gh extensions, see <link xlink:href="https://cli.github.com/manual/gh_extension"/>.
'';
example = literalExpression "[ pkgs.gh-eco ]";
};
};
config = mkIf cfg.enable {
@@ -106,5 +115,12 @@ in {
programs.git.extraConfig.credential."https://github.com".helper =
mkIf cfg.enableGitCredentialHelper
"${cfg.package}/bin/gh auth git-credential";
xdg.dataFile."gh/extensions" = mkIf (cfg.extensions != [ ]) {
source = pkgs.linkFarm "gh-extensions" (builtins.map (p: {
name = p.pname;
path = "${p}/bin";
}) cfg.extensions);
};
};
}

View File

@@ -73,7 +73,7 @@ let
signByDefault = mkOption {
type = types.bool;
default = false;
description = "Whether commits should be signed by default.";
description = "Whether commits and tags should be signed by default.";
};
gpgPath = mkOption {
@@ -130,10 +130,20 @@ let
</citerefentry>.
'';
};
};
config.path = mkIf (config.contents != { })
(mkDefault (pkgs.writeText "contents" (gitToIni config.contents)));
contentSuffix = mkOption {
type = types.str;
default = "gitconfig";
description = ''
Nix store name for the git configuration text file,
when generating the configuration text from nix options.
'';
};
};
config.path = mkIf (config.contents != { }) (mkDefault
(pkgs.writeText (hm.strings.storeFileName config.contentSuffix)
(gitToIni config.contents)));
});
in {
@@ -191,6 +201,21 @@ in {
'';
};
hooks = mkOption {
type = types.attrsOf types.path;
default = { };
example = literalExpression ''
{
pre-commit = ./pre-commit-script;
}
'';
description = ''
Configuration helper for Git hooks.
See <link xlink:href="https://git-scm.com/docs/githooks" />
for reference.
'';
};
iniContent = mkOption {
type = gitIniType;
internal = true;
@@ -242,7 +267,7 @@ in {
difftastic = {
enable = mkEnableOption "" // {
description = ''
Enable the <command>difft</command> syntax highlighter.
Enable the <command>difftastic</command> syntax highlighter.
See <link xlink:href="https://github.com/Wilfred/difftastic" />.
'';
};
@@ -253,7 +278,7 @@ in {
example = "dark";
description = ''
Determines whether difftastic should use the lighter or darker colors
for syntax highlithing.
for syntax highlighting.
'';
};
@@ -265,6 +290,16 @@ in {
Determines when difftastic should color its output.
'';
};
display = mkOption {
type =
types.enum [ "side-by-side" "side-by-side-show-both" "inline" ];
default = "side-by-side";
example = "inline";
description = ''
Determines how the output displays - in one column or two columns.
'';
};
};
delta = {
@@ -305,6 +340,14 @@ in {
'';
};
pagerOpts = mkOption {
type = types.listOf types.str;
default = [ "--tabs=4" "-RFX" ];
description = ''
Arguments to be passed to <command>less</command>.
'';
};
markEmptyLines = mkOption {
type = types.bool;
default = true;
@@ -423,11 +466,21 @@ in {
(mkIf (cfg.signing != null) {
programs.git.iniContent = {
user.signingKey = mkIf (cfg.signing.key != null) cfg.signing.key;
commit.gpgSign = cfg.signing.signByDefault;
commit.gpgSign = mkDefault cfg.signing.signByDefault;
tag.gpgSign = mkDefault cfg.signing.signByDefault;
gpg.program = cfg.signing.gpgPath;
};
})
(mkIf (cfg.hooks != { }) {
programs.git.iniContent = {
core.hooksPath = let
entries =
mapAttrsToList (name: path: { inherit name path; }) cfg.hooks;
in toString (pkgs.linkFarm "git-hooks" entries);
};
})
(mkIf (cfg.aliases != { }) { programs.git.iniContent.alias = cfg.aliases; })
(mkIf (lib.isAttrs cfg.extraConfig) {
@@ -476,8 +529,12 @@ in {
home.packages = [ pkgs.difftastic ];
programs.git.iniContent = let
difftCommand =
"${pkgs.difftastic}/bin/difft --color ${cfg.difftastic.color} --background ${cfg.difftastic.background}";
difftCommand = concatStringsSep " " [
"${pkgs.difftastic}/bin/difft"
"--color ${cfg.difftastic.color}"
"--background ${cfg.difftastic.background}"
"--display ${cfg.difftastic.display}"
];
in {
diff.external = difftCommand;
core.pager = "${pkgs.less}/bin/less -XF";
@@ -501,7 +558,9 @@ in {
programs.git.iniContent =
let dsfCommand = "${pkgs.diff-so-fancy}/bin/diff-so-fancy";
in {
core.pager = "${dsfCommand} | ${pkgs.less}/bin/less --tabs=4 -RFX";
core.pager = "${dsfCommand} | ${pkgs.less}/bin/less ${
escapeShellArgs cfg.diff-so-fancy.pagerOpts
}";
interactive.diffFilter = "${dsfCommand} --patch";
diff-so-fancy = {
markEmptyLines = cfg.diff-so-fancy.markEmptyLines;

View File

@@ -47,12 +47,9 @@ in {
type = types.listOf types.str;
default = [ ];
example = [ "extraGoPath1" "extraGoPath2" ];
description = let goPathOpt = "programs.go.goPath";
in ''
description = ''
Extra <envar>GOPATH</envar>s relative to <envar>HOME</envar> appended
after
<varname><link linkend="opt-${goPathOpt}">${goPathOpt}</link></varname>,
if that option is set.
after <xref linkend="opt-programs.go.goPath"/>, if that option is set.
'';
};

View File

@@ -0,0 +1,64 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.havoc;
iniFormat = pkgs.formats.ini { };
in {
meta.maintainers = with lib.maintainers; [ AndersonTorres ];
options.programs.havoc = {
enable = mkEnableOption "Havoc terminal";
package = mkPackageOption pkgs "havoc" { };
settings = mkOption {
type = iniFormat.type;
default = { };
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/havoc.cfg</filename>. See <link
xlink:href="https://raw.githubusercontent.com/ii8/havoc/master/havoc.cfg"/>
for a list of available options.
'';
example = literalExpression ''
{
child.program = "bash";
window.opacity = 240;
window.margin = no;
terminal = {
rows = 80;
columns = 24;
scrollback = 2000;
};
bind = {
"C-S-c" = "copy";
"C-S-v" = "paste";
"C-S-r" = "reset";
"C-S-Delete" = "hard reset";
"C-S-j" = "scroll down";
"C-S-k" = "scroll up";
"C-S-Page_Down" = "scroll down page";
"C-S-Page_Up" = "scroll up page";
"C-S-End" = "scroll to bottom";
"C-S-Home" = "scroll to top";
};
}
'';
};
};
config = mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "programs.havoc" pkgs platforms.linux) ];
home.packages = [ cfg.package ];
xdg.configFile."havoc.cfg" = mkIf (cfg.settings != { }) {
source = iniFormat.generate "havoc.cfg" cfg.settings;
};
};
}

View File

@@ -170,7 +170,7 @@ let
servers = mkOption {
type = listOf str;
default = [ ];
example = [ "chat.freenode.net" "irc.freenode.net" ];
example = [ "irc.oftc.net" ];
description = "IRC Server Address List.";
};
};
@@ -239,11 +239,10 @@ in {
default = { };
example = literalExpression ''
{
freenode = {
oftc = {
autojoin = [
"#home-manager"
"#linux"
"#nixos"
];
charset = "UTF-8 (Unicode)";
commands = [
@@ -263,8 +262,7 @@ in {
password = "my_password";
realName = "my_realname";
servers = [
"chat.freenode.net"
"irc.freenode.net"
"irc.oftc.net"
];
userName = "my_username";
};

View File

@@ -11,37 +11,55 @@ let
toHimalayaConfig = account:
{
email = account.address;
name = account.realName;
display-name = account.realName;
default = account.primary;
inbox-folder = account.folders.inbox;
sent-folder = account.folders.sent;
draft-folder = account.folders.drafts;
# NOTE: himalaya does not support configuring the name of the trash folder
mailboxes = {
inbox = account.folders.inbox;
sent = account.folders.sent;
draft = account.folders.drafts;
# NOTE: himalaya does not support configuring the name of the trash folder
};
} // (lib.optionalAttrs (account.signature.showSignature == "append") {
# FIXME: signature cannot be attached
signature = account.signature.text;
signature-delim = account.signature.delimiter;
}) // (if account.himalaya.backend == null then {
backend = "none";
} else if account.himalaya.backend == "imap" then {
# FIXME: does not support disabling TLS altogether
# NOTE: does not accept sequence of strings for password commands
backend = account.himalaya.backend;
imap-login = account.userName;
imap-passwd-cmd = lib.escapeShellArgs account.passwordCommand;
imap-host = account.imap.host;
imap-port = account.imap.port;
imap-starttls = account.imap.tls.useStartTls;
} else if account.himalaya.backend == "maildir" then {
backend = account.himalaya.backend;
maildir-root-dir = account.maildirBasePath;
} else
throw "Unsupported backend: ${account.himalaya.backend}")
// (if account.himalaya.sender == null then {
sender = "none";
} else if account.himalaya.sender == "smtp" then {
sender = account.himalaya.sender;
smtp-login = account.userName;
smtp-passwd-cmd = lib.escapeShellArgs account.passwordCommand;
smtp-host = account.smtp.host;
smtp-port = account.smtp.port;
smtp-starttls = account.smtp.tls.useStartTls;
} // (lib.optionalAttrs (account.signature.showSignature == "append") {
# FIXME: signature cannot be attached
signature = account.signature.text;
}) // account.himalaya.settings;
} else if account.himalaya.sender == "sendmail" then {
sender = account.himalaya.sender;
} else
throw "Unsupported sender: ${account.himalaya.sender}")
// account.himalaya.settings;
in {
# NOTE: will not start without this configured, but each account overrides it
name = "";
display-name = "";
} // cfg.settings // (lib.mapAttrs (_: toHimalayaConfig) enabledAccounts);
in {
meta.maintainers = with lib.hm.maintainers; [ ambroisie ];
meta.maintainers = with lib.hm.maintainers; [ toastal ];
options = with lib; {
programs.himalaya = {
@@ -61,7 +79,8 @@ in {
default = { };
example = lib.literalExpression ''
{
default-page-size = 50;
email-listing-page-size = 50;
watch-cmds = [ "mbsync -a" ]
}
'';
description = ''
@@ -78,6 +97,22 @@ in {
the himalaya mail client for this account
'';
backend = mkOption {
# TODO: “notmuch” (requires compile flag for himalaya, libnotmuch)
type = types.nullOr (types.enum [ "imap" "maildir" ]);
description = ''
The method for which <command>himalaya</command> will fetch, store,
etc. mail.
'';
};
sender = mkOption {
type = types.nullOr (types.enum [ "smtp" "sendmail" ]);
description = ''
The method for which <command>himalaya</command> will send mail.
'';
};
settings = mkOption {
type = tomlFormat.type;
default = { };

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