add borrow again

This commit is contained in:
Ingolf Wagner 2024-02-16 08:31:48 +01:00
parent 85ad24e01d
commit 4d79e88566
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -1,5 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with pkgs; with pkgs;
with lib;
let let
nextcloudSync = folder: nextcloudSync = folder:
let let
@ -12,6 +13,20 @@ let
~/Nextcloud/${folder} \ ~/Nextcloud/${folder} \
"https://${user}:${password}@nextcloud.ingolf-wagner.de" "https://${user}:${password}@nextcloud.ingolf-wagner.de"
''; '';
borrow = pkgs.writers.writeDashBin "borrow"
''
${getExe hledger-ui} \
--all \
--theme=terminal \
--file ~/Nextcloud/Unterlagen/.hledger-borrow "$@"
${getExe gum} confirm \
--affirmative="update" \
--negative="skip" \
--default=false \
"Syncronize with Nextcloud?" && ${getExe(nextcloudSync "Unterlagen")}
'';
in in
{ {
home.packages = [ home.packages = [
@ -25,6 +40,8 @@ in
(nextcloudSync "Kunstbuch") (nextcloudSync "Kunstbuch")
(nextcloudSync "AWS-SolutionArchitect-Professional") (nextcloudSync "AWS-SolutionArchitect-Professional")
borrow
(pkgs.writeShellScriptBin "nixFlakes" '' (pkgs.writeShellScriptBin "nixFlakes" ''
exec ${pkgs.nixUnstable}/bin/nix --experimental-features "nix-command flakes" "$@" exec ${pkgs.nixUnstable}/bin/nix --experimental-features "nix-command flakes" "$@"
'') '')
@ -33,4 +50,8 @@ in
]; ];
home.shellAliases = {
schulden = "borrow";
};
} }