about summary refs log tree commit diff
path: root/tools/website-blocker/shell.nix
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-03-29T17·49+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-03-29T17·49+0100
commit75595b0126806e1f1f35802ec534e32492cb2a6c (patch)
tree845351b7b4f712f507eb99932c64323e9575b33e /tools/website-blocker/shell.nix
parent059af12bea03eef4616cbf47fa60890c14e9049a (diff)
Parse and serialize rules.json
TL;DR:
- Write FromJSON instances to decode rules.json file
- Prefer Text to String and use the OverloadedStrings language extension
- Read /etc/hosts and append the serialized rules.json to the end

Notes:
- I can remove some of the FromJSON instances and use GHC Generics to define
  them for me.

TODO:
- Define the systemd timer unit for this to run
- Ensure script can run with root privileges
Diffstat (limited to 'tools/website-blocker/shell.nix')
-rw-r--r--tools/website-blocker/shell.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/website-blocker/shell.nix b/tools/website-blocker/shell.nix
index d82e0feda466..40f217e3f9a7 100644
--- a/tools/website-blocker/shell.nix
+++ b/tools/website-blocker/shell.nix
@@ -2,7 +2,11 @@ let
   pkgs = import <unstable> {};
 in pkgs.mkShell {
   buildInputs = with pkgs; [
-    ghc
-    haskellPackages.time
+    (haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
+      time
+      aeson
+      either
+      hspec
+    ]))
   ];
 }