Skip to content

Instantly share code, notes, and snippets.

@lheckemann
Last active April 25, 2018 10:32
Show Gist options
  • Save lheckemann/31585e985fdd11eb7cd247584a78cffc to your computer and use it in GitHub Desktop.
Save lheckemann/31585e985fdd11eb7cd247584a78cffc to your computer and use it in GitHub Desktop.
Create NixOS installation image with ZFS support
#!/bin/sh
# (first install nix; curl https://nixos.org/nix/install | sh)
cat > /tmp/nixos-with-zfs-image.nix <<EOF
(import <nixpkgs/nixos> {
configuration = {
imports = [ <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix> ];
boot.supportedFilesystems = [ "zfs" ];
};
}).config.system.build.isoImage
EOF
nix build -f /tmp/nixos-with-zfs-image.nix
# Image is now in result/iso/nixos-*.iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment