Files
homelab/flake.nix
sin serhao 637433e101
All checks were successful
/ perform flake analysis (push) Successful in 37s
disk
2026-01-13 22:33:20 +01:00

172 lines
4.1 KiB
Nix

{
description = "An empty flake template that you can adapt to your own environment";
# Flake inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
colmena.url = "github:zhaofengli/colmena";
# commons
agenix.url = "github:ryantm/agenix";
# zimablade inputs
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
# sin inputs
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
testing-grounds.url = "gitlab:shobu13/testing-grounds";
reclamation.url = "git+https://git.shobu.fr/sin_serhao/reclamation";
shoblog-front.url = "gitlab:shobu13/shoblog";
# striped-front.url = "git+ssh://git@gitlab.com/striped1/striped-front";
# striped-back.url = "git+ssh://git@gitlab.com/striped1/striped-back";
copyparty.url = "github:9001/copyparty";
};
# Flake outputs
outputs =
inputs@{
self,
nixpkgs,
unstable,
colmena,
agenix,
disko,
shoblog-front,
# striped-front,
# striped-back,
nix-minecraft,
testing-grounds,
reclamation,
copyparty,
...
}:
let
# The systems supported for this flake
supportedSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
];
# Helper to provide system-specific attributes
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import inputs.nixpkgs { inherit system; };
}
);
in
{
nixosConfigurations = {
sin = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
disko.nixosModules.disko
agenix.nixosModules.default
./hosts/sin/configuration.nix
./hosts/sin/hardware-configuration.nix
]
++ [
# modules
./modules/gitea/sin
];
specialArgs = {
inherit inputs;
};
};
};
colmenaHive = colmena.lib.makeHive {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ ];
};
specialArgs = {
inherit inputs;
};
};
thea =
{
name,
nodes,
pkgs,
...
}:
{
imports = [
agenix.nixosModules.default
./hosts/${name}/configuration.nix
./hosts/${name}/hardware-configuration.nix
]
++ [
# modules
./modules/gitea/${name}
];
deployment.targetHost = "192.168.1.12";
};
sin =
{
name,
nodes,
pkgs,
...
}:
{
imports = [
disko.nixosModules.disko
agenix.nixosModules.default
./hosts/${name}/configuration.nix
./hosts/${name}/hardware-configuration.nix
]
++ [
# modules
./modules/gitea/${name}
];
deployment.targetHost = "192.168.1.14";
deployment.allowLocalDeployment = true;
};
};
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
# The Nix packages provided in the environment
# Add any you need here
packages = with pkgs; [
colmena.packages.${pkgs.stdenv.system}.colmena
agenix.packages.${pkgs.stdenv.system}.agenix
];
# Set any environment variables for your dev shell
env = { };
# Add any shell logic you want executed any time the environment is activated
shellHook = '''';
};
}
);
packages = forEachSupportedSystem (
{ pkgs }:
{
inherit (colmena.packages."${pkgs.system}") colmena;
}
);
};
}