summary refs log tree commit diff
path: root/nixos/tests/spacecookie.nix
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-03-10 22:12:36 +0100
committersterni <sternenseemann@systemli.org>2021-04-10 15:44:19 +0200
commit76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c (patch)
treeb037be84fa460dd91b63ceba9ffa8e05b3acf2c5 /nixos/tests/spacecookie.nix
parentb74821f31b468d8a302b07e528bcce16c24e4b06 (diff)
downloadnixpkgs-76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c.tar
nixpkgs-76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c.tar.gz
nixpkgs-76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c.tar.bz2
nixpkgs-76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c.tar.lz
nixpkgs-76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c.tar.xz
nixpkgs-76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c.tar.zst
nixpkgs-76583ee81a1a2d1c8f467fd0c509bc7b4b79f17c.zip
nixos/spacecookie: convert into settings-style freeform configuration
* Move `hostname` and `root` into a settings submodule with a freeform
  type, allowing users to also use options not known to the NixOS
  service. Compatibility with a warning for the renamed options is also
  trivial to achieve.
* `port` stays where it is as we don't actually use the `port` option of
  spacecookie to set up the socket, but only to inform spacecookie about
  the port we have set in the `systemd.socket` file, this makes more
  sense. Additionally the configuration of the listening port and
  address change in the next spacecookie release — we can dodge this
  issue altogether by doing our own thing, but I'm interested to hear
  opinions on this.
  To ensure that this is not misconfigured, we add an assertion for
  the port option.
* Add an assertion for `user` in settings which has no effect the way
  we are starting spacecookie as it wouldn't be able to call setuid.
  The message also explains how a specific user can be used with
  spacecookie if desired.
Diffstat (limited to 'nixos/tests/spacecookie.nix')
-rw-r--r--nixos/tests/spacecookie.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/tests/spacecookie.nix b/nixos/tests/spacecookie.nix
index 19db520984b..a640657d8a6 100644
--- a/nixos/tests/spacecookie.nix
+++ b/nixos/tests/spacecookie.nix
@@ -18,9 +18,11 @@ in
 
         services.spacecookie = {
           enable = true;
-          root = gopherRoot;
-          hostname = gopherHost;
           openFirewall = true;
+          settings = {
+            root = gopherRoot;
+            hostname = gopherHost;
+          };
         };
       };