Avoid top-level `with ...;` in pkgs/games/factorio/utils.nix

authored by philiptaron.tngl.sh and committed by Valentin Gagarin 9be6e220 75d2271a

+13 -2
+13 -2
pkgs/games/factorio/utils.nix
··· 1 # This file provides a top-level function that will be used by both nixpkgs and nixos 2 # to generate mod directories for use at runtime by factorio. 3 { lib, stdenv }: 4 - with lib; 5 { 6 mkModDirDrv = mods: modsDatFile: # a list of mod derivations 7 let ··· 18 # NB: there will only ever be a single zip file in each mod derivation's output dir 19 ln -s $modDrv/*.zip $out 20 done 21 - '' + (lib.optionalString (modsDatFile != null) '' 22 cp ${modsDatFile} $out/mod-settings.dat 23 ''); 24 };
··· 1 # This file provides a top-level function that will be used by both nixpkgs and nixos 2 # to generate mod directories for use at runtime by factorio. 3 { lib, stdenv }: 4 + let 5 + inherit (lib) 6 + flatten 7 + head 8 + optionals 9 + optionalString 10 + removeSuffix 11 + replaceStrings 12 + splitString 13 + unique 14 + ; 15 + in 16 { 17 mkModDirDrv = mods: modsDatFile: # a list of mod derivations 18 let ··· 29 # NB: there will only ever be a single zip file in each mod derivation's output dir 30 ln -s $modDrv/*.zip $out 31 done 32 + '' + (optionalString (modsDatFile != null) '' 33 cp ${modsDatFile} $out/mod-settings.dat 34 ''); 35 };