nix: add nix module and runnable VM

This commit is contained in:
2026-05-24 22:25:42 +09:00
parent 528a20868a
commit 7d0f35e12e
4 changed files with 267 additions and 0 deletions
+23
View File
@@ -32,6 +32,20 @@
};
in f system pkgs toolchain);
in {
apps = let
mkApp = program: description: {
type = "app";
program = toString program;
meta = {
inherit description;
};
};
mkVm = name: mkApp "${self.nixosConfigurations.${name}.config.system.build.vm}/bin/run-nixos-vm";
in forAllSystems (system: pkgs: _: {
default = self.apps.${system}.vm;
vm = mkVm "vm" "Start a NixOS VM with bro installed";
});
devShells = forAllSystems (system: pkgs: toolchain: {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
@@ -53,6 +67,15 @@
};
};
nixosModules = {
default = self.nixosModules.bro;
bro = import ./nix/module.nix;
};
nixosConfigurations = {
vm = import ./nix/vm.nix { inherit self nixpkgs; };
};
packages = forAllSystems (system: pkgs: _:
let
cargoToml = fromTOML (builtins.readFile ./Cargo.toml);