From 3fc7502b3157a14fb384d4e761f316e9c5c52324 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Wed, 2 Sep 2020 19:13:00 +0200 Subject: [PATCH] Use home.activation for homedir symlinks so we can link files with spaces --- configurations/steam.nix | 7 +++++++ modules/zfs.nix | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/configurations/steam.nix b/configurations/steam.nix index f3154c9e..47abf89d 100644 --- a/configurations/steam.nix +++ b/configurations/steam.nix @@ -7,6 +7,13 @@ pulseaudio.support32Bit = true; }; + custom.zfs.homeLinks = [ + { path = ".paradoxlauncher"; type = "data"; } + { path = ".steam"; type = "data"; } + { path = ".local/share/Steam"; type = "data"; } + { path = ".local/share/Paradox Interactive"; type = "data"; } + ]; + home-manager.users.charlotte = { pkgs, ... }: { home.packages = [ pkgs.steam ]; }; diff --git a/modules/zfs.nix b/modules/zfs.nix index 32c9c449..03b08e63 100644 --- a/modules/zfs.nix +++ b/modules/zfs.nix @@ -1,5 +1,9 @@ { config, lib, ... }: - +let + linkCommands = map + (location: "$DRY_RUN_CMD ln -sf -T $VERBOSE_ARG \"/${location.type}/home/charlotte/${location.path}\" \"/home/charlotte/${location.path}\"") + config.custom.zfs.homeLinks; +in { options.custom.zfs = { enable = lib.mkOption { @@ -42,11 +46,9 @@ (map (location: "L ${location.path} - - - - /${location.type}${location.path}") config.custom.zfs.systemLinks) ); - config.home-manager.users.charlotte = { ... }: { - systemd.user.tmpfiles.rules = lib.mkIf config.custom.zfs.enable ( - map - (location: "L /home/charlotte/${location.path} - - - - /${location.type}/home/charlotte/${location.path}") - config.custom.zfs.homeLinks - ); + config.home-manager.users.charlotte = { lib, ... }: { + home.activation = lib.mkIf config.custom.zfs.enable { + linkCommands = lib.hm.dag.entryAfter [ "writeBoundary" ] (lib.concatStringsSep "\n" linkCommands); + }; }; }