You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
infra/flake.nix

62 lines
1.7 KiB

{
description = "NixOS Infrastructure";
inputs = {
nixos.follows = "nixpkgs-unstable";
nixpkgs.follows = "nixpkgs-unstable";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
outputs = { self, nixpkgs, nixos-hardware, ... }:
let
# Per-user mapping of auth (login) and sudo keys
key_mappings = {
alice = {
auth = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAliceAuthKeyPlaceholder alice@host"
];
sudo = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAliceSudoKeyPlaceholder alice-admin@host"
];
};
bob = {
auth = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBobAuthKeyPlaceholder bob@host"
];
sudo = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBobSudoKeyPlaceholder bob-admin@host"
];
};
};
sharedModules = [
./modules/users.nix
];
sharedArgs = {
inherit key_mappings;
};
in {
nixosConfigurations = {
auth.domain.com = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = sharedArgs;
modules = [
./machines/auth.domain.com/configuration.nix
./machines/auth.domain.com/hardware-configuration.nix
./modules/keycloak.nix
] ++ sharedModules;
};
status.domain.com = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = sharedArgs;
modules = [
./machines/status.domain.com/configuration.nix
./machines/status.domain.com/hardware-configuration.nix
] ++ sharedModules;
};
};
};
}