tvl-depot/tools/url-blocker/default.nix
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

37 lines
659 B
Nix

{ ... }:
let
pkgs = import <unstable> {};
ghc = pkgs.haskellPackages.ghcWithPackages (hpkgs: [
hpkgs.time
hpkgs.aeson
hpkgs.either
]);
# This is the systemd service unit
service = pkgs.stdenv.mkDerivation {
name = "url-blocker";
src = ./.;
buildInputs = with pkgs; [
];
buildPhase = ''
${ghc}/bin/ghc Main.hs
'';
installPhase = ''
mv ./Main $out
'';
};
# This is the systemd timer unit.
# Run once every minute.
# Give root privilege.
systemdUnit = {
systemd = {
timers.simple-timer = {
wantedBy = [ "timers.target" ];
partOf = [];
};
};
};
in null