2017-02-24 22:17:52 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../profiles/qemu-guest.nix
|
|
|
|
../profiles/headless.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
config = {
|
2017-02-24 22:19:53 +01:00
|
|
|
fileSystems."/" = {
|
|
|
|
device = "/dev/disk/by-label/nixos";
|
|
|
|
autoResize = true;
|
|
|
|
};
|
|
|
|
|
2018-01-06 14:52:51 +01:00
|
|
|
boot.growPartition = true;
|
2017-02-24 22:17:52 +01:00
|
|
|
boot.kernelParams = [ "console=ttyS0" ];
|
|
|
|
boot.loader.grub.device = "/dev/vda";
|
|
|
|
boot.loader.timeout = 0;
|
|
|
|
|
|
|
|
# Allow root logins
|
2017-09-11 18:33:33 +02:00
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
permitRootLogin = "prohibit-password";
|
|
|
|
passwordAuthentication = mkDefault false;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.cloud-init.enable = true;
|
2017-02-24 22:17:52 +01:00
|
|
|
|
|
|
|
# Put /tmp and /var on /ephemeral0, which has a lot more space.
|
|
|
|
# Unfortunately we can't do this with the `fileSystems' option
|
|
|
|
# because it has no support for creating the source of a bind
|
|
|
|
# mount. Also, "move" /nix to /ephemeral0 by layering a unionfs-fuse
|
|
|
|
# mount on top of it so we have a lot more space for Nix operations.
|
|
|
|
|
|
|
|
/*
|
|
|
|
boot.initrd.postMountCommands =
|
|
|
|
''
|
|
|
|
mkdir -m 1777 -p $targetRoot/ephemeral0/tmp
|
|
|
|
mkdir -m 1777 -p $targetRoot/tmp
|
|
|
|
mount --bind $targetRoot/ephemeral0/tmp $targetRoot/tmp
|
|
|
|
|
|
|
|
mkdir -m 755 -p $targetRoot/ephemeral0/var
|
|
|
|
mkdir -m 755 -p $targetRoot/var
|
|
|
|
mount --bind $targetRoot/ephemeral0/var $targetRoot/var
|
|
|
|
|
|
|
|
mkdir -p /unionfs-chroot/ro-nix
|
|
|
|
mount --rbind $targetRoot/nix /unionfs-chroot/ro-nix
|
|
|
|
|
|
|
|
mkdir -p /unionfs-chroot/rw-nix
|
|
|
|
mkdir -m 755 -p $targetRoot/ephemeral0/nix
|
|
|
|
mount --rbind $targetRoot/ephemeral0/nix /unionfs-chroot/rw-nix
|
|
|
|
unionfs -o allow_other,cow,nonempty,chroot=/unionfs-chroot,max_files=32768 /rw-nix=RW:/ro-nix=RO $targetRoot/nix
|
|
|
|
'';
|
|
|
|
|
|
|
|
boot.initrd.supportedFilesystems = [ "unionfs-fuse" ];
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
}
|