Initial NixOS infra flake skeleton
This commit is contained in:
commit
9383d615d7
9 changed files with 267 additions and 0 deletions
53
flake.nix
Normal file
53
flake.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
description = "Flowback infra (NixOS): Nextcloud + Forgejo, staging + production";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
# Optional, but strongly recommended for secrets:
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, sops-nix, ... }:
|
||||
let
|
||||
mkHost = { name, system, modules }:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules =
|
||||
modules ++ [
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
specialArgs = { inherit name; };
|
||||
};
|
||||
in
|
||||
{
|
||||
# Staging host (x86_64 for VM/cloud)
|
||||
nixosConfigurations.staging = mkHost {
|
||||
name = "staging";
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./hosts/staging/configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
# Production host (x86_64 for VM/cloud)
|
||||
nixosConfigurations.production = mkHost {
|
||||
name = "production";
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./hosts/production/configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
# Raspberry Pi example (aarch64) — use when you’re ready
|
||||
# nixosConfigurations.rpi-staging = mkHost {
|
||||
# name = "rpi-staging";
|
||||
# system = "aarch64-linux";
|
||||
# modules = [
|
||||
# ./hosts/staging/configuration.nix
|
||||
# ./hosts/staging/rpi-hardware.nix
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue