dotfiles/nix/secret-lib/default.nix
Magic_RB a9faa2c7b4
Add full blowhole system
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2021-10-18 00:13:22 +02:00

35 lines
810 B
Nix

{ lib, config, ... }:
with lib;
{
options.magic_rb.secret = mkOption {
description = ''
Magic_RB's secret sause.
'';
type = types.unspecified;
};
config = {
_module.args.secret = config.magic_rb.secret;
magic_rb.secret =
let
secret = "${config.magic_rb.pins.secret}/default.nix";
modules = evalModules
{ modules =
[ ./wireguard.nix
./network.nix
./password-hashes.nix
./mounts.nix
] ++
(if (builtins.tryEval { x = import secret; }).success then
[ secret ]
else
builtins.trace "Warning! Not loading any secrets, you may get errors." []
);
};
in
modules.config;
};
}