summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-10-14 15:51:14 +0200
committerlassulus <lassulus@lassul.us>2019-10-14 15:51:14 +0200
commit66816ee636d21582ad0e50b6fcdce0fdc2b26f71 (patch)
tree83dc56aaee0905c044f57cfb7b5109c9c37ccd00
parent90ec1376f3a3b4ef30432dd18115f9ca7b7afe35 (diff)
l bank: move to own package
-rw-r--r--lass/5pkgs/bank/default.nix14
-rw-r--r--lass/5pkgs/default.nix16
2 files changed, 15 insertions, 15 deletions
diff --git a/lass/5pkgs/bank/default.nix b/lass/5pkgs/bank/default.nix
new file mode 100644
index 000000000..9f3a44d79
--- /dev/null
+++ b/lass/5pkgs/bank/default.nix
@@ -0,0 +1,14 @@
+{ writeDashBin, coreutils, pass, hledger, diffutils }:
+
+writeDashBin "bank" ''
+ tmp=$(mktemp)
+ ${pass}/bin/pass show hledger > $tmp
+ ${hledger}/bin/hledger --file=$tmp "$@"
+ ${pass}/bin/pass show hledger | if ${diffutils}/bin/diff $tmp -; then
+ exit 0
+ else
+ ${coreutils}/bin/cat $tmp | ${pass}/bin/pass insert -m hledger
+ fi
+ ${coreutils}/bin/rm $tmp
+''
+
diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix
index fd6a555d4..e4208f1c1 100644
--- a/lass/5pkgs/default.nix
+++ b/lass/5pkgs/default.nix
@@ -19,20 +19,6 @@ self: super: let
mapAttrs (name: _: path + "/${name}")
(filterAttrs (_: eq "directory") (readDir path));
-in {
- bank = self.writeDashBin "bank" ''
- tmp=$(mktemp)
- ${self.pass}/bin/pass show hledger > $tmp
- ${self.hledger}/bin/hledger --file=$tmp "$@"
- ${self.pass}/bin/pass show hledger | if ${self.diffutils}/bin/diff $tmp -; then
- exit 0
- else
- ${self.coreutils}/bin/cat $tmp | ${self.pass}/bin/pass insert -m hledger
- fi
- ${self.coreutils}/bin/rm $tmp
- '';
-}
-
-// mapAttrs (_: flip callPackage {})
+in mapAttrs (_: flip callPackage {})
(filterAttrs (_: dir: pathExists (dir + "/default.nix"))
(subdirsOf ./.))