Last active
November 21, 2019 15:58
-
-
Save lordcirth/e949013cadfbddb1446d590d7381ffaa to your computer and use it in GitHub Desktop.
NixOS image build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Everything is as non-root user | |
# Install Nix: | |
# https://nixos.org/nix/ | |
# (Alternatively a NixOS VM using https://nixos.org/nixos/download.html ) | |
sudo apt install libvirt-bin | |
# Requires new login shell | |
sudo usermod -a -G kvm $USER | |
# Add nix build users to kvm group as well | |
for i in {1..32}; do sudo usermod -a -G kvm nixbld${i}; done | |
# Hold current stable. "nixos-stable" will track latest stable, -unstable, etc. | |
nix-channel --add https://nixos.org/channels/nixos-19.09 nixos | |
nix-channel --update | |
git clone https://github.com/lordcirth/nixos_configs | |
cd nixos_configs | |
# import ./core.nix and build 'config.system.build.core' using nixpkgs/nixos, | |
# To use a separate nixpkgs than the system channel, nix-build takes, eg, "-I ../nixpkgs" | |
nix-build '<nixpkgs/nixos>' --arg configuration ./core.nix -A config.system.build.core | |
# 1.3GB | |
ls -lh ./result/ | |
total 1.3G | |
-r--r--r-- 1 root root 4.0G Dec 31 1969 nixos.img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment