split home-manager into their own submodules
This commit is contained in:
25
modules/scripts/download/common.nix
Normal file
25
modules/scripts/download/common.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
}:
|
||||
let
|
||||
inherit (inputs.jawz-scripts.packages.x86_64-linux) download;
|
||||
gallerySecretsPath = lib.attrByPath [ "sops" "secrets" "gallery-dl/secrets" "path" ] null config;
|
||||
in
|
||||
{
|
||||
inherit gallerySecretsPath;
|
||||
wrappedDownload =
|
||||
if gallerySecretsPath != null then
|
||||
pkgs.symlinkJoin {
|
||||
name = "download-with-secrets";
|
||||
paths = [ download ];
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/download --run 'if [ -r "${gallerySecretsPath}" ]; then set -a; source "${gallerySecretsPath}"; set +a; fi'
|
||||
'';
|
||||
}
|
||||
else
|
||||
download;
|
||||
}
|
||||
Reference in New Issue
Block a user