mirror of
https://codeberg.org/27/inception-of-things.git
synced 2025-08-11 20:12:53 +02:00
🚧 wip: progress on p1 + changed provider to virtualbox
Signed-off-by: xtrm <oss@xtrm.me>
This commit is contained in:
36
vm/flake.nix
36
vm/flake.nix
@ -27,17 +27,16 @@
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
let
|
||||
vm = nixos-generators.nixosGenerate {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit hostname;
|
||||
generate-vm = modules:
|
||||
nixos-generators.nixosGenerate {
|
||||
inherit system, modules;
|
||||
specialArgs = {
|
||||
inherit hostname;
|
||||
};
|
||||
format = "vm";
|
||||
};
|
||||
modules = [
|
||||
./configuration.nix
|
||||
];
|
||||
format = "vm";
|
||||
};
|
||||
in
|
||||
vm = generate-vm [ ./configuration.nix ];
|
||||
in
|
||||
{
|
||||
inherit vm;
|
||||
default = vm;
|
||||
@ -58,7 +57,22 @@
|
||||
script = pkgs.writeShellScriptBin "${scriptName}" ''
|
||||
${selfPkgs.vm}/bin/run-${hostname}-vm \
|
||||
-enable-kvm \
|
||||
-virtfs local,path=$(${pkgs.coreutils}/bin/pwd)/..,mount_tag=host0,security_model=passthrough,id=host0
|
||||
-virtfs local,path=$(${pkgs.coreutils}/bin/pwd)/..,mount_tag=host0,security_model=mapped-xattr,id=host0
|
||||
'';
|
||||
in
|
||||
{
|
||||
type = "app";
|
||||
program = "${script}/bin/${scriptName}";
|
||||
};
|
||||
|
||||
vm-nodisplay =
|
||||
let
|
||||
scriptName = "run-${hostname}-vm-nodisplay";
|
||||
script = pkgs.writeShellScriptBin "${scriptName}" ''
|
||||
${selfPkgs.vm}/bin/run-${hostname}-vm \
|
||||
-enable-kvm \
|
||||
-nographic \
|
||||
-virtfs local,path=$(${pkgs.coreutils}/bin/pwd)/..,mount_tag=host0,security_model=mapped-xattr,id=host0
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
Reference in New Issue
Block a user