update concentration.nix
This commit is contained in:
parent
b9691caf58
commit
a181a11e3e
1 changed files with 33 additions and 7 deletions
|
|
@ -4,6 +4,21 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
options = {
|
||||||
|
blockYoutube = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Disables youtube using /etc/hosts file";
|
||||||
|
};
|
||||||
|
blockTwitter = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Disables twitter using /etc/hosts file";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf config.blockYoutube {
|
||||||
networking.extraHosts = ''
|
networking.extraHosts = ''
|
||||||
0.0.0.0 youtube.com
|
0.0.0.0 youtube.com
|
||||||
::0 youtube.com
|
::0 youtube.com
|
||||||
|
|
@ -11,4 +26,15 @@
|
||||||
0.0.0.0 www.youtube.com
|
0.0.0.0 www.youtube.com
|
||||||
::0 www.youtube.com
|
::0 www.youtube.com
|
||||||
'';
|
'';
|
||||||
|
})
|
||||||
|
(lib.mkIf config.blockTwitter {
|
||||||
|
networking.extraHosts = ''
|
||||||
|
0.0.0.0 twitter.com
|
||||||
|
::0 twitter.com
|
||||||
|
|
||||||
|
0.0.0.0 www.twitter.com
|
||||||
|
::0 www.twitter.com
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue