Read and write to /etc/hosts
TL;DR: - Rename website-blocker to url-blocker - Add a README.md - Reads and writes to /etc/hosts
This commit is contained in:
parent
75595b0126
commit
946764f6bd
8 changed files with 182 additions and 25 deletions
37
tools/url-blocker/default.nix
Normal file
37
tools/url-blocker/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ ... }:
|
||||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue