aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorpacien2022-08-22 18:31:14 +0200
committerpacien2022-08-22 18:31:14 +0200
commit96411aaa21543c81ce53fd9210e63c5e3d4ac519 (patch)
tree55d97ba83bc9ae6fad1ca4f9a8b17df7c114131f /readme.md
parent24a5cf35ea3b4c46a1a9dc6d39dd6a45d7b1c70c (diff)
downloadflaky-utils-96411aaa21543c81ce53fd9210e63c5e3d4ac519.tar.gz
bootstrap lib, add mkDevShell
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md68
1 files changed, 68 insertions, 0 deletions
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..88c4d4a
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,68 @@
1# flaky-utils
2
3Additional Nix Flake utility functions for personal convenience (mainly
4reducing boilerplate).
5
6No promise on API stability.
7
8
9## Usage
10
11Functions documentation provided as comments below.
12
13```nix
14{
15 description = "Example of a Flake using flaky-utils.";
16
17 inputs = {
18 nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
19 flake-utils.url = "github:numtide/flake-utils";
20 flaky-utils.url = "git+https://cgit.pacien.net/libs/flaky-utils";
21 };
22
23 outputs = { self, nixpkgs, flake-utils, flaky-utils }:
24 flake-utils.lib.eachDefaultSystem (system: let
25 pkgs = import nixpkgs { inherit system; };
26 in {
27
28 # Convenience development shell providing some tools.
29 #
30 # The binaries made available and the environment variable set are printed
31 # when entering the shell.
32 #
33 # The user's default shell is used instead of Bash (sacrifying a bit of
34 # reproducibility for convenience).
35 #
36 devShell = flaky-utils.lib.mkDevShell {
37 inherit pkgs;
38
39 tools = with pkgs; [
40 postgresql_14
41 pgcli
42 ];
43
44 envVars = rec {
45 PGDATA = "$PWD/development_database/pgdata";
46 PGHOST = "$PWD/development_database";
47 PGPORT = "5432";
48 PGDATABASE = "app";
49 DATABASE_URL = "postgresql:///${PGDATABASE}?host=${PGHOST}";
50 };
51 };
52
53 });
54}
55```
56
57
58## Contributing
59
60Issues and patches: email the author.
61
62
63## Licence and copyright
64
65Copyright (C) 2022 Pacien TRAN-GIRARD.
66
67This project is distributed under the terms of European Union Public Licence
68version 1.2, a copy of which is provided in `./licence.txt`.