nixos: create 'modules/nixos' folder
Let's consolidate all modules under one path, so that NixOS, home-manager, and nix-darwin (if I ever end up using it down the line) would go under the same folder.
This commit is contained in:
parent
b52e56ed08
commit
c856933803
74 changed files with 1 additions and 1 deletions
24
modules/nixos/secrets/default.nix
Normal file
24
modules/nixos/secrets/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config, inputs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.agenix.nixosModules.age
|
||||
];
|
||||
|
||||
config.age = {
|
||||
secrets =
|
||||
let
|
||||
toName = lib.removeSuffix ".age";
|
||||
userExists = u: builtins.hasAttr u config.users.users;
|
||||
# Only set the user if it exists, to avoid warnings
|
||||
userIfExists = u: if userExists u then u else "root";
|
||||
toSecret = name: { owner ? "root", ... }: {
|
||||
file = ./. + "/${name}";
|
||||
owner = lib.mkDefault (userIfExists owner);
|
||||
};
|
||||
convertSecrets = n: v: lib.nameValuePair (toName n) (toSecret n v);
|
||||
secrets = import ./secrets.nix;
|
||||
in
|
||||
lib.mapAttrs' convertSecrets secrets;
|
||||
};
|
||||
}
|
||||
10
modules/nixos/secrets/secrets.nix
Normal file
10
modules/nixos/secrets/secrets.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Common secrets
|
||||
let
|
||||
keys = import ../../keys;
|
||||
|
||||
inherit (keys) all;
|
||||
in
|
||||
{
|
||||
"users/ambroisie/hashed-password.age".publicKeys = all;
|
||||
"users/root/hashed-password.age".publicKeys = all;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 cKojmg vOaL2ZKsFEjX9mzQvw8Je7x2Dq8cMhrZEyBTXpH4QnE
|
||||
HXO4fbWdJsbsRmGq0IYzq8/szObxzpsGfQNNTJ4vNzg
|
||||
-> ssh-ed25519 jPowng WPxg0pP6O3ZS4dPc1WcDvzig22Fylk3mR/W9STaWbW4
|
||||
GuhFwt7M5Lc38q2LC/0eul0yP60UxmWwi9I8ToHv7bE
|
||||
-> :;V8\-grease ZC#7~eR# P<'e?vI3 9R
|
||||
lZlb44QiAaIxd0SYiRNT/QRnxxUt7npbksg
|
||||
--- 9xv4lt8IcGR8jP0UcKYYnTuh1Ix/pqXgDmevkTH9j1A
|
||||
Ï]ºcÓ3óxíwÿ'ã `<0B>ùhçÒ=X¨í·¢Ç‘g3ÆÆÄ]~ËôÞqÙ.XnÄa*€±W:<3A>–¸±,â©z®vyzñI¦æ }ÂDO=`êw“ñõ¹ˆ7:™ù“ÐRx•5$¨Ö6:ö¨´"õ,HM„<4D>"_ëÞòMÛMƒœˆBJe‰ùFá
|
||||
BIN
modules/nixos/secrets/users/root/hashed-password.age
Normal file
BIN
modules/nixos/secrets/users/root/hashed-password.age
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue