nix: add nix module and runnable VM
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user