-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Symlinks created via the home-manager module are broken #177
Comments
Temporary fix: home.activation.createTargetFileDirectoriesFixup =
let
isSymlink = entry: (!lib.isString entry) && (entry.method == "symlink");
entryPath = entry: if lib.isString entry then entry else entry.directory;
cfg = config.home.persistence;
persistenceRoots = lib.attrNames cfg;
mkdirPersistentLocations = map (root:
let
persistentDiskPath = cfg.${root}.persistentStoragePath;
persistentDirectories =
# Collect all directories which are symlinks
(map entryPath (lib.filter isSymlink cfg.${root}.directories)) ++
# And all directories of files
(map lib.dirOf (map entryPath (cfg.${root}.files)));
completePaths = map (path: lib.path.append (/. + root) path) persistentDirectories;
mkdirCommands = lib.concatMapStrings (completePath: "run mkdir -p ${lib.escapeShellArg completePath}\n") completePaths;
in ''
# mkdir's for ${root}
${mkdirCommands}
''
) persistenceRoots;
in
config.lib.dag.entryBetween [ "writeBoundary" ] [ "createTargetFileDirectories" ] (
lib.concatMapStrings (cmds: "${cmds}\n") mkdirPersistentLocations
); This should create all directories as intended when put into the home-manager configuration. |
I've also ran into this problem. |
I think I am running a similar issue. All my directories are working. If I add the following:
The chain leads to nowhere, leading to "No such file or directory". I suspect it is due to the It does work with |
Its just generally broken with the symlink method because there's the bug in the logic mentioned above, doesn't matter whether the name has a leading dot or not |
Adding the following configuration creates a broken symlink
persistent
in/home/janrupf
:Inspecting:
So the symlink does point to the correct location afterall - the issue is, that location is never created.
The creation is supposed to happen here:
impermanence/home-manager.nix
Lines 451 to 461 in a33ef10
Inspecting the flake output reveals that the command added to
home.activation.createTargetFileDirectories
ismkdir -p /persistent/home/janrupf/.
- notice the dot at the end. I think this is caused by thedirOf
call on line 458.The text was updated successfully, but these errors were encountered: