-
Notifications
You must be signed in to change notification settings - Fork 7
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
Recreate .guix-profile; .guix-home; and .profile at startup #7
Comments
That's an interesting setup. Comments aside, this is a valid bug as my module does not properly reactivate those profiles unlike NixOS and home-manager profiles. (Though, for |
For now, I'm going to leave these puzzle pieces for me (or anyone who's interested) to revisit these next time. Hopefully, this could also spark a discussion and put the puzzle pieces together. Here's what I came up with from at least 15 minutes fiddling with this. :)
|
As for a possible workaround while no fix is here, I guess manually creating a systemd service for activating would suffice. Here's a very very very crude (and untested) example of one. systemd.services.guix-profiles-activation-$USER = {
description = "Guix profiles activation for $USER";
wantedBy = [ "multi-user.target" ];
after = [ "guix-daemon.service" ];
script = ''
# Link back the profiles.
ln -sf /var/guix/profiles/per-user/$USER/current-guix /home/$USER/.config/guix/current
ln -sf /var/guix/profiles/per-user/$USER/guix-profile /home/$USER/.guix-profile
ln -sf /var/guix/profiles/per-user/$USER/guix-home /home/$USER/.guix-home
# Activate the Guix home profile.
/var/guix/profiles/per-user/$USER/guix-home/activate
'';
} Another way would be to use environment.extraInit = ''
# Link back the profiles.
ln -sf /var/guix/profiles/per-user/$USER/current-guix $HOME/.config/guix/current
ln -sf /var/guix/profiles/per-user/$USER/guix-profile $HOME/.guix-profile
ln -sf /var/guix/profiles/per-user/$USER/guix-home $HOME/.guix-home
# Activate the Guix home profile.
/var/guix/profiles/per-user/$USER/guix-home/activate
''; This is closer to the supposed solution I would do (except more elegant). |
I haven't formally revisit these issues yet (just putting my thoughts in the open) but I think creating an activation script for these profiles (so that they can regenerated at startup) would solve the crux of this issue. I guess a script written in Guile (to interact with Guix API) can be the solution(?). I'm not aware if it's even possible in the first place. This should be investigated in the future. |
This is now implemented in nixpkgs' version of the module. Though Guix home is not yet supported since it has other things for me to worry about such as running the activation script of the profile (but it should be trivial to add it if needed, it just needs some more consideration for nixpkgs' version). |
I'll consider this closed since it resolves the behavior now. For the missing Guix home support, it will be considered resolved at #8. |
Describe the bug
I'm using ephemeral home and root[0], and the directories where I store my files are mounted at boot. This means that all files under
~/
is removed. After rebooting I don't have the links~/.guix-profile
;~/.guix-home
; and~/.profile
.I'm trying to use
guix home
for configuring my home environment, instead of Home Manager. This is intended as a way to test out Guix; and potentially be a stepping stone to fully move over to Guix from NixOS on my desktop systems.The link
seems to be created when I install a package into my profile with
guix install kakoune
, but not when I try to update my home environment by runningguix home reconfigure a12l.scm
. I also get warnings that~/.profile
doesn't exist when I open a shell.(removed irrelevant directories from the output)
To Reproduce
Steps to reproduce the behavior:
~/.guix-profile
and~/.guix-home
directoriesExpected behavior
The symbolic links
~/.guix-profile
;~/.guix-home
; and~/.profile
are recreated at startup if missing.[0] https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
The text was updated successfully, but these errors were encountered: