1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-13 22:59:44 +01:00
home-manager/tests/modules/files/target-with-shellvar.nix
Robert Helgesson 4fe5afa755
files: make sure the target file name is escaped
The previous implementation would allow variables to sneak into the
file names. This commit makes sure the resulting target file path
exactly matches the expected path.
2020-08-29 18:22:03 +02:00

15 lines
299 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
home.file."$HOME/$FOO/bar baz".text = "blah";
nmt.script = ''
assertFileExists 'home-files/$HOME/$FOO/bar baz';
assertFileContent 'home-files/$HOME/$FOO/bar baz' \
${pkgs.writeText "expected" "blah"}
'';
};
}