mirror of
https://codeberg.org/27/inception-of-things.git
synced 2025-08-11 20:12:53 +02:00
71 lines
1.5 KiB
Nix
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
|
|
);
|
|
};
|
|
}
|