66 Commits

Author SHA1 Message Date
Austin Horstman
355734d876 treewide: remove literalExpression where unneeded
`literalExpression` is intended just to signify code that needs to stay
a string that gets represented exactly as-is for docs. It has been
misused heavily and people get confused repeatedly on when or not to use
it because of the rampant misuse.
2026-05-17 21:43:25 -05:00
shimeoki
d987617879 generic-linux-gpu: don't pass kernel 2026-05-05 15:46:31 +02:00
Esteve Fernandez
5be632dab0 gpu: use tmpfiles.d to set up the /run/opengl-driver symlink
Signed-off-by: Esteve Fernandez <esteve@apache.org>
2026-05-05 12:30:44 +02:00
jae beller
e82d4a4ecd copyApps: workaround for macOS 26.3 signature bug
macOS throws a code signing error when the modification time on an app
is set to 1. This seems to have started on macOS 26.3, but I'm not fully
sure. Hitting this is uncommon. macOS caches signatures, so apps that
were opened prior to updating macOS continue to work. I ran into this
because Ghostty 1.3.0 added a new signature to their bundle.
2026-04-26 15:52:06 -05:00
Seong Yong-ju
c55c498c9a targets/darwin: set TERMINFO_DIRS
Make terminfo descriptions from Home Manager-installed packages (e.g.
kitty, alacritty) discoverable on macOS by exporting TERMINFO_DIRS via
hm-session-vars.sh. macOS has no systemd/environment.d equivalent, so
the shell session file is the available entry point.

Closes nix-community/home-manager#2918 for macOS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 10:44:45 -05:00
Benedikt Rips
a93d80bcec treewide: remove unused attrs patterns 2026-04-13 22:02:40 -05:00
Benedikt Rips
71402c5df3 treewide: mark unused lambda arguments 2026-04-13 22:02:40 -05:00
Michael Hoang
fd22058b43 copyApps: fix linkApps migration
Prior to this commit, the migration would not run as the condition in `ourLink`
would not be fulfilled by the symlink created by `linkApps`.
2026-04-12 10:39:04 -05:00
Michael Hoang
23d85301a5 copyApps: skip check when migrating from linkApps 2026-04-12 10:39:04 -05:00
Austin Horstman
01ea51d706 treewide: use inherit for attribute assignments
This change converts redundant attribute assignments of the form `a =
a;` or `a = someSet.a;` into cleaner `inherit` statements. This reduces
verbosity and follows common Nix style for bringing attributes into
scope.

Statix Codes: W03 (manual_inherit), W04 (manual_inherit_from)

Also include statix and the rule in our configuration.
2026-04-08 14:47:48 -05:00
Stellessia
0e0e7a072a generic-linux-gpu: Update NVIDIA driver version regex pattern 2026-03-26 16:03:37 -05:00
luo jiyin
7d06e0cefe treewide: fix spelling errors 2026-03-11 22:32:16 -05:00
Ryan Hendrickson
26dfad95d9 nix: add assumeXdg option
The use-xdg-base-directories Nix setting can be set globally in
/etc/nix/nix.conf, in which case Home Manager doesn't know about it.
Users could fix that by also setting it, redundantly, in `nix.settings`,
but then Nix issues a lot of spurious warnings about
use-xdg-base-directories being a restricted setting that untrusted users
can't pass on to the daemon.

As an alternative, users can now set `nix.assumeXdg`, which makes Home
Manager assume that use-xdg-base-directories is in effect without adding
it to the user's nix.conf file.
2026-02-13 15:28:13 -06:00
Austin Horstman
fa6de26b4d treewide: nixf-diagnose cleanup
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 16:30:04 -05:00
Jure Varlec
a3ac4bb1f8 generic-linux-gpu: put systemd unit in lib/systemd
This is where unit files are expected to be, making GPU setup compatible
with things like selinux. Fixes #8438. The `resources/` directory was
kept because it is expected to be used in the future.
2026-01-08 13:15:31 -05:00
Heitor Augusto
91cdb0e2d5 nixGL: patch systemd and d-bus services references 2025-12-25 11:16:13 -06:00
Carl
83053e1d33 GPU freedom (#8239)
* gpu: only add intel driver for x86_64-linux

* gpu: allow configuring drivers option

Allow overriding the drivers option if you're an advanced user
2025-11-30 14:48:38 +01:00
Kirill Kuznetsov
b9c0dae3e4 generic-linux-gpu: export setupPackage and drivers from targets.genericLinux.gpu to configuration (#8189) 2025-11-24 09:20:46 -06:00
zowoq
96156a9e86 targets/darwin: change pathsToLink to a list (#8164)
fbe214434a
2025-11-15 11:33:35 -06:00
Jure Varlec
193e44d316 generic-linux-gpu: add module 2025-11-09 09:02:58 -06:00
Jure Varlec
066874efb5 nixgl: move under targets.genericLinux 2025-11-09 09:02:58 -06:00
Thiago Kenji Okada
fca3fedcdc targets/darwin: do not use sudo to check for App Management
This is writing `.DS_Store` files as root in "~/Applications/Home
Manager Apps/<app>", and causing errors during the `rsync` call since it
will try to delete any files that is not present in the app bundle.

Fix #8067.
2025-10-28 08:54:13 -05:00
Mio
82b58f3820 targets/darwin: better error message 2025-10-24 09:43:15 -05:00
Thiago Kenji Okada
4b846fa3aa targets/darwin: init copyapps
This is basically a better version of `targets.darwin.linkApps` that
copy apps instead of linking (hence the name). While this is a
convoluted approach, it works with Spotlight, where the previous
approach doesn't. This is also the approach adopted by nix-darwin, see
PR: https://github.com/nix-darwin/nix-darwin/pull/1396.

There are a few particularities about this implementation, for one the
flags we use in rsync are different since we are not using root to copy
the apps to `~/Applications`. This may or may not cause some issues with
specific applications so further testing will be needed. Also the check
for App Management permission needs root (via sudo), so this check is
gated behind a flag that can be disabled if needed.

Fix: #1341.
2025-10-23 19:41:13 -05:00
Thiago Kenji Okada
44ca573665 targets/darwin: refactor linkapps 2025-10-23 19:41:13 -05:00
lignus
3ec1cd9a07 launchd+targets/darwin: Escape XML in plists (#7356)
This patch updates all usage of toPlist such that it escapes any strings
in the final output.

The motication for this change is to avoid confusion when end-users of
home-manager's APIs are not aware that the option values they set end up
being passed un-escaped to XML files.

BREAKING CHANGE: Consumers doing manual escaping will now be doubly escaped.

Co-authored-by: Linnnus <linnnus@users.noreply.github.com>
2025-08-09 11:22:08 -05:00
Sam
5ab15331c2 targets/darwin: fix ShowDate default description (#7256) 2025-06-12 20:46:23 -05:00
awwpotato
5da6eafceb treewide: remove unused code (#6985) 2025-05-07 10:03:21 -05:00
Austin Horstman
cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00
Thiago Kenji Okada
ab56fd8db8 targets/generic-linux: use home.sessionSearchVariables for XCURSOR_PATH 2025-03-09 09:36:41 -05:00
Austin Horstman
95711f9266 treewide: remove with lib (#6512)
* nixos: remove with lib
* nix-darwin: remove with lib
* home-manager: remove with lib
* modules/accounts: remove with lib
* modules/config: remove with lib
* modules/i18n: remove with lib
* modules/misc: remove with lib
* modules: remove with lib
* modules/targets: remove with lib
* tests/modules/firefox: remove with lib
* tests/modules/services: remove with lib
2025-03-07 14:16:46 -06:00
moni
fb568d75cf targets/darwin: allow configuring application linking (#4809)
Darwin users can disable application linking or change the path where applications are linked.
2025-02-22 17:00:52 -06:00
Hraban Luyat
15d7ec3051 darwin: misc defaults (dock, menu clock, finder) 2024-05-11 00:04:45 +02:00
Igor
b0b0c3d943 targets/generic-linux: use xdg path for defexpr
Fixes warnings about the non-existent `~/.nix-defexpr` folder when
using `use-xdg-base-directories = true`.

Example:

    warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring
    Starting Home Manager activation
    Activating checkFilesChanged
    Activating checkLinkTargets
    Activating writeBoundary
    Activating installPackages
    replacing old 'home-manager-path'
    installing 'home-manager-path'
    Activating dconfSettings
    Activating linkDesktopApplications
    Activating linkGeneration
    Cleaning up orphan links from /home/user
    No change so reusing latest profile generation 13
    Creating home file links in /home/user
    Activating onFilesChange
    Activating reloadSystemd
    warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring
2024-03-09 13:43:12 +01:00
Albert Peschar
738527f866 darwin: fonts: speed up font installation
* Skip font installation if the derivation hasn't changed.
* Use `rsync` instead of `install` to copy font files, to avoid useless
  copying of pre-existent identical files.
2024-02-18 23:09:58 +01:00
Robert Helgesson
e84811035d treewide: deprecate VERBOSE_ECHO
The shell function `verboseEcho` can be used in its stead.
2024-01-24 13:36:05 +01:00
Robert Helgesson
4256729006 treewide: deprecate DRY_RUN_CMD and DRY_RUN_NULL
As a replacement, this adds the `run` helper function.
2024-01-24 13:36:05 +01:00
Emily
9f9e277b60 treewide: remove now-redundant lib.mdDoc calls
These (and the `*MD` functions apart from `literalMD`) are now no-ops
in nixpkgs and serve no purpose other than to add additional noise and
potentially mislead people into thinking unmarked DocBook documentation
will still be accepted.

Note that if backporting changes including documentation to 23.05,
the `mdDoc` calls will need to be re-added.

To reproduce this commit, run:

    $ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \
      nix shell nixpkgs#coreutils \
      -c find . -name '*.nix' \
      -exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \
      --strip {} +
    $ ./format
2023-07-17 18:49:09 +01:00
Emily
36a53d9f26 treewide: convert all option docs to Markdown
This process was automated by [my fork of `nix-doc-munge`]. All
conversions were automatically checked to produce the same DocBook
result when converted back, modulo minor typographical/formatting
differences on the acceptable-to-desirable spectrum.

To reproduce this commit, run:

  $ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \
    nix shell nixpkgs#coreutils \
    -c find . -name '*.nix' \
    -exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \
    {} +
  $ ./format

[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge/tree/home-manager
2023-07-17 18:40:56 +01:00
Emily
c1d8d2a3d1 treewide: adjust some DocBook for conversion
The NixOS variant of Markdown doesn't make a distinction between
`<code>` and `<literal>` or `<quote>` and... quotes, and doesn't
support `<parameter>` or `<replaceable>`. These are infrequently used
(apart from `<code>`) and don't add much, so just convert them to
simpler forms to allow the options containing them to be converted
to Markdown automatically.

A few minor syntactic adjustments were also made to make
`nix-doc-munge`'s job easier.
2023-07-17 16:49:35 +01:00
Emily
21c700d14b treewide: convert options with lists to Markdown
`nix-doc-munge` can't handle these, which is understandable as I can
barely handle them either. There are a few infelicities here: the
current processor can't handle multiple terms to one description in
a description list so they get comma-separated in one case, and one
case that should ideally render as a `<figure>` with a `<figcaption>`
in HTML is reduced to a paragraph with some `<strong>` text. (Which, in
fairness, is how it rendered in practice with the DocBook anyway.) The
docs generator has since been updated to handle figures, but we can't
use it until moving off DocBook output.
2023-07-17 16:49:35 +01:00
Emily
9e4a73c25e treewide: convert custom enable docs to Markdown
`nix-doc-munge` can't tell what's going on with this pattern, so I
just handled them all manually.
2023-07-17 16:49:35 +01:00
Mario Rodas
b5c083300b treewide: fix typos 2022-12-05 12:58:02 +01:00
midchildan
c728307482 darwin: use full path to commands in activation script 2022-11-05 12:14:08 +09:00
Marin
f520832a47 darwin: re-enable ~/Applications symlinks (#3139)
Tested-by: supermarin@users.noreply.github.com
2022-11-02 13:41:53 -04:00
David Arnold
183a62f356 targets/generic-linux: use the correct nix package 2022-11-02 00:45:56 +01:00
midchildan
572f348a10 darwin: add support for 'defaults -currentHost' options
Closes #2615
2022-07-24 15:17:21 +02:00
polykernel
8ec13d33b1 targets.genericLinux: include additional directories in XCURSOR_PATH (#2902)
This commit appends system-wide icon and pixmap directory and the icon
directory in the home-manager profile to the XCURSOR_PATH session variable
for the generic linux target. This is necessary because the default prefix
for libXcursor resolves to the Nix store which excludes the aforementioned
directories from being searched for cursor themes. [1]

[1] - https://github.com/nix-community/home-manager/pull/2891#issuecomment-1101064521.
2022-04-19 20:04:10 -04:00
Ryan Burns
781d25b315 Replace pkgs.hostPlatform by pkgs.stdenv.hostPlatform
We are attempting to deprecate these top-level attributes in upstream
Nixpkgs.

See also bc0acdad8c.
2021-12-03 23:36:50 +01:00
midchildan
fbb80207f3 darwin: add midchildan to maintainers 2021-12-02 23:39:08 +01:00