Add Usage for NixOS
authorsheepfleece <redacted>
Mon, 11 May 2020 01:21:17 +0000 (04:21 +0300)
committersheepfleece <redacted>
Tue, 12 May 2020 04:48:37 +0000 (07:48 +0300)
readme_template.md

index ec37d37286cb7dee8786fa5256169e4fbad88fe1..0a7490cb92468f35da933d2ddf2f314732bb3ca0 100644 (file)
@@ -152,6 +152,20 @@ in hosts format to the generated hosts file.
 `--whitelist <whitelistfile>`, or `-w <whitelistfile>`: Use the given whitelist file
 to remove hosts from the generated hosts file.
 
+#### Using NixOS:
+
+To install hosts file on your machine add the following into your `configuration.nix`:
+
+```haskell
+  networking.extraHosts = let 
+    hostsPath = https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts;
+    hostsFile = builtins.fetchurl hostsPath;
+  in builtins.readFile "${hostsFile}";
+```
+
+* NOTE: The call to `fetchurl` is impure. 
+Use `fetchFromGitHub` with the exact commit if you want to always get the same result.
+
 
 ## How do I control which sources are unified?
 
git clone https://git.99rst.org/PROJECT