flake/flake.nix
2024-10-29 08:55:56 +01:00

80 lines
2 KiB
Nix

{
description = "Lyns flake";
inputs = {
microvm.url = "github:astro/microvm.nix";
microvm.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
sops-nix.url = "github:Mic92/sops-nix";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
sops-nix,
lanzaboote,
microvm,
} @ inputs: let
imports = {
imports = [
sops-nix.nixosModules.sops
passInputs
mkLocalModsInput
lanzaboote.nixosModules.lanzaboote
inputs.microvm.nixosModules.host
];
};
passInputs = {
lib,
config,
...
}: {
options.flakePath = lib.mkOption {type = lib.types.path;};
config.flakePath = ./.;
options.inputs = lib.mkOption {type = lib.types.attrs;};
config.inputs = inputs;
options.pkgsInstances = lib.mkOption {type = lib.types.attrs;};
config.pkgsInstances = {
unstable = import inputs.nixpkgs-unstable {system = config.nixpkgs.system;};
};
};
inherit (nixpkgs) lib;
mkLocalMods = import ./meta/mkLocalMods.nix {inherit lib;};
mkLocalModsInput = mkLocalMods {
prefix = ["lyn"];
dir = ./modules;
};
in {
nixosConfigurations = {
"forgenite" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/forgenite
imports
];
};
"forgejo-ci" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/forgejo-ci
imports
];
};
"supernova" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/supernova
imports
];
};
"wg-gateway" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
./hosts/wg-gateway
imports
];
};
};
};
}