2020-01-04 20:58:00 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
appvm = (pkgs.buildGoPackage {
|
|
|
|
# TODO ../default.nix
|
|
|
|
name = "appvm";
|
|
|
|
goPackagePath = "code.dumpstack.io/tools/appvm";
|
|
|
|
goDeps = ../deps.nix;
|
|
|
|
src = builtins.fetchGit {
|
|
|
|
url = "https://code.dumpstack.io/tools/appvm.git";
|
|
|
|
ref = "master";
|
|
|
|
};
|
|
|
|
buildInputs = [ pkgs.makeWrapper ];
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $bin/bin/appvm \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ pkgs.nix pkgs.virt-viewer ]}"
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
in {
|
|
|
|
imports = [
|
2020-01-05 08:49:48 +00:00
|
|
|
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
|
2020-01-04 20:58:00 +00:00
|
|
|
./target.nix
|
|
|
|
#./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
time.timeZone = "UTC";
|
|
|
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
|
|
|
# You can not use networking.networkmanager with networking.wireless
|
|
|
|
networking.wireless.enable = false;
|
|
|
|
|
|
|
|
users.users.user = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "audio" "libvirtd" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.libvirtd = {
|
|
|
|
enable = true;
|
|
|
|
qemuVerbatimConfig = ''
|
|
|
|
namespaces = []
|
|
|
|
user = "user"
|
|
|
|
group = "users"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# TODO run ${appvm}/bin/appvm autoballoon each second
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
appvm virtmanager chromium
|
|
|
|
# Cache packages required for application VMs
|
2020-01-05 06:58:46 +00:00
|
|
|
xmonad-with-packages spice-vdagent bc qemu_test lightdm
|
2020-01-04 20:58:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.displayManager.gdm = {
|
|
|
|
enable = true;
|
|
|
|
wayland = false; # FIXME
|
|
|
|
autoLogin = {
|
|
|
|
enable = true;
|
|
|
|
user = "user";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.xserver.desktopManager.gnome3.enable = true;
|
|
|
|
}
|