add microvms, and try to set up basics

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
ahuston-0 2024-06-22 10:57:23 -04:00
parent be327b6c90
commit f9d31cba65
No known key found for this signature in database
GPG Key ID: 1FACF4075E3212F7
6 changed files with 98 additions and 1 deletions

41
flake.lock generated
View File

@ -267,6 +267,30 @@
"type": "github"
}
},
"microvm": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"spectrum": "spectrum"
},
"locked": {
"lastModified": 1716382614,
"narHash": "sha256-dwUYl8jyMNKidPEM9gTafcRe+3pUh2rH3ZlBrUpsvnw=",
"owner": "astro",
"repo": "microvm.nix",
"rev": "a59c3167f673ce29b65c674deb2bee73d151a96c",
"type": "github"
},
"original": {
"owner": "astro",
"repo": "microvm.nix",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": [
@ -609,6 +633,7 @@
"flake-utils": "flake-utils_2",
"home-manager": "home-manager",
"hyprland-contrib": "hyprland-contrib",
"microvm": "microvm",
"nix": "nix",
"nix-index-database": "nix-index-database",
"nixos-generators": "nixos-generators",
@ -733,6 +758,22 @@
"type": "github"
}
},
"spectrum": {
"flake": false,
"locked": {
"lastModified": 1708358594,
"narHash": "sha256-e71YOotu2FYA67HoC/voJDTFsiPpZNRwmiQb4f94OxQ=",
"ref": "refs/heads/main",
"rev": "6d0e73864d28794cdbd26ab7b37259ab0e1e044c",
"revCount": 614,
"type": "git",
"url": "https://spectrum-os.org/git/spectrum"
},
"original": {
"type": "git",
"url": "https://spectrum-os.org/git/spectrum"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,

View File

@ -72,6 +72,14 @@
inputs.nixpkgs.follows = "nixpkgs";
};
microvm = {
url = "github:astro/microvm.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
nix = {
url = "github:NixOS/nix/latest-release";
inputs = {

33
modules/microvm-host.nix Normal file
View File

@ -0,0 +1,33 @@
{
config,
lib,
inputs,
...
}:
let
cfg = config.rad-dev.microvm-host;
inherit (inputs.microvm.nixosModules) microvm;
in
{
# imports = [microvm.host];
options.rad-dev.microvm-host = {
enable = lib.mkEnableOption "microvm-host";
};
config = lib.mkIf cfg.enable {
networking.useNetworkd = true;
# microvm.shares = [
# {
# tag = "ro-store";
# source = "/nix/store";
# mountPoint = "/nix/.ro-store";
# }
# ];
# systemd.tmpfiles.rules = map (vmHost:
# let
# machineId = lib.addresses.machineId.${vmHost};
# in
# # creates a symlink of each MicroVM's journal under the host's /var/log/journal
# "L+ /var/log/journal/${machineId} - - - - /var/lib/microvms/${vmHost}/journal/${machineId}"
# ) (builtins.attrNames lib.addresses.machineId);
};
}

View File

@ -9,11 +9,13 @@
./attic.nix
./docker.nix
./hydra.nix
./microvms.nix
./minio.nix
./networking.nix
./nextcloud.nix
./services.nix
./zfs.nix
./networking.nix
];
programs.git.lfs.enable = false;

View File

@ -4,5 +4,8 @@
"alice"
"richie"
];
modules = [ inputs.attic.nixosModules.atticd ];
modules = [
inputs.attic.nixosModules.atticd
inputs.microvm.nixosModules.host
];
}

View File

@ -0,0 +1,10 @@
{
config,
lib,
pkgs,
...
}:
{
rad-dev.microvm-host.enable = true;
}