Files
inception-of-things/vm/flake.nix
xtrm e9f538ed92 🔨 chore: initial commit
Signed-off-by: xtrm <oss@xtrm.me>
2025-02-19 13:05:06 +01:00

71 lines
1.5 KiB
Nix

{
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
);
};
}