Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: support rootless containers via home-manager #3
base: main
Are you sure you want to change the base?
feat: support rootless containers via home-manager #3
Changes from all commits
c9196a1
37595a7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
virtualisation.quadlet.user
, as there isn't really the concept of "user virtualisation".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.
I followed the convention that exists in nixpkgs:
systemd.service
->systemd.user.services
But happy to change it.
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.
I think
systend.user.services
is based on that "user systemd" being something. We can have a service managed by "user systemd", or similarly a container managed by a concrete system named "user quadlet" / "user podman", rather than an abstract idea if "user virtualisation".From the ownership perspective, the systemd module conceptually owns
systemd.**
options and does user vs system separation inside that scope, while quadlet-nix should probably do the same and implement the separation within its own landvirtualisation.quadlet.**
.What do you think?
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.
Yes you've convinced me. I'll make the change!
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.
Nice. Do you want to add the same timer for rootful quadlet?
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.
Sure can do.
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 it possible to link directly from /run/user/... without linkFarm? With that we might even be able to use
$UID
without relying onuid
being explicitly set in nixos config.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.
Yea, this bit I'm not 100% happy with either. The symlinks are definitely needed so that the home manager reactivation can restart them. But while home-manager let's us write files into $HOME, it doesn't let us write symlinks directly (as far as I can find). So I used
linkFarm
which creates a derivation with links fromgenerated-service-name.service
to/run/user/UID/systemd/generator/generated-service-name.service
Then home-manager creates a link to the
linkFarm
file (which is itself a link). The end result is a chain of links:Happy to improve it, I'm just not sure how at this point.
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.
On second thought perhaps using home-manager's
systemd.user.tmpfiles.rules
would work? We'd still have to reference the user's UID somehow.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.
I gave systemd tmpfiles a try (
"L+ ${config.xdg.configHome}/foo - - - - %t/foo"
), it worked well creating the links but I can't make it delete those link when the config is removed.I think linkFarm is fine here but getting uid from config isn't ideal as not everyone sets it. Since I don't have a good solution either (except for resorting to
pkgs.runCommandLocal
or activation script), I'm ok to merge the current version for now provided we make it a documented limitation (comment and README).