mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 19:46:17 +01:00
34 lines
760 B
Nix
34 lines
760 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
|
||
|
] ++
|
||
|
(if (builtins.pathExists secret) then
|
||
|
[ secret ]
|
||
|
else
|
||
|
builtins.trace "Warning! Not loading any secrets, you may get errors." []
|
||
|
);
|
||
|
};
|
||
|
in
|
||
|
modules.config;
|
||
|
};
|
||
|
}
|