Testing sops

This commit is contained in:
iFargle 2023-08-15 12:29:23 +09:00
parent 530ce274cb
commit af12998913
3 changed files with 65 additions and 26 deletions

View file

@ -10,6 +10,10 @@
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
bashrcExtra = '' bashrcExtra = ''
sops-edit() {
nix-shell -p sops --run "sops $1"
}
nix-clean-all() { nix-clean-all() {
nix-channel --update nix-channel --update
nix-env -u --always nix-env -u --always

37
home-manager/shell.nix Normal file
View file

@ -0,0 +1,37 @@
# shell.nix
with import <nixpkgs> {};
let
sops-nix = builtins.fetchTarball {
url = "https://github.com/Mic92/sops-nix/archive/master.tar.gz";
};
in
mkShell {
# imports all files ending in .asc/.gpg
sopsPGPKeyDirs = [
"${toString ./.}/keys/hosts"
"${toString ./.}/keys/users"
];
# Also single files can be imported.
#sopsPGPKeys = [
# "${toString ./.}/keys/users/mic92.asc"
# "${toString ./.}/keys/hosts/server01.asc"
#];
# This hook can also import gpg keys into its own seperate
# gpg keyring instead of using the default one. This allows
# to isolate otherwise unrelated server keys from the user gpg keychain.
# By uncommenting the following lines, it will set GNUPGHOME
# to .git/gnupg.
# Storing it inside .git prevents accedentially commiting private keys.
# After setting this option you will also need to import your own
# private key into keyring, i.e. using a a command like this
# (replacing 0000000000000000000000000000000000000000 with your fingerprint)
# $ (unset GNUPGHOME; gpg --armor --export-secret-key 0000000000000000000000000000000000000000) | gpg --import
#sopsCreateGPGHome = true;
# To use a different directory for gpg dirs set sopsGPGHome
#sopsGPGHome = "${toString ./.}/../gnupg";
nativeBuildInputs = [
(pkgs.callPackage sops-nix {}).sops-import-keys-hook
];
}

View file

@ -1,30 +1,28 @@
-----BEGIN PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: A20F 7BD3 9673 AEA2 E929 3E35 4E71 A215 3513 42A6
Comment: nixos-laptop
xsFNBAAAAAABEADOHuEyjp0I7RgvVmmijYMW1DS6+sGpfIZH9Emte2nQ4RmzJ4hy xsFNBAAA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