File tree Expand file tree Collapse file tree 2 files changed +28
-23
lines changed Expand file tree Collapse file tree 2 files changed +28
-23
lines changed Original file line number Diff line number Diff line change 22
22
nixos . modules . services = {
23
23
cryptpad = {
24
24
name = "cryptpad" ;
25
- module =
26
- { config , ... } :
27
- let
28
- cfg = config . services . cryptpad ;
29
- in
30
- {
31
- imports = [
32
- "${ sources . inputs . nixpkgs } /nixos/modules/services/web-apps/cryptpad.nix"
33
- ] ;
34
-
35
- # TODO: add to nixpkgs
36
- options . services . cryptpad . openPorts = lib . mkOption {
37
- type = lib . types . bool ;
38
- default = false ;
39
- description = ''
40
- Whether to open the port specified in `settings.httpPort` in the firewall.
41
- '' ;
42
- } ;
43
- config = lib . mkIf cfg . openPorts {
44
- networking . firewall . allowedTCPPorts = [ cfg . settings . httpPort ] ;
45
- networking . firewall . allowedUDPPorts = [ cfg . settings . httpPort ] ;
46
- } ;
47
- } ;
25
+ module = ./module.nix ;
48
26
examples . demo = {
49
27
module = ./demo.nix ;
50
28
description = "Deployment for demo purposes" ;
Original file line number Diff line number Diff line change
1
+ {
2
+ lib ,
3
+ config ,
4
+ modulesPath ,
5
+ ...
6
+ } :
7
+ let
8
+ cfg = config . services . cryptpad ;
9
+ in
10
+ {
11
+ imports = [
12
+ "${ modulesPath } /services/web-apps/cryptpad.nix"
13
+ ] ;
14
+
15
+ # TODO: add to nixpkgs
16
+ options . services . cryptpad . openPorts = lib . mkOption {
17
+ type = lib . types . bool ;
18
+ default = false ;
19
+ description = ''
20
+ Whether to open the port specified in `settings.httpPort` in the firewall.
21
+ '' ;
22
+ } ;
23
+ config = lib . mkIf cfg . openPorts {
24
+ networking . firewall . allowedTCPPorts = [ cfg . settings . httpPort ] ;
25
+ networking . firewall . allowedUDPPorts = [ cfg . settings . httpPort ] ;
26
+ } ;
27
+ }
You can’t perform that action at this time.
0 commit comments