mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-10 17:34:05 -05:00
working on provisioning secrets for hosts
This commit is contained in:
parent
ee0a312cfa
commit
455d1973f7
4 changed files with 44 additions and 6 deletions
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -150,11 +150,11 @@
|
|||
},
|
||||
"nix-secrets": {
|
||||
"locked": {
|
||||
"lastModified": 1738963104,
|
||||
"narHash": "sha256-bdSb4LkBr7RKFvnnBzc7ORSD63ZFwH+BvwxbipAvOMw=",
|
||||
"lastModified": 1738965110,
|
||||
"narHash": "sha256-5fym44pj7haqIOfoTMjrZQnwhgNfvK7dNwu6e6sK2mk=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "f0f2b3488781a6428629aadb4d56644301dd5862",
|
||||
"revCount": 34,
|
||||
"rev": "ed1492e5a7b6c66c5e03f7c465914d44cb736abc",
|
||||
"revCount": 36,
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/TheWanderingCrow/nix-secrets"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nvix.url = "github:TheWanderingCrow/nvix";
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
nix-secrets.url = "git+ssh://git@github.com/TheWanderingCrow/nix-secrets";
|
||||
|
|
|
|||
|
|
@ -5,5 +5,6 @@
|
|||
}: {
|
||||
imports = [
|
||||
./user.nix
|
||||
./secrets.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
35
modules/users/crow/secrets.nix
Normal file
35
modules/users/crow/secrets.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
lib,
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.user.crow.enable {
|
||||
sops = {
|
||||
defaultSopsFile = inputs.nix-secrets.secrets.parzival;
|
||||
age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||
age.generateKey = true;
|
||||
};
|
||||
|
||||
#######
|
||||
# AWS #
|
||||
#######
|
||||
|
||||
sops.secrets."aws/wce/access_key" = {};
|
||||
sops.secrets."aws/wce/secret_key" = {};
|
||||
sops.secrets."aws/work/access_key" = {};
|
||||
sops.secrets."aws/work/secret_key" = {};
|
||||
|
||||
sops.templates."aws_shared_config" = {
|
||||
owner = config.users.users.crow.name;
|
||||
content = ''
|
||||
[default]
|
||||
aws_access_key_id=${config.sops.placeholder."aws/work/access_key"}
|
||||
aws_secret_access_key=${config.sops.placeholder."aws/work/secret_key"}
|
||||
|
||||
[wce]
|
||||
aws_access_key_id=${config.sops.placeholder."aws/wce/access_key"}
|
||||
aws_secret_access_key=${config.sops.placeholder."aws/wce/secret_key"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue