chore: split nixos and opentofu
This commit is contained in:
parent
d125848b82
commit
06500a8f01
68 changed files with 44 additions and 61 deletions
76
nixos/flake.nix
Normal file
76
nixos/flake.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
description = "Homelab configuration using flakes (v2 GitOps)";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
utils = {
|
||||
url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{
|
||||
self, nixpkgs,
|
||||
flake-utils, sops-nix, utils, pre-commit-hooks,
|
||||
...
|
||||
}:
|
||||
let
|
||||
system = utils.lib.system.x86_64-linux;
|
||||
in
|
||||
utils.lib.mkFlake {
|
||||
inherit self inputs;
|
||||
|
||||
outputsBuilder = channels: let
|
||||
pkgs = channels.nixpkgs;
|
||||
system = pkgs.system;
|
||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixfmt-rfc-style.enable = true;
|
||||
statix.enable = true;
|
||||
terraform-format.enable = true;
|
||||
};
|
||||
};
|
||||
in {
|
||||
checks = {
|
||||
inherit pre-commit-check;
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
inherit (pre-commit-check) shellHook;
|
||||
buildInputs = pre-commit-check.enabledPackages;
|
||||
};
|
||||
};
|
||||
|
||||
hostDefaults = {
|
||||
inherit system;
|
||||
|
||||
modules = [
|
||||
./modules
|
||||
./users
|
||||
|
||||
sops-nix.nixosModules.sops
|
||||
({ config, pkgs, ... }: {
|
||||
# Inject git revision for our custom GitOps module to query
|
||||
system.configurationRevision = self.rev or self.dirtyRev or "unknown";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
hosts = {
|
||||
# Hosts will be populated here as they are migrated to the v2 branch.
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue