Skip to content

Instantly share code, notes, and snippets.

@PerchunPak
Created April 16, 2024 18:06
Show Gist options
  • Save PerchunPak/cd7a4adc41ce61b08fffa5adec236ca3 to your computer and use it in GitHub Desktop.
Save PerchunPak/cd7a4adc41ce61b08fffa5adec236ca3 to your computer and use it in GitHub Desktop.
untested WIP diswall module for nixos, do note that I am not planning to continue it
{
lib,
config,
pkgs,
...
}: let
cfg = config.my.diswall;
srcPath = cfg.package.src.outPath;
in {
options = {
my.diswall = {
enable = lib.my.mkEnableByDefaultOption "Diswall";
package = lib.mkPackageOption pkgs.unstable "diswall" {};
};
};
config = lib.mkIf cfg.enable {
environment.etc."rsyslog.d/10-diswall.conf".source = srcPath + "/scripts/10-diswall.conf";
environment.etc."systemd/system/diswall.service".source = srcPath + "/scripts/diswall.service";
environment.etc."systemd/system/diswall-fw-init.service".source = srcPath + "/scripts/diswall-fw-init.service";
environment.etc."diswall/diswall.conf".source = srcPath + "/scripts/diswall.toml";
systemd.tmpfiles.rules = [
"f /var/log/diswall/diswall.pipe 0777 root syslog - -"
];
environment.systemPackages = with pkgs; [
cfg.package
ipset # dependency
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment