diff --git a/README.md b/README.md index 54ba7f5..da1a139 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ # nixos-anywhere-workshop template -[docs](./template/README.md) \ No newline at end of file +[docs](./template/README.md) + +## Build installer ISO with SSH + +```shell +nix-build '' -A config.system.build.isoImage -I nixos-config=iso.nix +ls result/iso/ +``` diff --git a/iso.nix b/iso.nix new file mode 100644 index 0000000..fde5531 --- /dev/null +++ b/iso.nix @@ -0,0 +1,19 @@ +# This module defines a small NixOS installation CD. It does not +# contain any graphical stuff. +# https://nixos.wiki/wiki/Creating_a_NixOS_live_CD +{ config, pkgs, ... }: +{ + imports = [ + + + # Provide an initial copy of the NixOS channel so that the user + # doesn't need to run "nix-channel --update" first. + + ]; + + # Enable SSH in the boot process. + systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ]; + users.users.root.openssh.authorizedKeys.keys = [ + (builtins.readFile ./template/nitrokey.pub) + ]; +}