Open PowderedToastMan opened 1 month ago
I am encountering a similar issue and created a minimal setup to reproduce in this folder which includes:
nixos
and home-manager
modulesneededForBoot = true
):
/persist/data/system
/persist/data/system
bphenriques
data: /persist/data/bphenriques
bphenriques
cache: /persist/cache/bphenriques
.gnupg
which is also part of the persisted directories.Issue:
.config/systemd
under the home's persisted directory, the folder .gnupg
no longer contains the links.Relevant snippet:
{
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gnome3;
};
...
home.persistence."/persist/data/bphenriques" = {
allowOther = true;
directories = [
".dotfiles"
"Desktop"
"Downloads"
# Both absent: work
# Both present: break
# only nix one: works
# only systemd: breaks -> the culprit
#".local/share/nix" # trusted settings and repl history
".config/systemd" # systemd timers
".ssh"
".gnupg"
];
};
}
After isolating the issue, I also tried your patch https://github.com/nix-community/impermanence/pull/199 but did not work for me.
It is hard to debug this and impermanence does not complain :sweat:
edit summary:
systemd.user.tmpfiles.rules
that sets fixes permissions to sensitive directories. Doesnt affect the issue.degraded
message if I manually activate home-manager as @PowderedToastMan did./nix/store/v3ilw80a0syc5l3daqayci4s9pn7yzcv-bindfs-1.17.7/bin/bindfs -o fsname='/persist/data/bphenriques/.gnupg' '/persist/data/bphenriques/.gnupg' '/home/bphenriques/.gnupg'
, it works. Why was it skipped? The elif
also returns 1
therefore the else
should run.runUnmountPersistentStoragePaths
log as it runs everytime (including on the scenario that works). If I can bind manually, why are my mounts not working?systemd
stating that the *.mount
was Desactivated successfully
. I am running out of clues.Never persist .config/systemd
:sweat_smile: I copied from someone's impermenance file and it seemed like a good idea but it contains the service
definitions that I needed :runner: :dash: Good way to learn linux!
FYI: Looking through the code looks like A LOT is duplicated and mountpoints aren't even properly handled (eg: parsing mount
output vs using findmnt
), so I'm actually working on refactoring the whole home-manager
and de-duplicating code at https://github.com/nix-community/impermanence
Under my current configuration, the Impermanence module refuses to bindMount folders under my home directory because it mistakenly believes there is already and active mount.
I maintain a
/persist
folder containing all persistent data. Under this folder, I mount a few zfs filesystems.The folder fails to mount when activating home-manager, only creating an empty folder. Upon closer inspection, it would appear that the logic that determines whether the destination is already mounted is mistakenly tripping on this setup.
It appears the problem is the grep logic that takes the output of mount:
The grep statement isn't looking for whitespace at the beginning of the file path. The following seems to work:
This grep logic appears in a few places. Are there any issues with adding a check for whitespace preceding the path?