mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
fontconfig: use a prettier "real directory" hack
This commit is contained in:
parent
e0a87d75e9
commit
179ce0aacf
1 changed files with 5 additions and 17 deletions
|
@ -36,22 +36,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# Create two dummy files in /lib/fontconfig to make sure that
|
|
||||||
# buildEnv creates a real directory path. These files are removed
|
|
||||||
# in home.extraProfileCommands below so the packages will not
|
|
||||||
# become "runtime" dependencies.
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
(pkgs.writeTextFile {
|
# Make sure that buildEnv creates a real directory path so that we avoid
|
||||||
name = "hm-dummy1";
|
# trying to write to a read-only location.
|
||||||
destination = "/lib/fontconfig/hm-dummy1";
|
(pkgs.runCommandLocal "dummy-fc-dir1" { } "mkdir -p $out/lib/fontconfig")
|
||||||
text = "dummy";
|
(pkgs.runCommandLocal "dummy-fc-dir2" { } "mkdir -p $out/lib/fontconfig")
|
||||||
})
|
|
||||||
|
|
||||||
(pkgs.writeTextFile {
|
|
||||||
name = "hm-dummy2";
|
|
||||||
destination = "/lib/fontconfig/hm-dummy2";
|
|
||||||
text = "dummy";
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.extraProfileCommands = ''
|
home.extraProfileCommands = ''
|
||||||
|
@ -76,8 +65,7 @@ in {
|
||||||
unset FONTCONFIG_FILE
|
unset FONTCONFIG_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove hacky dummy files.
|
# Remove the fontconfig directory if no files were available.
|
||||||
rm $out/lib/fontconfig/hm-dummy?
|
|
||||||
rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig
|
rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue