summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-07-14 20:29:53 -0700
committerBen Sima <ben@bsima.me>2020-07-14 20:29:53 -0700
commit584239a1a0c97f9d57f2de76c04708127178bceb (patch)
tree9114e816425ad03c521d1b4d37eea986cd5ecbd0
parentca28f4a86b839d702bdaa70925884aa2bd5cf9ed (diff)
dev: move some commands to shell
-rwxr-xr-xBiz/lint.py (renamed from lint)0
-rw-r--r--default.nix2
-rwxr-xr-xdeps2
-rw-r--r--nix/build.nix32
-rwxr-xr-xrepl4
-rw-r--r--shell.nix23
6 files changed, 33 insertions, 30 deletions
diff --git a/lint b/Biz/lint.py
index d12431c..d12431c 100755
--- a/lint
+++ b/Biz/lint.py
diff --git a/default.nix b/default.nix
index 32f9952..237a6da 100644
--- a/default.nix
+++ b/default.nix
@@ -87,7 +87,7 @@ in rec {
Que.Server = build.ghc ./Que/Server.hs;
Que.Website = build.ghc ./Que/Website.hs;
# Development environment
- repl = build.env;
+ env = build.env;
# Fall through to any of our overlay packages
inherit nixpkgs;
}
diff --git a/deps b/deps
deleted file mode 100755
index 7f185b8..0000000
--- a/deps
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env bash
-niv --sources-file $BIZ_ROOT/nix/sources.json "$@"
diff --git a/nix/build.nix b/nix/build.nix
index dd16df6..7335159 100644
--- a/nix/build.nix
+++ b/nix/build.nix
@@ -93,7 +93,37 @@ in {
installPhase = "exit 0";
} // { env = ghcjs; };
- env = ghc_ allDeps;
+ env = mkShell {
+ name = "bizdev";
+ buildInputs = [
+ (ghc_ allDeps)
+ # this says something about missing haskelline?
+ #(ghcjs_ allDeps)
+
+ nixpkgs.niv.niv
+ nixpkgs.hlint
+ nixpkgs.ormolu
+ nixpkgs.python37Packages.black
+ nixpkgs.python37Packages.pylint
+ nixpkgs.wemux
+ ];
+ shellHook = ''
+ echo "bizdev" | ${nixpkgs.figlet}/bin/figlet | ${nixpkgs.lolcat}/bin/lolcat
+ echo "(be sure to run 'nix-shell' to get the build functions)"
+ echo "-------------------------------------------------------"
+ echo ""
+
+ function repl() {
+ ghci -i$BIZ_ROOT -ghci-script "$BIZ_ROOT/.ghci"
+ }
+
+ function deps() {
+ niv --sources-file $BIZ_ROOT/nix/sources.json $@
+ }
+
+ alias lint=$BIZ_ROOT/Biz/lint.py
+ '';
+ };
os = cfg: (nixos (args: lib.attrsets.recursiveUpdate cfg {
boot.cleanTmpDir = true;
diff --git a/repl b/repl
deleted file mode 100755
index b09bb5a..0000000
--- a/repl
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-set -ex
-nix run -f $BIZ_ROOT/default.nix "repl" \
- -c ghci -i$BIZ_ROOT -ghci-script "$BIZ_ROOT/.ghci"
diff --git a/shell.nix b/shell.nix
index a83b9af..7e64e11 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,22 +1 @@
-{
- isDevelopmentShell ? true
-}:
-
-let
- nixpkgs = import ./nix/default.nix;
- basepkgs = import ./Biz/packages.nix { inherit (nixpkgs) pkgs; };
- devpkgs = with nixpkgs; [
- hlint
- #niv
- ormolu
- python37Packages.black
- python37Packages.pylint
- wemux
- ];
-in nixpkgs.mkShell {
- name = "bizdev";
- buildInputs = devpkgs;
- shellHook = ''
- echo "biz" | ${nixpkgs.figlet}/bin/figlet | ${nixpkgs.lolcat}/bin/lolcat
- '';
-}
+(import ./default.nix).env