infrastructure/nixos/common/default.nix

21 lines
847 B
Nix
Raw Normal View History

2022-10-31 10:41:17 +01:00
{ inputs, lib, config, ... }: {
# This file deals with everything requiring `inputs`, the rest being delagated to `common.nix`
# this is because we can't import inputs from all contexts as that can lead to infinite recursion.
2022-12-26 13:02:48 +01:00
imports = [ ./common.nix inputs.vault-secrets.nixosModules.vault-secrets ];
2021-10-13 18:17:45 +02:00
2022-10-31 10:41:17 +01:00
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
2022-12-26 13:02:48 +01:00
nix.registry.nixpkgs.flake = inputs.nixpkgs;
2023-04-25 09:50:25 +02:00
home-manager.sharedModules =
[ ./hm-modules inputs.nixvim.homeManagerModules.nixvim ];
2021-10-13 18:17:45 +02:00
2022-10-01 14:43:26 +02:00
vault-secrets = let
inherit (config.networking) domain hostName;
server = if domain == "olympus" then "vault" else "vault-0";
in lib.mkIf (domain == "olympus" || domain == "hades") {
vaultPrefix = "${domain}_secrets/nixos";
vaultAddress = "http://${server}.${domain}:8200/";
approlePrefix = "${domain}-${hostName}";
2021-11-22 00:10:21 +01:00
};
2022-10-31 13:05:45 +01:00
}