by Herwig Hochleitner
is
is
/etc
is
nix-copy-closure
rsync
Just update expressions on your NIX_PATH
echo $NIX_PATH
nixpkgs=/var/nixpkgs:nixos=/var/nixpkgs/nixos:nixos-config=/etc/nixos/configuration.nix
Official Distribution Mechanism.
Distribute Nix expressions via HTTP.
CI via
Hydra
allows for automatic creation
and binary cache
Many providers. Remote NixOS, container, vm, aws, gce, azure, digital_ocean, hetzner
nixops {create,delete,deploy,modify,start,stop,ssh,...}
# machines.nix { staging = { ... }: { imports = [ ./configuration.nix ]; deployment.targetHost = "11.22.33.44"; acme.environment = "staging"; }; # ... }
NixOS' - style lifecycle and provision for the cloud
# Deploy / Update
disnix-env -s services.nix -i infrastructure.nix -d distribution.nix
# Rollback
disnix-env --list-generations
1 2018-02-13 13:22:35
2 2018-02-13 13:30:24 (current)
disnix-env --rollback
disnix-env --switch-to-generation 1
nix-copy-closure
Transfer packages between Nix stores
nix-copy-closure --to root@staging $(which pkg)
rsync
Transfer packages between non-Nix machines
rsync -avz \
$(nix-store -qR
$(which pkg)) \
root@staging:/nix/store
unshare
docker
docker
serviceFrom the manual
buildImage {
name = "redis";
tag = "latest";
fromImage = someBaseImage;
fromImageName = null;
fromImageTag = "latest";
contents = pkgs.redis;
runAsRoot = ''
#!${stdenv.shell}
mkdir -p /data
'';
config = {
Cmd = [ "/bin/redis-server" ];
WorkingDir = "/data";
Volumes = {
"/data" = {};
};
};
}
NixOS isn't a ready-made package, and it's not tied to Docker. It does, however, solve many of the same problems.
You could conceivably deploy a Kubernetes cluster with Rancher Services via NixOS. Or anything else.