-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
users-groups module: add per-user packages #25712
Conversation
@4z3, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @rickynils and @nbp to be potential reviewers. |
name = "per-user-pkgs.${name}"; | ||
paths = packages; | ||
}; | ||
}) cfg.users; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create a symlink tree + /etc/per-user-pkgs symlink for every user, even if packages
is empty, right? Might be nice to filter out users with empty packages
. And maybe also filter out system users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I've added a filter to only create symlinks where packages are defined. Though, I'm not sure about (silently) filtering out system users because it would be counterintuitive in case someone actually tries to define packages for them for some reason. We could add an assertion, but then I wouldn't want to patronize users.
@nbp what is your opinion on that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably could be probably also added to environment.profiles
in nixos/modules/programs/environment.nix
. Just extending PATH will not be sufficient for all kind of applications, for instances a theme also needs to be in XDG_DATA_DIRS (see environment.profileRelativeEnvVars
)
👍 from my side. I just used this patch for managing my family machines since my parents use the same laptop but different accounts. @4z3 thank you |
name = "per-user-pkgs/${name}"; | ||
value.source = pkgs.symlinkJoin { | ||
name = "per-user-pkgs.${name}"; | ||
paths = packages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are binaries symlink stored in /etc
instead of /var/run
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an easy way to write to /var/run
?
As a fish user, I now get this at every shell startup:
|
Motivation for this change
Currently it's only possible to define a system-wide set of packages that should be added to PATH. This PR allows to define a package set per user.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)