aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md20
-rw-r--r--build.nix13
-rw-r--r--shell.nix19
3 files changed, 44 insertions, 8 deletions
diff --git a/README.md b/README.md
index a4596ea..5adcea6 100644
--- a/README.md
+++ b/README.md
@@ -2,28 +2,32 @@
Share costs with a group of people.
-## Install nix
+## Getting started
+
+Install nix:
```
curl https://nixos.org/nix/install | sh
```
-## Usage
-
-Open a nix shell:
+Inside the project directory, open a nix shell:
```
nix-shell
```
-Then:
+Inside tmux, add some users with sqlite after the migration is done:
```
-make install
-make build
-make watch
+sqlite3 database
+insert into user(creation, email, name) values (datetime('now'), 'john@mail.com', 'John');
+insert into user(creation, email, name) values (datetime('now'), 'lisa@mail.com', 'Lisa');
```
+## Configuration
+
+[application.conf](application.conf)
+
## TODO
- Income CRUD
diff --git a/build.nix b/build.nix
new file mode 100644
index 0000000..66e7e04
--- /dev/null
+++ b/build.nix
@@ -0,0 +1,13 @@
+with import <nixpkgs> {}; {
+ env = stdenv.mkDerivation {
+ name = "env";
+ buildInputs = [
+ elmPackages.elm
+ cabal-install
+ cabal2nix
+ nodejs
+ sqlite
+ tmux
+ ];
+ };
+}
diff --git a/shell.nix b/shell.nix
index 4a2046a..bb656a8 100644
--- a/shell.nix
+++ b/shell.nix
@@ -6,6 +6,25 @@ with import <nixpkgs> {}; {
cabal-install
cabal2nix
nodejs
+ sqlite
+ tmux
];
+ shellHook = ''
+ tmux kill-session -t sharedCost >/dev/null
+
+ urxvt -e zsh -c "tmux new-session -s sharedCost" & sleep 0.5
+ tmux send-keys -t sharedCost '"$EDITOR" README.md' 'C-m'
+
+ tmux split-window -h -t sharedCost
+ tmux send-keys -t sharedCost 'make install && make build && make watch' 'C-m'
+
+ tmux select-pane -t sharedCost -L
+ tmux resize-pane -t sharedCost -R 25
+
+ firefox http://localhost:3000/
+
+ sleep 0.5
+ kill -9 $PPID
+ '';
};
}