File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
nixos/modules/services/security Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1313 file = pkgs . writeText "rule" ( builtins . toJSON cfg ) ;
1414 }
1515 ) ;
16-
1716in
1817{
1918 options = {
2019 services . opensnitch = {
2120 enable = lib . mkEnableOption "Opensnitch application firewall" ;
21+ package = lib . mkPackageOption pkgs "opensnitch" { } ;
2222
2323 rules = lib . mkOption {
2424 default = { } ;
192192 services . opensnitch . settings = lib . mapAttrs ( _ : v : lib . mkDefault v ) (
193193 builtins . fromJSON (
194194 builtins . unsafeDiscardStringContext (
195- builtins . readFile "${ pkgs . opensnitch } /etc/opensnitchd/default-config.json"
195+ builtins . readFile "${ cfg . package } /etc/opensnitchd/default-config.json"
196196 )
197197 )
198198 ) ;
199199
200200 systemd = {
201- packages = [ pkgs . opensnitch ] ;
201+ packages = [ cfg . package ] ;
202202 services . opensnitchd = {
203203 wantedBy = [ "multi-user.target" ] ;
204204 serviceConfig = {
210210 in
211211 [
212212 ""
213- "${ pkgs . opensnitch } /bin/opensnitchd --config-file ${ format . generate "default-config.json" preparedSettings } "
213+ "${ cfg . package } /bin/opensnitchd --config-file ${ format . generate "default-config.json" preparedSettings } "
214214 ] ;
215215 } ;
216216 preStart = lib . mkIf ( cfg . rules != { } ) (
245245 } ;
246246 tmpfiles . rules = [
247247 "d ${ cfg . settings . Rules . Path } 0750 root root - -"
248- "L+ /etc/opensnitchd/system-fw.json - - - - ${ pkgs . opensnitch } /etc/opensnitchd/system-fw.json"
248+ "L+ /etc/opensnitchd/system-fw.json - - - - ${ cfg . package } /etc/opensnitchd/system-fw.json"
249249 ] ;
250250 } ;
251251
You can’t perform that action at this time.
0 commit comments