mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-04-03 11:32:10 +02:00
12
home/scripts/age.nix
Normal file
12
home/scripts/age.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
homedir = config.home.homeDirectory;
|
||||
|
||||
add-secrets = pkgs.writeShellScriptBin "add-secrets" ''
|
||||
file=$1
|
||||
pubkey=$(cat ~/nixy.key | grep "public key" | cut -d':' -f2 | sed 's/ //g')
|
||||
${pkgs.age}/bin/age -r $pubkey -o ~/.config/nixos/home/secrets/$file.age -a $file
|
||||
'';
|
||||
|
||||
in { home.packages = with pkgs; [ add-secrets ]; }
|
||||
Reference in New Issue
Block a user