4 nix-shell maintainers/scripts/update-dotnet-lockfiles.nix
6 This script finds all the derivations in nixpkgs that have a 'fetch-deps'
7 attribute, and runs all of them sequentially. This is useful to test changes
8 to 'fetch-deps', 'nuget-to-nix', or other changes to the dotnet build
9 infrastructure. Regular updates should be done through the individual packages
14 pkgs = import ../.. { config.allowAliases = false; };
18 packagesWith = cond: pkgs:
20 packagesWithInner = attrs:
22 lib.mapAttrsToList (name: elem:
24 result = builtins.tryEval elem;
26 if result.success then
30 if lib.isDerivation value then
31 lib.optional (cond value) value
33 if lib.isAttrs value && (value.recurseForDerivations or false || value.recurseForRelease or false) then
34 packagesWithInner value
38 packagesWithInner pkgs;
42 (builtins.tryEval p.outPath).success ||
43 builtins.trace "warning: skipping ${p.name} because it failed to evaluate" false)
44 ((pkgs: (lib.drop (lib.lists.findFirstIndex (p: p.name == startWith) 0 pkgs) pkgs))
45 (packagesWith (p: p ? fetch-deps) pkgs)));
50 % nix-shell maintainers/scripts/update-dotnet-lockfiles.nix
53 fetchScripts = map (p: p.fetch-deps) packages;
55 in pkgs.stdenv.mkDerivation {
56 name = "nixpkgs-update-dotnet-lockfiles";
59 echo "----------------------------------------------------------------"
61 echo "Not possible to update packages using \`nix-build\`"
64 echo "----------------------------------------------------------------"
68 unset shellHook # do not contaminate nested shells
70 for x in $fetchScripts; do