demo vm
This commit is contained in:
parent
2d4b9bb0ed
commit
6034940039
5 changed files with 175 additions and 64 deletions
|
@ -2,10 +2,11 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, inputs, ... }: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./vms.nix
|
||||
];
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
|
@ -27,10 +28,10 @@
|
|||
# Additional packages
|
||||
environment.systemPackages = with pkgs; [ vault ];
|
||||
|
||||
networking.useNetworkd = true;
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = "curses";
|
||||
};
|
||||
|
||||
home-manager.users.vivian = import ./home.nix;
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
_: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv = { enable = true; };
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
sessionVariables = { DIRENV_LOG_FORMAT = ""; };
|
||||
};
|
||||
}
|
32
nixos/hosts/olympus/bastion/vms.nix
Normal file
32
nixos/hosts/olympus/bastion/vms.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ config, pkgs, inputs, ... }: {
|
||||
imports = [
|
||||
inputs.microvm.nixosModules.host
|
||||
];
|
||||
|
||||
microvm.vms = {
|
||||
test-vm = {
|
||||
inherit pkgs;
|
||||
|
||||
# (Optional) A set of special arguments to be passed to the MicroVM's NixOS modules.
|
||||
#specialArgs = {};
|
||||
|
||||
# The configuration for the MicroVM.
|
||||
# Multiple definitions will be merged as expected.
|
||||
config = {
|
||||
# It is highly recommended to share the host's nix-store
|
||||
# with the VMs to prevent building huge images.
|
||||
microvm.hypervisor = "crosvm";
|
||||
microvm.shares = [{
|
||||
source = "/nix/store";
|
||||
mountPoint = "/nix/.ro-store";
|
||||
tag = "ro-store";
|
||||
proto = "virtiofs";
|
||||
}];
|
||||
|
||||
# Any other configuration for your MicroVM
|
||||
# [...]
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue