summaryrefslogtreecommitdiffstats
path: root/lib/asecret.nix
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2025-09-06 16:36:03 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2025-09-06 17:36:40 +0200
commit56a1709be4f23c333730e159b219104c7fb073c2 (patch)
treecea1c9191464ef17079fe4584fb667eaceb8c385 /lib/asecret.nix
parent3010bb10e3b23ea3bec47048775aaf9c325b51a9 (diff)
add lib/asecret.nix
Diffstat (limited to 'lib/asecret.nix')
-rw-r--r--lib/asecret.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/asecret.nix b/lib/asecret.nix
new file mode 100644
index 0000000..3688612
--- /dev/null
+++ b/lib/asecret.nix
@@ -0,0 +1,29 @@
+{ lib
+, pkgs
+, sources
+, ...
+}:
+{
+ overlays = [
+ (import "${sources.asecret}/pkgs")
+ ];
+ devShell = {
+ packages = [
+ pkgs.asecret
+ pkgs.nixVersions.nix_2_24 # nix-plugins' `buildInputs'
+ ];
+ shellHook = ''
+ PASSWORD_STORE_DIR=${toString ../.}/secrets; export PASSWORD_STORE_DIR
+
+ NIX_CONFIG='
+ plugin-files = ${pkgs.nix-plugins}/lib/nix/plugins
+ extra-builtins-file = ${sources.asecret}/extra-builtins.nix
+ '; export NIX_CONFIG
+ '';
+ };
+ nixosModules.asecret = {
+ nixpkgs.overlays = [
+ (_: super: { asecret-lib = import "${sources.asecret}/lib" { inherit lib; }; })
+ ];
+ };
+}