-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(nixosProfiles.vm): Flatten directory structure [WIP]
- Loading branch information
1 parent
f3f57b2
commit 1f9536f
Showing
12 changed files
with
135 additions
and
88 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
{ inputs , config, lib, pkgs , ... }: | ||
{ | ||
inputs, | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
imports = [ | ||
(inputs.self + /nixos/profiles/qemu.nix) | ||
]; | ||
|
||
# See: https://nixos.wiki/wiki/Libvirt | ||
# QEMU web clients: | ||
# - https://cgit.freedesktop.org/spice/spice-html5/ | ||
|
@@ -8,15 +17,15 @@ | |
# Since libvirt doesn't support websockets on its own, we'll need to add websockify to your configuration.nix | ||
services.networking.websockify = { | ||
enable = false; | ||
sslCert = "/https-cert.pem"; | ||
sslKey = "/https-key.pem"; | ||
sslCert = config.sops.secrets.websockify-ssl-cert.path; | ||
sslKey = config.sops.secrets.websockify-ssl-key.path; | ||
portMap = { | ||
"5959" = 5900; | ||
}; | ||
}; | ||
services.nginx = { | ||
enable = config.services.networking.websockify.enable; | ||
virtualHosts."qemu-web-client.fw.local" = { | ||
virtualHosts."qemu-web-client.${config.networking.hostName}.local" = { | ||
forceSSL = true; | ||
root = "/var/www/"; | ||
locations."/spice/" = { | ||
|
@@ -30,9 +39,27 @@ | |
proxy_buffering off; | ||
''; | ||
}; | ||
sslCertificate = "/https-cert.pem"; | ||
sslCertificateKey = "/https-key.pem"; | ||
listen = [ { addr = "*"; port = 45000; ssl = true; } ]; | ||
sslCertificate = config.sops.secrets.websockify-ssl-cert.path; | ||
sslCertificateKey = config.sops.secrets.websockify-ssl-key.path; | ||
listen = [ | ||
{ | ||
addr = "*"; | ||
port = 45000; | ||
ssl = true; | ||
} | ||
]; | ||
}; | ||
}; | ||
|
||
security.acme.certs = { | ||
"websockify.${config.networking.domain}" = { | ||
email = "[email protected]"; | ||
webroot = "/var/lib/acme/acme-challenge/"; | ||
}; | ||
}; | ||
|
||
sops.secrets = lib.mkIf config.services.networking.websockify.enable { | ||
websockify-ssl-cert = {}; | ||
websockify-ssl-key = {}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
pkgs, | ||
user, | ||
... | ||
}: { | ||
environment.systemPackages = [pkgs.qemu-utils pkgs.quickemu]; | ||
users.extraGroups.qemu-libvirtd.members = [user]; | ||
# virtualisation.qemu = { | ||
# guestAgent.enable = true; | ||
# diskInterface = "virtio"; # virtio | scsi | ide | ||
# networkingOptions = [ | ||
# "-net nic,netdev=user.0,model=virtio" | ||
# "-netdev user,id=user.0,\${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}" | ||
# ]; | ||
# options = [ "-vga std" ]; | ||
# ovmf = { | ||
# enable = true; | ||
# packages = with pkgs; [ OVMFFull.fd pkgsCross.aarch64-multiplatform.OVMF.fd ]; | ||
# }; | ||
# }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{inputs, ...}: { | ||
imports = [ | ||
(inputs.self + /nixos/profiles/vm-host.nix) | ||
(inputs.self + /nixos/profiles/libvirt.nix) | ||
(inputs.self + /nixos/profiles/kvm.nix) | ||
(inputs.self + /nixos/profiles/qemu.nix) | ||
(inputs.self + /nixos/profiles/qemu-web.nix) | ||
# (inputs.self + /nixos/profiles/vm-guest-windows.nix) | ||
]; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.