nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.14k stars 85 forks source link

Build fails when all directories use symlink method #105

Closed tom-kuca closed 1 year ago

tom-kuca commented 1 year ago

Given a configuration

  persistence = {
      "/persist/home/tomas" = {
        directories = [
          { directory = "downloads"; method = "symlink"; }
        ];
      };
    };

build fails with an error

[nix-shell:~/nix-config]$ home-manager --flake . build
error: builder for '/nix/store/3bnvjh4rjggywr0lniwc0zki07hkpb3y-activation-script.drv' failed with exit code 2;
       last 2 log lines:
       > /nix/store/s77bdz2a49jrj8byhi4xyna5ifkmhnc0-activation-script: line 152: syntax error near unexpected token `}'
       > /nix/store/s77bdz2a49jrj8byhi4xyna5ifkmhnc0-activation-script: line 152: `}'
       For full logs, run 'nix log /nix/store/3bnvjh4rjggywr0lniwc0zki07hkpb3y-activation-script.drv'.
error: 1 dependencies of derivation '/nix/store/7bkzpr53544zl0h17i7cwp7k7iwxslrk-home-manager-generation.drv' failed to build

The relevant lines in nix/store/s77bdz2a49jrj8byhi4xyna5ifkmhnc0-activation-script are

   148  
   149  _iNote "Activating %s" "unmountPersistentStoragePaths"
   150  unmountBindMounts() {
   151  
   152  }
   153  

The code is generated by https://github.com/nix-community/impermanence/blob/def994adbdfc28974e87b0e4c949e776207d5557/home-manager.nix#L418. According to Stack Overflow, empty function in bash is invalid. Adding : there should do the job.