Commit graph

5 commits

Author SHA1 Message Date
William Carroll
946764f6bd Read and write to /etc/hosts
TL;DR:
- Rename website-blocker to url-blocker
- Add a README.md
- Reads and writes to /etc/hosts
2020-03-29 20:39:39 +01:00
William Carroll
75595b0126 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
2020-03-29 18:49:45 +01:00
William Carroll
059af12bea Experiment with user /etc/hosts
I have not been able to get this to work yet, but I hear that it is possible to
maintain a user-specific /etc/hosts.
2020-03-29 00:01:51 +00:00
William Carroll
ef5eda4015 Implement isToday predicate
Use the Data.Time package to implement the isToday predicate.
2020-03-29 00:00:47 +00:00
William Carroll
37bb04eb5d Start social-fasting app
I'd like to ensure that my /etc/hosts file blocks websites at certains times. I
use this to allow / disallow websites at various times of the day.

TODO:
- Add project README
- Add tests
- Publish
- Create a Nix derivation
- Run as a systemd timer unit
- Figure out if I can run this as a user rather than root
2020-03-28 19:36:13 +00:00