1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

Use preferLocalBuild with runCommand

This commit is contained in:
Robert Helgesson 2018-11-14 20:59:45 +01:00
parent f4ebbcbf70
commit 0efda9cd6b
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 23 additions and 12 deletions

View file

@ -6,11 +6,17 @@ let
cfg = config.programs.direnv; cfg = config.programs.direnv;
configFile = config: configFile = config:
pkgs.runCommand "config.toml" { buildInputs = [ pkgs.remarshal ]; } '' pkgs.runCommand "config.toml"
remarshal -if json -of toml \ {
< ${pkgs.writeText "config.json" (builtins.toJSON config)} \ buildInputs = [ pkgs.remarshal ];
> $out preferLocalBuild = true;
''; allowSubstitutes = false;
}
''
remarshal -if json -of toml \
< ${pkgs.writeText "config.json" (builtins.toJSON config)} \
> $out
'';
in in

View file

@ -12,13 +12,18 @@ let
pluginDirs = map (pkg: "${pkg}/share/obs/obs-plugins") packages; pluginDirs = map (pkg: "${pkg}/share/obs/obs-plugins") packages;
plugins = concatMapStringsSep " " (p: "${p}/*") pluginDirs; plugins = concatMapStringsSep " " (p: "${p}/*") pluginDirs;
in in
pkgs.runCommand "obs-studio-plugins" {} '' pkgs.runCommand "obs-studio-plugins"
mkdir $out {
[[ '${plugins}' ]] || exit 0 preferLocalBuild = true;
for plugin in ${plugins}; do allowSubstitutes = false;
ln -s "$plugin" $out/ }
done ''
''; mkdir $out
[[ '${plugins}' ]] || exit 0
for plugin in ${plugins}; do
ln -s "$plugin" $out/
done
'';
in in