Commit 0c24c1ec authored by Ben Millwood's avatar Ben Millwood
Browse files

factorio: Give advice on retaining source tarball

When manually adding the source tarball to the store with
`nix-prefetch-url`, it can be GC'd after the derivation is built. Then
if any library version updates and the derivation wants to rebuild, the
same tarball needs to be redownloaded and re-prefetched. (Even if
downloading it automatically, this can be annoying on a slower network
connection, since it's nearly 4GB).

This advice is mostly helpful on NixOS and it'd be nice to offer
something to non-NixOS nix users as well, but I don't know what it would
be.
parent 0bf0c12a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -70,6 +70,15 @@ let
      nix-prefetch-url file://\''$HOME/Downloads/factorio_\''${releaseType}_x64_\''${version}.tar.xz --name factorio_\''${releaseType}_x64-\''${version}.tar.xz

    Note the ultimate "_" is replaced with "-" in the --name arg!

    If you go this route you might want to tell nix to explicitly hold on to the
    source tarball. Otherwise it could get GC'd from the nix store and you'd
    have to redownload it next time the package wants to rebuild to use a newer
    dependency. E.g. if you're using nixos:

      system.extraDependencies = [
        factorio.src
      ];
  '';

  desktopItem = makeDesktopItem {