Created
April 16, 2024 18:06
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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