1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39: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;
configFile = config:
pkgs.runCommand "config.toml" { buildInputs = [ pkgs.remarshal ]; } ''
remarshal -if json -of toml \
< ${pkgs.writeText "config.json" (builtins.toJSON config)} \
> $out
'';
pkgs.runCommand "config.toml"
{
buildInputs = [ pkgs.remarshal ];
preferLocalBuild = true;
allowSubstitutes = false;
}
''
remarshal -if json -of toml \
< ${pkgs.writeText "config.json" (builtins.toJSON config)} \
> $out
'';
in

View file

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