aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-12-31 11:39:00 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-12-31 11:55:57 +0100
commit0ba91bdd57fd6b08f00197d65cd298c317aa164f (patch)
treee06c322a2c308e32e794ffca1bd91d33889d9d9e /modules
parente8864bbff33f33b1de4929037a81368263c5475b (diff)
downloadNix-0ba91bdd57fd6b08f00197d65cd298c317aa164f.tar.gz
Nix-0ba91bdd57fd6b08f00197d65cd298c317aa164f.tar.zst
Nix-0ba91bdd57fd6b08f00197d65cd298c317aa164f.zip
Remove flaked modules
Diffstat (limited to 'modules')
-rw-r--r--modules/default.nix2
-rw-r--r--modules/myids.nix33
-rw-r--r--modules/openarc.nix90
3 files changed, 1 insertions, 124 deletions
diff --git a/modules/default.nix b/modules/default.nix
index 059a9d8..53e3932 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -2,7 +2,7 @@ let
2 flakeCompat = import ../lib/flake-compat.nix; 2 flakeCompat = import ../lib/flake-compat.nix;
3in 3in
4{ 4{
5 myids = ./myids.nix; 5 myids = (flakeCompat ../flakes/myuids).nixosModule;
6 secrets = ./secrets.nix; 6 secrets = ./secrets.nix;
7 filesWatcher = ./filesWatcher.nix; 7 filesWatcher = ./filesWatcher.nix;
8 8
diff --git a/modules/myids.nix b/modules/myids.nix
deleted file mode 100644
index 1a1a5d6..0000000
--- a/modules/myids.nix
+++ /dev/null
@@ -1,33 +0,0 @@
1{ ... }:
2{
3 # Check that there is no clash with nixos/modules/misc/ids.nix
4 config = {
5 ids.uids = {
6 acme = 388;
7 backup = 389;
8 vhost = 390;
9 openarc = 391;
10 opendmarc = 392;
11 peertube = 394;
12 redis = 395;
13 nullmailer = 396;
14 mediagoblin = 397;
15 diaspora = 398;
16 mastodon = 399;
17 };
18 ids.gids = {
19 nagios = 11; # commented in the ids file
20 acme = 388;
21 backup = 389;
22 vhost = 390;
23 openarc = 391;
24 opendmarc = 392;
25 peertube = 394;
26 redis = 395;
27 nullmailer = 396;
28 mediagoblin = 397;
29 diaspora = 398;
30 mastodon = 399;
31 };
32 };
33}
diff --git a/modules/openarc.nix b/modules/openarc.nix
deleted file mode 100644
index 9dc49de..0000000
--- a/modules/openarc.nix
+++ /dev/null
@@ -1,90 +0,0 @@
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 cfg = config.services.openarc;
8
9 defaultSock = "local:/run/openarc/openarc.sock";
10
11 args = [ "-f"
12 "-p" cfg.socket
13 ] ++ optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
14
15in {
16
17 ###### interface
18
19 options = {
20
21 services.openarc = {
22
23 enable = mkOption {
24 type = types.bool;
25 default = false;
26 description = "Whether to enable the OpenARC sender authentication system.";
27 };
28
29 socket = mkOption {
30 type = types.str;
31 default = defaultSock;
32 description = "Socket which is used for communication with OpenARC.";
33 };
34
35 user = mkOption {
36 type = types.str;
37 default = "opendmarc";
38 description = "User for the daemon.";
39 };
40
41 group = mkOption {
42 type = types.str;
43 default = "opendmarc";
44 description = "Group for the daemon.";
45 };
46
47 configFile = mkOption {
48 type = types.nullOr types.path;
49 default = null;
50 description = "Additional OpenARC configuration.";
51 };
52
53 };
54
55 };
56
57
58 ###### implementation
59
60 config = mkIf cfg.enable {
61
62 users.users = optionalAttrs (cfg.user == "openarc") (singleton
63 { name = "openarc";
64 group = cfg.group;
65 uid = config.ids.uids.openarc;
66 });
67
68 users.groups = optionalAttrs (cfg.group == "openarc") (singleton
69 { name = "openarc";
70 gid = config.ids.gids.openarc;
71 });
72
73 environment.systemPackages = [ pkgs.openarc ];
74
75 systemd.services.openarc = {
76 description = "OpenARC daemon";
77 after = [ "network.target" ];
78 wantedBy = [ "multi-user.target" ];
79
80 serviceConfig = {
81 ExecStart = "${pkgs.openarc}/bin/openarc ${escapeShellArgs args}";
82 User = cfg.user;
83 Group = cfg.group;
84 RuntimeDirectory = optional (cfg.socket == defaultSock) "openarc";
85 PermissionsStartOnly = true;
86 };
87 };
88
89 };
90}