🔨 chore: initial commit

Signed-off-by: xtrm <oss@xtrm.me>
This commit is contained in:
xtrm
2025-02-19 13:05:06 +01:00
commit e9f538ed92
14 changed files with 343 additions and 0 deletions

70
vm/flake.nix Normal file
View File

@ -0,0 +1,70 @@
{
description = "A NixOS configuration for the Inception of Things";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
systems.url = "github:nix-systems/x86_64-linux";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
nixos-generators,
...
}@inputs:
let
inherit (self) outputs;
systems = (import inputs.systems);
forAllSystems = nixpkgs.lib.genAttrs systems;
hostname = "iot-box";
in
{
packages = forAllSystems (
system:
let
vm = nixos-generators.nixosGenerate {
inherit system;
specialArgs = {
inherit hostname;
};
modules = [
./configuration.nix
];
format = "vm";
};
in
{
inherit vm;
default = vm;
}
);
apps = forAllSystems (
system:
let
vm = {
type = "app";
program = "${self.packages.${system}.vm}/bin/run-${hostname}-vm";
programArgs = [ "-enable-kvm" ];
};
in
{
inherit vm;
default = vm;
}
);
formatter = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
in
pkgs.nixfmt-rfc-style
);
};
}