Compare commits

..

378 Commits

Author SHA1 Message Date
Robert Helgesson
a17d730ab5 treewide: remove formatting excludes
This removes the last three formatting excludes so that the entire
project is formatted by nixfmt. This is the first step towards moving
to the RFC style format.
2024-12-13 13:20:31 +01:00
Matthieu Coudron
3066cc58f5 kanshi: dont write config in absence of nix settings (#6198)
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-12-12 23:48:46 +01:00
Matthieu Coudron
e526fd2b1a gnome-shell: fix extensions' default (#6199)
Else I get a
===

       … while calling the 'throw' builtin
         at /nix/store/afpmddfrmx5df3h16bdh00yy8i7db8w4-source/pkgs/desktops/gnome/default.nix:96:28:
           95|   gnome-shell = throw "The ‘gnome.gnome-shell’ was moved to top-level. Please use ‘pkgs.gnome-shell’ directly."; # Added on 2024-08-28.
           96|   gnome-shell-extensions = throw "The ‘gnome.gnome-shell-extensions’ was moved to top-level. Please use ‘pkgs.gnome-shell-extensions’ directly."; # Added on 2024-08-11.
             |                            ^
           97|   gnome-software = throw "The ‘gnome.gnome-software’ was moved to top-level. Please use ‘pkgs.gnome-software’ directly."; # Added on 2024-08-11.

       error: The ‘gnome.gnome-shell-extensions’ was moved to top-level. Please use ‘pkgs.gnome-shell-extensions’ directly.
===

on rebuild
2024-12-12 21:58:33 +01:00
Matthieu Coudron
15151bb5e7 gpg: fix hash of test (#6200)
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
would fail on tests
2024-12-12 20:18:22 +01:00
DDoSolitary
6e5b2d9e80 home-manager: support username with special chars (#5609)
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
The home manager script fails when $USER contains special characters.

For example, my work PC is managed by company's LDAP and username is <COMPANY>\<user>). When running home-manager switch I get the following error:
```
error: flake 'path:/home/<COMPANY>/<user>/.config/home-manager' does not provide attribute 'packages.x86_64-linux.homeConfigurations."<COMPANY>\<user>".activationPackage', 'legacyPackages.x86_64-linux.homeConfigurations."<COMPANY>\<user>".activationPackage' or 'homeConfigurations."<COMPANY>\<user>".activationPackage'
       Did you mean <COMPANY><user>?
```
There are two types of strings that need escaping:

    strings in Nix expressions (e.g. home.nix generated by home-manager init)
    they need backslashes before special chars
    flake URI (passed to nix build)
    they need URI's percent encoding, luckily jq supports that
2024-12-11 22:13:27 +01:00
Axel Karjalainen
f26aa4b76f gpg-agent: fix GCR DBus package note
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
D-Bus services are queried from Home Manager packages too. NixOS is
not required.
2024-12-11 00:26:35 +01:00
Aly Raffauf
c6a5fbfd99 qt: install kio when qt.platformTheme = "kde" 2024-12-11 00:16:07 +01:00
Aidan Gauland
8772bae58c nushell: allow installing plugins
When the version of Nushell or any Nushell plugin changes, the plugin
registry must be regenerated.
2024-12-10 23:21:17 +01:00
Manuel Mendez
e952e94955 atuin: Prepare for daemon socket path in 18.4.0
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Update flake inputs / update (push) Has been cancelled
The path is changing in 18.4.0 to XDG_RUNTIME_DIR over XDG_DATA_DIR so
update the specifier. See https://github.com/atuinsh/atuin/pull/2171.
2024-12-09 13:40:54 -05:00
Manuel Mendez
77a792a041 atuin: Do not hard code prefix for daemon socket path
Autin looks for the XDG_DATA_HOME which may not be set as
$HOME/.local/share so lets use the systemd specifier for it instead.
2024-12-09 13:25:11 -05:00
alois31
9ebaa80a22 thunderbird: set the correct SMTP server for aliases (#6177)
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Previously, only the main identity of an account would get the proper SMTP
server assigned. Identities corresponding to aliases would not get an SMTP
server assigned at all, leading to a (Thunderbird-internal) fallback to the
SMTP server associated to the primary account. This is obviously wrong for
non-primary accounts having aliases associated to them. Fix it by specifying
the SMTP server explicitly for all identities.
2024-12-09 15:34:21 +01:00
Karl H
f63c15c137 isync/mbsync: update module for 1.5.0 changes (#5918)
* mbsync: Add NEWS entry about isync 1.5.0 changes

* mbsync: Place config file in $XDG_CONFIG_HOME

mbsync 1.5.0 supports placing isync's configuration file in
$XDG_CONFIG_HOME/isyncrc [1].

[1] https://sourceforge.net/projects/isync/files/isync/1.5.0/

* mbsync: Replace SSLType with TLSType

mbsync 1.5.0 replaced the name of the configuration option [1].

Also update SSLVersions to TLSVersions for the same reason. Inform the
user if the option was renamed.

[1] https://sourceforge.net/projects/isync/files/isync/1.5.0/

* mbsync: Replace SSLVersions with TLSVerisons

* mbsync: Update extraConfig.account example with SSL->TLS changes
2024-12-09 15:32:05 +01:00
Robert Helgesson
d00c6f6d0a nix: simplify tests
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled
Update flake inputs / update (push) Has been cancelled
2024-12-06 12:24:37 +01:00
Robert Helgesson
63eb786e04 xresources: simplify tests 2024-12-06 12:22:03 +01:00
Robert Helgesson
0b42cc1b1c cmus: reduce test closure 2024-12-06 12:19:59 +01:00
Robert Helgesson
953521f759 fcitx5: fix package reference in test 2024-12-06 12:08:32 +01:00
Linus Heckemann
65912bc684 imapnotify: provide an option for setting PATH
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Including some useful presetting for notmuch and mbsync.
2024-12-05 10:08:50 +01:00
eljamm
0daaded612 starship: replace eval with source for fish
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Changed the initialization method from `eval` to `source` as per the
starship installation guide.

See: https://starship.rs/guide/#%F0%9F%9A%80-installation

This is in accordance with the Fish docs which recommends using `source`
if the command does not need access to stdin, which in this case is what
upstream has.

See: https://fishshell.com/docs/current/cmds/eval.html
2024-12-05 00:19:44 +01:00
eljamm
86ee1290d7 starship: add enableInteractive option for fish
Some fish plugins such as https://github.com/acomagu/fish-async-prompt
require that starship be initialized as non-interactive.

When the `programs.starship.enableInteractive` option is enabled,
starship is initialized at the end of the init script, outside the
interactive block.
2024-12-05 00:19:44 +01:00
Lukáš Kucharczyk
1cd17a2f76 mangohud: fix a non-working example
The example for settingsPerApplication is missing a semicolon.
2024-12-04 20:56:44 +01:00
Nova Leary
3a7fc9cd71 zsh: make autosuggest strategy accept more options
Now accepts an empty list, which turns off the code so the user can
manually set ZSH_AUTOSUGGEST_STRATEGY anywhere they want via any of the
`*Variables` module options.
2024-12-04 20:54:01 +01:00
LorenzBischof
ad48eb25cd etesync-dav: update default server URL
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-12-04 14:06:18 +01:00
Robert Helgesson
b1c19f1dcb home-cursor: use profileExtra instead of initExtra
The initExtra code is executed after systemd graphical-session.target
starts, which means graphical applications started by
graphical-session.target cannot get these X settings.
2024-12-04 12:38:17 +01:00
Robert Helgesson
30f66eaa32 xresources: use profileExtra instead of initExtra
The initExtra code is executed after systemd graphical-session.target
starts, which means graphical applications started by
graphical-session.target cannot get these X settings.
2024-12-04 12:37:15 +01:00
Robert Helgesson
6c3a7a0b72 qt: reduce test closure 2024-12-04 10:24:09 +01:00
Louis Opter
8f4f57f9a6 qt: update tooling for Plasma 6 2024-12-04 09:21:37 +01:00
Ricky Tigg
7080328318 Translate using Weblate (Finnish)
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Currently translated at 75.6% (28 of 37 strings)

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fi/
Translation: Home Manager/Home Manager CLI
2024-12-04 07:59:37 +00:00
Philip Wilk
5b5de4338f kakoune: fix color scheme package XDG file 2024-12-04 08:59:32 +01:00
home-manager-bot
256ec2653e flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/970e93b9f82e2a0f3675757eb0bfc73297cc6370?narHash=sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE%3D' (2024-11-28)
  → 'github:NixOS/nixpkgs/55d15ad12a74eb7d4646254e13638ad0c4128776?narHash=sha256-M1%2BuCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo%3D' (2024-12-03)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-04 08:48:45 +01:00
Robert Helgesson
92e644a95e atuin: configure daemon using systemd and launchd 2024-12-04 08:39:49 +01:00
Varun Narravula
dfdf59b2d5 atuin: make daemon log level configurable 2024-12-03 00:11:05 +01:00
Varun Narravula
f8bc330a13 atuin: capitalize mentions of "atuin" 2024-12-03 00:09:57 +01:00
Varun Narravula
c56aa0f51d atuin: assert version >= 18.2.0 when daemon is enabled 2024-12-03 00:09:57 +01:00
Varun Narravula
33c236f1d5 atuin: add water-sucks as maintainer 2024-12-03 00:09:57 +01:00
Varun Narravula
092b81b956 atuin: configure daemon using systemd and launchd
This configures the atuin daemon for Linux and Darwin systems using
systemd and launchd, respectively. For systemd, a socket is also
automatically configured to exist at atuin's default socket location.
2024-12-03 00:09:57 +01:00
Bruno BELANYI
bf23fe4108 tmux: add 'focusEvents'
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled
Update flake inputs / update (push) Has been cancelled
With `tmux-sensible` being disabled by default, add an easy toggle to
enable this functionality.

Disabled by default, as in upstream `tmux`.
2024-12-02 22:43:34 +01:00
Gaétan Lepage
873e39d5f4 podman-container: fix tests and failing podman 5.3.0 service
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Co-authored-by: Dylan Wilson <dylan@bytepen.com>
2024-12-02 11:05:28 +01:00
Fea
d2e2bda6c0 nix-your-shell: fix creating required directory
This fixes https://github.com/nix-community/home-manager/issues/6161
2024-12-02 10:38:18 +01:00
paumr
c1fee8d4a6 alot: make package used by module configurable
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-12-01 21:38:04 +01:00
Igor Rzegocki
8632735050 kubecolor: add module 2024-12-01 20:35:09 +01:00
Terje Larsen
e71e678d18 nix-your-shell: add module 2024-12-01 20:20:16 +01:00
Gaétan Lepage
7f78e2d1c6 yazi: update keymap config 2024-12-01 18:47:01 +01:00
Nova Leary
441fae847d zsh-abbr: add package option 2024-12-01 18:23:18 +01:00
Robert Helgesson
4964f3c6fc home-manager: prepare 24.11 release
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-12-01 10:31:51 +01:00
home-manager-bot
8eeda281e7 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4633a7c72337ea8fd23a4f2ba3972865e3ec685d?narHash=sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0%3D' (2024-11-25)
  → 'github:NixOS/nixpkgs/970e93b9f82e2a0f3675757eb0bfc73297cc6370?narHash=sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE%3D' (2024-11-28)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-01 10:04:56 +01:00
Ken Micklas
819f682269 lorri: fix ReadWritePaths for new gcroots behavior
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled
Update flake inputs / update (push) Has been cancelled
2024-11-29 13:43:55 +01:00
Philip Wilk
2f7739d010 kakoune: add colorSchemePackage option
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
This makes it easy to declaratively manage the color scheme for
kakoune via a nix package in your `~/.config/kak/colors` folder. The
color scheme can then be declaratively selected by name using the
existing Home Manager option `programs.kakoune.config.colorScheme`.
2024-11-28 12:24:55 +01:00
Jordan Williams
b721965238 mopidy: ignore collisions between extensions 2024-11-28 12:12:32 +01:00
Jordan Williams
de7d67b8ba mopidy: make makeWrapper a native build input
This fixes the error message

    error: makeWrapper/makeShellWrapper must be in nativeBuildInputs
2024-11-28 12:11:18 +01:00
Etherbloom
21396857fd kdeconnect: upgrade default version
Plasma6 has been out for a while now and the service still points to
the old, incompatible version.
2024-11-28 11:32:21 +01:00
Gen
f83dc9f25a tmux: set sensibleOnTop = false as a default
Fixes #5952
2024-11-28 11:30:10 +01:00
home-manager-bot
0941a2e144 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367?narHash=sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w%3D' (2024-11-19)
  → 'github:NixOS/nixpkgs/4633a7c72337ea8fd23a4f2ba3972865e3ec685d?narHash=sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0%3D' (2024-11-25)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-28 10:44:48 +01:00
Jordan Williams
a9953635d7 mopidy: restart service on config changes
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled
Update flake inputs / update (push) Has been cancelled
Also extend basic configuration test a bit to verify the restart
trigger.
2024-11-24 22:04:15 +01:00
Ingo Reitz
4d8d8c385e zed-editor: add extraPackages option
Add extraPackages option to make for example language servers
available to Zed without having to add them to `home.packages` or
similar.
2024-11-24 21:15:57 +01:00
Jordan Williams
83002f1846 mopidy: restart the systemd service on failure
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-11-24 19:26:14 +01:00
Tomodachi94
98bf8de65d volnoti: use cfg.package instead of pkgs 2024-11-24 19:06:58 +01:00
Tomodachi94
f9fd45c512 volnoti: add self to maintainers 2024-11-24 17:54:00 +01:00
Christian Segundo
9ae941a4cf abook: remove platform linux assertion
Abook is also available on other platforms, e.g., Darwin.
2024-11-24 17:45:26 +01:00
Sebastián Zavala Villagómez
5e2f47c5a5 hypridle: fix service when no config file
The systemd user service depends on

  config.xdg.configFile."hypr/hypridle.conf".source

for `X-Restart-Triggers`. When `cfg.settings` is the default `{}`,
this causes failure since

  config.xdg.configFile."hypr/hypridle.conf".source

will not exist.

Making the addition conditional on `cfg.settings` actually having
content, which would mean `xdg.configFile."hypr/hypridle.conf"` does
exist, avoids the error.
2024-11-24 17:41:50 +01:00
Sebastián Zavala Villagómez
bd58a1132e hyprpaper: fix service when no config file
The systemd user service depends on

  config.xdg.configFile."hypr/hyprpaper.conf".source

for `X-Restart-Triggers`. When `cfg.settings` is the default `{}`,
this causes failure since

  config.xdg.configFile."hypr/hyprpaper.conf".source

will not exist.

Making the addition conditional on `cfg.settings` actually having
content, which would mean `xdg.configFile."hypr/hyprpaper.conf"` does
exist, avoids the error.
2024-11-24 14:05:10 +01:00
github-actions[bot]
67cd4814a2 flake.lock: Update
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5e4fbfb6b3de1aa2872b76d49fafc942626e2add?narHash=sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg%3D' (2024-11-15)
  → 'github:NixOS/nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367?narHash=sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w%3D' (2024-11-19)
2024-11-24 03:59:24 +00:00
Dawid Dziurla
92fef254a9 podman: install package and create config files
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Co-authored-by: Dylan Wilson <dylan@bytepen.com>
2024-11-23 22:36:33 +01:00
klchen0112
ba9367b5a9 emacs: add darwin service 2024-11-23 19:15:47 +01:00
Nithin S Varrier
16fe78182e conky: update systemd exec path to config package
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Update flake inputs / update (push) Has been cancelled
Currently systemd ExecStart uses pkgs.conky as executable path, this
commit changes it to the package defined by services.conky.package.
2024-11-23 18:36:17 +01:00
arminius-smh
445d721ecf home-cursor: add hyprcursor support
Add the option to enable hyprcursor support by setting the relevant
environment variables.
2024-11-23 18:27:16 +01:00
Robert Helgesson
8cf9cb2ee7 tests: fix integration test
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-11-22 20:32:42 +01:00
Robert Helgesson
a46e702093 espanso: fix test failure
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled
Update flake inputs / update (push) Has been cancelled
2024-11-19 15:05:03 +01:00
home-manager-bot
d37f154dba flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/76612b17c0ce71689921ca12d9ffdc9c23ce40b2?narHash=sha256-IigrKK3vYRpUu%2BHEjPL/phrfh7Ox881er1UEsZvw9Q4%3D' (2024-11-09)
  → 'github:NixOS/nixpkgs/5e4fbfb6b3de1aa2872b76d49fafc942626e2add?narHash=sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg%3D' (2024-11-15)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-19 14:40:06 +01:00
Nikolaos Karaolidis
a42fa14b53 syncthing: expand declarative configuration
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
This expands the Syncthing configuration to allow declarative
settings. Code mostly pulled from the Nixpkgs module.

Changes compared to the NixOS module are:

Removed the following options:

- user, group, systemService: Unnecessary since Syncthing always runs
  as the user declaring the configuration.

- dataDir configDir, databaseDir: Pointed to ~/.local/state/syncthing,
  the default Syncthing directory.

- openDefaultPorts: We don't have access to the system firewall.

Furthermore, multiple changes to systemd services were made to
maintain consistency with other Home Manager modules, sandboxing
options might need to be reviewed further.

Fixes #4049
2024-11-18 23:27:58 +01:00
wadsaek
705cf3763a Translate using Weblate (Ukrainian)
Currently translated at 100.0% (37 of 37 strings)

Co-authored-by: wadsaek <wadsaek@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/uk/
Translation: Home Manager/Home Manager CLI
2024-11-18 21:16:30 +00:00
Lorenzo Bevilacqua
094265fca0 Translate using Weblate (Italian)
Currently translated at 100.0% (37 of 37 strings)

Co-authored-by: Lorenzo Bevilacqua <lorenzobevilacqua02@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/it/
Translation: Home Manager/Home Manager CLI
2024-11-18 21:16:30 +00:00
chayleaf
0bd5e9c76c librewolf: hide bookmarks option 2024-11-18 22:14:54 +01:00
chayleaf
18462998b1 librewolf: use mkFirefoxModule 2024-11-18 22:14:54 +01:00
Ilham AM
f3a2ff6958 zsh-abbr: update source path (#6084)
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-11-18 00:44:26 +01:00
Robert Helgesson
05d3b6215a home-manager: prepare 25.05-pre 2024-11-18 00:13:46 +01:00
Robert Helgesson
0918bb0238 ci: make dependabot consider release-24.11 2024-11-17 23:31:31 +01:00
Kacper Koniuszy
aecd341dfe firefox: improve search engine disclaimer generation
Using a fixed application name in the salt for the search engine name
hash can break with minor branding changes. For example, LibreWolf 127
used the application name "LibreWolf", but in version 128 it is
"Firefox".

The proper name can be found in about:support -> Application Basics.

Because it doesn't have to be related to the product name visible in
most of the browser (for example in the window title and help menus),
we shouldn't rely on cfg.name for that.

The application name can be read from lib/*/application.ini and we can
use that if the browser was installed via Home Manager. If not, we can
fall back to cfg.name.
2024-11-17 22:58:01 +01:00
Juanjo Presa
5056a1cf0c version: allow 25.05 as state version
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
Nixpkgs updated upstream:
90fcf3aa7e
2024-11-17 09:34:39 +01:00
Andrew Marshall
1bd5616e33 lib/file-type: Make force option visible (#6003)
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
This is something that is useful, we should not hide it from the docs.
2024-11-16 20:54:20 +01:00
Nanotwerp
c7c2517612 {gtk, dunst}: replace pkgs.gnome.adwaita-icon-theme with pkgs.adwaita-icon-theme in the examples (#5712)
`adwaita-icon-theme` has been moved out of the `gnome` scope and into the top level with https://github.com/NixOS/nixpkgs/pull/319659
2024-11-16 19:36:13 +01:00
Jany
d154a557da aerc: add support of account gpg config (#5298) 2024-11-16 18:38:16 +01:00
Michael Hoang
192f123e4b nixos: add key to shared module to allow disabling it (#6017)
By adding `key`, this allows users to disable this shared module or they can choose to not disable this shared module (by filtering by key before disabling)

This means users can disable all shared modules if all modules are paths or attrsets with a key:

`configuration.nix`:

```nix
{ config, ... }:

{
  home-manager.users.enzime = { ... }: {
    disabledModules = config.home-manager.sharedModules;
  };
}
```

Or disabling just this module specifically:

```nix
{ ... }:

{
  home-manager.users.enzime = { ... }: {
    disabledModules = [ { key = "home-manager#nixos-shared-module"; } ];
  };
}
```

Or disabling all modules when you have modules you can't disable (like lambdas):

```nix
{ ... }:

{
  home-manager.users.enzime = { ... }: {
    disabledModules = lib.filter (v: lib.isString v || lib.isPath v || (lib.isAttrs v && v ? key)) config.home-manager.sharedModules;
  };
}
```


https://nixos.org/manual/nixos/unstable/#sec-replace-modules
2024-11-16 18:31:16 +01:00
Michael Hoang
400e3c0152 nixos: always run home-manager on NixOS activation (#5780)
Currently, the home-manager systemd service will only get restarted when
the home-manager configuration changes. This can lead to issues in
users' home directories not getting corrected for a while.

    $ rm ~/.zshrc
    $ sudo nixos-rebuild switch
    $ ls ~/.zshrc
    ls: cannot access '/home/enzime/.zshrc': No such file or directory
2024-11-16 18:25:31 +01:00
gmvar
1d0862ee2d feh: add themes option (#6074)
Some checks failed
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled
Update flake inputs / update (push) Has been cancelled
- added themes option
- added themes test
- updated broken man page links
2024-11-14 18:16:21 +01:00
Gaétan Lepage
35b055009a kanshi: add package to home.packages
Some checks are pending
GitHub Pages / publish (ubuntu-latest) (push) Waiting to run
2024-11-13 23:07:20 +01:00
RedEtherbloom
3c044aefe6 git-sync: add example to repository option 2024-11-13 23:03:24 +01:00
RedEtherbloom
cd21d2e61b git-sync: fix crash when whitespace in path
systemd rejects the service unit due to whitespace in the environment
variable assignment, pointing to the repo path, being invalid for
systemd's unit format.

See https://github.com/nix-community/home-manager/issues/6023 for
details.

The git-sync variable should also be escaped due to similar issues
with e.g. local git urls.
2024-11-13 23:03:19 +01:00
RedEtherbloom
ee8ff6d53f espanso: fix test for nixpkgs update
Recent nixpkgs update made a small change how YAML is generated,
causing the test YAML to be out of date.

The replacement match is also an exact example from the espanso wiki
https://espanso.org/docs/matches/basics/#multi-line-expansions.
2024-11-13 22:51:34 +01:00
RedEtherbloom
7e42a37bf7 spotify-player: fix test for nixpkgs update
Recent nixpkgs update made a small change to how TOML is generated,
causing the test toml to be out of date.
2024-11-13 22:51:33 +01:00
RedEtherbloom
40746b5c77 alacritty: fix test for nixpkgs update
Recent nixpkgs update made a small change to how TOML is generated,
causing the test toml to be out of date.
2024-11-13 22:51:33 +01:00
home-manager-bot
149a48da31 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/807e9154dcb16384b1b765ebe9cd2bba2ac287fd?narHash=sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU%3D' (2024-10-29)
  → 'github:NixOS/nixpkgs/76612b17c0ce71689921ca12d9ffdc9c23ce40b2?narHash=sha256-IigrKK3vYRpUu%2BHEjPL/phrfh7Ox881er1UEsZvw9Q4%3D' (2024-11-09)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-13 22:50:06 +01:00
Milo Moisson
60bb110917 helix: fix wrapping of extraPackages
This makes extraPackages the default, but they do not shadow the env
so you can still have packages (e.g. LSPs) with a different version
than the global one in you local env like nix's shells.
2024-11-10 11:42:08 +01:00
Gaétan Lepage
7309007271 news: fix typo 2024-11-10 11:38:24 +01:00
rodrigovillarbello
2f607e07f3 docs: home.sessionVariable clarification
Closes: https://github.com/nix-community/home-manager/issues/6027
2024-11-05 21:18:50 +01:00
home-manager-bot
8f6ca7855d flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/18536bf04cd71abd345f9579158841376fdd0c5a?narHash=sha256-RP%2BOQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM%3D' (2024-10-25)
  → 'github:NixOS/nixpkgs/807e9154dcb16384b1b765ebe9cd2bba2ac287fd?narHash=sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU%3D' (2024-10-29)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-03 12:34:30 +01:00
sinavir
2c6a9b3ccf git: fix maintenance service
Call to git-maintenance in the systemd user service was using a
erroneous value for exec-path flag. Removing the flag is fine.
2024-11-03 12:29:02 +01:00
Nicholas Hassan
1743615b61 podman: add module
Adds a new Podman module for creating user containers and networks as
systemd services. These are installed to the user's
`$XDG_CONFIG/systemd/user` directory.
2024-11-01 20:45:06 +01:00
Kosta Gorodetsky
8ca921e5a8 git-credential-oauth: fix ordering of git extraConfig
Added `mkAfter` to `git.extraConfig` to ensure our oauth is last, as
required to work with additional helpers.
2024-11-01 09:46:22 +01:00
home-manager-bot
e83414058e flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0?narHash=sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c%2BcHUJwA%3D' (2024-10-18)
  → 'github:NixOS/nixpkgs/18536bf04cd71abd345f9579158841376fdd0c5a?narHash=sha256-RP%2BOQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM%3D' (2024-10-25)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-27 09:15:08 +01:00
Tomo
05d9bee4a5 git-credential-oauth: fix use of mkIf and add tests
Closes #6005
2024-10-27 07:45:32 +01:00
William Phetsinorath
93435d27d2 direnv: add support for mise integration 2024-10-26 00:16:39 +02:00
nyadiia
0c0268a3c8 eza: add color option 2024-10-25 16:02:28 +02:00
Tomo
c0e2315987 git-credential-oauth: add extraFlags option
This facilitates a legitimate use-case for browserless systems. From the
README:
> On systems without a web browser, set the -device flag to authenticate
> on another device using [OAuth device flow]:
> ```ini
  [credential]
	  helper = cache --timeout 7200	# two hours
	  helper = oauth -device
  ```

[OAuth device flow]: https://www.rfc-editor.org/rfc/rfc8628

Please note that, for the documentation about the man-page to be
accurate, https://github.com/NixOS/nixpkgs/pull/302922 must be merged.
2024-10-25 15:56:37 +02:00
Bruno BELANYI
6cc03e337a nix-gc: add randomizedDelaySec option
There's no launchd equivalent to this option, so this is a no-op on
Darwin.
2024-10-25 15:53:42 +02:00
Giovanni Nicosia (mood)
c77c3bb233 yazi: enable shell integration values by default
Previously,

  - `programs.yazi.enableNushellIntegration`,
  - `programs.yazi.enableFishIntegration`, and
  - `programs.yazi.enableZshIntegration`

were set to false by default. It seems more appropriate to enable
these integrations by default.
2024-10-25 11:21:03 +02:00
Robert Helgesson
5feb9dba3c nixgl: add module 2024-10-25 10:23:36 +02:00
Jure Varlec
8bd6e0a1a8 nixgl: add support for channel-based configuration 2024-10-25 10:20:38 +02:00
Jure Varlec
7a5879707b nixgl: API rework for flexibility and dual-GPU 2024-10-25 10:20:38 +02:00
Mel Bourgeois
e61f87969a nixgl: Improve option documentation 2024-10-25 10:20:38 +02:00
Mel Bourgeois
7dee0dc8f0 nixgl: reference lib directly
Co-authored-by: V. <150687949+vigress8@users.noreply.github.com>
2024-10-25 10:20:38 +02:00
Mel Bourgeois
d0c036ca49 nixgl: ensure makeWrapper is present during build
Co-authored-by: V. <150687949+vigress8@users.noreply.github.com>
2024-10-25 10:20:38 +02:00
Mel Bourgeois
199cf5634c nixgl: use -q to silence grep
Co-authored-by: V. <150687949+vigress8@users.noreply.github.com>
2024-10-25 10:20:38 +02:00
Mel Bourgeois
b9fe747915 nixgl: use makeWrapper and update docs
makeWrapper is more consistent with the rest of nixpkgs & home-manager,
so it should be a little more maintainable. It can also validate that
the wrapper command is executable at build time.
2024-10-25 10:20:37 +02:00
Mel Bourgeois
bbd4254d00 nixgl: make desktop files point to wrapped exe
Some desktop files will refer to the absolute path of the original
derivation, which would bypass nixGL wrapping. So we need to replace the
path with the path to the wrapper derivation to ensure the wrapped
version is always launched.
2024-10-25 10:20:37 +02:00
Mel Bourgeois
446293584f nixgl: add module
This module enables wrapping programs which require access to libGL
with nixGL on non-NixOS systems.
2024-10-25 10:20:32 +02:00
Luflosi
82378b3f7f htop: use attrsOf instead of attrs as settings type 2024-10-25 10:08:11 +02:00
diniamo
c7cfdb3864 spotify-player: add support for actions
Actions were added in the v0.19.1 release.
2024-10-25 10:04:48 +02:00
DrymarchonShaun
eea1bc6072 gpg-agent: use $TTY parameter in zsh integration 2024-10-25 09:53:41 +02:00
Willi Carlsen
454e8d6b15 granted: use assume directly
The `.assume-wrapped` path is not available since the merge of

    https://github.com/NixOS/nixpkgs/pull/347816

Use assume directly instead.

PR #5994
2024-10-25 09:42:19 +02:00
Omer Naveed
0a0b1b18bd maintainers: remove omernaveedxyz 2024-10-24 23:41:24 -05:00
Sandro Jäckel
a4353cc43d accounts/contacts: fix defaultText rendering 2024-10-23 22:55:53 +02:00
Sandro Jäckel
5765fe4feb accounts/calendar: fix defaultText rendering 2024-10-23 22:55:42 +02:00
Austin Horstman
5ec753a1fc modules/neovim: fix config generation (#5976) 2024-10-22 00:58:46 +02:00
home-manager-bot
1e27f213d7 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c?narHash=sha256-nsNdSldaAyu6PE3YUA%2BYQLqUDJh%2BgRbBooMMekZJwvI%3D' (2024-10-14)
  → 'github:NixOS/nixpkgs/4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0?narHash=sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c%2BcHUJwA%3D' (2024-10-18)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-20 23:21:28 +02:00
Talha Can Havadar
fe56302339 zoxide: fix fzf bash-completion conflict
When zoxide initializes after fzf it causes fzf " ** " trigger to not
work.

To fix the issue we needed to make zoxide initialize earlier than fzf
but after bash-completion.

PR #5955
2024-10-20 10:58:46 +02:00
John Titor
892a6443b7 nh: add module 2024-10-20 10:54:45 +02:00
Scharada
122f70545b firefox: change container.json version to 5 2024-10-19 09:02:11 +02:00
Muhammad Talal Anwar
802b3cb2d4 espanso: use launcher command on Linux
The source uses `launcher` instead of `daemon`. Additionally we remove
`Type` and add `RestartSec` as defined in the source:

b421bcf73f/espanso/src/res/linux/systemd.service (L5-L7C1)
2024-10-19 09:01:11 +02:00
joygnu
09a0c0c029 cmus: add module
PR #5951
2024-10-18 16:03:33 +02:00
Austin Horstman
346973b338 tests/firefox: add shared path test
Used to make sure that profiles that share a common generated path still
build properly.
2024-10-18 08:31:24 -05:00
Austin Horstman
2ffb68e209 thunderbird: conditional search file 2024-10-18 08:31:24 -05:00
Austin Horstman
d4a3186de0 firefox: conditional search file 2024-10-18 08:31:24 -05:00
K900
cb93ab1c99 direnv: remove nushell hack 2024-10-18 15:26:47 +02:00
K900
1834304bc3 direnv: simplify, work around nushell/nushell#14112
nushell 0.99 does not like early returns in hooks. So, what if we just
didn't? Rewrite the entire hook to work as one single pipeline.
2024-10-18 15:26:17 +02:00
libewa
e78cbb2027 zed-editor: add module
Add a simple module for zed-editor, a simple editor written in Rust.
2024-10-17 16:15:20 +02:00
Robert Helgesson
9c1a1c7df4 activitywatch: reduce test closure
This also reduces test flakiness.
2024-10-17 15:30:02 +02:00
home-manager-bot
78a7a070bb flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7?narHash=sha256-9UTxR8eukdg%2BXZeHgxW5hQA9fIKHsKCdOIUycTryeVw%3D' (2024-10-09)
  → 'github:NixOS/nixpkgs/a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c?narHash=sha256-nsNdSldaAyu6PE3YUA%2BYQLqUDJh%2BgRbBooMMekZJwvI%3D' (2024-10-14)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-17 13:53:03 +02:00
Robert Helgesson
e43902a7d6 broot: fix minor documentation bug 2024-10-17 13:51:49 +02:00
xwjqv
800a191f33 broot: allow multiple keyboard keys per verb
To allow multiple keys the verb options need to accept listOf str.
2024-10-17 13:41:55 +02:00
Jeffrey C. Ollie
1d9b4a3e60 fish: make generation of completions optional
Add a config option to optionally disable the generation of command
completions based upon man pages.
2024-10-17 13:31:56 +02:00
Julius Marozas
5bb057a7b5 Translate using Weblate (Lithuanian)
Currently translated at 97.2% (36 of 37 strings)

Co-authored-by: Julius Marozas <marozas.julius@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/lt/
Translation: Home Manager/Home Manager CLI
2024-10-17 11:23:29 +00:00
Viktor Illmer
f81be125ff Translate using Weblate (German)
Currently translated at 100.0% (18 of 18 strings)

Co-authored-by: Viktor Illmer <accounts@viktor.im>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/de/
Translation: Home Manager/Home Manager Modules
2024-10-17 11:23:29 +00:00
AtomicDude
b534276566 Translate using Weblate (Romanian)
Currently translated at 100.0% (18 of 18 strings)

Co-authored-by: AtomicDude <vasilescutoma4@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/ro/
Translation: Home Manager/Home Manager Modules
2024-10-17 11:23:28 +00:00
Joaquín Triñanes
628b15d275 nushell: allow arbitrary environment variables 2024-10-17 12:54:19 +02:00
Joaquín Triñanes
edf15f1549 nushell: create generator helpers 2024-10-17 12:54:19 +02:00
Joaquín Triñanes
994a0baf7b nushell: add joaquintrinanes as maintainer 2024-10-17 12:54:19 +02:00
Sergey
2a4fd1cfd8 eza: fix icons option
Fixes the icons option for eza which was breaking completion in zsh.
2024-10-15 23:22:21 +02:00
Kira Bruneau
e1aec543f5 thunderbird: support setting search engines (#5697)
* firefox: split search into separate submodule file

* thunderbird: support setting search engines
2024-10-14 13:01:26 +02:00
github-actions[bot]
64c6325b28 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c31898adf5a8ed202ce5bea9f347b1c6871f32d1?narHash=sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw%3D' (2024-10-06)
  → 'github:NixOS/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7?narHash=sha256-9UTxR8eukdg%2BXZeHgxW5hQA9fIKHsKCdOIUycTryeVw%3D' (2024-10-09)
2024-10-13 03:59:22 +00:00
Nabeen Tiwaree
d57112db87 pls: fixed perm argument to pass via pls 2024-10-12 11:43:52 +02:00
Kilian Mio
2b13611eae floorp: add module
Also fix tests for Firefox module derivatives.
2024-10-12 00:21:33 +02:00
Perchun Pak
65ae9c1473 git: add module for git maintenance (#5772)
Adds module for git-scm.com/docs/git-maintenance.
2024-10-11 14:48:52 +02:00
aabccd021
5828309542 vifm: add module 2024-10-11 12:54:39 +02:00
home-manager-bot
342a1d6823 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/9357f4f23713673f310988025d9dc261c20e70c6?narHash=sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c%3D' (2024-09-21)
  → 'github:NixOS/nixpkgs/c31898adf5a8ed202ce5bea9f347b1c6871f32d1?narHash=sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw%3D' (2024-10-06)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-11 00:19:04 +02:00
Damien Cassou
03f8e0b3b3 snixembed: add module
This is used by SafeEyes (another home-manager) module to show a
systemtray icon. See https://git.sr.ht/~steef/snixembed.

Fixes #5728
2024-10-11 00:14:36 +02:00
Andrew Voynov
8bb5d53c58 docs: add XDG_*_HOME mentions to xdg.*Home options 2024-10-10 21:22:52 +02:00
Sandro
d47d33254f home-manager-manual: expose options.json 2024-10-10 20:29:24 +02:00
Utkarsh Sharma
d3ee25c078 Translate using Weblate (Hindi)
Currently translated at 5.5% (1 of 18 strings)

Translate using Weblate (Hindi)

Currently translated at 13.5% (5 of 37 strings)

Co-authored-by: Utkarsh Sharma <utkasharma19@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hi/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/hi/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
2024-10-09 16:31:58 +02:00
Timothy Gallion
038630363e xdg-mime type package options (#5920)
* xdg-mime: allow overrides to shared-mime-info and desktop-file-utils

The `xdg-mime` module now exposes packages to determine what will be run
for update-mime-database and update-desktop-database. This allows users
to select a different version of these packages if the are incompatible.
This should, in combination with an override to the version of
`shared-mime-info` (can be found here notalltim/home-manager-config#4),
resolve #4955, #5102, #4682, and possibly #4941. The problem seems to stem
from a mismatch in the version of `shared-mime-info` with the host.

I also switched from using `buildPackages` to `pkgs` to improve
cross-compilation compatibility.

* xdg-mime: Add tests for xdg-mime module

The xdg-mime module was missing tests so I added basic test for all the
options and checked the basic behavior. It covers ensuring that the
proper files/folders are created and that the package overrides work.
2024-10-07 23:39:24 +02:00
Kira Bruneau
271c83e21e firefox: organize tests by submodule (#5698)
Split off from #5697, organizes firefox tests by submodule.

This is intended to match directory structure setup for the new search submodule.
2024-10-07 23:06:52 +02:00
Akshett Rai Jindal
3ac39b2a8b zathura: Fix the type for config options (#5934)
* zathura: add float to acceptable types for `options` attrset

The man page states that the `set` directive can take 4 types of values:
INT, FLOAT, STRING, BOOL. But the FLOAT part was missing from the
home-manager module

* zathura: make type of `programs.zathura.options` more readable

Change from cascading mess of `either` to `oneOf`
2024-10-07 15:16:25 +02:00
MithicSpirit
fcf5e608ac kitty: allow float values in settings (#5925)
Some settings in kitty allow floating-point values, but this was not
reflected in the type.
2024-10-07 12:18:19 +02:00
dependabot[bot]
bc623830e6 ci: bump cachix/install-nix-action from 27 to 30
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 27 to 30.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v27...v30)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 11:44:28 +02:00
Christophe Van den Abbeele
509dbf8d45 megasync: fix issue with service failing to launch
Change `After=` setting in the user service to only launch after the
full `graphical-session.target`.
2024-10-04 13:32:07 +02:00
Christina Sørensen
30e04f3d47 pass-secret-service: add GNUPGHOME to service env vars
This is nescesarry for non-default locations, and without it, many
programs like element-desktop break in very confusing ways.

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-10-04 09:19:02 +02:00
Sirio Balmelli
437ec62009 borgmatic: note Darwin platform support
The current module works on Darwin as-is; mark the platform as
supported.

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
2024-10-01 23:11:40 +02:00
K900
ffe2d07e77 direnv: hopefully final nushell fix 2024-09-26 22:52:03 +02:00
Robert Helgesson
0afc2f0f19 river: reduce risk of large rebuilds in test
Specifically, overriding the dbus package can cause rebuilds of many
packages.
2024-09-26 22:19:30 +02:00
K900
853e7bd24f direnv: even better nushell fix
Avoid do | complete, because it swallows stderr, which can contain
direnv debug output.
2024-09-26 22:03:30 +02:00
K900
57e6b30d18 direnv: work around nushell bug
try/catch in a pipeline does not always work correctly in 0.98,
so avoid the try-catch entirely.

Upstream issue: https://github.com/nushell/nushell/issues/13868
2024-09-26 19:07:37 +02:00
home-manager-bot
c124568e10 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c04d5652cfa9742b1d519688f65d1bbccea9eb7e?narHash=sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK%2BWk%3D' (2024-09-19)
  → 'github:NixOS/nixpkgs/9357f4f23713673f310988025d9dc261c20e70c6?narHash=sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c%3D' (2024-09-21)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-26 12:20:17 +02:00
K900
1e22ef1518 direnv: update for new nushell behavior (#5880)
Nushell 0.98 makes it so external commands returning non-zero
is considered an exception[0]. Wrap the direnv invocation in a
try-catch, so that even if direnv fails, we get the message
from direnv, but not the traceback from nushell.

[0]: https://www.nushell.sh/blog/2024-09-17-nushell_0_98_0.html#non-zero-exit-codes-are-now-errors-toc
2024-09-25 00:39:06 -06:00
Robert Helgesson
21c021862f ci: disable the tests for macos
They have been broken for a long time now and makes the PR flow quite
cumbersome. Thus we disable them until somebody is able to get them to
work again.
2024-09-23 19:15:45 +02:00
home-manager-bot
04213d1ce4 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/99dc8785f6a0adac95f5e2ab05cc2e1bf666d172?narHash=sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c%3D' (2024-09-16)
  → 'github:NixOS/nixpkgs/c04d5652cfa9742b1d519688f65d1bbccea9eb7e?narHash=sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK%2BWk%3D' (2024-09-19)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-22 08:17:35 +02:00
Patrick Nuckolls
14929f7089 zoxide: clarify options option
The value of the option `programs.zoxide.options` is passed to `zoxide
init` at shell initialization time, not to the command itself when
it's called by the user from their shell. This change makes that a
little bit clearer in the documentation.
2024-09-21 09:13:43 +02:00
Ben Brown
51e1d69f7a poweralertd: fix regression
This fixes a regression introduced in
8d7e352a4b. That commit made the false
assumption that utils would have propagated from Nixpkgs to Home
Manager. This commit copies in `escapeSystemdExecArgs` to fix the
immediate issue, perhaps we can pull this in some other way later down
the line.
2024-09-21 09:08:48 +02:00
bhougland18
dfe4d334b1 wezterm: fix generated configuration
The semi-colon breaks this config file, it is not in the Weztem
documentation either.
2024-09-20 22:15:45 +02:00
Robert Helgesson
0b052dd811 swayidle: minor cleanups 2024-09-20 11:45:46 +02:00
leoTlr
4803bf558b swayidle: make -w optional
The option -w causes swayidle to wait on timeouts/events to finish.
This can cause problems with certain timout/event commands (see
https://github.com/swaywm/swaylock/issues/86#issuecomment-662702180)
2024-09-20 11:13:54 +02:00
Ben Brown
8d7e352a4b poweralertd: Enable passing CLI args to the daemon 2024-09-20 09:44:52 +02:00
dependabot[bot]
6b1912380e ci: bump DeterminateSystems/update-flake-lock from 23 to 24
Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 23 to 24.
- [Release notes](https://github.com/determinatesystems/update-flake-lock/releases)
- [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v23...v24)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-20 09:43:17 +02:00
mgdbbrt
f48b181f01 ssh-agent: use POSIX conforming if condition 2024-09-20 09:38:42 +02:00
alejandro-angulo
ecaed80b18 kitty: remove IFD
With this change the theme check happens at activation time. An
integration test is also added to verify the functionality.

Fixes #5110
2024-09-20 09:02:48 +02:00
iniw
2cf3abce03 neovim: use home.shellAliases
Instead of manually adding it as an alias for each and every
individual shell, which inevitably ends up missing some.
2024-09-20 08:47:23 +02:00
Robert Helgesson
1786e2afdb firefox: fix incorrect condition
This error was introduced by me when switching from use of an explicit
`if` expression to `optionalAttrs`.
2024-09-20 00:35:54 +02:00
yuanwang
b5e09b85f2 firefox: only add Version = 2 on non-darwin
The `Version` field in `profiles.ini` does not seem to work on Darwin
systems.

Co-authored-by: bricked <git@bricked.dev>
2024-09-19 19:57:38 +02:00
Mike Thai
1f7b8188a9 zoxide: replace outdated flag in "options" example
The "--no-aliases" option hasn't been a valid init option since 0.8.1,
when it was renamed to "--no-cmd".
2024-09-19 18:43:19 +02:00
bricked
87c7d4df16 firefox: fix policies availability 2024-09-19 18:22:39 +02:00
Coutinho de Souza
451606f4a8 polybar: fix type of systemd Service.Environment
See #5854
2024-09-19 18:19:27 +02:00
Coutinho de Souza
480d589cdd opensnitch-client: fix type of systemd Service.Environment
See #5854
2024-09-19 18:18:59 +02:00
Coutinho de Souza
7540dcc789 opensnitch-ui: fix type of systemd Service.Environment
See #5854
2024-09-19 18:18:36 +02:00
Coutinho de Souza
dcc1a9e659 nextcloud-client: fix type of systemd Service.Environment
See #5854
2024-09-19 18:18:08 +02:00
Coutinho de Souza
06c6695c8c grobi: fix type of systemd Service.Environment
See #5854
2024-09-19 18:17:44 +02:00
Coutinho de Souza
3670a03586 hound: fix type of systemd Service.Environment
See #5854
2024-09-19 18:17:05 +02:00
Coutinho de Souza
cacf2d27f6 kbfs: fix type of systemd Service.Environment
See #5854
2024-09-19 18:16:40 +02:00
Coutinho de Souza
397750d269 xsettings: fix type of systemd Service.Environment
See #5854
2024-09-19 18:15:43 +02:00
Coutinho de Souza
336c792b19 rsibreak: fix type of systemd Service.Environment
See #5854
2024-09-19 18:15:20 +02:00
Coutinho de Souza
80092fae03 mpd: fix type of systemd Service.Environment
See #5854
2024-09-19 18:14:54 +02:00
Coutinho de Souza
10fd27c291 kdeconnect: fix type of systemd Service.Environment
See #5854
2024-09-19 18:14:28 +02:00
Coutinho de Souza
ffc3a473e6 xembed-sni-proxy: fix type of systemd Service.Environment
See #5854
2024-09-19 18:13:59 +02:00
Coutinho de Souza
1d8296c46f flameshot: fix type of systemd Service.Environment
See #5854
2024-09-19 18:13:03 +02:00
Coutinho de Souza
b6204ff489 xscreensaver: fix type of systemd Service.Environment 2024-09-19 18:08:54 +02:00
home-manager-bot
7578176649 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4f807e8940284ad7925ebd0a0993d2a1791acb2f?narHash=sha256-IiA3jfbR7K/B5%2B9byVi9BZGWTD4VSbWe8VLpp9B/iYk%3D' (2024-09-11)
  → 'github:NixOS/nixpkgs/99dc8785f6a0adac95f5e2ab05cc2e1bf666d172?narHash=sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c%3D' (2024-09-16)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-19 13:31:52 +02:00
Robert Helgesson
d2493de5cd ci: remove 23.11 from dependabot 2024-09-18 00:14:15 +02:00
Matthew_Cash
4974dfb26e thunderbird: change settings type to json
Uses the JSON type, just like the Firefox module, so that nested sets
can be used.
2024-09-18 00:12:16 +02:00
bricked
4a4a8b1454 firefox: fix languagepacks policy 2024-09-17 19:20:22 +02:00
Andrew Marshall
a9c9cc6e50 sway: do not use pkgs.sway when cfg.package = null
- Implicitly disable checkConfig when `cfg.package = null` as we don’t
  have any exe to use for the check
- Implicitly disable `swaymsg reload` on activation, since we have no
  exe to use for running it

See https://github.com/nix-community/home-manager/issues/5307
2024-09-16 00:56:20 +02:00
Andrew Marshall
76bf779881 sway: un-extract single-use variable 2024-09-16 00:51:30 +02:00
home-manager-bot
25479e29d1 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/574d1eac1c200690e27b8eb4e24887f8df7ac27c?narHash=sha256-v3rIhsJBOMLR8e/RNWxr828tB%2BWywYIoajrZKFM%2B0Gg%3D' (2024-09-06)
  → 'github:NixOS/nixpkgs/4f807e8940284ad7925ebd0a0993d2a1791acb2f?narHash=sha256-IiA3jfbR7K/B5%2B9byVi9BZGWTD4VSbWe8VLpp9B/iYk%3D' (2024-09-11)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-16 00:47:02 +02:00
sdaqo
9c5f16d703 borgmatic: fix service permissions
Fixes #5749
2024-09-15 09:32:04 +02:00
Robert Helgesson
e524c57b1f mopidy: fix formatting 2024-09-15 01:45:42 +02:00
Robert Helgesson
6c1a461a44 mopidy: reduce test closure size 2024-09-14 12:14:32 +02:00
Heitor Augusto
c6e4ec39df z-lua: add support for fish abbreviations 2024-09-14 11:53:10 +02:00
Heitor Augusto
0d118885b2 lsd: add support for fish abbreviations 2024-09-14 11:53:10 +02:00
Heitor Augusto
f69e61a2d7 pls: add support for fish abbreviations 2024-09-14 11:53:10 +02:00
Languages add-on
7edf6ccaec Add translation using Weblate (Hindi)
Co-authored-by: Languages add-on <noreply-addon-languages@weblate.org>
2024-09-14 07:18:07 +00:00
Jay Thomas
e94bee9574 Translate using Weblate (Hindi)
Currently translated at 8.1% (3 of 37 strings)

Add translation using Weblate (Hindi)

Co-authored-by: Jay Thomas <jay@gfax.ch>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hi/
Translation: Home Manager/Home Manager CLI
2024-09-14 07:18:06 +00:00
NikSne
898eaef7ea Translate using Weblate (Russian)
Currently translated at 100.0% (37 of 37 strings)

Co-authored-by: NikSne <commits@niksne.ru>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ru/
Translation: Home Manager/Home Manager CLI
2024-09-14 07:18:06 +00:00
Dominic Esposito
f084d65319 swaync: fix example configuration
Add a semicolon after "notification-body-image-width = 200" for
completeness.

PR #5828
2024-09-14 09:15:45 +02:00
Ayman Bagabas
43845d04f8 git: add diff-highlight diff pager option
This adds a new diff-highlight option to make use of the simple
included git diff highlighter that comes with canonical git.

For more info, see https://github.com/git/git/blob/master/contrib/diff-highlight/README
2024-09-14 01:38:40 +02:00
Heitor Augusto
503af483e1 eza: add support for fish abbreviations 2024-09-13 12:12:18 +02:00
Heitor Augusto
076c78eded fish: add preferAbbrs option 2024-09-13 12:04:56 +02:00
NitroSniper
7923c69152 neovide: add module
Neovide is a simple, no-nonsense, cross-platform graphical user
interface for Neovim See <https://neovide.dev/>.

Used ruff's module as reference during creation.
2024-09-13 11:50:57 +02:00
Callum Leslie
4c8647b1ed trayscale: add module
Trayscale is an unofficial GUI wrapper around the Tailscale CLI
client.

PR #5803
2024-09-13 10:59:31 +02:00
O. C. Taskin
daaf0c2f8d kanshi: add support for output aliases
- Add `services.kanshi.profiles.<name>.outputs.*.alias` to support new
  alias directive from kanshi [1].
  - Add an assertion to reject aliases not on global scope, which are
    not allowed on kanshi [2].
  - Add a new test to check alias rejection, `alias-assertion`.
- Add relevant coverage by modifying the existing "new-configuration"
  test.
- Kanshi also doesn't allow wildcards on global scope [3], correct the
  faulty test case.

[1]: 1ed86ce523
[2]: 1605f7c813/item/doc/kanshi.5.scd (L78)
[3]: 1605f7c813/item/doc/kanshi.5.scd (L80)
2024-09-13 10:51:33 +02:00
Chet Gurevitch
cb3ab5928c helix: add example for use with evil-helix 2024-09-13 10:49:07 +02:00
Chet Gurevitch
ea244c5ae2 helix: remove outdated language-server comment 2024-09-13 10:49:06 +02:00
Zachary H
433e686675 autorandr: configModule.extraConfig
Add an option to programs.autorandr's configModule to allow arbitrary
extra config lines.

No option exists for adding arbitrary key/values to generated autorandr
profile config, as is common in other nix modules. This commit adds one.
2024-09-13 09:58:00 +02:00
Ayman Bagabas
ef50612457 gpg-agent: add launchd service agent and sockets
This adds a Darwin Launchd agent along with its sockets to make
gpg-agent starts at load or whenever the sockets are needed.

Fixes: https://github.com/nix-community/home-manager/issues/3864
2024-09-13 08:59:29 +02:00
Bryan Lai
c82fc8cf3f home-manager: use hostname from GNU inetutils
This partially reverts commit 89670e27e1.

Co-authored-by: Johannes Maier <johannes.maier@mailbox.org>
2024-09-13 08:37:10 +02:00
Bryan Lai
2b1957a0a3 home-manager: fix early exit due to FQDN error
Since 89670e27e1, FQDN lookup errors
from `hostname -f` may cause an early exit of the whole program.

This commit fixes the problem by absorbing the FQDN query inside the
`if` statement.
2024-09-13 08:37:09 +02:00
Robert Helgesson
da8406a6ff systemd: use getExe for sd-switch 2024-09-12 13:54:47 +02:00
Robert Helgesson
e1c6094075 systemd: unify handling of switch environment 2024-09-12 13:54:47 +02:00
Robert Helgesson
51e4664342 treewide: use non-deprecated substitute arguments 2024-09-12 13:54:47 +02:00
home-manager-bot
8a16716428 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/12228ff1752d7b7624a54e9c1af4b222b3c1073b?narHash=sha256-Ym04C5%2BqovuQDYL/rKWSR%2BWESseQBbNAe5DsXNx5trY%3D' (2024-08-31)
  → 'github:NixOS/nixpkgs/574d1eac1c200690e27b8eb4e24887f8df7ac27c?narHash=sha256-v3rIhsJBOMLR8e/RNWxr828tB%2BWywYIoajrZKFM%2B0Gg%3D' (2024-09-06)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-11 08:40:28 +02:00
Weblate (bot)
e5fa72bad0 Translate using Weblate (Romanian)
Currently translated at 100.0% (37 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ro/
Translation: Home Manager/Home Manager CLI

Co-authored-by: Felix Puscasu <puscasu.felix1@gmail.com>
2024-09-10 08:04:35 +02:00
Donovan Glover
10541f19c5 pqiv: add boolean support 2024-09-09 16:50:17 +02:00
Paul Meyer
be47a2bdf2 k9s: remove katexochen as maintainer 2024-09-09 08:34:44 +02:00
Sefa Eyeoglu
77c9414828 k9s: allow defining custom theme file
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-09-09 08:27:29 +02:00
Robert Helgesson
8a175a8913 tests: change quoting to match new Nixpkgs behavior
Fixes tests that are affected by
<https://github.com/NixOS/nixpkgs/pull/333744>.
2024-09-08 23:32:19 +02:00
Nina Morgan
ec4c6928bb firefox: fix selection of lastUserContextId
The lastUserContextId value should match the highest context ID from
the containers set in a given profile. This update ensures that this
always is the case.
2024-09-08 09:52:15 +02:00
NAHO
aaebdea769 taskwarrior: support taskwarrior3 migration
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

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

Closes: https://github.com/nix-community/home-manager/issues/5310
Link: https://github.com/nix-community/home-manager/pull/5782
2024-09-07 09:41:58 +02:00
DCsunset
127ccc3eb7 i3/sway: support str type for font size 2024-09-06 15:23:08 +02:00
home-manager-bot
7d569851e9 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5e0ca22929f3342b19569b21b2f3462f053e497b?narHash=sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI%3D' (2024-08-09)
  → 'github:NixOS/nixpkgs/12228ff1752d7b7624a54e9c1af4b222b3c1073b?narHash=sha256-Ym04C5%2BqovuQDYL/rKWSR%2BWESseQBbNAe5DsXNx5trY%3D' (2024-08-31)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-06 15:03:51 +02:00
Ferenci Ákos
5b95e0611b Translate using Weblate (Hungarian)
Currently translated at 33.3% (6 of 18 strings)

Translate using Weblate (Hungarian)

Currently translated at 97.2% (36 of 37 strings)

Co-authored-by: Ferenci Ákos <synthetace@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hu/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/hu/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules
2024-09-06 14:55:42 +02:00
Bruno BELANYI
b00bdf59c0 xdg: add option 'xdg.stateFile' 2024-09-06 14:55:36 +02:00
Lulu
03b49187a2 sway: indent sway configuration options
Fix the indentation for the configuration of `input`, `output` and
`seat` to match that of `mode`.
2024-09-06 14:51:44 +02:00
Martin Eek Gerhardsen
5130249ab2 taskwarrior-sync: add package option
Add option to change which package is used for taskwarrior-sync, to
e.g. taskwarrior3.
2024-09-06 14:47:43 +02:00
Alex Lov
471e3eb0a1 git: add option to provide difftastic package 2024-09-01 10:42:46 +02:00
name_snrl
c2cd2a52e0 submodule-support: add default values for top-level configs
This way the end user can easily check whether the home-manager
configuration is part of the module or not. Example of use:

```nix
{ lib, nixosConfig, ... }:
let
  mkIfNixos = lib.mkIf nixosConfig != null;
in
{
  programs.foot.enable = mkIfNixos true;
}
```
2024-08-23 19:56:03 +02:00
Szabin Hamrik
5dc2535656 Translate using Weblate (Hungarian)
Currently translated at 22.2% (4 of 18 strings)

Translation: Home Manager/Home Manager Modules
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/hu/
2024-08-23 16:09:26 +02:00
Robert Helgesson
b18f3ebc40 systemd: fully deprecate legacy switcher
This switches `systemd.user.startServices = true` to be the same as
`systemd.user.startServices = "sd-switch"`, previously it would use
the "legacy" method. It also introduces a warning that triggers if the
user explicitly have `systemd.user.startServices = "legacy"`.

See #5452
2024-08-23 13:31:48 +02:00
Robert Helgesson
25c12f0736 tests: fix escaping of wait command 2024-08-23 13:31:48 +02:00
sudoforge
40ddec2f8a zsh: add option: history.append
This change adds the programs.zsh.history.append option in order to
manage the configuration of the APPEND_HISTORY zsh option.
2024-08-23 13:29:12 +02:00
Alex Hamilton
2598861031 bash: add package option 2024-08-18 15:15:31 +02:00
home-manager-bot
086f619dd9 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28)
  → 'github:NixOS/nixpkgs/5e0ca22929f3342b19569b21b2f3462f053e497b?narHash=sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI%3D' (2024-08-09)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-11 20:11:24 +02:00
Weblate (bot)
8b7cdfceaf Translate using Weblate (Catalan)
Currently translated at 100.0% (37 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ca/
Translation: Home Manager/Home Manager CLI

Co-authored-by: Tomi Ockier <ockier1@gmail.com>
2024-08-11 20:11:05 +02:00
Ladas552
b3d5ea65d8 fastfetch: update example for JsonConfig settings
fastfetch: update example for JsonConfig settings

Using the present version of the example, trows an error:

    JsonConfig Error: `display.binaryPrefix` has been renamed to
    `display.size.binaryPrefix`. Sorry for another break change.

It occurs because of change in fastfetch 2.19 of JsonConfig - moving
`display.binaryPrefix` to `display.size.binaryPrefix`

To not confuse the users, this commit changes the example to fit
current standard

See <b3ac696312/CHANGELOG.md (L85)>
2024-08-07 09:21:46 +02:00
Anomalocaridid
a6c743980e dunst: use -config flag when configFile is set 2024-08-06 11:28:17 +02:00
Weblate (bot)
afc892db74 Translate using Weblate (Vietnamese)
Currently translated at 44.4% (8 of 18 strings)

Translate using Weblate (Vietnamese)

Currently translated at 97.2% (36 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/vi/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules

Co-authored-by: goatastronaut0212 <goatastronaut0212@proton.me>
2024-08-02 22:21:05 +02:00
home-manager-bot
6e090576c4 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3?narHash=sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg%3D' (2024-07-27)
  → 'github:NixOS/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-31 23:45:38 +02:00
William Tan
58cef37962 nix-gc: remove extraneous quotes from shell script 2024-07-31 08:27:17 +02:00
Jakub Nowak
4fcd54df7c firefox: fix userChrome example
Example CSS wasn't valid for Firefox 69+.
2024-07-30 08:33:10 +02:00
Ninja3047
d34aaf7b3b nix-gc: set service type to oneshot 2024-07-30 07:54:40 +02:00
Ninja3047
db40fead89 nix-gc: call nix-collect-garbage in a shell script
This will match the behavior in the upstream service which allows the
user to set options to something that uses shell syntax.
2024-07-30 07:54:18 +02:00
Gaurav Juvekar
89670e27e1 home-manager: ignore hostname -f lookup errors
`hostname -f` could fail depending on the resolver. Discard any stderr
and test for the exit status before using the value for flake attribute
lookup.

I was unable to repro the exact bad exit status in #5665.
With
  - nscd disabled,
  - nsswitch.conf pointing to 'files',
  - hostname entry removed from /etc/hosts
`hostname -f` from inetutils-2.5 fell back to showing just the nodename
from `uname(2)`. Injecting an empty string into the
`(struct utsname).nodename` field of `uname(2)` using strace still
exited with empty output and 0 exit-status.

Fixes #5665
2024-07-28 21:21:23 -07:00
bricked
792757f643 firefox: support firefox derivatives
Adds support for Firefox forks by introducing methods that create
generic configs and options. Additional configs and options can be
added in separate modules.
2024-07-28 23:53:08 +02:00
Jean Sidharta
587fcca66e eww: add terminal integration options
Use eww's shell-completions command to generate completions for
bash, zsh and fish.
2024-07-28 23:37:02 +02:00
nikitax44
a11cfcd0a1 micro: add package option 2024-07-28 23:00:57 +02:00
Milo Moisson
ea72cf548f jujutsu: support darwin guidelines for config placement
Follow up to #5207, fixing jujutsu module on darwin targets.
2024-07-28 22:54:29 +02:00
home-manager-bot
9fdadb1cb6 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/68c9ed8bbed9dfce253cc91560bf9043297ef2fe?narHash=sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8%3D' (2024-07-21)
  → 'github:NixOS/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3?narHash=sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg%3D' (2024-07-27)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-28 22:43:01 +02:00
polykernel
cd520fbd31 maintainers: remove polykernel 2024-07-28 11:58:33 -04:00
Tomodachi94
d0240a064d gnome-terminal: update package name
The `pkgs.gnome.gnome-terminal` package was moved to
`pkgs.gnome-terminal`. The former is now a deprecated alias that
throws a warning whenever a configuration enabling the module is used:

```
The ‘gnome.gnome-terminal’ was moved to top-level. Please use
‘pkgs.gnome-terminal’ directly.
```

Related: https://github.com/NixOS/nixpkgs/pull/319659
Related: https://github.com/nix-community/home-manager/pull/5611
2024-07-28 00:32:19 +02:00
Robert Helgesson
975b83ca56 treewide: fix eval after Nixpkgs maintainer changes 2024-07-27 10:10:13 +02:00
Robert Helgesson
180158b46e mcfly: add settings option 2024-07-27 10:10:13 +02:00
Masum Reza
bc2b96acda zsh: add programs.zsh.autosuggestions.strategy option (#5396)
defaults to history
2024-07-26 14:28:33 +02:00
Cezary Drożak
304a011325 firefox: add languagePacks option
Port the programs.firefox.languagePacks option from NixOS
2024-07-24 22:15:38 +02:00
home-manager-bot
af70fc502a flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374?narHash=sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0%3D' (2024-07-19)
  → 'github:NixOS/nixpkgs/68c9ed8bbed9dfce253cc91560bf9043297ef2fe?narHash=sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8%3D' (2024-07-21)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-24 08:55:10 +02:00
Donovan Glover
465ea1f994 swayosd: avoid restarting too quickly
Should fix an issue where swayosd.service would stop without starting
again after restarting too quickly.

Triggered by ending a Hyprland session and logging in with tuigreet.

Related: https://github.com/nix-community/home-manager/pull/4316
2024-07-24 07:37:28 +02:00
Amit Aryeh Levy
7560dc942a kbfs: avoid using PrivateTmp for systemd service
The kbfs service does not seem to actually work with a PrivateTmp. A
PrivateTmp seems as appropriate for kbfs as anything else, but the
upstream service does not use it either
<https://github.com/keybase/client/blob/master/packaging/linux/systemd/kbfs.service>
2024-07-23 08:04:23 +02:00
github-actions[bot]
635563f245 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/00d80d13810dbfea8ab4ed1009b09100cca86ba8?narHash=sha256-H3%2BEC5cYuq%2BgQW8y0lSrrDZfH71LB4DAf%2BTDFyvwCNA%3D' (2024-07-01)
  → 'github:NixOS/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374?narHash=sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0%3D' (2024-07-19)
2024-07-21 03:59:25 +00:00
O. C. Taskin
afd2021bed papis: add program.papis.package option
Add `programs.papis.package` option to override default package used.
This can be useful to track latest rev from repository via a flake.
2024-07-16 15:19:18 +02:00
O. C. Taskin
a38f88045e khard: add option to contact module for khard dir
Add an extra option,

    accounts.contact.accounts.<name>.khard.defaultCollection

to hardcode a subdirectory for khard to function as intended. Khard
expects to be given a collection directory directly, from which there
can be multiple of in a vdir. This contrasts khal or vdirsyncer which
support recursive search.

Fixes #4531
2024-07-16 15:17:37 +02:00
Chris Hodapp
90ae324e2c sd-switch: respect xdg directory specifications 2024-07-11 23:48:33 +02:00
Johann
c085b984ff gnome-keyring: update package
`pkgs.gnome.gnome-keyring` has been moved to `pkgs.gnome-keyring` In nixpgkgs-unstable
2024-07-10 23:15:28 +02:00
Lin Xianyi
57d85c6c6d xdg-desktop-entries: allow terminal to be null 2024-07-10 23:13:46 +02:00
Robert Helgesson
f79d950ac2 atuin: fix tests 2024-07-10 23:11:15 +02:00
Bruno BELANYI
f749fabecc atuin: use 'lib.getExe' 2024-07-10 13:07:54 +00:00
Robert Helgesson
2fb5c1e0a1 tests: update to match new sd-switch version
Also, seems Nix has become more memory hungry so increase memory
allocation.
2024-07-08 22:34:06 +02:00
Robert Helgesson
dfaf0ff2e7 systemd: only set old units directory when available 2024-07-08 22:34:05 +02:00
Weblate (bot)
6b7ce96f34 Translate using Weblate (Hungarian)
Currently translated at 43.2% (16 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hu/
Translation: Home Manager/Home Manager CLI

Co-authored-by: Ferenci Ákos <synthetace@gmail.com>
2024-07-07 06:49:29 +02:00
Bojun Ren
10486e6b31 starship: fix type of settings to allow all valid value
Previously, type check of `programs.starship.settings` fails for some
valid settings, such as `c.commands = [["cc" "--version"]]`.

The commit fix the `type` argument passed to `mkOption`, so
`programs.starship.settings` can accept all valid values (of toml
type).
2024-07-06 20:08:39 +02:00
novenary
e3582e5151 sway: unfail units before starting session target
Sometimes services can fail. Failed services will generally not be
restarted by systemd. To start previously failed services we can
just reset their failed state before starting our session target.

GNOME and Plasma do the same thing.

See: https://github.com/alebastr/sway-systemd/pull/11
2024-07-05 17:10:02 +03:00
novenary
b7b55e285c sway: stop sway-session.target on exit
This ensures graphical-session.target is properly cycled, and that all
of its members are restarted on consecutive runs.
2024-07-05 17:10:02 +03:00
0x4A6F
bbe6e94737 dunst: fix warning for lib.cartesianProductOfSets
"lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct."
Rename happened in nixpkgs commit `228621e42dc43f936b66e0ed042c90c511aa0535`.
2024-07-05 10:12:00 +02:00
Robert Helgesson
c514e862cd treewide: fix eval after Nixpkgs maintainer changes 2024-07-05 01:19:01 +02:00
Tadeo Kondrak
6ea6fafa3e mpv: remove tadeokondrak as maintainer 2024-07-05 01:09:47 +02:00
TheRealGramdalf
c23060ce95 hyprland: emphasize usage of the NixOS module 2024-07-05 01:07:22 +02:00
novenary
0a30138c69 mpd: specify dependency of service on socket
This allows `systemctl --user restart mpd.socket` to work properly.
2024-07-04 00:22:58 +02:00
home-manager-bot
58268b4d77 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a?narHash=sha256-C8e9S7RzshSdHB7L%2Bv9I51af1gDM5unhJ2xO1ywxNH8%3D' (2024-06-27)
  → 'github:NixOS/nixpkgs/00d80d13810dbfea8ab4ed1009b09100cca86ba8?narHash=sha256-H3%2BEC5cYuq%2BgQW8y0lSrrDZfH71LB4DAf%2BTDFyvwCNA%3D' (2024-07-01)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-03 23:36:42 +02:00
uncenter
e915831472 yazi: allow literal string for initLua 2024-07-03 23:36:14 +02:00
sg-qwt
269cc18d94 sway: fix systemd variables example 2024-07-04 03:43:38 +08:00
Sumner Evans
36e2f9da91 maintainers: remove ivar
ivar was removed as a maintainer from upstream nixpkgs due to
inactivity: https://github.com/NixOS/nixpkgs/pull/322266

Signed-off-by: Sumner Evans <me@sumnerevans.com>
2024-07-03 09:39:20 +02:00
home-manager-bot
59ce796b25 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60?narHash=sha256-ECni%2BIkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko%3D' (2024-06-24)
  → 'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a?narHash=sha256-C8e9S7RzshSdHB7L%2Bv9I51af1gDM5unhJ2xO1ywxNH8%3D' (2024-06-27)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-01 11:50:39 +02:00
dependabot[bot]
ef74bacbb4 ci: bump DeterminateSystems/update-flake-lock from 22 to 23
Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 22 to 23.
- [Release notes](https://github.com/determinatesystems/update-flake-lock/releases)
- [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v22...v23)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 11:49:15 +02:00
Shogo Takata
36317d4d38 direnv: add silent option
PR #5586
2024-06-29 18:07:14 +02:00
Robert Helgesson
c2f806e60a pulseeffects: fix test evaluation
Fixes #5588
2024-06-29 17:20:18 +02:00
Gutyina Gergő
7e68e55d2e glance: add module 2024-06-28 17:24:13 +02:00
home-manager-bot
f50e2779ed flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/d603719ec6e294f034936c0d0dc06f689d91b6c3?narHash=sha256-k3JqJrkdoYwE3fHE6xGDY676AYmyh4U2Zw%2B0Bwe5DLU%3D' (2024-06-20)
  → 'github:NixOS/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60?narHash=sha256-ECni%2BIkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko%3D' (2024-06-24)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-28 16:16:42 +02:00
Jakob Kukla
19e2f43e0b rbw: fix url option examples
rbw expects a protocol for its base_url setting[1]. Otherwise fails
with `rbw unlock: failed to parse base url: relative URL without a
base`.

[1] 741a72cf0d/README.md (configuration)
2024-06-28 16:16:01 +02:00
Shahar "Dawn" Or
1a4f12ae0b docs: introduction chapter
Adds an introduction chapter to the manual.
2024-06-26 23:48:52 +02:00
Adam Dinwoodie
607f969f5d systemd: don't try to restart templates
If the user has template services in their systemd configuration, these
can't be restarted, and will produces warnings during the activation
phase.  Avoid those warnings by skipping any uninstantiated templates
when looking for services to start or stop.
2024-06-26 18:14:48 +02:00
Kacper Koniuszy
7a88ff6ad1 systemd: fix sd-switch error on empty target directory
After update to sd-switch 0.5.0, `home-manager switch` failed with the
following error message:

> Error: Error switching
>
> Caused by:
>     0: Failed to build switch plan
>     1: No such file or directory (os error 2)

This was caused by a non-existing target unit directory due to no user
services being managed by home-manager. This change makes sd-switch
run with pkgs.emptyDirectory as the target in such cases.

Closes: https://github.com/nix-community/home-manager/issues/5552
2024-06-26 17:41:48 +02:00
eljamm
92a26bf6df yazi: add shellWrapperName & rename wrappers to yy
The program shell wrappers have been renamed from `ya` to `yy`
following the introduction of the new CLI tool named `ya`.

With this in mind, the `shellWrapperName` option has been introduced
to provide users with more flexibility in choosing the name they're
most accustomed to (ra, lf, ...).

Co-authored-by: XYenon <register@xyenon.bid>

Co-authored-by: 三咲雅 · Misaki Masa <sxyazi@gmail.com>
2024-06-26 09:08:30 +02:00
eljamm
d3bf2a0612 yazi: add eljamm as maintainer 2024-06-25 14:27:44 +01:00
h7x4
6b1f90a8ff stalonetray: move config file to XDG_CONFIG_HOME 2024-06-24 00:10:26 +02:00
Robert Helgesson
d2f631a96e yazi: ensure plugin suffix .yazi
PR #5492
2024-06-24 00:06:20 +02:00
lordkekz
216d51eb22 yazi: Fix expected structure of flavors 2024-06-23 23:12:50 +02:00
lordkekz
16f86c94ce yazi: Assert plugin/flavor structure and warn about plugin/flavor suffix
- Always append suffix `.yazi` to plugin's and flavor's attribute names.
- Warn if the attribute names already have the suffix.
- Assert that plugin's and flavor's values point to directories
  containing an `init.lua` file.
2024-06-23 23:12:50 +02:00
Didn't read the style guide
09bc5c5949 yazi: plugin names should be in kebab case (test)
Co-authored-by: 三咲雅 · Misaki Masa <sxyazi@gmail.com>
2024-06-23 23:12:50 +02:00
lordkekz
340b98c0ab yazi: Assert that plugins have valid structure 2024-06-23 23:12:50 +02:00
lordkekz
5ccc3d6739 yazi: Ensure plugin suffix .yazi
- Append suffix `.yazi` to symlink targets of yazi plugins, if needed
- Improve some docs, especially links to upstream docs.
- Update tests to make use of this feature.
2024-06-23 23:12:50 +02:00
home-manager-bot
6a9a1e51bb flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b60ebf54c15553b393d144357375ea956f89e9a9?narHash=sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU%3D' (2024-06-16)
  → 'github:NixOS/nixpkgs/d603719ec6e294f034936c0d0dc06f689d91b6c3?narHash=sha256-k3JqJrkdoYwE3fHE6xGDY676AYmyh4U2Zw%2B0Bwe5DLU%3D' (2024-06-20)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-23 23:11:27 +02:00
Robert Helgesson
8be82697f7 ssh-agent: fix evaluation of maintainer field 2024-06-23 23:03:18 +02:00
daru
cd88671199 blanket: add module 2024-06-22 08:19:17 +02:00
Kira Bruneau
c559542f0a gtk: explicitly set default font size
Fixes #5562
2024-06-21 11:32:58 -04:00
home-manager-bot
d7830d0542 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13)
  → 'github:NixOS/nixpkgs/b60ebf54c15553b393d144357375ea956f89e9a9?narHash=sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU%3D' (2024-06-16)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-19 11:11:47 +02:00
Weblate (bot)
0dd1c1495a Translate using Weblate (Polish)
Currently translated at 100.0% (18 of 18 strings)

Translate using Weblate (Polish)

Currently translated at 100.0% (37 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pl/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/pl/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules

Co-authored-by: Mateusz P <medan1993@gmail.com>
2024-06-18 23:05:42 +02:00
bricked
fab8e511d5 firefox: update expected container settings 2024-06-18 15:23:11 +02:00
Balint Barna Kovari
0a7ffb28e5 Translate using Weblate (Hungarian)
Currently translated at 5.4% (2 of 37 strings)

Add translation using Weblate (Hungarian)

Co-authored-by: Balint Barna Kovari <balint+weblate@kovari.cc>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hu/
Translation: Home Manager/Home Manager CLI
2024-06-16 10:32:27 +02:00
Languages add-on
6396c03229 Add translation using Weblate (Hungarian)
Add translation using Weblate (Arabic)

Co-authored-by: Languages add-on <noreply-addon-languages@weblate.org>
2024-06-16 10:32:26 +02:00
Mohamed Nehad Shalabi
f2f254640e Add translation using Weblate (Arabic)
Co-authored-by: Mohamed Nehad Shalabi <mohammednehad450@gmail.com>
2024-06-16 10:32:26 +02:00
home-manager-bot
03c45b982c flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e?narHash=sha256-4q0s6m0GUcN7q%2BY2DqD27iLvbcd1G50T2lv08kKxkSI%3D' (2024-06-07)
  → 'github:NixOS/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-16 10:32:21 +02:00
midchildan
8d5e27b480 nix: add a declarative alternative to Nix channels (#4031)
* nix: add options 'nixPath' and 'keepOldNixPath'

By default, the system value for $NIX_PATH is kept as a fallback.
To completely override the system value for $NIX_PATH:

    nix.keepOldNixPath = false;

* nix: add more tests

* nix: add a declarative alternative to Nix channels

This adds a new option, 'nix.channels'. It's the Nix channels equivalent
of the 'nix.registry' option, and compatible with pre-Flake Nix tooling
including nix-env and nix-shell. Like 'nix.registry', this option is
useful for pinning Nix channels.

Channels defined in the new option can coexist with channels introduced
through the nix-channel command. If the same channel exists in both, the
one from Home Manager will be prioritized.

* nix: add news entry

* nix: make channels respect use-xdg-base-directories

* nix: remove 'with lib;'

---------

Co-authored-by: Michael Hoang <enzime@users.noreply.github.com>
2024-06-13 01:47:38 +00:00
Mathis H
892f76bd0a mpv: fix package if wrapMpv not found
`wrapMpv` was removed from nixpkgs since this PR:
https://github.com/NixOS/nixpkgs/pull/304349

Co-authored-by: Mario Rodas <marsam@users.noreply.github.com>
2024-06-11 23:35:34 +02:00
Matthieu Coudron
3d65009eff waybar: remove modules-* from defaults
Some prefer to handle modules-* imperatively for more flexibility, e.g.,
via waybar "includes" (https://github.com/Alexays/Waybar/wiki/Configuration).
Current HM defaults modules-* to `[]` instead of null for most other
settings, so they get written to ~/.config/waybar/config even though
no explicit configuration has been made.

And they take precedence over the imperative ones because of how
waybar's includes work:

====
Paths to additional configuration files.
Each file can contain a single object with any of the bar configuration options. In case of duplicate options, the first defined value takes precedence, i.e. including file -> first included file -> etc. Nested includes are permitted, but make sure to avoid circular imports.
For a multi-bar config, the include directive affects only current bar configuration object.
====
2024-06-09 13:14:04 +02:00
Mihai Fufezan
8a20efbb00 hyprland: install xwayland if enabled
Install the `xwayland` package if `cfg.xwayland.enable = true;`.
This allows XWayland to work without having to enable the NixOS Hyprland
option.
2024-06-09 13:11:01 +02:00
home-manager-bot
885c037109 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29)
  → 'github:NixOS/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e?narHash=sha256-4q0s6m0GUcN7q%2BY2DqD27iLvbcd1G50T2lv08kKxkSI%3D' (2024-06-07)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-09 13:09:33 +02:00
Mario Rodas
8bdb74eaff docs: add redirect from the previous options.html
After migrating to nixos-render-docs, the extension move to .xtml.
Unfortunately, this broke links to the previous Options Page.

This patch provides a basic redirect support to the new Options Page.
2024-06-09 13:09:00 +02:00
Mario Rodas
8f1b183c91 fcitx5: fix tests
Since https://github.com/NixOS/nixpkgs/pull/308725, fcitx5-with-addons
expects share/dbus-1/services/ to be present.
This patch updates the fcitx5 stub to reflect that.
2024-06-07 04:20:00 +00:00
Jdogzz
a7117efb37 accounts.email: add clarifying documentation
Add clarifying documentation for maildirBasePath value. Also improve
default text.
2024-06-04 20:23:39 +02:00
Sumner Evans
2cacdd6a27 ci/labeler: fix upgrade to v5 format
Signed-off-by: Sumner Evans <me@sumnerevans.com>
2024-06-04 08:39:30 +02:00
Sumner Evans
1a577c135c ci/labeler: upgrade to v5 format
Signed-off-by: Sumner Evans <me@sumnerevans.com>
2024-06-04 08:32:53 +02:00
Sumner Evans
07b2c41d2d ci: bump all actions versions (#5496)
* cachix/install-nix-action: v23 -> v27

  Release: https://github.com/cachix/install-nix-action/releases/tag/v27

* actions/labeler: v4 -> v5

  Release: https://github.com/actions/labeler/releases/tag/v5.0.0

* DeterminateSystems/update-flake-lock: v21 -> v22

  Release: https://github.com/DeterminateSystems/update-flake-lock/releases/tag/v22

Signed-off-by: Sumner Evans <me@sumnerevans.com>
2024-06-03 22:41:47 -06:00
Dawid Dziurla
83bfe1bac8 nix-gc: add persistent option (#5490)
Mirrors the `nix.gc.persistent` option in nixpkgs:
https://search.nixos.org/options?channel=unstable&show=nix.gc.persistent&from=0&size=50&sort=relevance&type=packages&query=nix.gc.persistent
2024-06-03 22:20:47 -06:00
Matthieu Coudron
9b53a10f4c swayidle: wait for WAYLAND_DISPLAY
To avoid this kind of message:

    swayidle[181123]: - [Line 1054] Unable to connect to the compositor. If your compositor is running, check or set the WAYLAND_DISPLAY environment variable.
2024-06-02 10:16:22 +02:00
Weblate (bot)
62da78e1f8 Translate using Weblate (Vietnamese)
Currently translated at 22.2% (4 of 18 strings)

Translate using Weblate (Vietnamese)

Currently translated at 75.6% (28 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/vi/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules

Co-authored-by: goatastronaut0212 <goatastronaut0212@proton.me>
2024-06-02 10:15:15 +02:00
Weblate (bot)
bf3815854e Translate using Weblate (Finnish)
Currently translated at 55.5% (10 of 18 strings)

Translate using Weblate (Finnish)

Currently translated at 72.9% (27 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fi/
Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/fi/
Translation: Home Manager/Home Manager CLI
Translation: Home Manager/Home Manager Modules

Co-authored-by: jarre johansson <jarre@johansson.today>
2024-06-02 10:14:04 +02:00
github-actions[bot]
c497bdc12f flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24)
  → 'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b' (2024-05-29)
2024-06-02 03:59:27 +00:00
Gaurav Juvekar
0eb314b4f0 home-manager: use short -f instead of --fqdn
MacOS doesn't support the long-style `--fqdn` option to `hostname` that
was added by 1b589257f7.

Switch to short style `-f` that should be supported on every platform.
2024-05-30 21:35:07 +02:00
Liassica
29c69d9a46 kdeconnect: fix service with 24.05 package version
The 24.05 update for KDE Connect moved the kdeconnectd binary from
`/libexec` to `/bin`, so this fix will check the version of the
package used and set the path accordingly.
2024-05-30 09:05:10 +02:00
Weblate (bot)
60b85414b4 Translate using Weblate (Korean)
Currently translated at 100.0% (37 of 37 strings)


Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ko/
Translation: Home Manager/Home Manager CLI

Co-authored-by: lentil32 <lentil32@icloud.com>
2024-05-30 08:17:09 +02:00
Gaurav Juvekar
1b589257f7 home-manager: check FQDN for '--flake .' attribute
Since nixpkgs commit 993baa587c4b82e791686f6ce711bcd4ee8ef933,
`networking.hostName` is not allowed to be a FQDN.

Add `hostname --fqdn` to the default flake attribute names that are
searched.

If

    netorking.hostname = "hostname";
    networking.domain = "example.com";

is set in the system NixOS configuration, this allows defining

    homeConfigurations."username@hostname.example.com" = ...

and still use

    home-manager switch --flake .

instead of having to type out

    home-manager switch --flake .#$(whoami)@$(hostname --fqdn)
2024-05-30 00:02:35 +02:00
XYenon
04bc391a90 yazi: support plugins and flavors 2024-05-29 11:29:08 +08:00
Sharzy
a9b36cbe92 gpg-agent: fix usage of splitString
`splitString "" "some string"` would throw exception `error: invalid
regular expression` on Darwin (or accurately, on Nix built against
libc++). Refer to https://github.com/NixOS/nix/issues/7208 for
details.

Before Nix handles that issue correctly, we should refrain from using
`splitString ""`, and luckliy `lib.stringAsChars` can do the same thing.
2024-05-28 23:15:11 +02:00
midchildan
373ead2060 tests: fix broken overlay in mpv test 2024-05-28 17:02:06 +02:00
Dee Anzorge
10c7c219b7 listenbrainz-mpd: fix config example 2024-05-28 00:07:22 +02:00
Phani Rithvij
90010df158 topgrade: update example config 2024-05-28 00:03:45 +02:00
Jany
939375b396 khal: add package option 2024-05-27 23:59:26 +02:00
Gabriel Fontes
7e769959e8 hyprland: onChange: remove subshell comment 2024-05-27 23:57:03 +02:00
Gabriel Fontes
7ac529c221 hyprland: onChange: check XDG_RUNTIME_DIR as well
The previous check false negatives in Hyprland >= 0.40.0
2024-05-27 23:57:03 +02:00
RoadRoller01
0cf552f39f bash: add missing 'ignoreboth' to historyControl
Reference: https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-HISTCONTROL
2024-05-27 23:52:55 +02:00
Austin Horstman
e8482a798f yazi: use builtin cd
cd conflicts with aliases that dont support -- syntax
2024-05-27 23:50:57 +02:00
Stanislav Asunkin
65e0f5aa25 eza: don't create shell aliases with empty args 2024-05-27 23:50:09 +02:00
Stanislav Asunkin
8f8eb15c6d fd: don't create shell aliases with empty args 2024-05-27 23:49:28 +02:00
nurelin
5d151429e1 kanshi: fix configuration example 2024-05-26 17:19:20 +02:00
home-manager-bot
b2a4ddf657 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/f1010e0469db743d14519a1efd37e23f8513d714' (2024-05-09)
  → 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-26 17:15:27 +02:00
DeeKahy
05e6ba83eb Translate using Weblate (Danish)
Currently translated at 100.0% (37 of 37 strings)

Co-authored-by: DeeKahy <Lennart.Diego.Kahn@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/da/
Translation: Home Manager/Home Manager CLI
2024-05-26 10:13:39 +02:00
TANIGUCHI Kohei
517682ed21 Translate using Weblate (Japanese)
Currently translated at 100.0% (37 of 37 strings)

Co-authored-by: TANIGUCHI Kohei <a.d.xvii.kal.mai@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/
Translation: Home Manager/Home Manager CLI
2024-05-26 10:13:39 +02:00
Narazaki Shuji
cd29501b79 Translate using Weblate (Japanese)
Currently translated at 94.5% (35 of 37 strings)

Co-authored-by: Narazaki Shuji <shujinarazaki@protonmail.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/
Translation: Home Manager/Home Manager CLI
2024-05-26 10:13:39 +02:00
halbGefressen
943f1e97fc Translate using Weblate (German)
Currently translated at 100.0% (37 of 37 strings)

Co-authored-by: halbGefressen <chzi@pm.me>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/de/
Translation: Home Manager/Home Manager CLI
2024-05-26 10:13:39 +02:00
Zexin Yuan
fb7feac55b Translate using Weblate (Chinese (Simplified))
Currently translated at 100.0% (37 of 37 strings)

Co-authored-by: Zexin Yuan <yuan.zx@outlook.com>
Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/zh_Hans/
Translation: Home Manager/Home Manager CLI
2024-05-26 10:13:39 +02:00
dependabot[bot]
6a35d1969e ci: bump cachix/cachix-action from 13 to 15
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 13 to 15.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v13...v15)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-26 10:13:35 +02:00
Robert Helgesson
e4611630c3 ci: fix manual build in sourcehut build 2024-05-26 01:25:03 +02:00
Robert Helgesson
d179da4e81 home-manager: prepare 24.11-pre 2024-05-25 22:13:25 +02:00
Robert Helgesson
548ba194d0 home-manager: prepare release 24.05 2024-05-25 22:13:25 +02:00
Robert Helgesson
850cb32204 ci: make dependabot consider the release-24.05
Also remove 23.05 from dependabot.
2024-05-23 11:45:08 +02:00
Robert Helgesson
25dedb0d52 version: allow 24.11 as state version 2024-05-23 09:07:00 +02:00
468 changed files with 10987 additions and 2966 deletions

View File

@@ -19,3 +19,6 @@ indent_style = tab
[*.md]
trim_trailing_whitespace = false
[*.plist]
insert_final_newline = false

View File

@@ -10,7 +10,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-23.11"
target-branch: "release-24.05"
schedule:
interval: "weekly"
commit-message:
@@ -18,7 +18,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-24.05"
target-branch: "release-24.11"
schedule:
interval: "weekly"
commit-message:

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@V27
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15

View File

@@ -21,4 +21,3 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true

View File

@@ -12,9 +12,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@V27
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-24.05
nix_path: nixpkgs=channel:nixos-unstable
- run: |
if grep -R --exclude stdlib-extended.nix literalExample modules ; then
echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr
@@ -25,3 +25,5 @@ jobs:
- run: nix-shell --show-trace . -A install
- run: yes | home-manager -I home-manager=. uninstall
- run: nix-shell --show-trace --arg enableBig false --pure tests -A run.all
# Somebody please help us fix the macos tests.
if: matrix.os != 'macos-latest'

View File

@@ -12,7 +12,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@V27
uses: cachix/install-nix-action@v30
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v24
with:

View File

@@ -28,7 +28,7 @@ Releases
Home Manager is developed against `nixpkgs-unstable` branch, which often causes
it to contain tweaks for changes/packages not yet released in stable [NixOS][].
To avoid breaking users' configurations, Home Manager is released in branches
corresponding to NixOS releases (e.g. `release-24.05`). These branches get
corresponding to NixOS releases (e.g. `release-24.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.
@@ -49,7 +49,7 @@ 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 24.05 (the current
Home Manager targets [NixOS][] unstable and NixOS version 24.11 (the current
stable version), it may or may not work on other Linux distributions and NixOS
versions.

View File

@@ -147,7 +147,7 @@ in {
substitute \
${hmOptionsDocs.optionsJSON}/nix-support/hydra-build-products \
$out/nix-support/hydra-build-products \
--replace \
--replace-fail \
'${hmOptionsDocs.optionsJSON}/share/doc/nixos' \
"$out/share/doc/home-manager"
'';

View File

@@ -59,5 +59,7 @@ in stdenv.mkDerivation {
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
'';
passthru = { inherit home-manager-options; };
meta = { maintainers = [ lib.maintainers.considerate ]; };
}

View File

@@ -15,10 +15,10 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master
$ nix-channel --update
```
and if you follow a Nixpkgs version 24.05 channel, you can run
and if you follow a Nixpkgs version 24.11 channel, you can run
``` shell
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager
$ nix-channel --update
```
@@ -45,7 +45,7 @@ home-manager.users.eve = { pkgs, ... }: {
# The state version is required and should stay at the version you
# originally installed.
home.stateVersion = "24.05";
home.stateVersion = "24.11";
};
```

View File

@@ -17,10 +17,10 @@ $ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/m
$ sudo nix-channel --update
```
and if you follow a Nixpkgs version 24.05 channel, you can run
and if you follow a Nixpkgs version 24.11 channel, you can run
``` shell
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager
$ sudo nix-channel --update
```
@@ -44,7 +44,7 @@ home-manager.users.eve = { pkgs, ... }: {
# The state version is required and should stay at the version you
# originally installed.
home.stateVersion = "24.05";
home.stateVersion = "24.11";
};
```

View File

@@ -19,10 +19,10 @@
$ nix-channel --update
```
and if you follow a Nixpkgs version 24.05 channel you can run
and if you follow a Nixpkgs version 24.11 channel you can run
``` shell
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager
$ nix-channel --update
```

View File

@@ -0,0 +1,32 @@
# Introduction to Home Manager {#ch-introduction}
Home Manager is a [Nix](https://nix.dev/)-powered tool for reproducible management of the contents of users' home directories.
This includes programs, configuration files, environment variables and, well… arbitrary files.
The following example snippet of Nix code:
```nix
programs.git = {
enable = true;
userEmail = "joe@example.org";
userName = "joe";
};
```
would make available to a user the `git` executable and man pages and a configuration file `~/.config/git/config`:
```ini
[user]
email = "joe@example.org"
name = "joe"
```
Since Home Manager is implemented in Nix, it provides several benefits:
- Contents are reproducible — a home will be the exact same every time it is built, unless of course, an intentional change is made.
This also means you can have the exact same home on different hosts.
- Significantly faster and more powerful than various backup strategies.
- Unlike "dotfiles" repositories, Home Manager supports specifying programs, as well as their configurations.
- Supported by <http://cache.nixos.org/>, so that you don't have to build from source.
- If you do want to build some programs from source, there is hardly a tool more useful than Nix for that, and the build instructions can be neatly integrated in your Home Manager usage.
- Infinitely composable, so that values in different configuration files and build instructions can share a source of truth.
- Connects you with the [most extensive](https://repology.org/repositories/statistics/total) and [most up-to-date](https://repology.org/repositories/statistics/newest) software package repository on earth, [Nixpkgs](https://github.com/NixOS/nixpkgs).

View File

@@ -1,6 +1,6 @@
# Home Manager Manual {#home-manager-manual}
## Version 24.05
## Version 25.05 (unstable)
```{=include=} preface
@@ -8,6 +8,7 @@ preface.md
```
```{=include=} parts
introduction.md
installation.md
usage.md
nix-flakes.md

View File

@@ -11,10 +11,10 @@ then to generate and activate a basic configuration run the command
$ nix run home-manager/master -- init --switch
```
For Nixpkgs or NixOS version 24.05 run
For Nixpkgs or NixOS version 24.11 run
``` shell
$ nix run home-manager/release-24.05 -- init --switch
$ nix run home-manager/release-24.11 -- init --switch
```
This will generate a `flake.nix` and a `home.nix` file in
@@ -30,7 +30,7 @@ $ # Edit files in ~/.config/home-manager
$ nix run home-manager/$branch -- init --switch
```
Where `$branch` is one of `master` or `release-24.05`.
Where `$branch` is one of `master` or `release-24.11`.
After the initial activation has completed successfully then building
and activating your flake-based configuration is as simple as

View File

@@ -59,5 +59,6 @@ usage/configuration.md
usage/rollbacks.md
usage/dotfiles.md
usage/graphical.md
usage/gpu-non-nixos.md
usage/updating.md
```

View File

@@ -20,7 +20,7 @@ A fresh install of Home Manager will generate a minimal
# 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 = "24.05";
home.stateVersion = "24.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
@@ -65,7 +65,7 @@ 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 = "24.05";
home.stateVersion = "24.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

View File

@@ -0,0 +1,81 @@
# GPU on non-NixOS systems {#sec-usage-gpu-non-nixos}
To access the GPU, programs need access to OpenGL and Vulkan libraries. While
this works transparently on NixOS, it does not on other Linux systems. A
solution is provided by [NixGL](https://github.com/nix-community/nixGL), which
can be integrated into Home Manager.
To enable the integration, import NixGL into your home configuration, either as
a channel, or as a flake input passed via `extraSpecialArgs`. Then, set the
`nixGL.packages` option to the package set provided by NixGL.
Once integration is enabled, it can be used in two ways: as Nix functions for
wrapping programs installed via Home Manager, and as shell commands for running
programs installed by other means (such as `nix shell`). In either case, there
are several wrappers available. They can be broadly categorized
- by vendor: as Mesa (for Free drivers of all vendors) and Nvidia (for
Nvidia-specific proprietary drivers).
- by GPU selection: as primary and secondary (offloading).
For example, the `mesa` wrapper provides support for running programs on the
primary GPU for Intel, AMD and Nouveau drivers, while the `mesaPrime` wrapper
does the same for the secondary GPU.
**Note:** when using Nvidia wrappers together with flakes, your home
configuration will not be pure and needs to be built using `home-manager switch
--impure`. Otherwise, the build will fail, complaining about missing attribute
`currentTime`.
Wrapper functions are available under `config.lib.nixGL.wrappers`. However, it
can be more convenient to use the `config.lib.nixGL.wrap` alias, which can be
configured to use any of the wrappers. It is intended to provide a customization
point when the same home configuration is used across several machines with
different hardware. There is also the `config.lib.nixGL.wrapOffload` alias for
two-GPU systems.
Another convenience is that all wrapper functions are always available. However,
when `nixGL.packages` option is unset, they are no-ops. This allows them to be
used even when the home configuration is used on NixOS machines. The exception
is the `prime-offload` script which ignores `nixGL.packages` and is installed
into the environment whenever `nixGL.prime.installScript` is set. This script,
which can be used to start a program on a secondary GPU, does not depend on
NixGL and is useful on NixOS systems as well.
Below is an abbreviated example for an Optimus laptop that makes use of both
Mesa and Nvidia wrappers, where the latter is used in dGPU offloading mode. It
demonstrates how to wrap `mpv` to run on the integrated Intel GPU, wrap FreeCAD
to run on the Nvidia dGPU, and how to install the wrapper scripts. It also wraps
Xonotic to run on the dGPU, but uses the wrapper function directly for
demonstration purposes.
```nix
{ config, lib, pkgs, nixgl, ... }:
{
nixGL.packages = nixgl.packages;
nixGL.defaultWrapper = "mesa";
nixGL.offloadWrapper = "nvidiaPrime";
nixGL.installScripts = [ "mesa" "nvidiaPrime" ];
programs.mpv = {
enable = true;
package = config.lib.nixGL.wrap pkgs.mpv;
};
home.packages = [
(config.lib.nixGL.wrapOffload pkgs.freecad)
(config.lib.nixGL.wrappers.nvidiaPrime pkgs.xonotic)
];
}
```
The above example assumes a flake-based setup where `nixgl` was passed from the
flake. When using channels, the example would instead begin with
```nix
{ config, lib, pkgs, ... }:
{
nixGL.packages = import <nixgl> { inherit pkgs; };
# The rest is the same as above
...
```

View File

@@ -4,6 +4,8 @@ This section lists the release notes for stable versions of Home Manager
and the current unstable version.
```{=include=} chapters
rl-2505.md
rl-2411.md
rl-2405.md
rl-2311.md
rl-2305.md

View File

@@ -0,0 +1,31 @@
# Release 24.11 {#sec-release-24.11}
The 24.05 release branch became stable in November, 2024.
## Highlights {#sec-release-24.11-highlights}
This release has the following notable changes:
- The swayidle module behavior has changed. Specifically, swayidle was
previously always called with a `-w` flag. This flag is now moved to
the default
[services.swayidle.extraArgs](#opt-services.swayidle.extraArgs)
value to make it optional.
Your configuration may break if you already set this option and also
rely on the flag being automatically added. To resolve this, please
add `-w` to your assignment of
[services.swayidle.extraArgs](#opt-services.swayidle.extraArgs).
- Support for Boolean values in the option
[programs.eza.icons](#opt-programs.eza.icons) is deprecated for
future removal. The new value for `true` is `"auto"`, and for
`false` it is `null`.
## State Version Changes {#sec-release-24.11-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
\"24.11\" or later.
- There was no state version change in this release.

View File

@@ -0,0 +1,18 @@
# Release 25.05 {#sec-release-25.05}
This is the current unstable branch and the information in this
section is therefore not final.
## Highlights {#sec-release-25.05-highlights}
This release has the following notable changes:
- No changes.
## State Version Changes {#sec-release-25.05-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
\"25.05\" or later.
- No changes.

8
flake.lock generated
View File

@@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1716542732,
"narHash": "sha256-0Y9fRr0CUqWT4KgBITmaGwlnNIGMYuydu2L8iLTfHU4=",
"lastModified": 1733212471,
"narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d12251ef6e8e6a46e05689eeccd595bdbd3c9e60",
"rev": "55d15ad12a74eb7d4646254e13638ad0c4128776",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}

View File

@@ -1,7 +1,7 @@
{
description = "Home Manager for Nix";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, ... }:
{

14
format
View File

@@ -23,23 +23,9 @@ for arg do
esac
done
# The excludes are for files touched by open pull requests and we want
# to avoid merge conflicts.
excludes=(
modules/files.nix
modules/home-environment.nix
modules/programs/zsh.nix
)
exclude_args=()
for e in "${excludes[@]}"; do
exclude_args+=(-e "$e")
done
git_root=$(git rev-parse --show-toplevel)
git ls-files -z --cached --others --full-name -- "${files[@]}" |
grep -z '\.nix$' |
grep -z -v "${exclude_args[@]}" |
sed -z "s|^|$git_root/|" |
xargs -0 nixfmt "${nixfmt_args[@]}"

View File

@@ -1,5 +1,5 @@
{ runCommand, lib, bash, callPackage, coreutils, findutils, gettext, gnused, jq
, less, ncurses, unixtools
, less, ncurses, inetutils
# used for pkgs.path for nixos-option
, pkgs
@@ -38,7 +38,7 @@ in runCommand "home-manager" {
less
ncurses
nixos-option
unixtools.hostname
inetutils # for `hostname`
]
}" \
--subst-var-by HOME_MANAGER_LIB '${../lib/bash/home-manager.sh}' \

View File

@@ -52,6 +52,11 @@ function hasFlakeSupport() {
| grep -q nix-command
}
# Escape string for use in Nix files.
function escapeForNix() {
printf %s "$1" | sed 's/["$\\]/\\\0/g'
}
# Attempts to set the HOME_MANAGER_CONFIG global variable.
#
# If no configuration file can be found then this function will print
@@ -198,10 +203,10 @@ function setFlakeAttribute() {
;;
*)
local name="$USER"
# Check both long and short hostnames; long first to preserve
# Check FQDN, 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
for n in "$USER@$(hostname -f)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do
if [[ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$(escapeForNix "$n")\"")" == "true" ]]; then
name="$n"
if [[ -v VERBOSE ]]; then
echo "Using flake homeConfiguration for $name"
@@ -210,7 +215,7 @@ function setFlakeAttribute() {
done
;;
esac
export FLAKE_CONFIG_URI="$flake#homeConfigurations.\"$name\""
export FLAKE_CONFIG_URI="$flake#homeConfigurations.\"$(printf %s "$name" | jq -sRr @uri)\""
fi
}
@@ -349,8 +354,8 @@ function doInit() {
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "$USER";
home.homeDirectory = "$HOME";
home.username = "$(escapeForNix "$USER")";
home.homeDirectory = "$(escapeForNix "$HOME")";
$xdgVars
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
@@ -359,7 +364,7 @@ $xdgVars
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.05"; # Please read the comment before changing.
home.stateVersion = "24.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
@@ -439,7 +444,7 @@ EOF
mkdir -p "$confDir"
cat > "$flakeFile" <<EOF
{
description = "Home Manager configuration of $USER";
description = "Home Manager configuration of $(escapeForNix "$USER")";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
@@ -455,7 +460,7 @@ EOF
system = "$nixSystem";
pkgs = nixpkgs.legacyPackages.\${system};
in {
homeConfigurations."$USER" = home-manager.lib.homeManagerConfiguration {
homeConfigurations."$(escapeForNix "$USER")" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
@@ -855,9 +860,9 @@ function doUninstall() {
cat > "$HOME_MANAGER_CONFIG" <<EOF
{
uninstall = true;
home.username = "$USER";
home.homeDirectory = "$HOME";
home.stateVersion = "24.05";
home.username = "$(escapeForNix "$USER")";
home.homeDirectory = "$(escapeForNix "$HOME")";
home.stateVersion = "24.11";
}
EOF
# shellcheck disable=2064
@@ -1044,7 +1049,7 @@ while [[ $# -gt 0 ]]; do
export VERBOSE=1
;;
--version)
echo 24.05
echo 25.05-pre
exit 0
;;
*)

217
home-manager/po/ar.po Normal file
View File

@@ -0,0 +1,217 @@
# 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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
#: home-manager/home-manager:64
msgid "No configuration file found at %s"
msgstr ""
#. translators: The first '%s' specifier will be replaced by either
#. 'home.nix' or 'flake.nix'.
#: home-manager/home-manager:81 home-manager/home-manager:85
#: home-manager/home-manager:184
msgid ""
"Keeping your Home Manager %s in %s is deprecated,\n"
"please move it to %s"
msgstr ""
#: home-manager/home-manager:92
msgid "No configuration file found. Please create one at %s"
msgstr ""
#: home-manager/home-manager:107
msgid "Home Manager not found at %s."
msgstr ""
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:115
msgid ""
"The fallback Home Manager path %s has been deprecated and a file/directory "
"was found there."
msgstr ""
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:118
msgid ""
"To remove this warning, do one of the following.\n"
"\n"
"1. Explicitly tell Home Manager to use the path, for example by adding\n"
"\n"
" { programs.home-manager.path = \"%s\"; }\n"
"\n"
" to your configuration.\n"
"\n"
" If you import Home Manager directly, you can use the `path` parameter\n"
"\n"
" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n"
"\n"
" when calling the Home Manager package.\n"
"\n"
"2. Remove the deprecated path.\n"
"\n"
" $ rm -r \"%s\""
msgstr ""
#: home-manager/home-manager:146
msgid "Sanity checking Nix"
msgstr ""
#: home-manager/home-manager:166
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:221
msgid "Can't inspect options of a flake configuration"
msgstr ""
#: home-manager/home-manager:296 home-manager/home-manager:319
#: home-manager/home-manager:1051
msgid "%s: unknown option '%s'"
msgstr ""
#: home-manager/home-manager:301 home-manager/home-manager:1052
msgid "Run '%s --help' for usage help"
msgstr ""
#: home-manager/home-manager:327 home-manager/home-manager:431
msgid "The file %s already exists, leaving it unchanged..."
msgstr ""
#: home-manager/home-manager:329 home-manager/home-manager:433
msgid "Creating %s..."
msgstr ""
#: home-manager/home-manager:475
msgid "Creating initial Home Manager generation..."
msgstr ""
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/home-manager:480
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/home-manager:485
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 ""
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:496
msgid "Can't instantiate a flake configuration"
msgstr ""
#: home-manager/home-manager:572
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:586
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr ""
#: home-manager/home-manager:594
#, sh-format
msgid "Please set the $EDITOR or $VISUAL environment variable"
msgstr ""
#: home-manager/home-manager:612
msgid "Cannot run build in read-only directory"
msgstr ""
#: home-manager/home-manager:693
msgid "No generation with ID %s"
msgstr ""
#: home-manager/home-manager:695
msgid "Cannot remove the current generation %s"
msgstr ""
#: home-manager/home-manager:697
msgid "Removing generation %s"
msgstr ""
#: home-manager/home-manager:718
msgid "No generations to expire"
msgstr ""
#: home-manager/home-manager:729
msgid "No home-manager packages seem to be installed."
msgstr ""
#: home-manager/home-manager:811
msgid "Unknown argument %s"
msgstr ""
#: home-manager/home-manager:835
msgid "This will remove Home Manager from your system."
msgstr ""
#: home-manager/home-manager:838
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr ""
#: home-manager/home-manager:842
msgid "Really uninstall Home Manager?"
msgstr ""
#: home-manager/home-manager:848
msgid "Switching to empty Home Manager configuration..."
msgstr ""
#: home-manager/home-manager:863
msgid "Yay!"
msgstr ""
#: home-manager/home-manager:868
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
#: home-manager/home-manager:1091
msgid "expire-generations expects one argument, got %d."
msgstr ""
#: home-manager/home-manager:1113
msgid "Unknown command: %s"
msgstr ""
#: home-manager/install.nix:18
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-04-05 11:01+0000\n"
"Last-Translator: Leix b <abone9999@gmail.com>\n"
"PO-Revision-Date: 2024-08-07 17:09+0000\n"
"Last-Translator: Tomi Ockier <ockier1@gmail.com>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/home-manager/cli/"
"ca/>\n"
"Language: ca\n"
@@ -17,12 +17,12 @@ 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 5.5-dev\n"
"X-Generator: Weblate 5.7-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%: falta un argument per %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"

View File

@@ -8,23 +8,25 @@ msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"PO-Revision-Date: 2024-12-03 13:00+0000\n"
"Last-Translator: Ricky Tigg <ricky.tigg@gmail.com>\n"
"Language-Team: Finnish <https://hosted.weblate.org/projects/home-manager/cli/"
"fi/>\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"
"X-Generator: Weblate 5.9-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: puuttuva argumentti kohteelle %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"
msgstr ""
msgstr "Kokoonpanotiedostoa ei löydy %s:sta"
#. translators: The first '%s' specifier will be replaced by either
#. 'home.nix' or 'flake.nix'.
@@ -34,14 +36,16 @@ msgid ""
"Keeping your Home Manager %s in %s is deprecated,\n"
"please move it to %s"
msgstr ""
"Home Managerin %s pitäminen %s:ssa on vanhentunut.\n"
"ole hyvä ja siirrä se %s:een"
#: home-manager/home-manager:92
msgid "No configuration file found. Please create one at %s"
msgstr ""
msgstr "Kokoonpanotiedostoa ei löytynyt. Luo sellainen %s:lla"
#: home-manager/home-manager:107
msgid "Home Manager not found at %s."
msgstr ""
msgstr "Home Manageria ei löytynyt sijainnista %s."
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:115
@@ -74,37 +78,37 @@ msgstr ""
#: home-manager/home-manager:146
msgid "Sanity checking Nix"
msgstr ""
msgstr "Nixin eheys tarkistetaan"
#: home-manager/home-manager:166
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
msgstr "Sopivaa profiilihakemistoa ei löytynyt, yritettiin %s ja %s"
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:221
msgid "Can't inspect options of a flake configuration"
msgstr ""
msgstr "Flake-konfiguraation asetuksia ei voi tarkastella"
#: home-manager/home-manager:296 home-manager/home-manager:319
#: home-manager/home-manager:1051
msgid "%s: unknown option '%s'"
msgstr ""
msgstr "%s: tuntematon vaihtoehto '%s"
#: home-manager/home-manager:301 home-manager/home-manager:1052
msgid "Run '%s --help' for usage help"
msgstr ""
msgstr "Aja '%s --help' saadaksesi käyttöohjeita"
#: home-manager/home-manager:327 home-manager/home-manager:431
msgid "The file %s already exists, leaving it unchanged..."
msgstr ""
msgstr "Tiedosto %s on jo olemassa, jätetään se muuttumattomaksi..."
#: home-manager/home-manager:329 home-manager/home-manager:433
msgid "Creating %s..."
msgstr ""
msgstr "Luodaan tiedostoa %s..."
#: home-manager/home-manager:475
msgid "Creating initial Home Manager generation..."
msgstr ""
msgstr "Luodaan alkuperäistä Home Manager -generaatiota..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/home-manager:480
@@ -130,7 +134,7 @@ msgstr ""
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:496
msgid "Can't instantiate a flake configuration"
msgstr ""
msgstr "Flake-konfiguraatiota ei voi luoda"
#: home-manager/home-manager:572
msgid ""
@@ -140,16 +144,20 @@ msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
"Sinulla on %d lukematon ja oleellinen uutisartikkeli.\n"
"Lue se ajamalla komento \"%s news\"."
msgstr[1] ""
"Sinulla on %d lukematonta ja oleellista uutisartikkelia.\n"
"Lue ne ajamalla komento \"%s news\"."
#: home-manager/home-manager:586
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr ""
msgstr "Tuntematon asetus \"news.display\" \"%s\"."
#: home-manager/home-manager:594
#, sh-format
msgid "Please set the $EDITOR or $VISUAL environment variable"
msgstr ""
msgstr "Aseta $EDITOR- tai $VISUAL-ympäristömuuttujaksi"
#: home-manager/home-manager:612
msgid "Cannot run build in read-only directory"
@@ -161,11 +169,11 @@ msgstr ""
#: home-manager/home-manager:695
msgid "Cannot remove the current generation %s"
msgstr ""
msgstr "Nykyistä generaatiota %s ei voi poistaa"
#: home-manager/home-manager:697
msgid "Removing generation %s"
msgstr ""
msgstr "Generaatio %s poistetaan"
#: home-manager/home-manager:718
msgid "No generations to expire"
@@ -173,35 +181,36 @@ msgstr ""
#: home-manager/home-manager:729
msgid "No home-manager packages seem to be installed."
msgstr ""
msgstr "Näyttää siltä, ettei yhtään home-manager-pakettia ole asennettu."
#: home-manager/home-manager:811
msgid "Unknown argument %s"
msgstr ""
msgstr "Tuntematon argumentti %s"
#: home-manager/home-manager:835
msgid "This will remove Home Manager from your system."
msgstr ""
msgstr "Tämä poistaa Home Managerin järjestelmästäsi."
#: home-manager/home-manager:838
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr ""
msgstr "Tämä on kuivaharjoitus, mitään ei oikeasti poisteta."
#: home-manager/home-manager:842
msgid "Really uninstall Home Manager?"
msgstr ""
msgstr "Haluatko varmasti poistaa Home Managerin?"
#: home-manager/home-manager:848
msgid "Switching to empty Home Manager configuration..."
msgstr ""
msgstr "Vaihdetaan tyhjään Home Manager -konfiguraatioon..."
#: home-manager/home-manager:863
msgid "Yay!"
msgstr ""
msgstr "Jes!"
#: home-manager/home-manager:868
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
"Home Manager on poistettu, mutta home.nix-tiedostosi jää koskemattomaksi."
#: home-manager/home-manager:1091
msgid "expire-generations expects one argument, got %d."
@@ -209,7 +218,7 @@ msgstr ""
#: home-manager/home-manager:1113
msgid "Unknown command: %s"
msgstr ""
msgstr "Tuntematon komento: %s"
#: home-manager/install.nix:18
msgid "This derivation is not buildable, please run it using nix-shell."

220
home-manager/po/hi.po Normal file
View File

@@ -0,0 +1,220 @@
# 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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-10-09 14:31+0000\n"
"Last-Translator: Utkarsh Sharma <utkasharma19@gmail.com>\n"
"Language-Team: Hindi <https://hosted.weblate.org/projects/home-manager/cli/"
"hi/>\n"
"Language: hi\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 5.8-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr "%s: %s के लिए कोई आर्ग्यूमेंट नहीं दिया"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"
msgstr "%s में कोई कन्फि़गरेशन फाइल नहीं मिली"
#. translators: The first '%s' specifier will be replaced by either
#. 'home.nix' or 'flake.nix'.
#: home-manager/home-manager:81 home-manager/home-manager:85
#: home-manager/home-manager:184
msgid ""
"Keeping your Home Manager %s in %s is deprecated,\n"
"please move it to %s"
msgstr ""
"अपने Home Manager %s को %s में रखना अप्रचलित है,\n"
"कृपया इसे %s में स्थानांतरित करें"
#: home-manager/home-manager:92
msgid "No configuration file found. Please create one at %s"
msgstr "कोई कॉन्फ़िगरेशन फ़ाइल नहीं मिली। कृपया %s पर एक फ़ाइल बनाएं।"
#: home-manager/home-manager:107
msgid "Home Manager not found at %s."
msgstr "%s पर Home Manager नहीं मिला।"
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:115
msgid ""
"The fallback Home Manager path %s has been deprecated and a file/directory "
"was found there."
msgstr ""
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:118
msgid ""
"To remove this warning, do one of the following.\n"
"\n"
"1. Explicitly tell Home Manager to use the path, for example by adding\n"
"\n"
" { programs.home-manager.path = \"%s\"; }\n"
"\n"
" to your configuration.\n"
"\n"
" If you import Home Manager directly, you can use the `path` parameter\n"
"\n"
" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n"
"\n"
" when calling the Home Manager package.\n"
"\n"
"2. Remove the deprecated path.\n"
"\n"
" $ rm -r \"%s\""
msgstr ""
#: home-manager/home-manager:146
msgid "Sanity checking Nix"
msgstr ""
#: home-manager/home-manager:166
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:221
msgid "Can't inspect options of a flake configuration"
msgstr ""
#: home-manager/home-manager:296 home-manager/home-manager:319
#: home-manager/home-manager:1051
msgid "%s: unknown option '%s'"
msgstr ""
#: home-manager/home-manager:301 home-manager/home-manager:1052
msgid "Run '%s --help' for usage help"
msgstr ""
#: home-manager/home-manager:327 home-manager/home-manager:431
msgid "The file %s already exists, leaving it unchanged..."
msgstr ""
#: home-manager/home-manager:329 home-manager/home-manager:433
msgid "Creating %s..."
msgstr ""
#: home-manager/home-manager:475
msgid "Creating initial Home Manager generation..."
msgstr ""
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/home-manager:480
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/home-manager:485
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 ""
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:496
msgid "Can't instantiate a flake configuration"
msgstr ""
#: home-manager/home-manager:572
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:586
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr ""
#: home-manager/home-manager:594
#, sh-format
msgid "Please set the $EDITOR or $VISUAL environment variable"
msgstr ""
#: home-manager/home-manager:612
msgid "Cannot run build in read-only directory"
msgstr ""
#: home-manager/home-manager:693
msgid "No generation with ID %s"
msgstr ""
#: home-manager/home-manager:695
msgid "Cannot remove the current generation %s"
msgstr ""
#: home-manager/home-manager:697
msgid "Removing generation %s"
msgstr ""
#: home-manager/home-manager:718
msgid "No generations to expire"
msgstr ""
#: home-manager/home-manager:729
msgid "No home-manager packages seem to be installed."
msgstr ""
#: home-manager/home-manager:811
msgid "Unknown argument %s"
msgstr ""
#: home-manager/home-manager:835
msgid "This will remove Home Manager from your system."
msgstr ""
#: home-manager/home-manager:838
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr ""
#: home-manager/home-manager:842
msgid "Really uninstall Home Manager?"
msgstr ""
#: home-manager/home-manager:848
msgid "Switching to empty Home Manager configuration..."
msgstr ""
#: home-manager/home-manager:863
msgid "Yay!"
msgstr ""
#: home-manager/home-manager:868
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
#: home-manager/home-manager:1091
msgid "expire-generations expects one argument, got %d."
msgstr ""
#: home-manager/home-manager:1113
msgid "Unknown command: %s"
msgstr ""
#: home-manager/install.nix:18
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""

258
home-manager/po/hu.po Normal file
View File

@@ -0,0 +1,258 @@
# 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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-09-02 17:09+0000\n"
"Last-Translator: Ferenci Ákos <synthetace@gmail.com>\n"
"Language-Team: Hungarian <https://hosted.weblate.org/projects/home-manager/"
"cli/hu/>\n"
"Language: hu\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 5.8-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr "%s: hiányzó érték erre: %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"
msgstr "Nincs konfigurációs fájl itt: %s"
#. translators: The first '%s' specifier will be replaced by either
#. 'home.nix' or 'flake.nix'.
#: home-manager/home-manager:81 home-manager/home-manager:85
#: home-manager/home-manager:184
msgid ""
"Keeping your Home Manager %s in %s is deprecated,\n"
"please move it to %s"
msgstr ""
"A Home Manager %s %s elérési úton való tárolása elavult. Kérem helyezze át a "
"%s elérési úthoz"
#: home-manager/home-manager:92
msgid "No configuration file found. Please create one at %s"
msgstr ""
"Nem található konfigurációs fájl. Kérem hozza létre a fájlt a %s elérési úton"
#: home-manager/home-manager:107
msgid "Home Manager not found at %s."
msgstr "Home Manager nem található a %s elérési úton."
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:115
msgid ""
"The fallback Home Manager path %s has been deprecated and a file/directory "
"was found there."
msgstr ""
"A tartalék Home Manager fájlútvonal %s elavult és fájl/könyvtár található "
"itt."
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:118
msgid ""
"To remove this warning, do one of the following.\n"
"\n"
"1. Explicitly tell Home Manager to use the path, for example by adding\n"
"\n"
" { programs.home-manager.path = \"%s\"; }\n"
"\n"
" to your configuration.\n"
"\n"
" If you import Home Manager directly, you can use the `path` parameter\n"
"\n"
" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n"
"\n"
" when calling the Home Manager package.\n"
"\n"
"2. Remove the deprecated path.\n"
"\n"
" $ rm -r \"%s\""
msgstr ""
"A felmerült hiba elhárítására a következőket tegye:\n"
"\n"
"1. Közvetlen adja át a Home Manager-nek a fájlútvonalat, pl.:\n"
"\n"
" { programs.home-manager.path = \"%s\"; }\n"
"\n"
" sor konfigurációhoz való hozzáadásával.\n"
"\n"
" Amennyiben a Home Manager-t közvetlen importolja, használhatja a 'path' "
"paramétert\n"
"\n"
" pkgs.callPackage/path/tohome-manager-package{path = \"%s\"; }\n"
" a Home Manager csomag meghívásakor.\n"
"\n"
" 2. Távolítsa el az elavult fájlútvonalat.\n"
"\n"
" $ rm -r \"$s\""
#: home-manager/home-manager:146
msgid "Sanity checking Nix"
msgstr "Nix épségének ellenőrzése"
#: home-manager/home-manager:166
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
"Nem található megfelelő profil mappa, %s és %s útvonalak lettek kipróbálva."
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:221
msgid "Can't inspect options of a flake configuration"
msgstr "Nem lehet a flake konfiguráció beállításait megtekinteni."
#: home-manager/home-manager:296 home-manager/home-manager:319
#: home-manager/home-manager:1051
msgid "%s: unknown option '%s'"
msgstr "%s: ismeretlen opció '%s'"
#: home-manager/home-manager:301 home-manager/home-manager:1052
msgid "Run '%s --help' for usage help"
msgstr "Futtasa a '%s --help' parancsot a használattal kapcsolatos segítségért"
#: home-manager/home-manager:327 home-manager/home-manager:431
msgid "The file %s already exists, leaving it unchanged..."
msgstr "A fájl %s már létezik és változatlan marad..."
#: home-manager/home-manager:329 home-manager/home-manager:433
msgid "Creating %s..."
msgstr "%s létrehozása..."
#: home-manager/home-manager:475
msgid "Creating initial Home Manager generation..."
msgstr "Kezdeti Home Manager generáció létrehozása..."
#. translators: The "%s" specifier will be replaced by a file path.
#: home-manager/home-manager:480
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 ""
"Elkészült! A home-manager eszköz most már installálva van és a \n"
"\n"
" %s\n"
"\n"
"fájl szerkesztésével konfigurálhatja a Home Manager-t. \n"
"Futtassa a 'man home-configuration.nix' parancsot az összes opció "
"áttekintéséhez."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/home-manager:485
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, az installáció nem sikerült! Kérem készítsen egy jelentést erről a \n"
"\n"
" %s\n"
"\n"
"helyen amennyiben a hiba a Home Manager miatt lépett fel."
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:496
msgid "Can't instantiate a flake configuration"
msgstr "Flake konfiguráció nem példányosítható"
#: home-manager/home-manager:572
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] ""
"%d olvasatlan és releváns hírt kapott.\n"
"Olvassa el a \"%s news\" futattásával."
msgstr[1] ""
"%d olvasatlan és releváns hírt kapott.\n"
"Olvassa el őket a \"%s news\" futattásával."
#: home-manager/home-manager:586
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr "Ismeretlen \"news.display\" opció \"%s\"."
#: home-manager/home-manager:594
#, sh-format
msgid "Please set the $EDITOR or $VISUAL environment variable"
msgstr "Kérem állítása be az $EDITOR vagy a $VISUAL környezeti változókat."
#: home-manager/home-manager:612
msgid "Cannot run build in read-only directory"
msgstr "Build futtatása nem lehetséges csak-olvasható könyvtárban"
#: home-manager/home-manager:693
msgid "No generation with ID %s"
msgstr "Nem található generáció a következő ID-val: %"
#: home-manager/home-manager:695
msgid "Cannot remove the current generation %s"
msgstr "A jelenlegi generáció %s nem eltávolítható"
#: home-manager/home-manager:697
msgid "Removing generation %s"
msgstr "%s generáció eltávolítása"
#: home-manager/home-manager:718
msgid "No generations to expire"
msgstr "Nincs lejárandó generáció"
#: home-manager/home-manager:729
msgid "No home-manager packages seem to be installed."
msgstr "Nem található installált Home Manager csomag"
#: home-manager/home-manager:811
msgid "Unknown argument %s"
msgstr "Ismeretlen argumentum %s"
#: home-manager/home-manager:835
msgid "This will remove Home Manager from your system."
msgstr "Ez a művelet eltávolítja a Home Manager-t a rendszeréről."
#: home-manager/home-manager:838
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr "Ez egy üres járat, semmi nem lesz valójában eltávolítva."
#: home-manager/home-manager:842
msgid "Really uninstall Home Manager?"
msgstr "Biztosan eltávolítja a Home Managert-t?"
#: home-manager/home-manager:848
msgid "Switching to empty Home Manager configuration..."
msgstr "Átváltás üres Home Manager konfigurációra..."
#: home-manager/home-manager:863
msgid "Yay!"
msgstr "Hurrá!"
#: home-manager/home-manager:868
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr "Home Manager eltávolítva, de a home.nix fájl érintetlenül maradt."
#: home-manager/home-manager:1091
msgid "expire-generations expects one argument, got %d."
msgstr ""
#: home-manager/home-manager:1113
msgid "Unknown command: %s"
msgstr "Ismeretlen parancs: %s"
#: home-manager/install.nix:18
msgid "This derivation is not buildable, please run it using nix-shell."
msgstr ""
"Ez a származtatás nem építhető fel, kérlek futtasd nix-shell segítségével."

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-02-29 10:10+0000\n"
"Last-Translator: FedFer98123 <fede.ferrari123@gmail.com>\n"
"PO-Revision-Date: 2024-11-18 15:00+0000\n"
"Last-Translator: Lorenzo Bevilacqua <lorenzobevilacqua02@gmail.com>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/home-manager/cli/"
"it/>\n"
"Language: it\n"
@@ -17,12 +17,12 @@ 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 5.5-dev\n"
"X-Generator: Weblate 5.9-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: argomento mancante per %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-03-19 04:01+0000\n"
"Last-Translator: honnip <me@honnip.page>\n"
"PO-Revision-Date: 2024-05-30 06:09+0000\n"
"Last-Translator: lentil32 <lentil32@icloud.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/home-manager/cli/"
"ko/>\n"
"Language: ko\n"
@@ -17,12 +17,12 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.5-dev\n"
"X-Generator: Weblate 5.6-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: %s에 대한 인자 누락"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"

View File

@@ -8,22 +8,22 @@ msgstr ""
"Project-Id-Version: Home Manager\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-02-16 22:01+0000\n"
"Last-Translator: Robert Helgesson <robert@rycee.net>\n"
"PO-Revision-Date: 2024-10-17 00:20+0000\n"
"Last-Translator: Julius Marozas <marozas.julius@gmail.com>\n"
"Language-Team: Lithuanian <https://hosted.weblate.org/projects/home-manager/"
"cli/lt/>\n"
"Language: lt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"(n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 5.4\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && ("
"n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 5.8-rc\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: trūksta argumento %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"
@@ -55,6 +55,8 @@ msgid ""
"The fallback Home Manager path %s has been deprecated and a file/directory "
"was found there."
msgstr ""
"Atsarginis kelias %s į Home Manager jau nebenaudojamas, tačiau jame buvo "
"rastas failas/katalogas."
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
#: home-manager/home-manager:118
@@ -77,6 +79,24 @@ msgid ""
"\n"
" $ rm -r \"%s\""
msgstr ""
"Norėdami pašalinti šį įspėjimą, atlikite vieną iš šių veiksmų.\n"
"\n"
"1. Aiškiai nurodykite kelią į Home Manager, pavyzdžiui, pridėdami\n"
"\n"
" { programs.home-manager.path = \"%s\"; }\n"
"\n"
" prie jūsų konfigūracijos.\n"
"\n"
" Jei importuojate Home Manager tiesiogiai, galite naudoti parametrą `path`."
"\n"
"\n"
" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n"
"\n"
" kviečiant į Home Manager paketą.\n"
"\n"
"2. Pašalinkite nebenaudojamą kelią.\n"
"\n"
" $ rm -r \"%s\""
#: home-manager/home-manager:146
msgid "Sanity checking Nix"
@@ -175,10 +195,9 @@ msgstr "Nežinomas \"news.display\" nustatymas \"%s\"."
#: home-manager/home-manager:594
#, sh-format
msgid "Please set the $EDITOR or $VISUAL environment variable"
msgstr ""
msgstr "Nustatykite $EDITOR arba $VISUAL aplinkos kintamuosius"
#: home-manager/home-manager:612
#, fuzzy
msgid "Cannot run build in read-only directory"
msgstr "Negalima vykdyti kompiliavimo read-only kataloge"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-02-16 22:01+0000\n"
"Last-Translator: Robert Helgesson <robert@rycee.net>\n"
"PO-Revision-Date: 2024-06-17 09:46+0000\n"
"Last-Translator: Mateusz P <medan1993@gmail.com>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/home-manager/cli/"
"pl/>\n"
"Language: pl\n"
@@ -18,12 +18,12 @@ 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 5.4\n"
"X-Generator: Weblate 5.6-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: brakuje wartości dla %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"
@@ -194,7 +194,7 @@ msgstr "Nieznane ustawienie „%s” „news.display”."
#: home-manager/home-manager:594
#, sh-format
msgid "Please set the $EDITOR or $VISUAL environment variable"
msgstr ""
msgstr "Proszę ustawić zmienną środowiskową $EDITOR lub $VISUAL"
#: home-manager/home-manager:612
msgid "Cannot run build in read-only directory"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-03-31 22:01+0000\n"
"Last-Translator: SMFloris <floris.sm@gmail.com>\n"
"PO-Revision-Date: 2024-09-09 10:09+0000\n"
"Last-Translator: Felix Puscasu <puscasu.felix1@gmail.com>\n"
"Language-Team: Romanian <https://hosted.weblate.org/projects/home-manager/"
"cli/ro/>\n"
"Language: ro\n"
@@ -18,12 +18,12 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2;\n"
"X-Generator: Weblate 5.5-dev\n"
"X-Generator: Weblate 5.8-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: Argument lipsă pentru %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-03-31 22:01+0000\n"
"Last-Translator: Petr Portnov | PROgrm_JARvis <mrJARVIScraft@gmail.com>\n"
"PO-Revision-Date: 2024-09-12 02:12+0000\n"
"Last-Translator: NikSne <commits@niksne.ru>\n"
"Language-Team: Russian <https://hosted.weblate.org/projects/home-manager/cli/"
"ru/>\n"
"Language: ru\n"
@@ -18,12 +18,12 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 5.5-dev\n"
"X-Generator: Weblate 5.8-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: отсутствует параметр для %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-02-18 14:02+0000\n"
"Last-Translator: Сергій <sergiy.goncharuk.1@gmail.com>\n"
"PO-Revision-Date: 2024-11-18 15:00+0000\n"
"Last-Translator: wadsaek <wadsaek@gmail.com>\n"
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/home-manager/"
"cli/uk/>\n"
"Language: uk\n"
@@ -18,12 +18,12 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 5.4\n"
"X-Generator: Weblate 5.9-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: відсутній аргумент для %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-03-27 15:05+0000\n"
"Last-Translator: Nguyen Khanh <nguynkhan479@gmail.com>\n"
"PO-Revision-Date: 2024-08-01 04:09+0000\n"
"Last-Translator: goatastronaut0212 <goatastronaut0212@proton.me>\n"
"Language-Team: Vietnamese <https://hosted.weblate.org/projects/home-manager/"
"cli/vi/>\n"
"Language: vi\n"
@@ -17,12 +17,12 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.5-dev\n"
"X-Generator: Weblate 5.7-dev\n"
#. translators: For example: "home-manager: missing argument for --cores"
#: home-manager/home-manager:16
msgid "%s: missing argument for %s"
msgstr ""
msgstr "%s: bị thiếu đối số cho %s"
#: home-manager/home-manager:64
msgid "No configuration file found at %s"
@@ -36,6 +36,8 @@ msgid ""
"Keeping your Home Manager %s in %s is deprecated,\n"
"please move it to %s"
msgstr ""
"Giữ Home Manager của bạn %s ở %s đã không còn phù hợp,\n"
"hãy chuyển nó tới %s"
#: home-manager/home-manager:92
msgid "No configuration file found. Please create one at %s"
@@ -95,7 +97,7 @@ msgstr ""
#: home-manager/home-manager:146
msgid "Sanity checking Nix"
msgstr ""
msgstr "Kiểm tra hợp lệ của Nix"
#: home-manager/home-manager:166
msgid "Could not find suitable profile directory, tried %s and %s"
@@ -104,7 +106,7 @@ msgstr "Không thể tìm thấy thư mục hồ sơ phù hợp, đã thử %s v
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:221
msgid "Can't inspect options of a flake configuration"
msgstr ""
msgstr "Không thể kiểm tra tùy chọn của cấu hình flake"
#: home-manager/home-manager:296 home-manager/home-manager:319
#: home-manager/home-manager:1051
@@ -137,6 +139,13 @@ msgid ""
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
"see all available options."
msgstr ""
"Đã hoàn thành! Công cụ home-manager giờ đạ được cài đặt và bạn có thể chỉnh "
"sửa\n"
"\n"
" %s\n"
"\n"
"để cấu hình Home Manager. Chạy lệnh 'man home-configuration.nix' để\n"
"xem toàn bộ tùy chọn có sẵn."
#. translators: The "%s" specifier will be replaced by a URL.
#: home-manager/home-manager:485
@@ -147,6 +156,11 @@ msgid ""
"\n"
"if the error seems to be the fault of Home Manager."
msgstr ""
"Quá trình cài đặt đã thất bại! Vui lòng tạo 1 báo cáo lỗi tại\n"
"\n"
" %s\n"
"\n"
"nếu như lỗi đó thuộc về Home Manager."
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
#: home-manager/home-manager:496
@@ -161,76 +175,79 @@ msgid_plural ""
"There are %d unread and relevant news items.\n"
"Read them by running the command \"%s news\"."
msgstr[0] ""
msgstr[1] ""
"Có %d tin tức liên quan và chưa được đọc.\n"
"Để đọc nó hãy chạy lệnh \"%s news\"."
#: home-manager/home-manager:586
msgid "Unknown \"news.display\" setting \"%s\"."
msgstr ""
msgstr "Không tồn tại \"news.display\" cấu hình \"%s\"."
#: home-manager/home-manager:594
#, sh-format
msgid "Please set the $EDITOR or $VISUAL environment variable"
msgstr ""
msgstr "Vui lòng đặt biến môi trường $EDITOR hoặc $VISUAL"
#: home-manager/home-manager:612
msgid "Cannot run build in read-only directory"
msgstr ""
msgstr "Không thể chạy lệnh xây dựng trong thư mục chỉ cho phép đọc"
#: home-manager/home-manager:693
msgid "No generation with ID %s"
msgstr ""
msgstr "Không có thế hệ với ID %s"
#: home-manager/home-manager:695
msgid "Cannot remove the current generation %s"
msgstr ""
msgstr "Không thể xóa thể hệ hiện tại %s"
#: home-manager/home-manager:697
msgid "Removing generation %s"
msgstr ""
msgstr "Đang xóa thế hệ %s"
#: home-manager/home-manager:718
msgid "No generations to expire"
msgstr ""
msgstr "Không có bất kỳ thế hệ nào hết hạn"
#: home-manager/home-manager:729
msgid "No home-manager packages seem to be installed."
msgstr ""
msgstr "Không có bất kỳ gói home-manager nào được cài đặt."
#: home-manager/home-manager:811
msgid "Unknown argument %s"
msgstr ""
msgstr "Không tồn tại đối số %s"
#: home-manager/home-manager:835
msgid "This will remove Home Manager from your system."
msgstr ""
msgstr "Việc này sẽ xóa Home Manager khỏi hệ thống của bạn."
#: home-manager/home-manager:838
msgid "This is a dry run, nothing will actually be uninstalled."
msgstr ""
msgstr "Đây là chạy thử nghiệm, sẽ không có bất cư thứ gì được gỡ cài đặt."
#: home-manager/home-manager:842
msgid "Really uninstall Home Manager?"
msgstr ""
msgstr "Bạn có muốn gỡ Home Manager không?"
#: home-manager/home-manager:848
msgid "Switching to empty Home Manager configuration..."
msgstr ""
msgstr "Chuyển đổi sang cấu hình Home Manager trống..."
#: home-manager/home-manager:863
msgid "Yay!"
msgstr ""
msgstr "Tuyệt vời!"
#: home-manager/home-manager:868
msgid "Home Manager is uninstalled but your home.nix is left untouched."
msgstr ""
"Home Manager đã được gỡ cài đặt nhưng home.nix của bạn sẽ được giữ nguyên "
"vẹn."
#: home-manager/home-manager:1091
msgid "expire-generations expects one argument, got %d."
msgstr ""
msgstr "expire-generations kỳ vọng 1 đối số, có %d."
#: home-manager/home-manager:1113
msgid "Unknown command: %s"
msgstr ""
msgstr "Không tồn tại câu lệnh: %s"
#: home-manager/install.nix:18
msgid "This derivation is not buildable, please run it using nix-shell."

View File

@@ -12,7 +12,8 @@ let
path = mkOption {
type = types.str;
default = "${cfg.basePath}/${name}";
defaultText = "accounts.calendar.basePath/name";
defaultText =
lib.literalExpression "accounts.calendar.basePath/name";
description = "The path of the storage.";
};

View File

@@ -12,7 +12,8 @@ let
path = mkOption {
type = types.str;
default = "${cfg.basePath}/${name}";
defaultText = "accounts.contact.basePath/name";
defaultText =
lib.literalExpression "accounts.contact.basePath/name";
description = "The path of the storage.";
};

View File

@@ -493,13 +493,14 @@ in {
maildirBasePath = mkOption {
type = types.str;
default = "${config.home.homeDirectory}/Maildir";
defaultText = "$HOME/Maildir";
defaultText = "Maildir";
apply = p:
if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}";
description = ''
The base directory for account maildir directories. May be a
relative path, in which case it is relative the home
directory.
relative path (e.g. the user setting this value as "MyMaildir"),
in which case it is relative the home directory (e.g. resulting
in "~/MyMaildir").
'';
};

View File

@@ -45,6 +45,17 @@ let
gtk config generation for {option}`home.pointerCursor`
'';
};
hyprcursor = {
enable = mkEnableOption "hyprcursor config generation";
size = mkOption {
type = types.nullOr types.int;
example = 32;
default = null;
description = "The cursor size for hyprcursor.";
};
};
};
};
@@ -163,7 +174,7 @@ in {
}
(mkIf cfg.x11.enable {
xsession.initExtra = ''
xsession.profileExtra = ''
${pkgs.xorg.xsetroot}/bin/xsetroot -xcf ${cursorPath} ${
toString cfg.size
}
@@ -178,5 +189,13 @@ in {
(mkIf cfg.gtk.enable {
gtk.cursorTheme = mkDefault { inherit (cfg) package name size; };
})
(mkIf cfg.hyprcursor.enable {
home.sessionVariables = {
HYPRCURSOR_THEME = cfg.name;
HYPRCURSOR_SIZE =
if cfg.hyprcursor.size != null then cfg.hyprcursor.size else cfg.size;
};
})
]);
}

View File

@@ -8,26 +8,26 @@ let
homeDirectory = config.home.homeDirectory;
fileType = (import lib/file-type.nix {
inherit homeDirectory lib pkgs;
}).fileType;
fileType =
(import lib/file-type.nix { inherit homeDirectory lib pkgs; }).fileType;
sourceStorePath = file:
let
sourcePath = toString file.source;
sourceName = config.lib.strings.storeFileName (baseNameOf sourcePath);
in
if builtins.hasContext sourcePath
then file.source
else builtins.path { path = file.source; name = sourceName; };
in if builtins.hasContext sourcePath then
file.source
else
builtins.path {
path = file.source;
name = sourceName;
};
in
{
in {
options = {
home.file = mkOption {
description = "Attribute set of files to link into the user home.";
default = {};
default = { };
type = fileType "home.file" "{env}`HOME`" homeDirectory;
};
@@ -39,16 +39,14 @@ in
};
config = {
assertions = [(
let
dups =
attrNames
(filterAttrs (n: v: v > 1)
(foldAttrs (acc: v: acc + v) 0
assertions = [
(let
dups = attrNames (filterAttrs (n: v: v > 1)
(foldAttrs (acc: v: acc + v) 0
(mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)));
dupsStr = concatStringsSep ", " dups;
in {
assertion = dups == [];
assertion = dups == [ ];
message = ''
Conflicting managed target files: ${dupsStr}
@@ -65,19 +63,17 @@ in
let
pathStr = toString path;
name = hm.strings.storeFileName (baseNameOf pathStr);
in
pkgs.runCommandLocal name {} ''ln -s ${escapeShellArg pathStr} $out'';
in pkgs.runCommandLocal name { } "ln -s ${escapeShellArg pathStr} $out";
# This verifies that the links we are about to create will not
# overwrite an existing file.
home.activation.checkLinkTargets = hm.dag.entryBefore ["writeBoundary"] (
let
home.activation.checkLinkTargets = hm.dag.entryBefore [ "writeBoundary" ]
(let
# Paths that should be forcibly overwritten by Home Manager.
# Caveat emptor!
forcedPaths =
concatMapStringsSep " " (p: ''"$HOME"/${escapeShellArg p}'')
(mapAttrsToList (n: v: v.target)
(filterAttrs (n: v: v.force) cfg));
(mapAttrsToList (n: v: v.target) (filterAttrs (n: v: v.force) cfg));
storeDir = escapeShellArg builtins.storeDir;
@@ -87,8 +83,7 @@ in
inherit (config.lib.bash) initHomeManagerLib;
inherit forcedPaths storeDir;
};
in
''
in ''
function checkNewGenCollision() {
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
@@ -97,8 +92,7 @@ in
}
checkNewGenCollision || exit 1
''
);
'');
# This activation script will
#
@@ -121,129 +115,127 @@ in
# and a failure during the intermediate state FA ∩ FB will not
# result in lost links because this set of links are in both the
# source and target generation.
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (
let
link = pkgs.writeShellScript "link" ''
${config.lib.bash.initHomeManagerLib}
home.activation.linkGeneration = hm.dag.entryAfter [ "writeBoundary" ] (let
link = pkgs.writeShellScript "link" ''
${config.lib.bash.initHomeManagerLib}
newGenFiles="$1"
shift
for sourcePath in "$@" ; do
relativePath="''${sourcePath#$newGenFiles/}"
targetPath="$HOME/$relativePath"
if [[ -e "$targetPath" && ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
# The target exists, back it up
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
run mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!"
fi
if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s "$sourcePath" "$targetPath" ; then
# The target exists but is identical don't do anything.
verboseEcho "Skipping '$targetPath' as it is identical to '$sourcePath'"
else
# Place that symlink, --force
# This can still fail if the target is a directory, in which case we bail out.
run mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
run ln -Tsf $VERBOSE_ARG "$sourcePath" "$targetPath" || exit 1
fi
done
'';
cleanup = pkgs.writeShellScript "cleanup" ''
${config.lib.bash.initHomeManagerLib}
# A symbolic link whose target path matches this pattern will be
# considered part of a Home Manager generation.
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
newGenFiles="$1"
shift 1
for relativePath in "$@" ; do
targetPath="$HOME/$relativePath"
if [[ -e "$newGenFiles/$relativePath" ]] ; then
verboseEcho "Checking $targetPath: exists"
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete."
else
verboseEcho "Checking $targetPath: gone (deleting)"
run rm $VERBOSE_ARG "$targetPath"
# Recursively delete empty parent directories.
targetDir="$(dirname "$relativePath")"
if [[ "$targetDir" != "." ]] ; then
pushd "$HOME" > /dev/null
# Call rmdir with a relative path excluding $HOME.
# Otherwise, it might try to delete $HOME and exit
# with a permission error.
run rmdir $VERBOSE_ARG \
-p --ignore-fail-on-non-empty \
"$targetDir"
popd > /dev/null
fi
fi
done
'';
in
''
function linkNewGen() {
_i "Creating home file links in %s" "$HOME"
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
find "$newGenFiles" \( -type f -or -type l \) \
-exec bash ${link} "$newGenFiles" {} +
}
function cleanOldGen() {
if [[ ! -v oldGenPath || ! -e "$oldGenPath/home-files" ]] ; then
return
fi
_i "Cleaning up orphan links from %s" "$HOME"
local newGenFiles oldGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
# Apply the cleanup script on each leaf in the old
# generation. The find command below will print the
# relative path of the entry.
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
| xargs -0 bash ${cleanup} "$newGenFiles"
}
cleanOldGen
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
_i "Creating profile generation %s" $newGenNum
if [[ -e "$genProfilePath"/manifest.json ]] ; then
# Remove all packages from "$genProfilePath"
# `nix profile remove '.*' --profile "$genProfilePath"` was not working, so here is a workaround:
nix profile list --profile "$genProfilePath" \
| cut -d ' ' -f 4 \
| xargs -rt $DRY_RUN_CMD nix profile remove $VERBOSE_ARG --profile "$genProfilePath"
run nix profile install $VERBOSE_ARG --profile "$genProfilePath" "$newGenPath"
else
run nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath"
fi
run --quiet nix-store --realise "$newGenPath" --add-root "$newGenGcPath" --indirect
if [[ -e "$legacyGenGcPath" ]]; then
run rm $VERBOSE_ARG "$legacyGenGcPath"
fi
else
_i "No change so reusing latest profile generation %s" "$oldGenNum"
newGenFiles="$1"
shift
for sourcePath in "$@" ; do
relativePath="''${sourcePath#$newGenFiles/}"
targetPath="$HOME/$relativePath"
if [[ -e "$targetPath" && ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
# The target exists, back it up
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
run mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!"
fi
linkNewGen
''
);
if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s "$sourcePath" "$targetPath" ; then
# The target exists but is identical don't do anything.
verboseEcho "Skipping '$targetPath' as it is identical to '$sourcePath'"
else
# Place that symlink, --force
# This can still fail if the target is a directory, in which case we bail out.
run mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
run ln -Tsf $VERBOSE_ARG "$sourcePath" "$targetPath" || exit 1
fi
done
'';
home.activation.checkFilesChanged = hm.dag.entryBefore ["linkGeneration"] (
let
homeDirArg = escapeShellArg homeDirectory;
cleanup = pkgs.writeShellScript "cleanup" ''
${config.lib.bash.initHomeManagerLib}
# A symbolic link whose target path matches this pattern will be
# considered part of a Home Manager generation.
homeFilePattern="$(readlink -e ${
escapeShellArg builtins.storeDir
})/*-home-manager-files/*"
newGenFiles="$1"
shift 1
for relativePath in "$@" ; do
targetPath="$HOME/$relativePath"
if [[ -e "$newGenFiles/$relativePath" ]] ; then
verboseEcho "Checking $targetPath: exists"
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete."
else
verboseEcho "Checking $targetPath: gone (deleting)"
run rm $VERBOSE_ARG "$targetPath"
# Recursively delete empty parent directories.
targetDir="$(dirname "$relativePath")"
if [[ "$targetDir" != "." ]] ; then
pushd "$HOME" > /dev/null
# Call rmdir with a relative path excluding $HOME.
# Otherwise, it might try to delete $HOME and exit
# with a permission error.
run rmdir $VERBOSE_ARG \
-p --ignore-fail-on-non-empty \
"$targetDir"
popd > /dev/null
fi
fi
done
'';
in ''
function linkNewGen() {
_i "Creating home file links in %s" "$HOME"
local newGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
find "$newGenFiles" \( -type f -or -type l \) \
-exec bash ${link} "$newGenFiles" {} +
}
function cleanOldGen() {
if [[ ! -v oldGenPath || ! -e "$oldGenPath/home-files" ]] ; then
return
fi
_i "Cleaning up orphan links from %s" "$HOME"
local newGenFiles oldGenFiles
newGenFiles="$(readlink -e "$newGenPath/home-files")"
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
# Apply the cleanup script on each leaf in the old
# generation. The find command below will print the
# relative path of the entry.
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
| xargs -0 bash ${cleanup} "$newGenFiles"
}
cleanOldGen
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
_i "Creating profile generation %s" $newGenNum
if [[ -e "$genProfilePath"/manifest.json ]] ; then
# Remove all packages from "$genProfilePath"
# `nix profile remove '.*' --profile "$genProfilePath"` was not working, so here is a workaround:
nix profile list --profile "$genProfilePath" \
| cut -d ' ' -f 4 \
| xargs -rt $DRY_RUN_CMD nix profile remove $VERBOSE_ARG --profile "$genProfilePath"
run nix profile install $VERBOSE_ARG --profile "$genProfilePath" "$newGenPath"
else
run nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath"
fi
run --quiet nix-store --realise "$newGenPath" --add-root "$newGenGcPath" --indirect
if [[ -e "$legacyGenGcPath" ]]; then
run rm $VERBOSE_ARG "$legacyGenGcPath"
fi
else
_i "No change so reusing latest profile generation %s" "$oldGenNum"
fi
linkNewGen
'');
home.activation.checkFilesChanged = hm.dag.entryBefore [ "linkGeneration" ]
(let homeDirArg = escapeShellArg homeDirectory;
in ''
function _cmp() {
if [[ -d $1 && -d $2 ]]; then
@@ -261,14 +253,12 @@ in
_cmp ${sourceArg} ${homeDirArg}/${targetArg} \
&& changedFiles[${targetArg}]=0 \
|| changedFiles[${targetArg}]=1
'') (filter (v: v.onChange != "") (attrValues cfg))
+ ''
unset -f _cmp
''
);
'') (filter (v: v.onChange != "") (attrValues cfg)) + ''
unset -f _cmp
'');
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (
concatMapStrings (v: ''
home.activation.onFilesChange = hm.dag.entryAfter [ "linkGeneration" ]
(concatMapStrings (v: ''
if (( ''${changedFiles[${escapeShellArg v.target}]} == 1 )); then
if [[ -v DRY_RUN || -v VERBOSE ]]; then
echo "Running onChange hook for" ${escapeShellArg v.target}
@@ -277,90 +267,83 @@ in
${v.onChange}
fi
fi
'') (filter (v: v.onChange != "") (attrValues cfg))
);
'') (filter (v: v.onChange != "") (attrValues cfg)));
# Symlink directories and files that have the right execute bit.
# Copy files that need their execute bit changed.
home-files = pkgs.runCommandLocal
"home-manager-files"
{
nativeBuildInputs = [ pkgs.xorg.lndir ];
}
(''
mkdir -p $out
home-files = pkgs.runCommandLocal "home-manager-files" {
nativeBuildInputs = [ pkgs.xorg.lndir ];
} (''
mkdir -p $out
# Needed in case /nix is a symbolic link.
realOut="$(realpath -m "$out")"
# Needed in case /nix is a symbolic link.
realOut="$(realpath -m "$out")"
function insertFile() {
local source="$1"
local relTarget="$2"
local executable="$3"
local recursive="$4"
function insertFile() {
local source="$1"
local relTarget="$2"
local executable="$3"
local recursive="$4"
# If the target already exists then we have a collision. Note, this
# should not happen due to the assertion found in the 'files' module.
# We therefore simply log the conflict and otherwise ignore it, mainly
# to make the `files-target-config` test work as expected.
if [[ -e "$realOut/$relTarget" ]]; then
echo "File conflict for file '$relTarget'" >&2
return
fi
# If the target already exists then we have a collision. Note, this
# should not happen due to the assertion found in the 'files' module.
# We therefore simply log the conflict and otherwise ignore it, mainly
# to make the `files-target-config` test work as expected.
if [[ -e "$realOut/$relTarget" ]]; then
echo "File conflict for file '$relTarget'" >&2
return
fi
# Figure out the real absolute path to the target.
local target
target="$(realpath -m "$realOut/$relTarget")"
# Figure out the real absolute path to the target.
local target
target="$(realpath -m "$realOut/$relTarget")"
# Target path must be within $HOME.
if [[ ! $target == $realOut* ]] ; then
echo "Error installing file '$relTarget' outside \$HOME" >&2
exit 1
fi
# Target path must be within $HOME.
if [[ ! $target == $realOut* ]] ; then
echo "Error installing file '$relTarget' outside \$HOME" >&2
exit 1
fi
mkdir -p "$(dirname "$target")"
if [[ -d $source ]]; then
if [[ $recursive ]]; then
mkdir -p "$target"
lndir -silent "$source" "$target"
else
ln -s "$source" "$target"
fi
mkdir -p "$(dirname "$target")"
if [[ -d $source ]]; then
if [[ $recursive ]]; then
mkdir -p "$target"
lndir -silent "$source" "$target"
else
[[ -x $source ]] && isExecutable=1 || isExecutable=""
ln -s "$source" "$target"
fi
else
[[ -x $source ]] && isExecutable=1 || isExecutable=""
# Link the file into the home file directory if possible,
# i.e., if the executable bit of the source is the same we
# expect for the target. Otherwise, we copy the file and
# set the executable bit to the expected value.
if [[ $executable == inherit || $isExecutable == $executable ]]; then
ln -s "$source" "$target"
# Link the file into the home file directory if possible,
# i.e., if the executable bit of the source is the same we
# expect for the target. Otherwise, we copy the file and
# set the executable bit to the expected value.
if [[ $executable == inherit || $isExecutable == $executable ]]; then
ln -s "$source" "$target"
else
cp "$source" "$target"
if [[ $executable == inherit ]]; then
# Don't change file mode if it should match the source.
:
elif [[ $executable ]]; then
chmod +x "$target"
else
cp "$source" "$target"
if [[ $executable == inherit ]]; then
# Don't change file mode if it should match the source.
:
elif [[ $executable ]]; then
chmod +x "$target"
else
chmod -x "$target"
fi
chmod -x "$target"
fi
fi
}
'' + concatStrings (
mapAttrsToList (n: v: ''
insertFile ${
escapeShellArgs [
(sourceStorePath v)
v.target
(if v.executable == null
then "inherit"
else toString v.executable)
(toString v.recursive)
]}
'') cfg
));
fi
}
'' + concatStrings (mapAttrsToList (n: v: ''
insertFile ${
escapeShellArgs [
(sourceStorePath v)
v.target
(if v.executable == null then "inherit" else toString v.executable)
(toString v.recursive)
]
}
'') cfg));
};
}

View File

@@ -113,10 +113,10 @@ let
options = {
layout = mkOption {
type = with types; nullOr str;
default =
if versionAtLeast config.home.stateVersion "19.09"
then null
else "us";
default = if versionAtLeast config.home.stateVersion "19.09" then
null
else
"us";
defaultText = literalExpression "null";
description = ''
Keyboard layout. If `null`, then the system
@@ -138,8 +138,8 @@ let
options = mkOption {
type = types.listOf types.str;
default = [];
example = ["grp:caps_toggle" "grp_led:scroll"];
default = [ ];
example = [ "grp:caps_toggle" "grp_led:scroll" ];
description = ''
X keyboard options; layout switching goes here.
'';
@@ -148,9 +148,7 @@ let
variant = mkOption {
type = with types; nullOr str;
default =
if versionAtLeast config.home.stateVersion "19.09"
then null
else "";
if versionAtLeast config.home.stateVersion "19.09" then null else "";
defaultText = literalExpression "null";
example = "colemak";
description = ''
@@ -164,9 +162,7 @@ let
};
};
in
{
in {
meta.maintainers = [ maintainers.rycee ];
imports = [
@@ -217,7 +213,7 @@ in
home.language = mkOption {
type = languageSubModule;
default = {};
default = { };
description = "Language configuration.";
};
@@ -255,9 +251,12 @@ in
};
home.sessionVariables = mkOption {
default = {};
default = { };
type = with types; lazyAttrsOf (oneOf [ str path int float ]);
example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; };
example = {
EDITOR = "emacs";
GS_OPTIONS = "-sPAPERSIZE=a4";
};
description = ''
Environment variables to always set at login.
@@ -280,8 +279,9 @@ in
};
```
may not work as expected. If you need to reference another
session variable, then do so inside Nix instead. The above
example then becomes
session variable (even if it is declared by using other options
like [](#opt-xdg.configHome)), then do so inside Nix instead.
The above example then becomes
```nix
home.sessionVariables = {
FOO = "Hello";
@@ -331,13 +331,13 @@ in
home.packages = mkOption {
type = types.listOf types.package;
default = [];
default = [ ];
description = "The set of packages to appear in the user environment.";
};
home.extraOutputsToInstall = mkOption {
type = types.listOf types.str;
default = [];
default = [ ];
example = [ "doc" "info" "devdoc" ];
description = ''
List of additional package outputs of the packages
@@ -370,7 +370,7 @@ in
home.activation = mkOption {
type = hm.types.dagOf types.str;
default = {};
default = { };
example = literalExpression ''
{
myActivationAction = lib.hm.dag.entryAfter ["writeBoundary"] '''
@@ -493,77 +493,60 @@ in
}
];
warnings =
let
hmRelease = config.home.version.release;
nixpkgsRelease = lib.trivial.release;
releaseMismatch =
config.home.enableNixpkgsReleaseCheck
&& hmRelease != nixpkgsRelease;
in
optional releaseMismatch ''
You are using
warnings = let
hmRelease = config.home.version.release;
nixpkgsRelease = lib.trivial.release;
releaseMismatch = config.home.enableNixpkgsReleaseCheck && hmRelease
!= nixpkgsRelease;
in optional releaseMismatch ''
You are using
Home Manager version ${hmRelease} and
Nixpkgs version ${nixpkgsRelease}.
Home Manager version ${hmRelease} and
Nixpkgs version ${nixpkgsRelease}.
Using mismatched versions is likely to cause errors and unexpected
behavior. It is therefore highly recommended to use a release of Home
Manager that corresponds with your chosen release of Nixpkgs.
Using mismatched versions is likely to cause errors and unexpected
behavior. It is therefore highly recommended to use a release of Home
Manager that corresponds with your chosen release of Nixpkgs.
If you insist then you can disable this warning by adding
If you insist then you can disable this warning by adding
home.enableNixpkgsReleaseCheck = false;
home.enableNixpkgsReleaseCheck = false;
to your configuration.
'';
to your configuration.
'';
home.username =
mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "USER"));
home.homeDirectory =
mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "HOME"));
home.username = mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "USER"));
home.homeDirectory = mkIf (versionOlder config.home.stateVersion "20.09")
(mkDefault (builtins.getEnv "HOME"));
home.profileDirectory =
if config.submoduleSupport.enable
&& config.submoduleSupport.externalPackageInstall
then "/etc/profiles/per-user/${cfg.username}"
else if config.nix.enable && (config.nix.settings.use-xdg-base-directories or false)
then "${config.xdg.stateHome}/nix/profile"
else cfg.homeDirectory + "/.nix-profile";
home.profileDirectory = if config.submoduleSupport.enable
&& config.submoduleSupport.externalPackageInstall then
"/etc/profiles/per-user/${cfg.username}"
else if config.nix.enable
&& (config.nix.settings.use-xdg-base-directories or false) then
"${config.xdg.stateHome}/nix/profile"
else
cfg.homeDirectory + "/.nix-profile";
programs.bash.shellAliases = cfg.shellAliases;
programs.zsh.shellAliases = cfg.shellAliases;
programs.fish.shellAliases = cfg.shellAliases;
home.sessionVariables =
let
maybeSet = n: v: optionalAttrs (v != null) { ${n} = v; };
in
(maybeSet "LANG" cfg.language.base)
//
(maybeSet "LC_CTYPE" cfg.language.ctype)
//
(maybeSet "LC_NUMERIC" cfg.language.numeric)
//
(maybeSet "LC_TIME" cfg.language.time)
//
(maybeSet "LC_COLLATE" cfg.language.collate)
//
(maybeSet "LC_MONETARY" cfg.language.monetary)
//
(maybeSet "LC_MESSAGES" cfg.language.messages)
//
(maybeSet "LC_PAPER" cfg.language.paper)
//
(maybeSet "LC_NAME" cfg.language.name)
//
(maybeSet "LC_ADDRESS" cfg.language.address)
//
(maybeSet "LC_TELEPHONE" cfg.language.telephone)
//
(maybeSet "LC_MEASUREMENT" cfg.language.measurement);
let maybeSet = n: v: optionalAttrs (v != null) { ${n} = v; };
in (maybeSet "LANG" cfg.language.base)
// (maybeSet "LC_CTYPE" cfg.language.ctype)
// (maybeSet "LC_NUMERIC" cfg.language.numeric)
// (maybeSet "LC_TIME" cfg.language.time)
// (maybeSet "LC_COLLATE" cfg.language.collate)
// (maybeSet "LC_MONETARY" cfg.language.monetary)
// (maybeSet "LC_MESSAGES" cfg.language.messages)
// (maybeSet "LC_PAPER" cfg.language.paper)
// (maybeSet "LC_NAME" cfg.language.name)
// (maybeSet "LC_ADDRESS" cfg.language.address)
// (maybeSet "LC_TELEPHONE" cfg.language.telephone)
// (maybeSet "LC_MEASUREMENT" cfg.language.measurement);
# Provide a file holding all session variables.
home.sessionVariablesPackage = pkgs.writeTextFile {
@@ -601,148 +584,129 @@ in
# In case the user has moved from a user-install of Home Manager
# to a submodule managed one we attempt to uninstall the
# `home-manager-path` package if it is installed.
home.activation.installPackages = hm.dag.entryAfter ["writeBoundary"] (
if config.submoduleSupport.externalPackageInstall
then
''
nixProfileRemove home-manager-path
''
else
''
function nixReplaceProfile() {
local oldNix="$(command -v nix)"
home.activation.installPackages = hm.dag.entryAfter [ "writeBoundary" ]
(if config.submoduleSupport.externalPackageInstall then ''
nixProfileRemove home-manager-path
'' else ''
function nixReplaceProfile() {
local oldNix="$(command -v nix)"
nixProfileRemove 'home-manager-path'
nixProfileRemove 'home-manager-path'
run $oldNix profile install $1
}
run $oldNix profile install $1
}
if [[ -e ${cfg.profileDirectory}/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="run nix-env -i"
LIST_CMD="nix-env -q"
REMOVE_CMD_SYNTAX='nix-env -e {package name}'
fi
if [[ -e ${cfg.profileDirectory}/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="run nix-env -i"
LIST_CMD="nix-env -q"
REMOVE_CMD_SYNTAX='nix-env -e {package name}'
fi
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 -f nixReplaceProfile
unset INSTALL_CMD INSTALL_CMD_ACTUAL LIST_CMD REMOVE_CMD_SYNTAX
''
);
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 -f nixReplaceProfile
unset INSTALL_CMD INSTALL_CMD_ACTUAL LIST_CMD REMOVE_CMD_SYNTAX
'');
# Text containing Bash commands that will initialize the Home Manager Bash
# library. Most importantly, this will prepare for using translated strings
# in the `hm-modules` text domain.
lib.bash.initHomeManagerLib =
let
domainDir = pkgs.runCommand "hm-modules-messages" {
nativeBuildInputs = [ pkgs.buildPackages.gettext ];
} ''
for path in ${./po}/*.po; do
lang="''${path##*/}"
lang="''${lang%%.*}"
mkdir -p "$out/$lang/LC_MESSAGES"
msgfmt -o "$out/$lang/LC_MESSAGES/hm-modules.mo" "$path"
done
'';
in
''
export TEXTDOMAIN=hm-modules
export TEXTDOMAINDIR=${domainDir}
source ${../lib/bash/home-manager.sh}
'';
lib.bash.initHomeManagerLib = let
domainDir = pkgs.runCommand "hm-modules-messages" {
nativeBuildInputs = [ pkgs.buildPackages.gettext ];
} ''
for path in ${./po}/*.po; do
lang="''${path##*/}"
lang="''${lang%%.*}"
mkdir -p "$out/$lang/LC_MESSAGES"
msgfmt -o "$out/$lang/LC_MESSAGES/hm-modules.mo" "$path"
done
'';
in ''
export TEXTDOMAIN=hm-modules
export TEXTDOMAINDIR=${domainDir}
source ${../lib/bash/home-manager.sh}
'';
home.activationPackage =
let
mkCmd = res: ''
_iNote "Activating %s" "${res.name}"
${res.data}
'';
sortedCommands = hm.dag.topoSort cfg.activation;
activationCmds =
if sortedCommands ? result then
concatStringsSep "\n" (map mkCmd sortedCommands.result)
else
abort ("Dependency cycle in activation script: "
+ builtins.toJSON sortedCommands);
home.activationPackage = let
mkCmd = res: ''
_iNote "Activating %s" "${res.name}"
${res.data}
'';
sortedCommands = hm.dag.topoSort cfg.activation;
activationCmds = if sortedCommands ? result then
concatStringsSep "\n" (map mkCmd sortedCommands.result)
else
abort ("Dependency cycle in activation script: "
+ builtins.toJSON sortedCommands);
# Programs that always should be available on the activation
# script's PATH.
activationBinPaths = lib.makeBinPath (
with pkgs; [
bash
coreutils
diffutils # For `cmp` and `diff`.
findutils
gettext
gnugrep
gnused
jq
ncurses # For `tput`.
]
++ config.home.extraActivationPath
)
+ (
# Programs that always should be available on the activation
# script's PATH.
activationBinPaths = lib.makeBinPath (with pkgs;
[
bash
coreutils
diffutils # For `cmp` and `diff`.
findutils
gettext
gnugrep
gnused
jq
ncurses # For `tput`.
] ++ 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)))"
)
":$(${pkgs.coreutils}/bin/dirname $(${pkgs.coreutils}/bin/readlink -m $(type -p nix-env)))")
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
activationScript = pkgs.writeShellScript "activation-script" ''
set -eu
set -o pipefail
activationScript = pkgs.writeShellScript "activation-script" ''
set -eu
set -o pipefail
cd $HOME
cd $HOME
export PATH="${activationBinPaths}"
${config.lib.bash.initHomeManagerLib}
export PATH="${activationBinPaths}"
${config.lib.bash.initHomeManagerLib}
${builtins.readFile ./lib-bash/activation-init.sh}
${builtins.readFile ./lib-bash/activation-init.sh}
if [[ ! -v SKIP_SANITY_CHECKS ]]; then
checkUsername ${escapeShellArg config.home.username}
checkHomeDirectory ${escapeShellArg config.home.homeDirectory}
fi
if [[ ! -v SKIP_SANITY_CHECKS ]]; then
checkUsername ${escapeShellArg config.home.username}
checkHomeDirectory ${escapeShellArg config.home.homeDirectory}
fi
${activationCmds}
'';
in
pkgs.runCommand
"home-manager-generation"
{
preferLocalBuild = true;
}
''
mkdir -p $out
${activationCmds}
'';
in pkgs.runCommand "home-manager-generation" { preferLocalBuild = true; } ''
mkdir -p $out
echo "${config.home.version.full}" > $out/hm-version
echo "${config.home.version.full}" > $out/hm-version
cp ${activationScript} $out/activate
cp ${activationScript} $out/activate
mkdir $out/bin
ln -s $out/activate $out/bin/home-manager-generation
mkdir $out/bin
ln -s $out/activate $out/bin/home-manager-generation
substituteInPlace $out/activate \
--subst-var-by GENERATION_DIR $out
substituteInPlace $out/activate \
--subst-var-by GENERATION_DIR $out
ln -s ${config.home-files} $out/home-files
ln -s ${cfg.path} $out/home-path
ln -s ${config.home-files} $out/home-files
ln -s ${cfg.path} $out/home-path
${cfg.extraBuilderCommands}
'';
${cfg.extraBuilderCommands}
'';
home.path = pkgs.buildEnv {
name = "home-manager-path";

View File

@@ -14,4 +14,5 @@ rec {
shell = import ./shell.nix { inherit lib; };
zsh = import ./zsh.nix { inherit lib; };
nushell = import ./nushell.nix { inherit lib; };
}

View File

@@ -99,7 +99,6 @@ in {
force = mkOption {
type = types.bool;
default = false;
visible = false;
description = ''
Whether the target path should be unconditionally replaced
by the managed file source. Warning, this will silently

View File

@@ -7,6 +7,12 @@
# [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1
{
aabccd021 = {
name = "Muhamad Abdurahman";
email = "aabccd021@gmail.com";
github = "aabccd021";
githubId = 33031950;
};
abayomi185 = {
name = "Yomi";
email = "yomi+nix@yomitosh.com";
@@ -37,6 +43,12 @@
github = "Avimitin";
githubId = 30021675;
};
bamhm182 = {
name = "bamhm182";
email = "bamhm182@gmail.com";
github = "bamhm182";
githubId = 920269;
};
blmhemu = {
name = "blmhemu";
email = "19410501+blmhemu@users.noreply.github.com";
@@ -49,6 +61,12 @@
github = "bertof";
githubId = 9915675;
};
bricked = {
name = "Bricked";
email = "hello@bricked.dev";
github = "brckd";
githubId = 92804487;
};
CarlosLoboxyz = {
name = "Carlos Lobo";
email = "86011416+CarlosLoboxyz@users.noreply.github.com";
@@ -215,6 +233,12 @@
github = "kubukoz";
githubId = 894884;
};
lheckemann = {
name = "Linus Heckemann";
email = "git@sphalerite.org";
github = "lheckemann";
githubId = 341954;
};
lilyinstarlight = {
email = "lily@lily.flowers";
matrix = "@lily:lily.flowers";
@@ -222,12 +246,6 @@
githubId = 298109;
name = "Lily Foster";
};
lheckemann = {
name = "Linus Heckemann";
email = "git@sphalerite.org";
github = "lheckemann";
githubId = 341954;
};
loicreynier = {
name = "Loïc Reynier";
email = "loic@loireynier.fr";
@@ -270,6 +288,22 @@
github = "nilp0inter";
githubId = 1224006;
};
NitroSniper = {
name = "Nitro Sniper";
email = "nitro@ortin.dev";
github = "NitroSniper";
githubId = 44097331;
};
n-hass = {
name = "Nicholas Hassan";
email = "nick@hassan.host";
github = "n-hass";
githubId = 72363381;
keys = [{
longkeyid = "rsa4096/0xFC95AB946A781EE7";
fingerprint = "FDEE 6116 DBA7 8840 7323 4466 A371 5973 2728 A6A6";
}];
};
seylerius = {
email = "sable@seyleri.us";
name = "Sable Seyler";
@@ -331,6 +365,11 @@
githubId = 12465195;
name = "Bruno BELANYI";
};
libewa = {
email = "libewa-git@icloud.com";
github = "libewa";
githubId = 67926131;
};
malvo = {
email = "malte@malvo.org";
github = "malte-v";
@@ -409,12 +448,6 @@
github = "nurelin";
githubId = 5276274;
};
omernaveedxyz = {
name = "Omer Naveed";
email = "omer@omernaveed.dev";
github = "omernaveedxyz";
githubId = 112912585;
};
otavio = {
email = "otavio.salvador@ossystems.com.br";
github = "otavio";
@@ -581,4 +614,18 @@
github = "zorrobert";
githubId = 118135271;
};
joygnu = {
name = "joygnu";
email = "contact@joygnu.org";
github = "joygnu";
githubId = 152063003;
};
callumio = {
name = "Callum Leslie";
email = "git+nix@cleslie.uk";
github = "callumio";
githubId = 16057677;
keys =
[{ fingerprint = "BC82 4BB5 1656 D144 285E A0EC D382 C4AF EECE AA90"; }];
};
}

65
modules/lib/nushell.nix Normal file
View File

@@ -0,0 +1,65 @@
{ lib }: rec {
mkNushellInline = expr: lib.setType "nushell-inline" { inherit expr; };
toNushell = { indent ? "", multiline ? true, asBindings ? false }@args:
v:
let
innerIndent = "${indent} ";
introSpace = if multiline then ''
${innerIndent}'' else
" ";
outroSpace = if multiline then ''
${indent}'' else
" ";
innerArgs = args // {
indent = if asBindings then indent else innerIndent;
asBindings = false;
};
concatItems = lib.concatStringsSep introSpace;
isNushellInline = lib.isType "nushell-inline";
generatedBindings = assert lib.assertMsg (badVarNames == [ ])
"Bad Nushell variable names: ${
lib.generators.toPretty { } badVarNames
}";
lib.concatStrings (lib.mapAttrsToList (key: value: ''
${indent}let ${key} = ${toNushell innerArgs value}
'') v);
isBadVarName = name:
# Extracted from https://github.com/nushell/nushell/blob/ebc7b80c23f777f70c5053cca428226b3fe00d30/crates/nu-parser/src/parser.rs#L33
# Variables with numeric or even empty names are allowed. The only requisite is not containing any of the following characters
let invalidVariableCharacters = ".[({+-*^/=!<>&|";
in lib.match "^[$]?[^${lib.escapeRegex invalidVariableCharacters}]+$"
name == null;
badVarNames = lib.filter isBadVarName (builtins.attrNames v);
in if asBindings then
generatedBindings
else if v == null then
"null"
else if lib.isInt v || lib.isFloat v || lib.isString v || lib.isBool v then
lib.strings.toJSON v
else if lib.isList v then
(if v == [ ] then
"[]"
else
"[${introSpace}${
concatItems (map (value: "${toNushell innerArgs value}") v)
}${outroSpace}]")
else if lib.isAttrs v then
(if isNushellInline v then
"(${v.expr})"
else if v == { } then
"{}"
else if lib.isDerivation v then
toString v
else
"{${introSpace}${
concatItems (lib.mapAttrsToList (key: value:
"${lib.strings.toJSON key}: ${toNushell innerArgs value}") v)
}${outroSpace}}")
else
abort "nushell.toNushell: type ${lib.typeOf v} is unsupported";
}

View File

@@ -107,4 +107,27 @@ in rec {
mergeDefaultOption loc defs;
};
nushellValue = let
valueType = types.nullOr (types.oneOf [
(lib.mkOptionType {
name = "nushell";
description = "Nushell inline value";
descriptionClass = "name";
check = lib.isType "nushell-inline";
})
types.bool
types.int
types.float
types.str
types.path
(types.attrsOf valueType // {
description = "attribute set of Nushell values";
descriptionClass = "name";
})
(types.listOf valueType // {
description = "list of Nushell values";
descriptionClass = "name";
})
]);
in valueType;
}

View File

@@ -53,7 +53,7 @@ let
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExpression "pkgs.gnome.adwaita-icon-theme";
example = literalExpression "pkgs.adwaita-icon-theme";
description = ''
Package providing the icon theme. This package will be installed
to your profile. If `null` then the theme
@@ -221,10 +221,9 @@ in {
config = mkIf cfg.enable (let
gtkIni = optionalAttrs (cfg.font != null) {
gtk-font-name = let
fontSize =
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
in "${cfg.font.name}" + fontSize;
gtk-font-name =
let fontSize = if cfg.font.size != null then cfg.font.size else 10;
in "${cfg.font.name} ${toString fontSize}";
} // optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; }
// optionalAttrs (cfg.iconTheme != null) {
gtk-icon-theme-name = cfg.iconTheme.name;
@@ -245,10 +244,9 @@ in {
'' + cfg4.extraCss;
dconfIni = optionalAttrs (cfg.font != null) {
font-name = let
fontSize =
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
in "${cfg.font.name}" + fontSize;
font-name =
let fontSize = if cfg.font.size != null then cfg.font.size else 10;
in "${cfg.font.name} ${toString fontSize}";
} // optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
// optionalAttrs (cfg.iconTheme != null) {
icon-theme = cfg.iconTheme.name;

View File

@@ -1,9 +1,6 @@
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.news;
hostPlatform = pkgs.stdenv.hostPlatform;
@@ -44,7 +41,6 @@ let
config = { id = mkDefault (builtins.hashString "sha256" config.message); };
});
in {
meta.maintainers = [ maintainers.rycee ];
@@ -1656,6 +1652,253 @@ in {
See https://codeberg.org/dnkl/yambar for more.
'';
}
{
time = "2024-05-25T14:36:03+00:00";
message = ''
Multiple new options are available:
- 'nix.nixPath'
- 'nix.keepOldNixPath'
- 'nix.channels'
'';
}
{
time = "2024-06-22T05:49:48+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.blanket'.
Blanket is a program you can use to improve your focus and increase
your productivity by listening to different sounds. See
https://github.com/rafaelmardojai/blanket for more.
'';
}
{
time = "2024-06-26T07:07:17+00:00";
condition = with config.programs.yazi;
enable && (enableBashIntegration || enableZshIntegration
|| enableFishIntegration || enableNushellIntegration);
message = ''
Yazi's shell integration wrappers have been renamed from 'ya' to 'yy'.
A new option `programs.yazi.shellWrapperName` is also available that
allows you to override this name.
'';
}
{
time = "2024-06-28T14:18:16+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.glance'.
Glance is a self-hosted dashboard that puts all your feeds in
one place. See https://github.com/glanceapp/glance for more.
'';
}
{
time = "2024-09-13T08:58:17+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.trayscale'.
An unofficial GUI wrapper around the Tailscale CLI client.
'';
}
{
time = "2024-09-13T09:50:49+00:00";
message = ''
A new module is available: 'programs.neovide'.
Neovide is a simple, no-nonsense, cross-platform graphical user
interface for Neovim (an aggressively refactored and updated Vim
editor).
'';
}
{
time = "2024-09-20T07:00:11+00:00";
condition = config.programs.kitty.theme != null;
message = ''
The option 'programs.kitty.theme' has been deprecated, please use
'programs.kitty.themeFile' instead.
The 'programs.kitty.themeFile' option expects the file name of a
theme from `kitty-themes`, without the `.conf` suffix. See
<https://github.com/kovidgoyal/kitty-themes/tree/master/themes> for a
list of themes.
'';
}
{
time = "2024-09-20T07:48:08+00:00";
condition = hostPlatform.isLinux && config.services.swayidle.enable;
message = ''
The swayidle module behavior has changed. Specifically, swayidle was
previously always called with a `-w` flag. This flag is now moved to
the default `services.swayidle.extraArgs` value to make it optional.
Your configuration may break if you already set this option and also
rely on the flag being automatically added. To resolve this, please
add `-w` to your assignment of `services.swayidle.extraArgs`.
'';
}
{
time = "2024-10-09T06:16:23+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.snixembed'.
snixembed proxies StatusNotifierItems as XEmbedded systemtray-spec
icons. This is useful for some tools in some environments, e.g., Safe
Eyes in i3, lxde or mate.
'';
}
{
time = "2024-10-11T08:23:19+00:00";
message = ''
A new module is available: 'programs.vifm'.
Vifm is a curses based Vim-like file manager extended with some useful
ideas from mutt.
'';
}
{
time = "2024-10-17T13:07:55+00:00";
message = ''
A new module is available: 'programs.zed-editor'.
Zed is a fast text editor for macOS and Linux.
See https://zed.dev for more.
'';
}
{
time = "2024-10-18T14:01:07+00:00";
message = ''
A new module is available: 'programs.cmus'.
cmus is a small, fast and powerful console music player.
'';
}
{
time = "2024-10-20T07:53:54+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'programs.nh'.
nh is yet another Nix CLI helper. Adding functionality on top of the
existing solutions, like nixos-rebuild, home-manager cli or nix
itself.
'';
}
{
time = "2024-10-25T08:18:30+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'nixGL'.
NixGL solve the "OpenGL" problem with nix. The 'nixGL' module provides
integration of NixGL into Home Manager. See the "GPU on non-NixOS
systems" section in the Home Manager manual for more.
'';
}
{
time = "2024-11-01T19:44:59+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.podman'.
Podman is a daemonless container engine that lets you manage
containers, pods, and images.
This Home Manager module allows you to define containers that will run
as systemd services.
'';
}
{
time = "2024-12-01T19:17:40+00:00";
message = ''
A new module is available: 'programs.nix-your-shell'.
nix-your-shell is a wrapper for `nix develop` or `nix-shell` to retain
the same shell inside the new environment.
'';
}
{
time = "2024-12-01T19:34:04+00:00";
message = ''
A new module is available: 'programs.kubecolor'.
Kubecolor is a kubectl wrapper used to add colors to your kubectl
output.
'';
}
{
time = "2024-12-04T20:00:00+00:00";
condition = let
sCfg = config.programs.starship;
fCfg = config.programs.fish;
in sCfg.enable && sCfg.enableFishIntegration && fCfg.enable;
message = ''
A new option 'programs.starship.enableInteractive' is available for
the Fish shell that only enables starship if the shell is interactive.
Some plugins require this to be set to 'false' to function correctly.
'';
}
{
time = "2024-12-08T17:22:13+00:00";
condition = let
usingMbsync = any (a: a.mbsync.enable)
(attrValues config.accounts.email.accounts);
in usingMbsync;
message = ''
isync/mbsync 1.5.0 has changed several things.
isync gained support for using $XDG_CONFIG_HOME, and now places
its config file in '$XDG_CONFIG_HOME/isyncrc'.
isync changed the configuration options SSLType and SSLVersion to
TLSType and TLSVersion respectively.
All instances of
'accounts.email.accounts.<account-name>.mbsync.extraConfig.account'
that use 'SSLType' or 'SSLVersion' should be replaced with 'TLSType'
or 'TLSVersion', respectively.
TLSType options are unchanged.
TLSVersions has a new syntax, requiring a change to the Nix syntax.
Old Syntax: SSLVersions = [ "TLSv1.3" "TLSv1.2" ];
New Syntax: TLSVersions = [ "+1.3" "+1.2" "-1.1" ];
NOTE: The minus symbol means to NOT use that particular TLS version.
'';
}
{
time = "2024-12-10T22:20:10+00:00";
condition = config.programs.nushell.enable;
message = ''
The module 'programs.nushell' can now manage the Nushell plugin
registry with the option 'programs.nushell.plugins'.
'';
}
];
};
}

View File

@@ -1,15 +1,40 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (lib)
boolToString concatStringsSep escape floatToString getVersion isBool
isConvertibleWithToString isDerivation isFloat isInt isList isString
literalExpression maintainers mapAttrsToList mkDefault mkEnableOption mkIf
mkMerge mkOption optionalString toPretty types versionAtLeast;
cfg = config.nix;
nixPackage = cfg.package;
isNixAtLeast = versionAtLeast (getVersion nixPackage);
nixPath = concatStringsSep ":" cfg.nixPath;
useXdg = config.nix.enable
&& (config.nix.settings.use-xdg-base-directories or false);
defexprDir = if useXdg then
"${config.xdg.stateHome}/nix/defexpr"
else
"${config.home.homeDirectory}/.nix-defexpr";
# The deploy path for declarative channels. The directory name is prefixed
# with a number to make it easier for files in defexprDir to control the order
# they'll be read relative to each other.
channelPath = "${defexprDir}/50-home-manager";
channelsDrv = let
mkEntry = name: drv: {
inherit name;
path = toString drv;
};
in pkgs.linkFarm "channels" (lib.mapAttrsToList mkEntry cfg.channels);
nixConf = assert isNixAtLeast "2.2";
let
@@ -102,6 +127,47 @@ in {
'';
};
nixPath = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"$HOME/.nix-defexpr/channels"
"darwin-config=$HOME/.config/nixpkgs/darwin-configuration.nix"
];
description = ''
Adds new directories to the Nix expression search path.
Used by Nix when looking up paths in angular brackets
(e.g. `<nixpkgs>`).
'';
};
keepOldNixPath = mkOption {
type = types.bool;
default = true;
example = false;
description = ''
Whether {option}`nix.nixPath` should keep the previously set values in
{env}`NIX_PATH`.
'';
};
channels = lib.mkOption {
type = with lib.types; attrsOf package;
default = { };
example = lib.literalExpression "{ inherit nixpkgs; }";
description = ''
A declarative alternative to Nix channels. Whereas with stock channels,
you would register URLs and fetch them into the Nix store with
{manpage}`nix-channel(1)`, this option allows you to register the store
path directly. One particularly useful example is registering flake
inputs as channels.
This option can coexist with stock Nix channels. If the same channel is
defined in both, this option takes precedence.
'';
};
registry = mkOption {
type = types.attrsOf (types.submodule (let
inputAttrs = types.attrsOf
@@ -210,6 +276,19 @@ in {
};
config = mkIf cfg.enable (mkMerge [
(mkIf (cfg.nixPath != [ ] && !cfg.keepOldNixPath) {
home.sessionVariables.NIX_PATH = "${nixPath}";
})
(mkIf (cfg.nixPath != [ ] && cfg.keepOldNixPath) {
home.sessionVariables.NIX_PATH = "${nixPath}\${NIX_PATH:+:$NIX_PATH}";
})
(lib.mkIf (cfg.channels != { }) {
nix.nixPath = [ channelPath ];
home.file."${channelPath}".source = channelsDrv;
})
(mkIf (cfg.registry != { }) {
xdg.configFile."nix/registry.json".source =
jsonFormat.generate "registry.json" {

296
modules/misc/nixgl.nix Normal file
View File

@@ -0,0 +1,296 @@
{ config, lib, pkgs, ... }:
let
cfg = config.nixGL;
wrapperListMarkdown = with builtins;
foldl' (list: name:
list + ''
- ${name}
'') "" (attrNames config.lib.nixGL.wrappers);
in {
meta.maintainers = [ lib.maintainers.smona ];
options.nixGL = {
packages = lib.mkOption {
type = with lib.types; nullOr attrs;
default = null;
example = lib.literalExpression "inputs.nixGL.packages";
description = ''
The nixGL package set containing GPU library wrappers. This can be used
to provide OpenGL and Vulkan access to applications on non-NixOS systems
by using `(config.lib.nixGL.wrap <package>)` for the default wrapper, or
`(config.lib.nixGL.wrappers.<wrapper> <package>)` for any available
wrapper.
The wrapper functions are always available. If this option is empty (the
default), they are a no-op. This is useful on NixOS where the wrappers
are unnecessary.
Note that using any Nvidia wrapper requires building the configuration
with the `--impure` option.
'';
};
defaultWrapper = lib.mkOption {
type = lib.types.enum (builtins.attrNames config.lib.nixGL.wrappers);
default = "mesa";
description = ''
The package wrapper function available for use as `(config.lib.nixGL.wrap
<package>)`. Intended to start programs on the main GPU.
Wrapper functions can be found under `config.lib.nixGL.wrappers`. They
can be used directly, however, setting this option provides a convenient
shorthand.
The following wrappers are available:
${wrapperListMarkdown}
'';
};
offloadWrapper = lib.mkOption {
type = lib.types.enum (builtins.attrNames config.lib.nixGL.wrappers);
default = "mesaPrime";
description = ''
The package wrapper function available for use as
`(config.lib.nixGL.wrapOffload <package>)`. Intended to start programs
on the secondary GPU.
Wrapper functions can be found under `config.lib.nixGL.wrappers`. They
can be used directly, however, setting this option provides a convenient
shorthand.
The following wrappers are available:
${wrapperListMarkdown}
'';
};
prime.card = lib.mkOption {
type = lib.types.str;
default = "1";
example = "pci-0000_06_00_0";
description = ''
Selects the non-default graphics card used for PRIME render offloading.
The value can be:
- a number, selecting the n-th non-default GPU;
- a PCI bus id in the form `pci-XXX_YY_ZZ_U`;
- a PCI id in the form `vendor_id:device_id`
For more information, consult the Mesa documentation on the `DRI_PRIME`
environment variable.
'';
};
prime.nvidiaProvider = lib.mkOption {
type = with lib.types; nullOr str;
default = null;
example = "NVIDIA-G0";
description = ''
If this option is set, it overrides the offload provider for Nvidia
PRIME offloading. Consult the proprietary Nvidia driver documentation
on the `__NV_PRIME_RENDER_OFFLOAD_PROVIDER` environment variable.
'';
};
prime.installScript = lib.mkOption {
type = with lib.types; nullOr (enum [ "mesa" "nvidia" ]);
default = null;
example = "mesa";
description = ''
If this option is set, the wrapper script `prime-offload` is installed
into the environment. It allows starting programs on the secondary GPU
selected by the `nixGL.prime.card` option. This makes sense when the
program is not already using one of nixGL PRIME wrappers, or for
programs not installed from Nixpkgs.
This option can be set to either "mesa" or "nvidia", making the script
use one or the other graphics library.
'';
};
installScripts = lib.mkOption {
type = with lib.types;
nullOr (listOf (enum (builtins.attrNames config.lib.nixGL.wrappers)));
default = null;
example = [ "mesa" "mesaPrime" ];
description = ''
For each wrapper `wrp` named in the provided list, a wrapper script
named `nixGLWrp` is installed into the environment. These scripts are
useful for running programs not installed via Home Manager.
The following wrappers are available:
${wrapperListMarkdown}
'';
};
vulkan.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = ''
Whether to enable Vulkan in nixGL wrappers.
This is disabled by default bacause Vulkan brings in several libraries
that can cause symbol version conflicts in wrapped programs. Your
mileage may vary.
'';
};
};
config = let
findWrapperPackage = packageAttr:
# NixGL has wrapper packages in different places depending on how you
# access it. We want HM configuration to be the same, regardless of how
# NixGL is imported.
#
# First, let's see if we have a flake.
if builtins.hasAttr pkgs.system cfg.packages then
cfg.packages.${pkgs.system}.${packageAttr}
else
# Next, let's see if we have a channel.
if builtins.hasAttr packageAttr cfg.packages then
cfg.packages.${packageAttr}
else
# Lastly, with channels, some wrappers are grouped under "auto".
if builtins.hasAttr "auto" cfg.packages then
cfg.packages.auto.${packageAttr}
else
throw "Incompatible NixGL package layout";
getWrapperExe = vendor:
let
glPackage = findWrapperPackage "nixGL${vendor}";
glExe = lib.getExe glPackage;
vulkanPackage = findWrapperPackage "nixVulkan${vendor}";
vulkanExe = if cfg.vulkan.enable then lib.getExe vulkanPackage else "";
in "${glExe} ${vulkanExe}";
mesaOffloadEnv = { "DRI_PRIME" = "${cfg.prime.card}"; };
nvOffloadEnv = {
"DRI_PRIME" = "${cfg.prime.card}";
"__NV_PRIME_RENDER_OFFLOAD" = "1";
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
"__VK_LAYER_NV_optimus" = "NVIDIA_only";
} // (let provider = cfg.prime.nvidiaProvider;
in if !isNull provider then {
"__NV_PRIME_RENDER_OFFLOAD_PROVIDER" = "${provider}";
} else
{ });
makePackageWrapper = vendor: environment: pkg:
if builtins.isNull cfg.packages then
pkg
else
# Wrap the package's binaries with nixGL, while preserving the rest of
# the outputs and derivation attributes.
(pkg.overrideAttrs (old: {
name = "nixGL-${pkg.name}";
# Make sure this is false for the wrapper derivation, so nix doesn't expect
# a new debug output to be produced. We won't be producing any debug info
# for the original package.
separateDebugInfo = false;
nativeBuildInputs = old.nativeBuildInputs or [ ]
++ [ pkgs.makeWrapper ];
buildCommand = let
# We need an intermediate wrapper package because makeWrapper
# requires a single executable as the wrapper.
combinedWrapperPkg =
pkgs.writeShellScriptBin "nixGLCombinedWrapper-${vendor}" ''
exec ${getWrapperExe vendor} "$@"
'';
in ''
set -eo pipefail
${ # Heavily inspired by https://stackoverflow.com/a/68523368/6259505
lib.concatStringsSep "\n" (map (outputName: ''
echo "Copying output ${outputName}"
set -x
cp -rs --no-preserve=mode "${
pkg.${outputName}
}" "''$${outputName}"
set +x
'') (old.outputs or [ "out" ]))}
rm -rf $out/bin/*
shopt -s nullglob # Prevent loop from running if no files
for file in ${pkg.out}/bin/*; do
local prog="$(basename "$file")"
makeWrapper \
"${lib.getExe combinedWrapperPkg}" \
"$out/bin/$prog" \
--argv0 "$prog" \
--add-flags "$file" \
${
lib.concatStringsSep " " (lib.attrsets.mapAttrsToList
(var: val: "--set '${var}' '${val}'") environment)
}
done
# If .desktop files refer to the old package, replace the references
for dsk in "$out/share/applications"/*.desktop ; do
if ! grep -q "${pkg.out}" "$dsk"; then
continue
fi
src="$(readlink "$dsk")"
rm "$dsk"
sed "s|${pkg.out}|$out|g" "$src" > "$dsk"
done
shopt -u nullglob # Revert nullglob back to its normal default state
'';
}));
wrappers = {
mesa = makePackageWrapper "Intel" { };
mesaPrime = makePackageWrapper "Intel" mesaOffloadEnv;
nvidia = makePackageWrapper "Nvidia" { };
nvidiaPrime = makePackageWrapper "Nvidia" nvOffloadEnv;
};
in {
lib.nixGL.wrap = wrappers.${cfg.defaultWrapper};
lib.nixGL.wrapOffload = wrappers.${cfg.offloadWrapper};
lib.nixGL.wrappers = wrappers;
home.packages = let
wantsPrimeWrapper = (!isNull cfg.prime.installScript);
wantsWrapper = wrapper:
(!isNull cfg.packages) && (!isNull cfg.installScripts)
&& (builtins.elem wrapper cfg.installScripts);
envVarsAsScript = environment:
lib.concatStringsSep "\n"
(lib.attrsets.mapAttrsToList (var: val: "export ${var}=${val}")
environment);
in [
(lib.mkIf wantsPrimeWrapper (pkgs.writeShellScriptBin "prime-offload" ''
${if cfg.prime.installScript == "mesa" then
(envVarsAsScript mesaOffloadEnv)
else
(envVarsAsScript nvOffloadEnv)}
exec "$@"
''))
(lib.mkIf (wantsWrapper "mesa") (pkgs.writeShellScriptBin "nixGLMesa" ''
exec ${getWrapperExe "Intel"} "$@"
''))
(lib.mkIf (wantsWrapper "mesaPrime")
(pkgs.writeShellScriptBin "nixGLMesaPrime" ''
${envVarsAsScript mesaOffloadEnv}
exec ${getWrapperExe "Intel"} "$@"
''))
(lib.mkIf (wantsWrapper "nvidia")
(pkgs.writeShellScriptBin "nixGLNvidia" ''
exec ${getWrapperExe "Nvidia"} "$@"
''))
(lib.mkIf (wantsWrapper "nvidia")
(pkgs.writeShellScriptBin "nixGLNvidiaPrime" ''
${envVarsAsScript nvOffloadEnv}
exec ${getWrapperExe "Nvidia"} "$@"
''))
];
};
}

View File

@@ -8,7 +8,11 @@ let
gnome = [ qgnomeplatform qgnomeplatform-qt6 ];
adwaita = [ qadwaitadecorations qadwaitadecorations-qt6 ];
gtk = [ libsForQt5.qtstyleplugins qt6Packages.qt6gtk2 ];
kde = [ libsForQt5.plasma-integration libsForQt5.systemsettings ];
kde = [
libsForQt5.kio
libsForQt5.plasma-integration
libsForQt5.systemsettings
];
lxqt = [ lxqt.lxqt-qtplugin lxqt.lxqt-config ];
qtct = [ libsForQt5.qt5ct qt6Packages.qt6ct ];
};

View File

@@ -17,13 +17,13 @@ in {
powermanagementprofilesrc.AC.HandleButtonEvents.lidAction = 32;
};
description = ''
A set of values to be modified by {command}`kwriteconfig5`.
A set of values to be modified by {command}`kwriteconfig6`.
The example value would cause the following command to run in the
activation script:
``` shell
kwriteconfig5 --file $XDG_CONFIG_HOME/powermanagementprofilesrc \
kwriteconfig6 --file $XDG_CONFIG_HOME/powermanagementprofilesrc \
--group AC \
--group HandleButtonEvents \
--group lidAction \
@@ -53,7 +53,7 @@ in {
lib.mapAttrsToList
(group: value: toLine file (path ++ [ group ]) value) value
else
"run test -f '${configHome}/${file}' && run ${pkgs.libsForQt5.kconfig}/bin/kwriteconfig5 --file '${configHome}/${file}' ${
"run ${pkgs.kdePackages.kconfig}/bin/kwriteconfig6 --file '${configHome}/${file}' ${
lib.concatMapStringsSep " " (x: "--group ${x}")
(lib.lists.init path)
} --key '${lib.lists.last path}' ${toValue value}";
@@ -62,7 +62,7 @@ in {
in builtins.concatStringsSep "\n" lines}
# TODO: some way to only call the dbus calls needed
run ${pkgs.libsForQt5.qttools.bin}/bin/qdbus org.kde.KWin /KWin reconfigure || echo "KWin reconfigure failed"
run ${pkgs.kdePackages.qttools}/bin/qdbus org.kde.KWin /KWin reconfigure || echo "KWin reconfigure failed"
# the actual values are https://github.com/KDE/plasma-workspace/blob/c97dddf20df5702eb429b37a8c10b2c2d8199d4e/kcms/kcms-common_p.h#L13
for changeType in {0..10}; do
# even if one of those calls fails the others keep running

View File

@@ -29,4 +29,19 @@ with lib;
'';
};
};
config = {
# To make it easier for the end user to override the values in the
# configuration depending on the installation method, we set default values
# for the arguments that are defined in the NixOS/nix-darwin modules.
#
# Without these defaults, these attributes would simply not exist, and the
# module system can not inform modules about their non-existence; see
# https://github.com/NixOS/nixpkgs/issues/311709#issuecomment-2110861842
_module.args = {
osConfig = mkDefault null;
nixosConfig = mkDefault null;
darwinConfig = mkDefault null;
};
};
}

View File

@@ -21,7 +21,7 @@ in {
config = mkIf config.uninstall {
home.packages = lib.mkForce [ ];
home.file = lib.mkForce { };
home.stateVersion = lib.mkForce "24.05";
home.stateVersion = lib.mkForce "24.11";
home.enableNixpkgsReleaseCheck = lib.mkForce false;
manual.manpages.enable = lib.mkForce false;
news.display = lib.mkForce "silent";

View File

@@ -21,6 +21,8 @@ in {
"23.05"
"23.11"
"24.05"
"24.11"
"25.05"
];
description = ''
It is occasionally necessary for Home Manager to change

View File

@@ -51,7 +51,7 @@ let
terminal = mkOption {
description = "Whether the program runs in a terminal window.";
type = types.bool;
type = types.nullOr types.bool;
default = false;
};

View File

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

View File

@@ -30,6 +30,8 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application caches.
Sets `XDG_CACHE_HOME` for the user if `xdg.enable` is set `true`.
'';
};
@@ -48,6 +50,8 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application configurations.
Sets `XDG_CONFIG_HOME` for the user if `xdg.enable` is set `true`.
'';
};
@@ -67,6 +71,18 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application data.
Sets `XDG_DATA_HOME` for the user if `xdg.enable` is set `true`.
'';
};
stateFile = mkOption {
type = fileType "xdg.stateFile" "<varname>xdg.stateHome</varname>"
cfg.stateHome;
default = { };
description = ''
Attribute set of files to link into the user's XDG
state home.
'';
};
@@ -76,6 +92,8 @@ in {
apply = toString;
description = ''
Absolute path to directory holding application states.
Sets `XDG_STATE_HOME` for the user if `xdg.enable` is set `true`.
'';
};
};
@@ -122,6 +140,8 @@ in {
cfg.configFile)
(mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file)
cfg.dataFile)
(mapAttrs' (name: file: nameValuePair "${cfg.stateHome}/${name}" file)
cfg.stateFile)
{ "${cfg.cacheHome}/.keep".text = ""; }
];
}

View File

@@ -31,6 +31,7 @@ let
./misc/gtk.nix
./misc/lib.nix
./misc/news.nix
./misc/nixgl.nix
./misc/numlock.nix
./misc/pam.nix
./misc/qt.nix
@@ -77,6 +78,7 @@ let
./programs/carapace.nix
./programs/cava.nix
./programs/chromium.nix
./programs/cmus.nix
./programs/command-not-found/command-not-found.nix
./programs/comodoro.nix
./programs/darcs.nix
@@ -92,6 +94,7 @@ let
./programs/feh.nix
./programs/firefox.nix
./programs/fish.nix
./programs/floorp.nix
./programs/foot.nix
./programs/freetube.nix
./programs/fuzzel.nix
@@ -140,6 +143,7 @@ let
./programs/khard.nix
./programs/kitty.nix
./programs/kodi.nix
./programs/kubecolor.nix
./programs/lazygit.nix
./programs/ledger.nix
./programs/less.nix
@@ -167,10 +171,13 @@ let
./programs/ncspot.nix
./programs/ne.nix
./programs/neomutt.nix
./programs/neovide.nix
./programs/neovim.nix
./programs/newsboat.nix
./programs/nh.nix
./programs/nheko.nix
./programs/nix-index.nix
./programs/nix-your-shell.nix
./programs/nnn.nix
./programs/noti.nix
./programs/notmuch.nix
@@ -240,8 +247,9 @@ let
./programs/translate-shell.nix
./programs/urxvt.nix
./programs/vdirsyncer.nix
./programs/vim.nix
./programs/vifm.nix
./programs/vim-vint.nix
./programs/vim.nix
./programs/vscode.nix
./programs/vscode/haskell.nix
./programs/pywal.nix
@@ -259,6 +267,7 @@ let
./programs/yt-dlp.nix
./programs/z-lua.nix
./programs/zathura.nix
./programs/zed-editor.nix
./programs/zellij.nix
./programs/zk.nix
./programs/zoxide.nix
@@ -274,6 +283,7 @@ let
./services/barrier.nix
./services/batsignal.nix
./services/betterlockscreen.nix
./services/blanket.nix
./services/blueman-applet.nix
./services/borgmatic.nix
./services/cachix-agent.nix
@@ -300,6 +310,7 @@ let
./services/fusuma.nix
./services/getmail.nix
./services/git-sync.nix
./services/glance.nix
./services/gnome-keyring.nix
./services/gpg-agent.nix
./services/grobi.nix
@@ -343,6 +354,7 @@ let
./services/plan9port.nix
./services/playerctld.nix
./services/plex-mpv-shim.nix
./services/podman-linux
./services/polybar.nix
./services/poweralertd.nix
./services/psd.nix
@@ -358,6 +370,7 @@ let
./services/screen-locker.nix
./services/sctd.nix
./services/signaturepdf.nix
./services/snixembed.nix
./services/spotifyd.nix
./services/ssh-agent.nix
./services/stalonetray.nix
@@ -372,6 +385,7 @@ let
./services/tahoe-lafs.nix
./services/taskwarrior-sync.nix
./services/trayer.nix
./services/trayscale.nix
./services/twmn.nix
./services/udiskie.nix
./services/unclutter.nix

113
modules/po/ar.po Normal file
View File

@@ -0,0 +1,113 @@
# 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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
msgstr ""
#: modules/files.nix:204
msgid "Cleaning up orphan links from %s"
msgstr ""
#: modules/files.nix:220
msgid "Creating profile generation %s"
msgstr ""
#: modules/files.nix:237
msgid "No change so reusing latest profile generation %s"
msgstr ""
#: modules/home-environment.nix:634
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:667
msgid "Activating %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:22
msgid "Migrating profile from %s to %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:54
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:83
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr ""
#: modules/lib-bash/activation-init.sh:86
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:127
msgid "Error: USER is set to \"%s\" but we expect \"%s\""
msgstr ""
#: modules/lib-bash/activation-init.sh:136
msgid "Error: HOME is set to \"%s\" but we expect \"%s\""
msgstr ""
#: modules/lib-bash/activation-init.sh:153
msgid "Starting Home Manager activation"
msgstr ""
#: modules/lib-bash/activation-init.sh:157
msgid "Sanity checking Nix"
msgstr ""
#: modules/lib-bash/activation-init.sh:170
msgid "This is a dry run"
msgstr ""
#: modules/lib-bash/activation-init.sh:174
msgid "This is a live run"
msgstr ""
#: modules/lib-bash/activation-init.sh:180
msgid "Using Nix version: %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:183
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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2023-12-29 02:09+0000\n"
"Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
"PO-Revision-Date: 2024-10-15 21:37+0000\n"
"Last-Translator: Viktor Illmer <accounts@viktor.im>\n"
"Language-Team: German <https://hosted.weblate.org/projects/home-manager/"
"modules/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 5.4-dev\n"
"X-Generator: Weblate 5.8-rc\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
@@ -120,7 +120,7 @@ msgstr "Fehler: HOME ist auf \"%s\" gesetzt, aber wir erwarten \"%s\""
#: modules/lib-bash/activation-init.sh:153
msgid "Starting Home Manager activation"
msgstr "Starte Home Manager Aktivierung"
msgstr "Starte Home-Manager-Aktivierung"
#: modules/lib-bash/activation-init.sh:157
msgid "Sanity checking Nix"

View File

@@ -8,21 +8,24 @@ msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"PO-Revision-Date: 2024-05-31 17:09+0000\n"
"Last-Translator: jarre johansson <jarre@johansson.today>\n"
"Language-Team: Finnish <https://hosted.weblate.org/projects/home-manager/"
"modules/fi/>\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"
"X-Generator: Weblate 5.6-dev\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
msgstr ""
msgstr "Luodaan kotitiedostolinkkejä sijaintiin %s"
#: modules/files.nix:204
msgid "Cleaning up orphan links from %s"
msgstr ""
msgstr "Siivotaan orpoja linkkejä sijainnista %s"
#: modules/files.nix:220
msgid "Creating profile generation %s"
@@ -50,15 +53,15 @@ msgstr ""
#: modules/home-environment.nix:667
msgid "Activating %s"
msgstr ""
msgstr "Aktivoidaan %s"
#: modules/lib-bash/activation-init.sh:22
msgid "Migrating profile from %s to %s"
msgstr ""
msgstr "Siirretään profiilia sijainnista %s kohteeseen %s"
#: modules/lib-bash/activation-init.sh:54
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
msgstr "Sopivaa profiilihakemistoa ei löytynyt, yritettiin %s ja %s"
#: modules/lib-bash/activation-init.sh:83
msgid "Sanity checking oldGenNum and oldGenPath"
@@ -79,6 +82,19 @@ msgid ""
"\n"
"and trying home-manager switch again. Good luck!"
msgstr ""
"Edellinen generaation numero ja polku ovat ristiriidassa! Niiden on oltava "
"joko molemmat tyhjiä tai molemmat määritettyjä, mutta ne ovat nyt asetettu "
"seuraavasti:\n"
"\n"
"'%s' ja '%s'\n"
"\n"
"Jos et välitä menettää aiempia profiilin generointeja, niin helpoin ratkaisu "
"on todennäköisesti suorittaa\n"
"\n"
"rm %s/home-manager*\n"
"rm %s/current-home\n"
"\n"
"ja yrittää sitten uudelleen home-manager switch -komentoa. Onnea matkaan!"
#: modules/lib-bash/activation-init.sh:127
msgid "Error: USER is set to \"%s\" but we expect \"%s\""
@@ -90,15 +106,15 @@ msgstr ""
#: modules/lib-bash/activation-init.sh:153
msgid "Starting Home Manager activation"
msgstr ""
msgstr "Home Managerin aktivointi käynnistyy"
#: modules/lib-bash/activation-init.sh:157
msgid "Sanity checking Nix"
msgstr ""
msgstr "Nixin eheys tarkistetaan"
#: modules/lib-bash/activation-init.sh:170
msgid "This is a dry run"
msgstr ""
msgstr "Tämä on testiajo"
#: modules/lib-bash/activation-init.sh:174
msgid "This is a live run"
@@ -110,4 +126,4 @@ msgstr ""
#: modules/lib-bash/activation-init.sh:183
msgid "Activation variables:"
msgstr ""
msgstr "Aktivointimuuttujat:"

116
modules/po/hi.po Normal file
View File

@@ -0,0 +1,116 @@
# 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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-10-09 14:31+0000\n"
"Last-Translator: Utkarsh Sharma <utkasharma19@gmail.com>\n"
"Language-Team: Hindi <https://hosted.weblate.org/projects/home-manager/"
"modules/hi/>\n"
"Language: hi\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 5.8-dev\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
msgstr ""
#: modules/files.nix:204
msgid "Cleaning up orphan links from %s"
msgstr "%s से ऑर्फे़न लिंक्स मिटाई जा रही है"
#: modules/files.nix:220
msgid "Creating profile generation %s"
msgstr ""
#: modules/files.nix:237
msgid "No change so reusing latest profile generation %s"
msgstr ""
#: modules/home-environment.nix:634
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:667
msgid "Activating %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:22
msgid "Migrating profile from %s to %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:54
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:83
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr ""
#: modules/lib-bash/activation-init.sh:86
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:127
msgid "Error: USER is set to \"%s\" but we expect \"%s\""
msgstr ""
#: modules/lib-bash/activation-init.sh:136
msgid "Error: HOME is set to \"%s\" but we expect \"%s\""
msgstr ""
#: modules/lib-bash/activation-init.sh:153
msgid "Starting Home Manager activation"
msgstr ""
#: modules/lib-bash/activation-init.sh:157
msgid "Sanity checking Nix"
msgstr ""
#: modules/lib-bash/activation-init.sh:170
msgid "This is a dry run"
msgstr ""
#: modules/lib-bash/activation-init.sh:174
msgid "This is a live run"
msgstr ""
#: modules/lib-bash/activation-init.sh:180
msgid "Using Nix version: %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:183
msgid "Activation variables:"
msgstr ""

117
modules/po/hu.po Normal file
View File

@@ -0,0 +1,117 @@
# 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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-09-02 17:09+0000\n"
"Last-Translator: Ferenci Ákos <synthetace@gmail.com>\n"
"Language-Team: Hungarian <https://hosted.weblate.org/projects/home-manager/"
"modules/hu/>\n"
"Language: hu\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 5.8-dev\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
msgstr "Hivatkozások létrehozása itt: %s"
#: modules/files.nix:204
msgid "Cleaning up orphan links from %s"
msgstr "Árva hivatkozások kitakarítása innen: %s"
#: modules/files.nix:220
msgid "Creating profile generation %s"
msgstr "%s. profil generáció létrehozása"
#: modules/files.nix:237
msgid "No change so reusing latest profile generation %s"
msgstr "Nincs változás, legutóbbi %s. generáció lesz használva"
#: modules/home-environment.nix:634
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:667
msgid "Activating %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:22
msgid "Migrating profile from %s to %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:54
msgid "Could not find suitable profile directory, tried %s and %s"
msgstr ""
"Nem található megfelelő profil mappa, %s és %s útvonalak lettek kipróbálva."
#: modules/lib-bash/activation-init.sh:83
msgid "Sanity checking oldGenNum and oldGenPath"
msgstr ""
#: modules/lib-bash/activation-init.sh:86
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:127
msgid "Error: USER is set to \"%s\" but we expect \"%s\""
msgstr ""
#: modules/lib-bash/activation-init.sh:136
msgid "Error: HOME is set to \"%s\" but we expect \"%s\""
msgstr ""
#: modules/lib-bash/activation-init.sh:153
msgid "Starting Home Manager activation"
msgstr ""
#: modules/lib-bash/activation-init.sh:157
msgid "Sanity checking Nix"
msgstr "Nix épségének ellenőrzése"
#: modules/lib-bash/activation-init.sh:170
msgid "This is a dry run"
msgstr ""
#: modules/lib-bash/activation-init.sh:174
msgid "This is a live run"
msgstr ""
#: modules/lib-bash/activation-init.sh:180
msgid "Using Nix version: %s"
msgstr ""
#: modules/lib-bash/activation-init.sh:183
msgid "Activation variables:"
msgstr ""

View File

@@ -8,17 +8,17 @@ msgstr ""
"Project-Id-Version: Home Manager Modules\n"
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
"POT-Creation-Date: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2023-05-03 19:48+0000\n"
"Last-Translator: Eryk Michalak <gnu.ewm@protonmail.com>\n"
"PO-Revision-Date: 2024-06-17 09:46+0000\n"
"Last-Translator: Mateusz P <medan1993@gmail.com>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/home-manager/"
"modules/pl/>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"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.18-dev\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 5.6-dev\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
@@ -112,10 +112,14 @@ msgstr ""
#: modules/lib-bash/activation-init.sh:127
msgid "Error: USER is set to \"%s\" but we expect \"%s\""
msgstr ""
"Błąd: Właściwość USER ma wartość \"%s\" podczas gdy spodziewana wartość to \""
"%s\""
#: modules/lib-bash/activation-init.sh:136
msgid "Error: HOME is set to \"%s\" but we expect \"%s\""
msgstr ""
"Błąd: Właściwość HOME ma wartość \"%s\" podczas gdy spodziewana wartość to \""
"%s\""
#: modules/lib-bash/activation-init.sh:153
msgid "Starting Home Manager activation"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2023-08-11 19:51+0000\n"
"Last-Translator: HeartBlin913861820c094e37 <heartblin@proton.me>\n"
"PO-Revision-Date: 2024-10-13 22:15+0000\n"
"Last-Translator: AtomicDude <vasilescutoma4@gmail.com>\n"
"Language-Team: Romanian <https://hosted.weblate.org/projects/home-manager/"
"modules/ro/>\n"
"Language: ro\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2;\n"
"X-Generator: Weblate 5.0-dev\n"
"X-Generator: Weblate 5.8-dev\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
@@ -26,7 +26,7 @@ msgstr "Se creează legături ale fișierelor personale în %s"
#: modules/files.nix:204
msgid "Cleaning up orphan links from %s"
msgstr "Se curăță legăturiile orfane din %s"
msgstr "Se curăță legăturile orfane din %s"
#: modules/files.nix:220
msgid "Creating profile generation %s"

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: 2024-04-17 23:19+0200\n"
"PO-Revision-Date: 2024-03-27 15:05+0000\n"
"Last-Translator: Nguyen Khanh <nguynkhan479@gmail.com>\n"
"PO-Revision-Date: 2024-08-01 04:09+0000\n"
"Last-Translator: goatastronaut0212 <goatastronaut0212@proton.me>\n"
"Language-Team: Vietnamese <https://hosted.weblate.org/projects/home-manager/"
"modules/vi/>\n"
"Language: vi\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 5.5-dev\n"
"X-Generator: Weblate 5.7-dev\n"
#: modules/files.nix:191
msgid "Creating home file links in %s"
@@ -53,11 +53,11 @@ msgstr ""
#: modules/home-environment.nix:667
msgid "Activating %s"
msgstr ""
msgstr "Đang khởi động %s"
#: modules/lib-bash/activation-init.sh:22
msgid "Migrating profile from %s to %s"
msgstr ""
msgstr "Chuyển đổi hồ sơ từ %s tới %s"
#: modules/lib-bash/activation-init.sh:54
msgid "Could not find suitable profile directory, tried %s and %s"
@@ -85,11 +85,11 @@ msgstr ""
#: modules/lib-bash/activation-init.sh:127
msgid "Error: USER is set to \"%s\" but we expect \"%s\""
msgstr ""
msgstr "Lỗi: USER được đặt thành \"%s\" nhưng chúng tôi kỳ vọng \"%s\""
#: modules/lib-bash/activation-init.sh:136
msgid "Error: HOME is set to \"%s\" but we expect \"%s\""
msgstr ""
msgstr "Lỗi: HOME được đặt thành \"%s\" nhưng chúng tôi kỳ vọng \"%s\""
#: modules/lib-bash/activation-init.sh:153
msgid "Starting Home Manager activation"
@@ -97,7 +97,7 @@ msgstr ""
#: modules/lib-bash/activation-init.sh:157
msgid "Sanity checking Nix"
msgstr ""
msgstr "Kiểm tra hợp lệ của Nix"
#: modules/lib-bash/activation-init.sh:170
msgid "This is a dry run"
@@ -109,8 +109,8 @@ msgstr ""
#: modules/lib-bash/activation-init.sh:180
msgid "Using Nix version: %s"
msgstr ""
msgstr "Phiên bản Nix đươc sử dụng: %s"
#: modules/lib-bash/activation-init.sh:183
msgid "Activation variables:"
msgstr ""
msgstr "Các biến được kích hoạt:"

View File

@@ -27,9 +27,6 @@ in {
};
config = mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "programs.abook" pkgs platforms.linux) ];
home.packages = [ pkgs.abook ];
xdg.configFile."abook/abookrc" = mkIf (cfg.extraConfig != "") {

View File

@@ -230,8 +230,15 @@ in {
else
{ };
gpgCfg = account:
optionalAttrs (account.gpg != null) {
pgp-key-id = account.gpg.key;
pgp-auto-sign = account.gpg.signByDefault;
pgp-opportunistic-encrypt = account.gpg.encryptByDefault;
};
in (basicCfg account) // (sourceCfg account) // (outgoingCfg account)
// account.aerc.extraAccounts;
// (gpgCfg account) // account.aerc.extraAccounts;
mkAccountConfig = name: account:
mapAttrNames (addAccountName name) account.aerc.extraConfig;

View File

@@ -56,7 +56,7 @@ in {
buildCommand = lib.concatStringsSep "\n" [
prevAttrs.buildCommand
# TODO: why is this needed? Is there a better way to retain escape sequences?
"substituteInPlace $out --replace '\\\\' '\\'"
"substituteInPlace $out --replace-quiet '\\\\' '\\'"
];
});
};

View File

@@ -132,6 +132,8 @@ in {
'';
};
package = mkPackageOption pkgs "alot" { };
hooks = mkOption {
type = types.lines;
default = "";
@@ -229,7 +231,7 @@ in {
};
config = mkIf cfg.enable {
home.packages = [ pkgs.alot ];
home.packages = [ cfg.package ];
xdg.configFile."alot/config".text = configFile;

View File

@@ -5,11 +5,13 @@ with lib;
let
cfg = config.programs.atuin;
daemonCfg = cfg.daemon;
tomlFormat = pkgs.formats.toml { };
inherit (pkgs.stdenv) isLinux isDarwin;
in {
meta.maintainers = [ maintainers.hawkw ];
meta.maintainers = [ maintainers.hawkw maintainers.water-sucks ];
options.programs.atuin = {
enable = mkEnableOption "atuin";
@@ -94,47 +96,137 @@ in {
Whether to enable Nushell integration.
'';
};
daemon = {
enable = mkEnableOption "Atuin daemon";
logLevel = mkOption {
default = null;
type =
types.nullOr (types.enum [ "trace" "debug" "info" "warn" "error" ]);
description = ''
Verbosity of Atuin daemon logging.
'';
};
};
};
config = let flagsStr = escapeShellArgs cfg.flags;
in mkIf cfg.enable {
in mkIf cfg.enable (mkMerge [
{
# Always add the configured `atuin` package.
home.packages = [ cfg.package ];
# Always add the configured `atuin` package.
home.packages = [ cfg.package ];
# If there are user-provided settings, generate the config file.
xdg.configFile."atuin/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "atuin-config" cfg.settings;
};
# If there are user-provided settings, generate the config file.
xdg.configFile."atuin/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "atuin-config" cfg.settings;
};
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then
source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh"
eval "$(${cfg.package}/bin/atuin init bash ${flagsStr})"
fi
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
if [[ $options[zle] = on ]]; then
eval "$(${cfg.package}/bin/atuin init zsh ${flagsStr})"
fi
'';
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
${cfg.package}/bin/atuin init fish ${flagsStr} | source
'';
programs.nushell = mkIf cfg.enableNushellIntegration {
extraEnv = ''
let atuin_cache = "${config.xdg.cacheHome}/atuin"
if not ($atuin_cache | path exists) {
mkdir $atuin_cache
}
${cfg.package}/bin/atuin init nu ${flagsStr} | save --force ${config.xdg.cacheHome}/atuin/init.nu
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then
source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh"
eval "$(${lib.getExe cfg.package} init bash ${flagsStr})"
fi
'';
extraConfig = ''
source ${config.xdg.cacheHome}/atuin/init.nu
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
if [[ $options[zle] = on ]]; then
eval "$(${lib.getExe cfg.package} init zsh ${flagsStr})"
fi
'';
};
};
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
${lib.getExe cfg.package} init fish ${flagsStr} | source
'';
programs.nushell = mkIf cfg.enableNushellIntegration {
extraEnv = ''
let atuin_cache = "${config.xdg.cacheHome}/atuin"
if not ($atuin_cache | path exists) {
mkdir $atuin_cache
}
${
lib.getExe cfg.package
} init nu ${flagsStr} | save --force ${config.xdg.cacheHome}/atuin/init.nu
'';
extraConfig = ''
source ${config.xdg.cacheHome}/atuin/init.nu
'';
};
}
(mkIf daemonCfg.enable (mkMerge [
{
assertions = [
{
assertion = versionAtLeast cfg.package.version "18.2.0";
message = ''
The Atuin daemon requires at least version 18.2.0 or later.
'';
}
{
assertion = isLinux || isDarwin;
message =
"The Atuin daemon can only be configured on either Linux or macOS.";
}
];
programs.atuin.settings = { daemon = { enabled = true; }; };
}
(mkIf isLinux {
programs.atuin.settings = { daemon = { systemd_socket = true; }; };
systemd.user.services.atuin-daemon = {
Unit = {
Description = "Atuin daemon";
Requires = [ "atuin-daemon.socket" ];
};
Install = {
Also = [ "atuin-daemon.socket" ];
WantedBy = [ "default.target" ];
};
Service = {
ExecStart = "${lib.getExe cfg.package} daemon";
Environment = lib.optionals (daemonCfg.logLevel != null)
[ "ATUIN_LOG=${daemonCfg.logLevel}" ];
Restart = "on-failure";
RestartSteps = 3;
RestartMaxDelaySec = 6;
};
};
systemd.user.sockets.atuin-daemon = let
socket_dir = if versionAtLeast cfg.package.version "18.4.0" then
"%t"
else
"%D/atuin";
in {
Unit = { Description = "Atuin daemon socket"; };
Install = { WantedBy = [ "sockets.target" ]; };
Socket = {
ListenStream = "${socket_dir}/atuin.sock";
SocketMode = "0600";
RemoveOnStop = true;
};
};
})
(mkIf isDarwin {
launchd.agents.atuin-daemon = {
enable = true;
config = {
ProgramArguments = [ "${lib.getExe cfg.package}" "daemon" ];
EnvironmentVariables =
lib.optionalAttrs (daemonCfg.logLevel != null) {
ATUIN_LOG = daemonCfg.logLevel;
};
KeepAlive = {
Crashed = true;
SuccessfulExit = false;
};
ProcessType = "Background";
};
};
})
]))
]);
}

View File

@@ -177,6 +177,18 @@ let
default = null;
example = "nearest";
};
extraConfig = mkOption {
type = types.lines;
description = "Extra lines to append to this profile's config.";
default = "";
example = literalExpression ''
'''
x-prop-non_desktop 0
some-key some-value
'''
'';
};
};
};
@@ -267,7 +279,8 @@ let
+ concatMapStringsSep "," toString (flatten config.transform))
++ optional (config.scale != null)
((if config.scale.method == "factor" then "scale" else "scale-from")
+ " ${toString config.scale.x}x${toString config.scale.y}"))
+ " ${toString config.scale.x}x${toString config.scale.y}")
++ optional (config.extraConfig != "") config.extraConfig)
else ''
output ${name}
off

View File

@@ -29,6 +29,8 @@ in {
programs.bash = {
enable = mkEnableOption "GNU Bourne-Again SHell";
package = mkPackageOption pkgs "bash" { default = "bashInteractive"; };
enableCompletion = mkOption {
type = types.bool;
default = true;
@@ -67,8 +69,8 @@ in {
};
historyControl = mkOption {
type =
types.listOf (types.enum [ "erasedups" "ignoredups" "ignorespace" ]);
type = types.listOf
(types.enum [ "erasedups" "ignoredups" "ignorespace" "ignoreboth" ]);
default = [ ];
description = "Controlling how commands are saved on the history list.";
};
@@ -190,7 +192,7 @@ in {
HISTIGNORE = escapeShellArg (concatStringsSep ":" cfg.historyIgnore);
}));
in mkIf cfg.enable {
home.packages = [ pkgs.bashInteractive ];
home.packages = [ cfg.package ];
home.file.".bash_profile".source = writeBashScript "bash_profile" ''
# include .profile if it exists

View File

@@ -7,7 +7,7 @@ let
cfg = config.programs.bemenu;
in {
meta.maintainers = [ hm.maintainers.omernaveedxyz ];
meta.maintainers = [ ];
options.programs.bemenu = {
enable = mkEnableOption "bemenu";

View File

@@ -272,10 +272,7 @@ in {
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "programs.borgmatic" pkgs
lib.platforms.linux)
] ++ (mapAttrsToList (backup: opts: {
assertions = (mapAttrsToList (backup: opts: {
assertion = opts.location.sourceDirectories == null
|| opts.location.patterns == null;
message = ''

View File

@@ -15,7 +15,7 @@ let
modal = mkEnableOption "modal (vim) mode";
verbs = mkOption {
type = with types; listOf (attrsOf (either bool str));
type = with types; listOf (attrsOf (oneOf [ bool str (listOf str) ]));
default = [ ];
example = literalExpression ''
[
@@ -46,6 +46,9 @@ let
`key` (optional)
: a keyboard key triggering execution
`keys` (optional)
: multiple keyboard keys each triggering execution
`shortcut` (optional)
: an alternate way to call the verb (without
the arguments part)
@@ -54,7 +57,7 @@ let
: whether to quit broot on execution
(default: `true`)
`from_shell` (optional)</term>
`from_shell` (optional)
: whether the verb must be executed from the
parent shell (default: `false`)
'';

44
modules/programs/cmus.nix Normal file
View File

@@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.cmus;
in {
meta.maintainers = [ hm.maintainers.joygnu ];
options.programs.cmus = {
enable = mkEnableOption "Enable cmus, the music player.";
theme = mkOption {
type = types.lines;
default = "";
example = "gruvbox";
description = ''
Select color theme. A list of available color themes can be found
here: <https://github.com/cmus/cmus/tree/master/data>.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
set audio_backend = "mpd"
set status_display = "default"
'';
description = "Extra configuration to add to cmus {file}`rc`.";
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.cmus ];
home.file.".config/cmus/rc".text = ''
${optionalString (cfg.theme != "") "colorscheme ${cfg.theme}"}
${cfg.extraConfig}
'';
};
}

View File

@@ -19,7 +19,7 @@ in {
"Flake support is now always enabled.")
];
meta.maintainers = [ lib.maintainers.rycee ];
meta.maintainers = [ lib.maintainers.rycee lib.maintainers.shikanime ];
options.programs.direnv = {
enable = mkEnableOption "direnv, the environment switcher";
@@ -95,6 +95,15 @@ in {
package = mkPackageOption pkgs "nix-direnv" { };
};
mise = {
enable = mkEnableOption ''
[mise](https://mise.jdx.dev/direnv.html),
integration of use_mise for direnv'';
package = mkPackageOption pkgs "mise" { };
};
silent = mkEnableOption "silent mode, that is, disabling direnv logging";
};
config = mkIf cfg.enable {
@@ -111,6 +120,12 @@ in {
xdg.configFile."direnv/direnvrc" =
lib.mkIf (cfg.stdlib != "") { text = cfg.stdlib; };
xdg.configFile."direnv/lib/hm-mise.sh" = mkIf cfg.mise.enable {
text = ''
eval "$(${getExe cfg.mise.package} direnv activate)"
'';
};
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
@@ -129,39 +144,34 @@ in {
${getExe cfg.package} hook fish | source
'');
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
mkAfter ''
$env.config = ($env.config? | default {})
$env.config.hooks = ($env.config.hooks? | default {})
$env.config.hooks.pre_prompt = (
$env.config.hooks.pre_prompt?
| default []
| append {||
let direnv = (${getExe cfg.package} export json
| from json
| default {})
if ($direnv | is-empty) {
return
}
$direnv
| items {|key, value|
{
key: $key
value: (do (
$env.ENV_CONVERSIONS?
| default {}
| get -i $key
| get -i from_string
| default {|x| $x}
) $value)
}
}
| transpose -ird
| load-env
}
)
'');
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (mkAfter ''
$env.config = ($env.config? | default {})
$env.config.hooks = ($env.config.hooks? | default {})
$env.config.hooks.pre_prompt = (
$env.config.hooks.pre_prompt?
| default []
| append {||
${getExe cfg.package} export json
| from json --strict
| default {}
| items {|key, value|
let value = do (
$env.ENV_CONVERSIONS?
| default {}
| get -i $key
| get -i from_string
| default {|x| $x}
) $value
return [ $key $value ]
}
| into record
| load-env
}
)
'');
home.sessionVariables = lib.mkIf cfg.silent { DIRENV_LOG_FORMAT = ""; };
};
}

View File

@@ -5,6 +5,7 @@ with lib;
let
cfg = config.programs.eww;
ewwCmd = "${cfg.package}/bin/eww";
in {
meta.maintainers = [ hm.maintainers.mainrs ];
@@ -30,10 +31,40 @@ in {
{file}`$XDG_CONFIG_HOME/eww`.
'';
};
enableBashIntegration = mkEnableOption "Bash integration" // {
default = true;
};
enableZshIntegration = mkEnableOption "Zsh integration" // {
default = true;
};
enableFishIntegration = mkEnableOption "Fish integration" // {
default = true;
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."eww".source = cfg.configDir;
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
if [[ $TERM != "dumb" ]]; then
eval "$(${ewwCmd} shell-completions --shell bash)"
fi
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
if [[ $TERM != "dumb" ]]; then
eval "$(${ewwCmd} shell-completions --shell zsh)"
fi
'';
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
if test "$TERM" != "dumb"
eval "$(${ewwCmd} shell-completions --shell fish)"
end
'';
};
}

View File

@@ -49,10 +49,21 @@ with lib;
};
icons = mkOption {
type = types.bool;
default = false;
type = types.enum [ null true false "auto" "always" "never" ];
default = null;
description = ''
Display icons next to file names ({option}`--icons` argument).
Note, the support for Boolean values is deprecated.
Setting this option to `true` corresponds to `--icons=auto`.
'';
};
colors = mkOption {
type = types.enum [ null "auto" "always" "never" ];
default = null;
description = ''
Use terminal colors in output ({option}`--color` argument).
'';
};
@@ -70,10 +81,18 @@ with lib;
config = let
cfg = config.programs.eza;
args = escapeShellArgs (optional cfg.icons "--icons"
iconsOption = let
v = if isBool cfg.icons then
(if cfg.icons then "auto" else null)
else
cfg.icons;
in optionals (v != null) [ "--icons" v ];
args = escapeShellArgs (iconsOption
++ optionals (cfg.colors != null) [ "--color" cfg.colors ]
++ optional cfg.git "--git" ++ cfg.extraOptions);
optionsAlias = { eza = "eza ${args}"; };
optionsAlias = optionalAttrs (args != "") { eza = "eza ${args}"; };
aliases = builtins.mapAttrs (_name: value: lib.mkDefault value) {
ls = "eza";
@@ -83,6 +102,12 @@ with lib;
lla = "eza -la";
};
in mkIf cfg.enable {
warnings = optional (isBool cfg.icons) ''
Setting programs.eza.icons to a Boolean is deprecated.
Please update your configuration so that
programs.eza.icons = ${if cfg.icons then ''"auto"'' else "null"}'';
home.packages = [ cfg.package ];
programs.bash.shellAliases = optionsAlias
@@ -91,8 +116,17 @@ with lib;
programs.zsh.shellAliases = optionsAlias
// optionalAttrs cfg.enableZshIntegration aliases;
programs.fish.shellAliases = optionsAlias
// optionalAttrs cfg.enableFishIntegration aliases;
programs.fish = mkMerge [
(mkIf (!config.programs.fish.preferAbbrs) {
shellAliases = optionsAlias
// optionalAttrs cfg.enableFishIntegration aliases;
})
(mkIf config.programs.fish.preferAbbrs {
shellAliases = optionsAlias;
shellAbbrs = optionalAttrs cfg.enableFishIntegration aliases;
})
];
programs.ion.shellAliases = optionsAlias
// optionalAttrs cfg.enableIonIntegration aliases;

View File

@@ -26,7 +26,9 @@ in {
};
};
display = {
binaryPrefix = "si";
size = {
binaryPrefix = "si";
};
color = "blue";
separator = " ";
};

View File

@@ -38,7 +38,7 @@ with lib; {
args = escapeShellArgs (optional cfg.hidden "--hidden" ++ cfg.extraOptions);
optionsAlias = { fd = "fd ${args}"; };
optionsAlias = optionalAttrs (args != "") { fd = "fd ${args}"; };
in mkIf cfg.enable {
home.packages = [ cfg.package ];

View File

@@ -8,6 +8,12 @@ let
bindingsOf = t: with types; attrsOf (nullOr (either t (listOf t)));
renderThemes = options:
let
render =
mapAttrsToList (theme: options: "${theme} ${escapeShellArgs options}");
in concatStringsSep "\n" (render options);
renderBindings = bindings:
let
enabled = filterAttrs (n: v: v != null) bindings;
@@ -41,7 +47,7 @@ in {
Override feh's default mouse button mapping. If you want to disable an
action, set its value to null. If you want to bind multiple buttons to
an action, set its value to a list.
See <https://man.finalrewind.org/1/feh/#x425554544f4e53> for
See <https://man.finalrewind.org/1/feh/#BUTTONS_CONFIG_SYNTAX> for
default bindings and available commands.
'';
};
@@ -58,10 +64,37 @@ in {
Override feh's default keybindings. If you want to disable a keybinding
set its value to null. If you want to bind multiple keys to an action,
set its value to a list.
See <https://man.finalrewind.org/1/feh/#x4b455953> for
See <https://man.finalrewind.org/1/feh/#KEYS_CONFIG_SYNTAX> for
default bindings and available commands.
'';
};
themes = mkOption {
default = { };
type = with types; attrsOf (listOf str);
example = {
feh = [ "--image-bg" "black" ];
webcam = [ "--multiwindow" "--reload" "20" ];
present = [ "--full-screen" "--sort" "name" "--hide-pointer" ];
booth = [ "--full-screen" "--hide-pointer" "--slideshow-delay" "20" ];
imagemap = [
"-rVq"
"--thumb-width"
"40"
"--thumb-height"
"30"
"--index-info"
"%n\\n%wx%h"
];
example = [ "--info" "foo bar" ];
};
description = ''
Define themes for feh.
See <https://man.finalrewind.org/1/feh/#THEMES_CONFIG_SYNTAX> for
important guidelines and limitations related to theme configuration.
'';
};
};
config = mkIf cfg.enable {
@@ -79,5 +112,8 @@ in {
xdg.configFile."feh/keys" = mkIf (cfg.keybindings != { }) {
text = renderBindings cfg.keybindings + "\n";
};
xdg.configFile."feh/themes" =
mkIf (cfg.themes != { }) { text = renderThemes cfg.themes + "\n"; };
};
}

View File

@@ -1,946 +1,50 @@
{ config, lib, pkgs, ... }:
{ lib, ... }:
with lib;
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
modulePath = [ "programs" "firefox" ];
cfg = config.programs.firefox;
moduleName = concatStringsSep "." modulePath;
jsonFormat = pkgs.formats.json { };
mozillaConfigPath =
if isDarwin then "Library/Application Support/Mozilla" else ".mozilla";
firefoxConfigPath = if isDarwin then
"Library/Application Support/Firefox"
else
"${mozillaConfigPath}/firefox";
profilesPath =
if isDarwin then "${firefoxConfigPath}/Profiles" else firefoxConfigPath;
nativeMessagingHostsPath = if isDarwin then
"${mozillaConfigPath}/NativeMessagingHosts"
else
"${mozillaConfigPath}/native-messaging-hosts";
nativeMessagingHostsJoined = pkgs.symlinkJoin {
name = "ff_native-messaging-hosts";
paths = [
# Link a .keep file to keep the directory around
(pkgs.writeTextDir "lib/mozilla/native-messaging-hosts/.keep" "")
# Link package configured native messaging hosts (entire Firefox actually)
cfg.finalPackage
]
# Link user configured native messaging hosts
++ cfg.nativeMessagingHosts;
};
# The extensions path shared by all profiles; will not be supported
# by future Firefox versions.
extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
profiles = flip mapAttrs' cfg.profiles (_: profile:
nameValuePair "Profile${toString profile.id}" {
Name = profile.name;
Path = if isDarwin then "Profiles/${profile.path}" else profile.path;
IsRelative = 1;
Default = if profile.isDefault then 1 else 0;
}) // {
General = { StartWithLastProfile = 1; };
};
profilesIni = generators.toINI { } profiles;
userPrefValue = pref:
builtins.toJSON (if isBool pref || isInt pref || isString pref then
pref
else
builtins.toJSON pref);
mkUserJs = prefs: extraPrefs: bookmarks:
let
prefs' = lib.optionalAttrs ([ ] != bookmarks) {
"browser.bookmarks.file" = toString (firefoxBookmarksFile bookmarks);
"browser.places.importBookmarksHTML" = true;
} // prefs;
in ''
// Generated by Home Manager.
${concatStrings (mapAttrsToList (name: value: ''
user_pref("${name}", ${userPrefValue value});
'') prefs')}
${extraPrefs}
'';
mkContainersJson = containers:
let
containerToIdentity = _: container: {
userContextId = container.id;
name = container.name;
icon = container.icon;
color = container.color;
public = true;
};
in ''
${builtins.toJSON {
version = 4;
lastUserContextId =
foldlAttrs (acc: _: value: if value.id > acc then value.id else acc) 0
containers;
identities = mapAttrsToList containerToIdentity containers ++ [
{
userContextId = 4294967294; # 2^32 - 2
name = "userContextIdInternal.thumbnail";
icon = "";
color = "";
accessKey = "";
public = false;
}
{
userContextId = 4294967295; # 2^32 - 1
name = "userContextIdInternal.webextStorageLocal";
icon = "";
color = "";
accessKey = "";
public = false;
}
];
}}
'';
firefoxBookmarksFile = bookmarks:
let
indent = level:
lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level));
bookmarkToHTML = indentLevel: bookmark:
''
${indent indentLevel}<DT><A HREF="${
escapeXML bookmark.url
}" ADD_DATE="1" LAST_MODIFIED="1"${
lib.optionalString (bookmark.keyword != null)
" SHORTCUTURL=\"${escapeXML bookmark.keyword}\""
}${
lib.optionalString (bookmark.tags != [ ])
" TAGS=\"${escapeXML (concatStringsSep "," bookmark.tags)}\""
}>${escapeXML bookmark.name}</A>'';
directoryToHTML = indentLevel: directory: ''
${indent indentLevel}<DT>${
if directory.toolbar then
''
<H3 ADD_DATE="1" LAST_MODIFIED="1" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar''
else
''<H3 ADD_DATE="1" LAST_MODIFIED="1">${escapeXML directory.name}''
}</H3>
${indent indentLevel}<DL><p>
${allItemsToHTML (indentLevel + 1) directory.bookmarks}
${indent indentLevel}</DL><p>'';
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.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>
<DL><p>
${bookmarkEntries}
</DL>
'';
mkNoDuplicateAssertion = entities: entityKind:
(let
# Return an attribute set with entity IDs as keys and a list of
# entity names with corresponding ID as value. An ID is present in
# the result only if more than one entity has it. The argument
# entities is a list of AttrSet of one id/name pair.
findDuplicateIds = entities:
filterAttrs (_entityId: entityNames: length entityNames != 1)
(zipAttrs entities);
duplicates = findDuplicateIds (mapAttrsToList
(entityName: entity: { "${toString entity.id}" = entityName; })
entities);
mkMsg = entityId: entityNames:
" - ID ${entityId} is used by " + concatStringsSep ", " entityNames;
in {
assertion = duplicates == { };
message = ''
Must not have a Firefox ${entityKind} with an existing ID but
'' + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
});
wrapPackage = package:
let
# The configuration expected by the Firefox wrapper.
fcfg = { enableGnomeExtensions = cfg.enableGnomeExtensions; };
# A bit of hackery to force a config into the wrapper.
browserName =
package.browserName or (builtins.parseDrvName package.name).name;
# The configuration expected by the Firefox wrapper builder.
bcfg = setAttrByPath [ browserName ] fcfg;
in if package == null then
null
else if isDarwin then
package
else if versionAtLeast config.home.stateVersion "19.09" then
package.override (old: {
cfg = old.cfg or { } // fcfg;
extraPolicies = (old.extraPolicies or { }) // cfg.policies;
})
else
(pkgs.wrapFirefox.override { config = bcfg; }) package { };
mkFirefoxModule = import ./firefox/mkFirefoxModule.nix;
in {
meta.maintainers = [ maintainers.rycee maintainers.kira-bruneau ];
meta.maintainers = [ maintainers.rycee hm.maintainers.bricked ];
imports = [
(mkRemovedOptionModule [ "programs" "firefox" "extensions" ] ''
(mkFirefoxModule {
inherit modulePath;
name = "Firefox";
wrappedPackageName = "firefox";
unwrappedPackageName = "firefox-unwrapped";
visible = true;
platforms.linux = rec {
vendorPath = ".mozilla";
configPath = "${vendorPath}/firefox";
};
platforms.darwin = {
vendorPath = "Library/Application Support/Mozilla";
configPath = "Library/Application Support/Firefox";
};
})
(mkRemovedOptionModule (modulePath ++ [ "extensions" ]) ''
Extensions are now managed per-profile. That is, change from
programs.firefox.extensions = [ foo bar ];
${moduleName}.extensions = [ foo bar ];
to
programs.firefox.profiles.myprofile.extensions = [ foo bar ];'')
(mkRemovedOptionModule [ "programs" "firefox" "enableAdobeFlash" ]
${moduleName}.profiles.myprofile.extensions = [ foo bar ];'')
(mkRemovedOptionModule (modulePath ++ [ "enableAdobeFlash" ])
"Support for this option has been removed.")
(mkRemovedOptionModule [ "programs" "firefox" "enableGoogleTalk" ]
(mkRemovedOptionModule (modulePath ++ [ "enableGoogleTalk" ])
"Support for this option has been removed.")
(mkRemovedOptionModule [ "programs" "firefox" "enableIcedTea" ]
(mkRemovedOptionModule (modulePath ++ [ "enableIcedTea" ])
"Support for this option has been removed.")
];
options = {
programs.firefox = {
enable = mkEnableOption "Firefox";
package = mkOption {
type = with types; nullOr package;
default = if versionAtLeast config.home.stateVersion "19.09" then
pkgs.firefox
else
pkgs.firefox-unwrapped;
defaultText = literalExpression "pkgs.firefox";
example = literalExpression ''
pkgs.firefox.override {
# See nixpkgs' firefox/wrapper.nix to check which options you can use
nativeMessagingHosts = [
# Gnome shell native connector
pkgs.gnome-browser-connector
# Tridactyl native connector
pkgs.tridactyl-native
];
}
'';
description = ''
The Firefox package to use. If state version  19.09 then
this should be a wrapped Firefox package. For earlier state
versions it should be an unwrapped Firefox package.
Set to `null` to disable installing Firefox.
'';
};
nativeMessagingHosts = mkOption {
type = types.listOf types.package;
default = [ ];
description = ''
Additional packages containing native messaging hosts that should be
made available to Firefox extensions.
'';
};
finalPackage = mkOption {
type = with types; nullOr package;
readOnly = true;
description = "Resulting Firefox package.";
};
policies = mkOption {
type = types.attrsOf jsonFormat.type;
default = { };
description =
"[See list of policies](https://mozilla.github.io/policy-templates/).";
example = {
DefaultDownloadDirectory = "\${home}/Downloads";
BlockAboutConfig = true;
};
};
profiles = mkOption {
type = types.attrsOf (types.submodule ({ config, name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Profile name.";
};
id = mkOption {
type = types.ints.unsigned;
default = 0;
description = ''
Profile ID. This should be set to a unique number per profile.
'';
};
settings = mkOption {
type = types.attrsOf (jsonFormat.type // {
description =
"Firefox preference (int, bool, string, and also attrs, list, float as a JSON string)";
});
default = { };
example = literalExpression ''
{
"browser.startup.homepage" = "https://nixos.org";
"browser.search.region" = "GB";
"browser.search.isUS" = false;
"distribution.searchplugins.defaultLocale" = "en-GB";
"general.useragent.locale" = "en-GB";
"browser.bookmarks.showMobileBookmarks" = true;
"browser.newtabpage.pinned" = [{
title = "NixOS";
url = "https://nixos.org";
}];
}
'';
description = ''
Attribute set of Firefox preferences.
Firefox only supports int, bool, and string types for
preferences, but home-manager will automatically
convert all other JSON-compatible values into strings.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra preferences to add to {file}`user.js`.
'';
};
userChrome = mkOption {
type = types.lines;
default = "";
description = "Custom Firefox user chrome CSS.";
example = ''
/* Hide tab bar in FF Quantum */
@-moz-document url("chrome://browser/content/browser.xul") {
#TabsToolbar {
visibility: collapse !important;
margin-bottom: 21px !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
visibility: collapse !important;
}
}
'';
};
userContent = mkOption {
type = types.lines;
default = "";
description = "Custom Firefox user content CSS.";
example = ''
/* Hide scrollbar in FF Quantum */
*{scrollbar-width:none !important}
'';
};
bookmarks = mkOption {
type = let
bookmarkSubmodule = types.submodule ({ config, name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Bookmark name.";
};
tags = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Bookmark tags.";
};
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.";
};
};
}) // {
description = "bookmark submodule";
};
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 = ''
Make this the toolbar directory. Note, this does _not_
mean that this directory will be added to the toolbar,
this directory _is_ the toolbar.
'';
};
};
}) // {
description = "directory submodule";
};
nodeType = types.either bookmarkType directoryType;
in with types;
coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
default = [ ];
example = literalExpression ''
[
{
name = "wikipedia";
tags = [ "wiki" ];
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
}
{
name = "kernel.org";
url = "https://www.kernel.org";
}
{
name = "Nix sites";
toolbar = true;
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
tags = [ "wiki" "nix" ];
url = "https://wiki.nixos.org/";
}
];
}
]
'';
description = ''
Preloaded bookmarks. Note, this may silently overwrite any
previously existing bookmarks!
'';
};
path = mkOption {
type = types.str;
default = name;
description = "Profile path.";
};
isDefault = mkOption {
type = types.bool;
default = config.id == 0;
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.
'';
};
privateDefault = mkOption {
type = with types; nullOr str;
default = null;
example = "DuckDuckGo";
description = ''
The default search engine used in the Private Browsing.
'';
};
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://wiki.nixos.org/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.nixos.org/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 {var}`metaData` specified will
be treated as builtin to Firefox.
See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177)
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.
Note, {var}`icon` is also a special option
added by Home Manager to make it convenient to specify
absolute icon paths.
'';
};
};
containersForce = mkOption {
type = types.bool;
default = false;
description = ''
Whether to force replace the existing containers
configuration. This is recommended since Firefox will
replace the symlink on every launch, but note that you'll
lose any existing configuration by enabling this.
'';
};
containers = mkOption {
type = types.attrsOf (types.submodule ({ name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Container name, e.g., shopping.";
};
id = mkOption {
type = types.ints.unsigned;
default = 0;
description = ''
Container ID. This should be set to a unique number per container in this profile.
'';
};
# List of colors at
# https://searchfox.org/mozilla-central/rev/5ad226c7379b0564c76dc3b54b44985356f94c5a/toolkit/components/extensions/parent/ext-contextualIdentities.js#32
color = mkOption {
type = types.enum [
"blue"
"turquoise"
"green"
"yellow"
"orange"
"red"
"pink"
"purple"
"toolbar"
];
default = "pink";
description = "Container color.";
};
icon = mkOption {
type = types.enum [
"briefcase"
"cart"
"circle"
"dollar"
"fence"
"fingerprint"
"gift"
"vacation"
"food"
"fruit"
"pet"
"tree"
"chill"
];
default = "fruit";
description = "Container icon.";
};
};
}));
default = { };
example = {
"shopping" = {
id = 1;
color = "blue";
icon = "cart";
};
"dangerous" = {
id = 2;
color = "red";
icon = "fruit";
};
};
description = ''
Attribute set of container configurations. See
[Multi-Account
Containers](https://support.mozilla.org/en-US/kb/containers)
for more information.
'';
};
extensions = mkOption {
type = types.listOf types.package;
default = [ ];
example = literalExpression ''
with pkgs.nur.repos.rycee.firefox-addons; [
privacy-badger
]
'';
description = ''
List of Firefox add-on packages to install for this profile.
Some pre-packaged add-ons are accessible from the
[Nix User Repository](https://github.com/nix-community/NUR).
Once you have NUR installed run
```console
$ nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons
```
to list the available Firefox add-ons.
Note that it is necessary to manually enable these extensions
inside Firefox after the first installation.
To automatically enable extensions add
`"extensions.autoDisableScopes" = 0;`
to
[{option}`programs.firefox.profiles.<profile>.settings`](#opt-programs.firefox.profiles._name_.settings)
'';
};
};
}));
default = { };
description = "Attribute set of Firefox profiles.";
};
enableGnomeExtensions = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the GNOME Shell native host connector. Note, you
also need to set the NixOS option
`services.gnome.gnome-browser-connector.enable` to
`true`.
'';
};
};
};
config = mkIf cfg.enable {
assertions = [
(let
defaults =
catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
in {
assertion = cfg.profiles == { } || length defaults == 1;
message = "Must have exactly one default Firefox profile but found "
+ toString (length defaults) + optionalString (length defaults > 1)
(", namely " + concatStringsSep ", " defaults);
})
(let
getContainers = profiles:
flatten
(mapAttrsToList (_: value: (attrValues value.containers)) profiles);
findInvalidContainerIds = profiles:
filter (container: container.id >= 4294967294)
(getContainers profiles);
in {
assertion = cfg.profiles == { }
|| length (findInvalidContainerIds cfg.profiles) == 0;
message = "Container id must be smaller than 4294967294 (2^32 - 2)";
})
(mkNoDuplicateAssertion cfg.profiles "profile")
] ++ (mapAttrsToList
(_: profile: mkNoDuplicateAssertion profile.containers "container")
cfg.profiles);
warnings = optional (cfg.enableGnomeExtensions or false) ''
Using 'programs.firefox.enableGnomeExtensions' has been deprecated and
will be removed in the future. Please change to overriding the package
configuration using 'programs.firefox.package' instead. You can refer to
its example for how to do this.
'';
programs.firefox.finalPackage = wrapPackage cfg.package;
home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage;
home.file = mkMerge ([{
"${firefoxConfigPath}/profiles.ini" =
mkIf (cfg.profiles != { }) { text = profilesIni; };
"${nativeMessagingHostsPath}" = {
source =
"${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts";
recursive = true;
};
}] ++ flip mapAttrsToList cfg.profiles (_: profile: {
"${profilesPath}/${profile.path}/.keep".text = "";
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
mkIf (profile.userChrome != "") { text = profile.userChrome; };
"${profilesPath}/${profile.path}/chrome/userContent.css" =
mkIf (profile.userContent != "") { text = profile.userContent; };
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings != { }
|| profile.extraConfig != "" || profile.bookmarks != [ ]) {
text =
mkUserJs profile.settings profile.extraConfig profile.bookmarks;
};
"${profilesPath}/${profile.path}/containers.json" =
mkIf (profile.containers != { }) {
force = profile.containersForce;
text = mkContainersJson profile.containers;
};
"${profilesPath}/${profile.path}/search.json.mozlz4" = mkIf
(profile.search.default != null || profile.search.privateDefault != null
|| profile.search.order != [ ] || profile.search.engines != { }) {
force = profile.search.force;
source = let
settings = {
version = 6;
engines = let
# Map of nice field names to internal field names.
# This is intended to be exhaustive and should be
# updated at every version bump.
internalFieldNames = (genAttrs [
"name"
"isAppProvided"
"loadPath"
"hasPreferredIcon"
"updateInterval"
"updateURL"
"iconUpdateURL"
"iconURL"
"iconMapObj"
"metaData"
"orderHint"
"definedAliases"
"urls"
] (name: "_${name}")) // {
searchForm = "__searchForm";
};
processCustomEngineInput = input:
(removeAttrs input [ "icon" ])
// optionalAttrs (input ? icon) {
# Convenience to specify absolute path to icon
iconURL = "file://${input.icon}";
} // (optionalAttrs (input ? iconUpdateURL) {
# Convenience to default iconURL to iconUpdateURL so
# the icon is immediately downloaded from the URL
iconURL = input.iconURL or input.iconUpdateURL;
} // {
# 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."${
replaceStrings [ "\\" ] [ "\\\\" ] input.name
}"'';
});
processEngineInput = name: input:
let
requiredInput = {
inherit name;
isAppProvided = input.isAppProvided or removeAttrs input
[ "metaData" ] == { };
metaData = input.metaData or { };
};
in if requiredInput.isAppProvided then
requiredInput
else
processCustomEngineInput (input // requiredInput);
buildEngineConfig = name: input:
mapAttrs' (name: value: {
name = internalFieldNames.${name} or name;
inherit value;
}) (processEngineInput name input);
sortEngineConfigs = configs:
let
buildEngineConfigWithOrder = order: name:
let
config = configs.${name} or {
_name = name;
_isAppProvided = true;
_metaData = { };
};
in config // {
_metaData = config._metaData // { inherit order; };
};
engineConfigsWithoutOrder =
attrValues (removeAttrs configs profile.search.order);
sortedEngineConfigs =
(imap buildEngineConfigWithOrder profile.search.order)
++ engineConfigsWithoutOrder;
in sortedEngineConfigs;
engineInput = profile.search.engines // {
# Infer profile.search.default as an app provided
# engine if it's not in profile.search.engines
${profile.search.default} =
profile.search.engines.${profile.search.default} or { };
} // {
${profile.search.privateDefault} =
profile.search.engines.${profile.search.privateDefault} or { };
};
in sortEngineConfigs (mapAttrs buildEngineConfig engineInput);
metaData = optionalAttrs (profile.search.default != null) {
current = profile.search.default;
hash = "@hash@";
} // optionalAttrs (profile.search.privateDefault != null) {
private = profile.search.privateDefault;
privateHash = "@privateHash@";
} // {
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 = if profile.search.default != null then
profile.path + profile.search.default + disclaimer "Firefox"
else
null;
privateSalt = if profile.search.privateDefault != null then
profile.path + profile.search.privateDefault
+ disclaimer "Firefox"
else
null;
in pkgs.runCommand "search.json.mozlz4" {
nativeBuildInputs = with pkgs; [ mozlz4a openssl ];
json = builtins.toJSON settings;
inherit salt privateSalt;
} ''
if [[ -n $salt ]]; then
export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64)
export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64)
mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out"
else
mozlz4a <(echo "$json") "$out"
fi
'';
};
"${profilesPath}/${profile.path}/extensions" =
mkIf (profile.extensions != [ ]) {
source = let
extensionsEnvPkg = pkgs.buildEnv {
name = "hm-firefox-extensions";
paths = profile.extensions;
};
in "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
recursive = true;
force = true;
};
}));
};
}

View File

@@ -0,0 +1,814 @@
{ modulePath, name, description ? null, wrappedPackageName ? null
, unwrappedPackageName ? null, platforms, visible ? false
, enableBookmarks ? true }:
{ config, lib, pkgs, ... }:
with lib;
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
moduleName = concatStringsSep "." modulePath;
cfg = getAttrFromPath modulePath config;
jsonFormat = pkgs.formats.json { };
supportedPlatforms = flatten (attrVals (attrNames platforms) lib.platforms);
isWrapped = versionAtLeast config.home.stateVersion "19.09"
&& wrappedPackageName != null;
defaultPackageName =
if isWrapped then wrappedPackageName else unwrappedPackageName;
packageName = if wrappedPackageName != null then
wrappedPackageName
else
unwrappedPackageName;
profilesPath =
if isDarwin then "${cfg.configPath}/Profiles" else cfg.configPath;
nativeMessagingHostsPath = if isDarwin then
"${cfg.vendorPath}/NativeMessagingHosts"
else
"${cfg.vendorPath}/native-messaging-hosts";
nativeMessagingHostsJoined = pkgs.symlinkJoin {
name = "ff_native-messaging-hosts";
paths = [
# Link a .keep file to keep the directory around
(pkgs.writeTextDir "lib/mozilla/native-messaging-hosts/.keep" "")
# Link package configured native messaging hosts (entire browser actually)
cfg.finalPackage
]
# Link user configured native messaging hosts
++ cfg.nativeMessagingHosts;
};
# The extensions path shared by all profiles; will not be supported
# by future browser versions.
extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
profiles = flip mapAttrs' cfg.profiles (_: profile:
nameValuePair "Profile${toString profile.id}" {
Name = profile.name;
Path = if isDarwin then "Profiles/${profile.path}" else profile.path;
IsRelative = 1;
Default = if profile.isDefault then 1 else 0;
}) // {
General = {
StartWithLastProfile = 1;
} // lib.optionalAttrs (cfg.profileVersion != null) {
Version = cfg.profileVersion;
};
};
profilesIni = generators.toINI { } profiles;
userPrefValue = pref:
builtins.toJSON (if isBool pref || isInt pref || isString pref then
pref
else
builtins.toJSON pref);
mkUserJs = prefs: extraPrefs: bookmarks:
let
prefs' = lib.optionalAttrs ([ ] != bookmarks) {
"browser.bookmarks.file" = toString (browserBookmarksFile bookmarks);
"browser.places.importBookmarksHTML" = true;
} // prefs;
in ''
// Generated by Home Manager.
${concatStrings (mapAttrsToList (name: value: ''
user_pref("${name}", ${userPrefValue value});
'') prefs')}
${extraPrefs}
'';
mkContainersJson = containers:
let
containerToIdentity = _: container: {
userContextId = container.id;
name = container.name;
icon = container.icon;
color = container.color;
public = true;
};
in ''
${builtins.toJSON {
version = 5;
lastUserContextId =
foldlAttrs (acc: _: value: if value.id > acc then value.id else acc) 0
containers;
identities = mapAttrsToList containerToIdentity containers ++ [
{
userContextId = 4294967294; # 2^32 - 2
name = "userContextIdInternal.thumbnail";
icon = "";
color = "";
accessKey = "";
public = false;
}
{
userContextId = 4294967295; # 2^32 - 1
name = "userContextIdInternal.webextStorageLocal";
icon = "";
color = "";
accessKey = "";
public = false;
}
];
}}
'';
browserBookmarksFile = bookmarks:
let
indent = level:
lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level));
bookmarkToHTML = indentLevel: bookmark:
''
${indent indentLevel}<DT><A HREF="${
escapeXML bookmark.url
}" ADD_DATE="1" LAST_MODIFIED="1"${
lib.optionalString (bookmark.keyword != null)
" SHORTCUTURL=\"${escapeXML bookmark.keyword}\""
}${
lib.optionalString (bookmark.tags != [ ])
" TAGS=\"${escapeXML (concatStringsSep "," bookmark.tags)}\""
}>${escapeXML bookmark.name}</A>'';
directoryToHTML = indentLevel: directory: ''
${indent indentLevel}<DT>${
if directory.toolbar then
''
<H3 ADD_DATE="1" LAST_MODIFIED="1" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar''
else
''<H3 ADD_DATE="1" LAST_MODIFIED="1">${escapeXML directory.name}''
}</H3>
${indent indentLevel}<DL><p>
${allItemsToHTML (indentLevel + 1) directory.bookmarks}
${indent indentLevel}</DL><p>'';
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 "${packageName}-bookmarks.html" ''
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>
<DL><p>
${bookmarkEntries}
</DL>
'';
mkNoDuplicateAssertion = entities: entityKind:
(let
# Return an attribute set with entity IDs as keys and a list of
# entity names with corresponding ID as value. An ID is present in
# the result only if more than one entity has it. The argument
# entities is a list of AttrSet of one id/name pair.
findDuplicateIds = entities:
filterAttrs (_entityId: entityNames: length entityNames != 1)
(zipAttrs entities);
duplicates = findDuplicateIds (mapAttrsToList
(entityName: entity: { "${toString entity.id}" = entityName; })
entities);
mkMsg = entityId: entityNames:
" - ID ${entityId} is used by " + concatStringsSep ", " entityNames;
in {
assertion = duplicates == { };
message = ''
Must not have a ${name} ${entityKind} with an existing ID but
'' + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
});
wrapPackage = package:
let
# The configuration expected by the Firefox wrapper.
fcfg = { enableGnomeExtensions = cfg.enableGnomeExtensions; };
# A bit of hackery to force a config into the wrapper.
browserName =
package.browserName or (builtins.parseDrvName package.name).name;
# The configuration expected by the Firefox wrapper builder.
bcfg = setAttrByPath [ browserName ] fcfg;
in if package == null then
null
else if isDarwin then
package
else if isWrapped then
package.override (old: {
cfg = old.cfg or { } // fcfg;
extraPolicies = (old.extraPolicies or { }) // cfg.policies;
})
else
(pkgs.wrapFirefox.override { config = bcfg; }) package { };
in {
options = setAttrByPath modulePath {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether to enable ${name}.${
optionalString (description != null) " ${description}"
}
${optionalString (!visible)
"See `programs.firefox` for more configuration options."}
'';
};
package = mkOption {
inherit visible;
type = with types; nullOr package;
default = pkgs.${defaultPackageName};
defaultText = literalExpression "pkgs.${packageName}";
example = literalExpression ''
pkgs.${packageName}.override {
# See nixpkgs' firefox/wrapper.nix to check which options you can use
nativeMessagingHosts = [
# Gnome shell native connector
pkgs.gnome-browser-connector
# Tridactyl native connector
pkgs.tridactyl-native
];
}
'';
description = ''
The ${name} package to use. If state version 19.09 then
this should be a wrapped ${name} package. For earlier state
versions it should be an unwrapped ${name} package.
Set to `null` to disable installing ${name}.
'';
};
languagePacks = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
The language packs to install. Available language codes can be found
on the releases page:
`https://releases.mozilla.org/pub/firefox/releases/''${version}/linux-x86_64/xpi/`,
replacing `''${version}` with the version of Firefox you have.
'';
example = [ "en-GB" "de" ];
};
name = mkOption {
internal = true;
type = types.str;
default = name;
example = "Firefox";
description = "The name of the browser.";
};
wrappedPackageName = mkOption {
internal = true;
type = with types; nullOr str;
default = wrappedPackageName;
description = "Name of the wrapped browser package.";
};
vendorPath = mkOption {
internal = true;
type = with types; nullOr str;
default = with platforms;
if isDarwin then
darwin.vendorPath or null
else
linux.vendorPath or null;
example = ".mozilla";
description =
"Directory containing the native messaging hosts directory.";
};
configPath = mkOption {
internal = true;
type = types.str;
default = with platforms;
if isDarwin then darwin.configPath else linux.configPath;
example = ".mozilla/firefox";
description = "Directory containing the ${name} configuration files.";
};
nativeMessagingHosts = optionalAttrs (cfg.vendorPath != null) (mkOption {
inherit visible;
type = types.listOf types.package;
default = [ ];
description = ''
Additional packages containing native messaging hosts that should be
made available to ${name} extensions.
'';
});
finalPackage = mkOption {
inherit visible;
type = with types; nullOr package;
readOnly = true;
description = "Resulting ${cfg.name} package.";
};
policies = optionalAttrs (wrappedPackageName != null) (mkOption {
inherit visible;
type = types.attrsOf jsonFormat.type;
default = { };
description =
"[See list of policies](https://mozilla.github.io/policy-templates/).";
example = {
DefaultDownloadDirectory = "\${home}/Downloads";
BlockAboutConfig = true;
};
});
profileVersion = mkOption {
internal = true;
type = types.nullOr types.ints.unsigned;
default = if isDarwin then null else 2;
description = "profile version, set null for nix-darwin";
};
profiles = mkOption {
inherit visible;
type = types.attrsOf (types.submodule ({ config, name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Profile name.";
};
id = mkOption {
type = types.ints.unsigned;
default = 0;
description = ''
Profile ID. This should be set to a unique number per profile.
'';
};
settings = mkOption {
type = types.attrsOf (jsonFormat.type // {
description =
"${name} preference (int, bool, string, and also attrs, list, float as a JSON string)";
});
default = { };
example = literalExpression ''
{
"browser.startup.homepage" = "https://nixos.org";
"browser.search.region" = "GB";
"browser.search.isUS" = false;
"distribution.searchplugins.defaultLocale" = "en-GB";
"general.useragent.locale" = "en-GB";
"browser.bookmarks.showMobileBookmarks" = true;
"browser.newtabpage.pinned" = [{
title = "NixOS";
url = "https://nixos.org";
}];
}
'';
description = ''
Attribute set of ${name} preferences.
${name} only supports int, bool, and string types for
preferences, but home-manager will automatically
convert all other JSON-compatible values into strings.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra preferences to add to {file}`user.js`.
'';
};
userChrome = mkOption {
type = types.lines;
default = "";
description = "Custom ${name} user chrome CSS.";
example = ''
/* Hide tab bar in FF Quantum */
@-moz-document url(chrome://browser/content/browser.xul), url(chrome://browser/content/browser.xhtml) {
#TabsToolbar {
visibility: collapse !important;
margin-bottom: 21px !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
visibility: collapse !important;
}
}
'';
};
userContent = mkOption {
type = types.lines;
default = "";
description = "Custom ${name} user content CSS.";
example = ''
/* Hide scrollbar in FF Quantum */
*{scrollbar-width:none !important}
'';
};
bookmarks = mkOption {
internal = !enableBookmarks;
type = let
bookmarkSubmodule = types.submodule ({ config, name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Bookmark name.";
};
tags = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Bookmark tags.";
};
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.";
};
};
}) // {
description = "bookmark submodule";
};
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 = ''
Make this the toolbar directory. Note, this does _not_
mean that this directory will be added to the toolbar,
this directory _is_ the toolbar.
'';
};
};
}) // {
description = "directory submodule";
};
nodeType = types.either bookmarkType directoryType;
in with types;
coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
default = [ ];
example = literalExpression ''
[
{
name = "wikipedia";
tags = [ "wiki" ];
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
}
{
name = "kernel.org";
url = "https://www.kernel.org";
}
{
name = "Nix sites";
toolbar = true;
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
tags = [ "wiki" "nix" ];
url = "https://wiki.nixos.org/";
}
];
}
]
'';
description = ''
Preloaded bookmarks. Note, this may silently overwrite any
previously existing bookmarks!
'';
};
path = mkOption {
type = types.str;
default = name;
description = "Profile path.";
};
isDefault = mkOption {
type = types.bool;
default = config.id == 0;
defaultText = "true if profile ID is 0";
description = "Whether this is a default profile.";
};
search = mkOption {
type = types.submodule (args:
import ./profiles/search.nix {
inherit (args) config;
inherit lib pkgs;
appName = cfg.name;
package = cfg.finalPackage;
modulePath = modulePath ++ [ "profiles" name "search" ];
profilePath = config.path;
});
default = { };
description = "Declarative search engine configuration.";
};
containersForce = mkOption {
type = types.bool;
default = false;
description = ''
Whether to force replace the existing containers configuration.
This is recommended since Firefox will replace the symlink on
every launch, but note that you'll lose any existing configuration
by enabling this.
'';
};
containers = mkOption {
type = types.attrsOf (types.submodule ({ name, ... }: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Container name, e.g., shopping.";
};
id = mkOption {
type = types.ints.unsigned;
default = 0;
description = ''
Container ID. This should be set to a unique number per container in this profile.
'';
};
# List of colors at
# https://searchfox.org/mozilla-central/rev/5ad226c7379b0564c76dc3b54b44985356f94c5a/toolkit/components/extensions/parent/ext-contextualIdentities.js#32
color = mkOption {
type = types.enum [
"blue"
"turquoise"
"green"
"yellow"
"orange"
"red"
"pink"
"purple"
"toolbar"
];
default = "pink";
description = "Container color.";
};
icon = mkOption {
type = types.enum [
"briefcase"
"cart"
"circle"
"dollar"
"fence"
"fingerprint"
"gift"
"vacation"
"food"
"fruit"
"pet"
"tree"
"chill"
];
default = "fruit";
description = "Container icon.";
};
};
}));
default = { };
example = {
"shopping" = {
id = 1;
color = "blue";
icon = "cart";
};
"dangerous" = {
id = 2;
color = "red";
icon = "fruit";
};
};
description = ''
Attribute set of container configurations. See
[Multi-Account
Containers](https://support.mozilla.org/en-US/kb/containers)
for more information.
'';
};
extensions = mkOption {
type = types.listOf types.package;
default = [ ];
example = literalExpression ''
with pkgs.nur.repos.rycee.firefox-addons; [
privacy-badger
]
'';
description = ''
List of ${name} add-on packages to install for this profile.
Some pre-packaged add-ons are accessible from the
[Nix User Repository](https://github.com/nix-community/NUR).
Once you have NUR installed run
```console
$ nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons
```
to list the available ${name} add-ons.
Note that it is necessary to manually enable these extensions
inside ${name} after the first installation.
To automatically enable extensions add
`"extensions.autoDisableScopes" = 0;`
to
[{option}`${moduleName}.profiles.<profile>.settings`](#opt-${moduleName}.profiles._name_.settings)
'';
};
};
}));
default = { };
description = "Attribute set of ${name} profiles.";
};
enableGnomeExtensions = mkOption {
inherit visible;
type = types.bool;
default = false;
description = ''
Whether to enable the GNOME Shell native host connector. Note, you
also need to set the NixOS option
`services.gnome.gnome-browser-connector.enable` to
`true`.
'';
};
};
config = mkIf cfg.enable ({
assertions = [
(hm.assertions.assertPlatform moduleName pkgs supportedPlatforms)
(let
defaults =
catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
in {
assertion = cfg.profiles == { } || length defaults == 1;
message = "Must have exactly one default ${cfg.name} profile but found "
+ toString (length defaults) + optionalString (length defaults > 1)
(", namely " + concatStringsSep ", " defaults);
})
(let
getContainers = profiles:
flatten
(mapAttrsToList (_: value: (attrValues value.containers)) profiles);
findInvalidContainerIds = profiles:
filter (container: container.id >= 4294967294)
(getContainers profiles);
in {
assertion = cfg.profiles == { }
|| length (findInvalidContainerIds cfg.profiles) == 0;
message = "Container id must be smaller than 4294967294 (2^32 - 2)";
})
{
assertion = cfg.languagePacks == [ ] || cfg.package != null;
message = ''
'programs.firefox.languagePacks' requires 'programs.firefox.package'
to be set to a non-null value.
'';
}
(mkNoDuplicateAssertion cfg.profiles "profile")
] ++ (mapAttrsToList
(_: profile: mkNoDuplicateAssertion profile.containers "container")
cfg.profiles);
warnings = optional (cfg.enableGnomeExtensions or false) ''
Using '${moduleName}.enableGnomeExtensions' has been deprecated and
will be removed in the future. Please change to overriding the package
configuration using '${moduleName}.package' instead. You can refer to
its example for how to do this.
'';
home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage;
home.file = mkMerge ([{
"${cfg.configPath}/profiles.ini" =
mkIf (cfg.profiles != { }) { text = profilesIni; };
}] ++ optional (cfg.vendorPath != null) {
"${nativeMessagingHostsPath}" = {
source =
"${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts";
recursive = true;
};
} ++ flip mapAttrsToList cfg.profiles (_: profile: {
"${profilesPath}/${profile.path}/.keep".text = "";
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
mkIf (profile.userChrome != "") { text = profile.userChrome; };
"${profilesPath}/${profile.path}/chrome/userContent.css" =
mkIf (profile.userContent != "") { text = profile.userContent; };
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings != { }
|| profile.extraConfig != "" || profile.bookmarks != [ ]) {
text =
mkUserJs profile.settings profile.extraConfig profile.bookmarks;
};
"${profilesPath}/${profile.path}/containers.json" =
mkIf (profile.containers != { }) {
text = mkContainersJson profile.containers;
force = profile.containersForce;
};
"${profilesPath}/${profile.path}/search.json.mozlz4" =
mkIf (profile.search.enable) {
enable = profile.search.enable;
force = profile.search.force;
source = profile.search.file;
};
"${profilesPath}/${profile.path}/extensions" =
mkIf (profile.extensions != [ ]) {
source = let
extensionsEnvPkg = pkgs.buildEnv {
name = "hm-firefox-extensions";
paths = profile.extensions;
};
in "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
recursive = true;
force = true;
};
}));
} // setAttrByPath modulePath {
finalPackage = wrapPackage cfg.package;
policies = {
ExtensionSettings = listToAttrs (map (lang:
nameValuePair "langpack-${lang}@firefox.mozilla.org" {
installation_mode = "normal_installed";
install_url =
"https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi";
}) cfg.languagePacks);
};
});
}

View File

@@ -0,0 +1,269 @@
{ config, lib, pkgs, appName, package, modulePath, profilePath }:
with lib;
let
jsonFormat = pkgs.formats.json { };
# Map of nice field names to internal field names.
# This is intended to be exhaustive and should be
# updated at every version bump.
internalFieldNames = (genAttrs [
"name"
"isAppProvided"
"loadPath"
"hasPreferredIcon"
"updateInterval"
"updateURL"
"iconUpdateURL"
"iconURL"
"iconMapObj"
"metaData"
"orderHint"
"definedAliases"
"urls"
] (name: "_${name}")) // {
searchForm = "__searchForm";
};
processCustomEngineInput = input:
(removeAttrs input [ "icon" ]) // optionalAttrs (input ? icon) {
# Convenience to specify absolute path to icon
iconURL = "file://${input.icon}";
} // (optionalAttrs (input ? iconUpdateURL) {
# Convenience to default iconURL to iconUpdateURL so
# the icon is immediately downloaded from the URL
iconURL = input.iconURL or input.iconUpdateURL;
} // {
# Required for custom engine configurations, loadPaths
# are unique identifiers that are generally formatted
# like: [source]/path/to/engine.xml
loadPath = "[home-manager]/${
concatStringsSep "." (map strings.escapeNixIdentifier
(modulePath ++ [ "engines" input.name ]))
}";
});
processEngineInput = name: input:
let
requiredInput = {
inherit name;
isAppProvided = input.isAppProvided or removeAttrs input [ "metaData" ]
== { };
metaData = input.metaData or { };
};
in if requiredInput.isAppProvided then
requiredInput
else
processCustomEngineInput (input // requiredInput);
buildEngineConfig = name: input:
mapAttrs' (name: value: {
name = internalFieldNames.${name} or name;
inherit value;
}) (processEngineInput name input);
sortEngineConfigs = configs:
let
buildEngineConfigWithOrder = order: name:
let
config = configs.${name} or {
_name = name;
_isAppProvided = true;
_metaData = { };
};
in config // { _metaData = config._metaData // { inherit order; }; };
engineConfigsWithoutOrder = attrValues (removeAttrs configs config.order);
sortedEngineConfigs = (imap buildEngineConfigWithOrder config.order)
++ engineConfigsWithoutOrder;
in sortedEngineConfigs;
engineInput = config.engines // {
# Infer config.default as an app provided
# engine if it's not in config.engines
${config.default} = config.engines.${config.default} or { };
} // {
${config.privateDefault} = config.engines.${config.privateDefault} or { };
};
settings = {
version = 6;
engines = sortEngineConfigs (mapAttrs buildEngineConfig engineInput);
metaData = optionalAttrs (config.default != null) {
current = config.default;
hash = "@hash@";
} // optionalAttrs (config.privateDefault != null) {
private = config.privateDefault;
privateHash = "@privateHash@";
} // {
useSavedOrder = config.order != [ ];
};
};
# Home Manager doesn't circumvent user consent and isn't acting
# maliciously. We're modifying the search outside of the browser, 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 = "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 = if config.default != null then
profilePath + config.default + disclaimer
else
null;
privateSalt = if config.privateDefault != null then
profilePath + config.privateDefault + disclaimer
else
null;
appNameVariable = if package == null then
"appName=${lib.escapeShellArg appName}"
else ''
applicationIni="$(find ${lib.escapeShellArg package} -maxdepth 3 -path ${
lib.escapeShellArg package
}'/lib/*/application.ini' -print -quit)"
if test -n "$applicationIni"; then
appName="$(sed -n 's/^Name=\(.*\)$/\1/p' "$applicationIni" | head -n1)"
else
appName=${lib.escapeShellArg appName}
fi
'';
file = pkgs.runCommand "search.json.mozlz4" {
nativeBuildInputs = with pkgs; [ mozlz4a openssl ];
json = builtins.toJSON settings;
inherit salt privateSalt;
} ''
${appNameVariable}
salt=''${salt//@appName@/"$appName"}
privateSalt=''${privateSalt//@appName@/"$appName"}
if [[ -n $salt ]]; then
export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64)
export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64)
mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out"
else
mozlz4a <(echo "$json") "$out"
fi
'';
in {
imports = [ (pkgs.path + "/nixos/modules/misc/meta.nix") ];
meta.maintainers = with maintainers; [ kira-bruneau ];
options = {
enable = mkOption {
type = with types; bool;
default = config.default != null || config.privateDefault != null
|| config.order != [ ] || config.engines != { };
internal = true;
};
force = mkOption {
type = with types; bool;
default = false;
description = ''
Whether to force replace the existing search
configuration. This is recommended since ${appName} 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.
'';
};
privateDefault = mkOption {
type = with types; nullOr str;
default = null;
example = "DuckDuckGo";
description = ''
The default search engine used in the Private Browsing.
'';
};
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://wiki.nixos.org/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.nixos.org/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 {var}`metaData` specified will be treated as builtin
to ${appName}.
See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177)
in ${appName}'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.
Note, {var}`icon` is also a special option added by Home
Manager to make it convenient to specify absolute icon paths.
'';
};
file = mkOption {
type = with types; path;
default = file;
internal = true;
readOnly = true;
description = ''
Resulting search.json.mozlz4 file.
'';
};
};
}

View File

@@ -253,6 +253,12 @@ in {
'';
};
generateCompletions = mkEnableOption
"the automatic generation of completions based upon installed man pages"
// {
default = true;
};
shellAliases = mkOption {
type = with types; attrsOf str;
default = { };
@@ -288,6 +294,16 @@ in {
'';
};
preferAbbrs = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
If enabled, abbreviations will be preferred over aliases when
other modules define aliases for fish.
'';
};
shellInit = mkOption {
type = types.lines;
default = "";
@@ -380,9 +396,9 @@ in {
};
config = mkIf cfg.enable (mkMerge [
{
home.packages = [ cfg.package ];
{ home.packages = [ cfg.package ]; }
(mkIf cfg.generateCompletions {
# Support completion for `man` by building a cache for `apropos`.
programs.man.generateCaches = mkDefault true;
@@ -446,7 +462,9 @@ in {
set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager_generated_completions" $post
end
'';
})
{
xdg.configFile."fish/config.fish".source = fishIndent "config.fish" ''
# ~/.config/fish/config.fish: DO NOT EDIT -- this file has been generated
# automatically by home-manager.

View File

@@ -0,0 +1,29 @@
{ lib, ... }:
with lib;
let
modulePath = [ "programs" "floorp" ];
mkFirefoxModule = import ./firefox/mkFirefoxModule.nix;
in {
meta.maintainers = [ hm.maintainers.bricked ];
imports = [
(mkFirefoxModule {
inherit modulePath;
name = "Floorp";
wrappedPackageName = "floorp";
unwrappedPackageName = "floorp-unwrapped";
visible = true;
platforms.linux = {
configPath = ".floorp";
vendorPath = ".floorp";
};
platforms.darwin = { configPath = "Library/Application Support/Floorp"; };
})
];
}

View File

@@ -12,13 +12,27 @@ in {
enable = lib.mkEnableOption "Git authentication handler for OAuth";
package = lib.mkPackageOption pkgs "git-credential-oauth" { };
extraFlags = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = lib.literalExpression ''[ "-device" ]'';
description = ''
Extra command-line arguments passed to git-credential-oauth.
For valid arguments, see {manpage}`git-credential-oauth(1)`.
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
programs.git.extraConfig.credential.helper =
[ "${cfg.package}/bin/git-credential-oauth" ];
programs.git.extraConfig.credential.helper = lib.mkAfter [
("${cfg.package}/bin/git-credential-oauth"
+ lib.optionalString (cfg.extraFlags != [ ])
" ${lib.strings.concatStringsSep " " cfg.extraFlags}")
];
};
}

View File

@@ -214,6 +214,59 @@ in {
};
};
maintenance = {
enable = mkEnableOption "" // {
description = ''
Enable the automatic {command}`git maintenance`.
See <https://git-scm.com/docs/git-maintenance>.
'';
};
repositories = mkOption {
type = with types; listOf str;
default = [ ];
description = ''
Repositories on which {command}`git maintenance` should run.
Should be a list of absolute paths.
'';
};
timers = mkOption {
type = types.attrsOf types.str;
default = {
hourly = "*-*-* 1..23:53:00";
daily = "Tue..Sun *-*-* 0:53:00";
weekly = "Mon 0:53:00";
};
description = ''
Systemd timers to create for scheduled {command}`git maintenance`.
Key is passed to `--schedule` argument in {command}`git maintenance run`
and value is passed to `Timer.OnCalendar` in `systemd.user.timers`.
'';
};
};
diff-highlight = {
enable = mkEnableOption "" // {
description = ''
Enable the contrib {command}`diff-highlight` syntax highlighter.
See <https://github.com/git/git/blob/master/contrib/diff-highlight/README>,
'';
};
pagerOpts = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "--tabs=4" "-RFX" ];
description = ''
Arguments to be passed to {command}`less`.
'';
};
};
difftastic = {
enable = mkEnableOption "" // {
description = ''
@@ -222,6 +275,8 @@ in {
'';
};
package = mkPackageOption pkgs "difftastic" { };
background = mkOption {
type = types.enum [ "light" "dark" ];
default = "light";
@@ -358,11 +413,15 @@ in {
home.packages = [ cfg.package ];
assertions = [{
assertion = let
enabled =
[ cfg.delta.enable cfg.diff-so-fancy.enable cfg.difftastic.enable ];
enabled = [
cfg.delta.enable
cfg.diff-so-fancy.enable
cfg.difftastic.enable
cfg.diff-highlight.enable
];
in count id enabled <= 1;
message =
"Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' or 'programs.git.diff-so-fancy.enable' can be set to true at the same time.";
"Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' or 'programs.git.diff-so-fancy.enable' or 'programs.git.diff-highlight' can be set to true at the same time.";
}];
programs.git.iniContent.user = {
@@ -477,12 +536,66 @@ in {
};
})
(mkIf cfg.maintenance.enable {
programs.git.iniContent.maintenance.repo = cfg.maintenance.repositories;
systemd.user.services."git-maintenance@" = {
Unit = {
Description = "Optimize Git repositories data";
Documentation = [ "man:git-maintenance(1)" ];
};
Service = {
Type = "oneshot";
ExecStart = let exe = lib.getExe cfg.package;
in ''
"${exe}" for-each-repo --keep-going --config=maintenance.repo maintenance run --schedule=%i
'';
LockPersonality = "yes";
MemoryDenyWriteExecute = "yes";
NoNewPrivileges = "yes";
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_VSOCK";
RestrictNamespaces = "yes";
RestrictRealtime = "yes";
RestrictSUIDSGID = "yes";
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
};
};
systemd.user.timers = let
toSystemdTimer = name: time:
lib.attrsets.nameValuePair "git-maintenance@${name}" {
Unit.Description = "Optimize Git repositories data";
Timer = {
OnCalendar = time;
Persistent = true;
};
Install.WantedBy = [ "timers.target" ];
};
in lib.attrsets.mapAttrs' toSystemdTimer cfg.maintenance.timers;
})
(mkIf cfg.diff-highlight.enable {
programs.git.iniContent = let
dhCommand =
"${cfg.package}/share/git/contrib/diff-highlight/diff-highlight";
in {
core.pager = "${dhCommand} | ${getExe pkgs.less} ${
escapeShellArgs cfg.diff-highlight.pagerOpts
}";
interactive.diffFilter = dhCommand;
};
})
(mkIf cfg.difftastic.enable {
home.packages = [ pkgs.difftastic ];
home.packages = [ cfg.difftastic.package ];
programs.git.iniContent = let
difftCommand = concatStringsSep " " [
"${pkgs.difftastic}/bin/difft"
"${getExe cfg.difftastic.package}"
"--color ${cfg.difftastic.color}"
"--background ${cfg.difftastic.background}"
"--display ${cfg.difftastic.display}"

View File

@@ -17,7 +17,7 @@ let
package = mkOption {
type = types.package;
example = "pkgs.gnome.gnome-shell-extensions";
example = "pkgs.gnome-shell-extensions";
description = ''
Package providing a GNOME Shell extension in
`$out/share/gnome-shell/extensions/''${id}`.
@@ -66,7 +66,7 @@ in {
{ package = pkgs.gnomeExtensions.dash-to-panel; }
{
id = "user-theme@gnome-shell-extensions.gcampax.github.com";
package = pkgs.gnome.gnome-shell-extensions;
package = pkgs.gnome-shell-extensions;
}
]
'';
@@ -106,7 +106,7 @@ in {
programs.gnome-shell.extensions = [{
id = "user-theme@gnome-shell-extensions.gcampax.github.com";
package = pkgs.gnome.gnome-shell-extensions;
package = pkgs.gnome-shell-extensions;
}];
home.packages = [ cfg.theme.package ];

View File

@@ -316,7 +316,7 @@ in {
})
];
home.packages = [ pkgs.gnome.gnome-terminal ];
home.packages = [ pkgs.gnome-terminal ];
dconf.settings = let dconfPath = "org/gnome/terminal/legacy";
in {

View File

@@ -28,7 +28,7 @@ in {
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
function assume() {
export GRANTED_ALIAS_CONFIGURED="true"
source ${package}/bin/.assume-wrapped "$@"
source ${package}/bin/assume "$@"
unset GRANTED_ALIAS_CONFIGURED
}
'';

View File

@@ -15,6 +15,7 @@ in {
type = types.package;
default = pkgs.helix;
defaultText = literalExpression "pkgs.helix";
example = literalExpression "pkgs.evil-helix";
description = "The package to use for helix.";
};
@@ -75,7 +76,6 @@ in {
default = { };
example = literalExpression ''
{
# the language-server option currently requires helix from the master branch at https://github.com/helix-editor/helix/
language-server.typescript-language-server = with pkgs.nodePackages; {
command = "''${typescript-language-server}/bin/typescript-language-server";
args = [ "--stdio" "--tsserver-path=''${typescript}/lib/node_modules/typescript/lib" ];
@@ -188,7 +188,7 @@ in {
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/hx \
--prefix PATH : ${lib.makeBinPath cfg.extraPackages}
--suffix PATH : ${lib.makeBinPath cfg.extraPackages}
'';
})
]

View File

@@ -113,7 +113,8 @@ in {
enable = mkEnableOption "htop";
settings = mkOption {
type = types.attrs;
type = with types;
attrsOf (oneOf [ bool int str (listOf (oneOf [ int str ])) ]);
default = { };
example = literalExpression ''
{

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