mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-15 05:59:17 +03:00
nixos/stevenblack: init
This commit is contained in:
parent
398bad9c8f
commit
decb4a675b
4 changed files with 45 additions and 0 deletions
|
@ -60,6 +60,14 @@
|
||||||
<link linkend="opt-programs.fzf.fuzzyCompletion">programs.fzf</link>.
|
<link linkend="opt-programs.fzf.fuzzyCompletion">programs.fzf</link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<link xlink:href="https://github.com/StevenBlack/hosts">stevenblack-blocklist</link>,
|
||||||
|
A unified hosts file with base extensions for blocking
|
||||||
|
unwanted websites. Available as
|
||||||
|
<link xlink:href="options.html#opt-networking.stevenblack.enable">networking.stevenblack</link>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<link xlink:href="https://github.com/ellie/atuin">atuin</link>,
|
<link xlink:href="https://github.com/ellie/atuin">atuin</link>,
|
||||||
|
|
|
@ -24,6 +24,8 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||||
|
|
||||||
- [fzf](https://github.com/junegunn/fzf), a command line fuzzyfinder. Available as [programs.fzf](#opt-programs.fzf.fuzzyCompletion).
|
- [fzf](https://github.com/junegunn/fzf), a command line fuzzyfinder. Available as [programs.fzf](#opt-programs.fzf.fuzzyCompletion).
|
||||||
|
|
||||||
|
- [stevenblack-blocklist](https://github.com/StevenBlack/hosts), A unified hosts file with base extensions for blocking unwanted websites. Available as [networking.stevenblack](options.html#opt-networking.stevenblack.enable).
|
||||||
|
|
||||||
- [atuin](https://github.com/ellie/atuin), a sync server for shell history. Available as [services.atuin](#opt-services.atuin.enable).
|
- [atuin](https://github.com/ellie/atuin), a sync server for shell history. Available as [services.atuin](#opt-services.atuin.enable).
|
||||||
|
|
||||||
- [mmsd](https://gitlab.com/kop316/mmsd), a lower level daemon that transmits and recieves MMSes. Available as [services.mmsd](#opt-services.mmsd.enable).
|
- [mmsd](https://gitlab.com/kop316/mmsd), a lower level daemon that transmits and recieves MMSes. Available as [services.mmsd](#opt-services.mmsd.enable).
|
||||||
|
|
34
nixos/modules/config/stevenblack.nix
Normal file
34
nixos/modules/config/stevenblack.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) optionals mkOption mkEnableOption types mkIf elem concatStringsSep maintainers mdDoc;
|
||||||
|
cfg = config.networking.stevenblack;
|
||||||
|
|
||||||
|
# needs to be in a specific order
|
||||||
|
activatedHosts = with cfg; [ ]
|
||||||
|
++ optionals (elem "fakenews" block) [ "fakenews" ]
|
||||||
|
++ optionals (elem "gambling" block) [ "gambling" ]
|
||||||
|
++ optionals (elem "porn" block) [ "porn" ]
|
||||||
|
++ optionals (elem "social" block) [ "social" ];
|
||||||
|
|
||||||
|
hostsPath = "${pkgs.stevenblack-blocklist}/alternates/" + concatStringsSep "-" activatedHosts + "/hosts";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.networking.stevenblack = {
|
||||||
|
enable = mkEnableOption (mdDoc "Enable the stevenblack hosts file blocklist.");
|
||||||
|
|
||||||
|
block = mkOption {
|
||||||
|
type = types.listOf (types.enum [ "fakenews" "gambling" "porn" "social" ]);
|
||||||
|
default = [ ];
|
||||||
|
description = mdDoc "Additional blocklist extensions.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
networking.hostFiles = [ ]
|
||||||
|
++ optionals (activatedHosts != [ ]) [ hostsPath ]
|
||||||
|
++ optionals (activatedHosts == [ ]) [ "${pkgs.stevenblack-blocklist}/hosts" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = [ maintainers.fortuneteller2k maintainers.artturin ];
|
||||||
|
}
|
|
@ -23,6 +23,7 @@
|
||||||
./config/qt5.nix
|
./config/qt5.nix
|
||||||
./config/resolvconf.nix
|
./config/resolvconf.nix
|
||||||
./config/shells-environment.nix
|
./config/shells-environment.nix
|
||||||
|
./config/stevenblack.nix
|
||||||
./config/swap.nix
|
./config/swap.nix
|
||||||
./config/sysctl.nix
|
./config/sysctl.nix
|
||||||
./config/system-environment.nix
|
./config/system-environment.nix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue