I am new to Nix, but so far I am finding it very useful. I’d like to know if I can copy/tar a package installed by Nix from one computer to another that is not connected to the Internet.
I have a RHEL 7 workstation that is connected to the Internet and I was able to install podman version 3.1.0 via Nix. I have a bunch of RHEL 7 boxes that is not connected to the Internet. I’d like to know, in addition to install Nix on those offline boxes, what do I need to do so I could copy podman and all of the other dependencies packages/libraries over?
If you can access the second machine (without internet) from the first one at some point in thime, you can use nix copy to propate the config (you will need to nix build the configuration/packages before).
If you can only reach the second machine with a disk/usbstick, you can still ! :
Oh yes, it is the thing you want to build, a package, en environment or a full nixos configuration ?
If you just want podman, then your-config is just podman.
If you want podman and extra tools, you could write an expression like this default.nix:
{pkgs ? import <nixpkgs> {} }:
{
podman-config = pkgs.buildEnv {
inherit ((import <nixpkgs/nixos> {}).config.system.path)
pathsToLink ignoreCollisions postBuild;
name = "podman-shell";
paths = with pkgs; [ podman ];
};
#... other configurations go there ...
}
You will have to copy this file too and to use it on the other machine, just run nix build podman-config, and you will get a result link in your directory to access it.