Commit graph

13 commits

Author SHA1 Message Date
William Carroll
f5f03e2049 Delete //tools/website-blocker
I changed the name of this project to url-blocker, which lives both
within this repository and at github.com/wpcarro/url-blocker.
2020-04-05 16:30:17 +01:00
William Carroll
7e41aba8b7 Drop attempt to support a user-local /etc/hosts
While the idea of managing the hosts at a per-user level appeals much more to me
that running this as root and managing /etc/hosts, I haven't been able to get it
to work.
2020-03-29 20:39:44 +01:00
William Carroll
7d340689ba Delete the stale tests
While this project would benefit from having test coverage, the current tests
are not providing any useful coverage.
2020-03-29 20:39:39 +01:00
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
William Carroll
6b224a9e31 Drop support for lorri
Lorri does not cleanly integrate with my corporate device, which cannot run
NixOS. To expose dependencies to Emacs buffers, I will use nix-buffer.el, which
reads its values from dir-locals.nix. To easily expose dependencies from my
existing shell.nix files into dir-locals.nix, I wrote a Nix utility function.
2020-03-27 10:59:50 +00:00
William Carroll
c6dac53b72 Drop support for cloudtop
While I do still technically own a Google cloudtop device, I haven't used it in
at least six months. In the interest of pruning non-critical dependencies, I'm
deleting it. I can alway restore it thanks to Git.
2020-03-05 15:04:04 +00:00
William Carroll
9e0fdd3973 Remove default values for Nix expression parameters
I'm not sure if this commit breaks everything in my monorepo. I think it
will.

Why am I doing this? Perhaps it's a bad idea. I don't fully understand how
readTree works. My ignorance is costing me hours of time spent debugging. In an
effort to better understand readTree, I'm removing the default values for my Nix
expression parameters, which I believe have preventing errors from surfacing.
2020-03-01 22:32:24 +00:00
William Carroll
072be0befd Nixify simple_vim idea
I previously had an alias defined as `simple_vim`, which would start an instance
of Vim with a bare bones config. I had a to-do to Nixify it. That is
now (mostly) to-done.

When I try and install it with `nix-env -f ~/briefcase -iA tools.simple_vim`,
Nix fails and says that pkgs.stdenv is undefined. I will need to fix this one
day, but it is neither important nor urgent...
2020-02-12 18:05:32 +00:00
William Carroll
fabf1c9334 Tidy up structure of briefcase
I had a spare fifteen minutes and decided that I should tidy up my
monorepo. The work of tidying up is not finished; this is a small step in the
right direction.

TL;DR
- Created a tools directory
- Created a scratch directory (see README.md for more information)
- Added README.md to third_party
- Renamed delete_dotfile_symlinks -> symlinkManager
- Packaged symlinkManager as an executable symlink-mgr using buildGo
2020-02-12 16:58:29 +00:00