summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-04-13 16:37:26 +0200
committerlassulus <lass@aidsballs.de>2016-04-13 16:37:26 +0200
commitf0863085c7f865069e0d49a99488734abe044c6a (patch)
treecd7c1034a477e1ad37b88f13e6df0ddd855bee9c /lass
parent6a009982af81f6591ee026c7f866008a17d4d8f8 (diff)
l 5: add mk_sql_pair
Diffstat (limited to 'lass')
-rw-r--r--lass/5pkgs/default.nix1
-rw-r--r--lass/5pkgs/mk_sql_pair/default.nix19
2 files changed, 20 insertions, 0 deletions
diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix
index 0c9dd94ca..e113af91f 100644
--- a/lass/5pkgs/default.nix
+++ b/lass/5pkgs/default.nix
@@ -8,6 +8,7 @@
ublock = pkgs.callPackage ./firefoxPlugins/ublock.nix {};
vimperator = pkgs.callPackage ./firefoxPlugins/vimperator.nix {};
};
+ mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {};
mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {};
xmonad-lass =
let src = pkgs.writeNixFromCabal "xmonad-lass.nix" ./xmonad-lass; in
diff --git a/lass/5pkgs/mk_sql_pair/default.nix b/lass/5pkgs/mk_sql_pair/default.nix
new file mode 100644
index 000000000..a9f0d2797
--- /dev/null
+++ b/lass/5pkgs/mk_sql_pair/default.nix
@@ -0,0 +1,19 @@
+{ pkgs, ... }:
+
+pkgs.writeScriptBin "mk_sql_pair" ''
+ #!/bin/sh
+
+ name=$1
+ password=$2
+
+ if [ $# -ne 2 ]; then
+ echo '$1=name, $2=password'
+ exit 23;
+ fi
+
+ cat <<EOF
+ create database $name;
+ create user $name;
+ grant all on $name.* to $name@'localhost' identified by '$password';
+ EOF
+''