diff options
author | lassulus <lassulus@lassul.us> | 2021-12-25 20:08:03 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-12-25 20:08:03 +0100 |
commit | 9f194012bd6e5524f547a9c361ee411baaee5048 (patch) | |
tree | a4cd821b08167d2db91b8ee7eca93805f41c776b /tv/3modules/x0vncserver.nix | |
parent | f31f9f37907c031091f208d30bd5f2e5011eebb0 (diff) | |
parent | a1a0f11af481d94fea38f0f6f71e3340587503ac (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/3modules/x0vncserver.nix')
-rw-r--r-- | tv/3modules/x0vncserver.nix | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/tv/3modules/x0vncserver.nix b/tv/3modules/x0vncserver.nix index ba79c4a4..4dbb34df 100644 --- a/tv/3modules/x0vncserver.nix +++ b/tv/3modules/x0vncserver.nix @@ -11,17 +11,12 @@ in { }; enable = mkEnableOption "tv.x0vncserver"; pwfile = mkOption { - default = { - name = "x0vncserver-pwfile"; - owner = cfg.user; - path = "${cfg.user.home}/.vncpasswd"; - source-path = toString <secrets> + "/vncpasswd"; - }; + default = toString <secrets> + "/vncpasswd"; description = '' Use vncpasswd to edit pwfile. See: nix-shell -p tigervnc --run 'man vncpasswd' ''; - type = types.secret-file; + type = types.absolute-pathname; }; rfbport = mkOption { default = 5900; @@ -33,26 +28,17 @@ in { }; }; config = mkIf cfg.enable { - krebs.secret.files = { - x0vncserver-pwfile = cfg.pwfile; - }; + krebs.systemd.services.x0vncserver = {}; systemd.services.x0vncserver = { - after = [ - config.krebs.secret.files.x0vncserver-pwfile.service - "graphical.target" - ]; - partOf = [ - config.krebs.secret.files.x0vncserver-pwfile.service - ]; - requires = [ - "graphical.target" - ]; + after = [ "graphical.target" ]; + requires = [ "graphical.target" ]; serviceConfig = { ExecStart = "${pkgs.tigervnc}/bin/x0vncserver ${toString [ "-display ${cfg.display}" - "-passwordfile ${cfg.pwfile.path}" + "-passwordfile \${CREDENTIALS_DIRECTORY}/pwfile" "-rfbport ${toString cfg.rfbport}" ]}"; + LoadCredential = "ssh_key:${cfg.pwfile}"; User = cfg.user.name; }; }; |