mirror of
https://github.com/ParkerTenBroeck/dotfiles.git
synced 2026-06-07 05:08:51 -04:00
switch laptop config
This commit is contained in:
parent
079b1eb5d6
commit
3a429b7fe1
10 changed files with 118 additions and 14 deletions
20
secrets.nix
20
secrets.nix
|
|
@ -1,7 +1,21 @@
|
|||
let
|
||||
desktop_may = builtins.readFile ./secrets/ssh/desktop_may_pub;
|
||||
desktop_host = builtins.readFile ./secrets/ssh/desktop_host_pub;
|
||||
pub_keys = [ desktop_may desktop_host ];
|
||||
readFileOrNull = path:
|
||||
if builtins.pathExists path
|
||||
then builtins.readFile path
|
||||
else null;
|
||||
|
||||
desktop_may = readFileOrNull ./secrets/ssh/desktop_may_pub;
|
||||
desktop_host = readFileOrNull ./secrets/ssh/desktop_host_pub;
|
||||
|
||||
laptop_may = readFileOrNull ./secrets/ssh/laptop_may_pub;
|
||||
laptop_host = readFileOrNull ./secrets/ssh/laptop_host_pub;
|
||||
|
||||
pub_keys = builtins.filter builtins.isString [
|
||||
desktop_may desktop_host
|
||||
laptop_may laptop_host
|
||||
];
|
||||
|
||||
_ = if builtins.length pub_keys == 0 then abort "pub_keys must have at least one key" else null;
|
||||
in {
|
||||
"secrets/wireguard/server_priv.age".publicKeys = pub_keys;
|
||||
"secrets/wireguard/home_psk.age".publicKeys = pub_keys;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue