Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pkgs = import <nixpkgs> {};
- lib = pkgs.lib;
- dom0_config = { pkgs, ... }:
- {
- virtualisation.xen = {
- enable = true;
- bootParams = [ "loglvl=all guest_loglvl=all com1=38400,8n1 console=com1" ];
- };
- fileSystems = {
- "/" = { device = "LABEL=nixos"; fsType = "ext4"; };
- "/stuff" = { device = "/dev/sdb"; fsType = "ext4"; autoFormat = true; };
- };
- boot = {
- loader.grub = {
- enable = true;
- device = "/dev/vda";
- };
- kernelParams = [ "console=hvc0 earlyprintk=xen" ];
- };
- services.mingetty.autologinUser = "root";
- systemd.services.xentest = {
- after = [ "xen-bridge.service" "xen-qemu.service" ];
- description = "xen automated testing";
- wantedBy = [ "multi-user.target" ];
- path = with pkgs; [ xen e2fsprogs utillinux ];
- script = ''
- exec > /dev/hvc0 2>&1
- xl list
- touch /stuff/stuff
- #shutdown -h now
- '';
- };
- };
- dom0_build = import <nixpkgs/nixos> { configuration = dom0_config; };
- rootDisk = import <nixpkgs/nixos/lib/make-disk-image.nix> {
- # ~5mins to build
- name = "xen-rootfs";
- inherit pkgs lib;
- config = dom0_build.config;
- partitioned = true;
- installBootLoader = true;
- diskSize = 4096;
- fixValidity = false;
- };
- rootDisk;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement