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:
@ -12,7 +12,6 @@
|
||||
];
|
||||
|
||||
networking.hostName = hostname;
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Since `fileSystems` is ignored by nixos-generators, we need to be creative
|
||||
@ -24,6 +23,7 @@
|
||||
script = ''
|
||||
mkdir -p /iot
|
||||
/run/wrappers/bin/mount -t 9p -o trans=virtio,version=9p2000.L host0 /iot
|
||||
${pkgs.bindfs}/bin/bindfs --map=1000/0:@100/@0 /iot /iot
|
||||
'';
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
@ -38,11 +38,36 @@
|
||||
users.users.root = {
|
||||
password = "toor";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "wheel" "libvirtd" ];
|
||||
};
|
||||
|
||||
services = {
|
||||
getty.autologinUser = "root";
|
||||
openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
settings = {
|
||||
PermitRootLogin = "yes";
|
||||
PasswordAuthentication = true;
|
||||
AllowUsers = null;
|
||||
};
|
||||
};
|
||||
xserver = {
|
||||
enable = true;
|
||||
xkb = {
|
||||
layout = "fr";
|
||||
variant = "us";
|
||||
};
|
||||
displayManager.gdm.enable = true;
|
||||
desktopManager.gnome.enable = true;
|
||||
};
|
||||
libinput.enable = true;
|
||||
};
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
|
||||
programs = {
|
||||
zsh = {
|
||||
@ -56,6 +81,8 @@
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
librewolf
|
||||
bindfs
|
||||
vagrant
|
||||
git
|
||||
zip
|
||||
|
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