home-environment: allow arbitrary paths as home file names

By not using the home file name in a derivation name, the home file name
is no longer exposed to the naming restrictions for nix store paths.

For example, it's now possible to define home files with spaces in their
names without providing a target or source attribute.
This commit is contained in:
Cornelius Mika 2017-09-06 10:17:26 +02:00
parent 9c1b3735b4
commit 2524d92e2b

View file

@ -134,8 +134,7 @@ in
config = { config = {
target = mkDefault name; target = mkDefault name;
source = mkIf (config.text != null) ( source = mkIf (config.text != null) (
let name' = "user-etc-" + baseNameOf name; mkDefault (pkgs.writeText "home-file" config.text)
in mkDefault (pkgs.writeText name' config.text)
); );
}; };
}) })