<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=TigerVNC</id>
	<title>TigerVNC - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=TigerVNC"/>
	<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=TigerVNC&amp;action=history"/>
	<updated>2026-04-06T21:47:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.0</generator>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=TigerVNC&amp;diff=30036&amp;oldid=prev</id>
		<title>Dangerflask: Add unmissable warning to draw attention to the Greater-than Sign not rendering properly</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=TigerVNC&amp;diff=30036&amp;oldid=prev"/>
		<updated>2026-02-20T06:07:14Z</updated>

		<summary type="html">&lt;p&gt;Add unmissable warning to draw attention to the Greater-than Sign not rendering properly&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:07, 20 February 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l81&quot;&gt;Line 81:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             if [ ! -r &amp;quot;$HOME/.vnc/passwd&amp;quot; ]; then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             if [ ! -r &amp;quot;$HOME/.vnc/passwd&amp;quot; ]; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               echo &amp;quot;ERROR: Run: vncpasswd ~/.vnc/passwd&amp;quot; &amp;gt;&amp;amp;2&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               echo &amp;quot;ERROR: Run: vncpasswd ~/.vnc/passwd&amp;quot; &amp;gt;&amp;amp;2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;### CHANGE THE &amp;gt; in the above line TO A GREATER THAN SIGN! ###&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               exit 1&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               exit 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             fi&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             fi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-29971:rev-30036:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Dangerflask</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=TigerVNC&amp;diff=29971&amp;oldid=prev</id>
		<title>Johanno: Explain how to configure a systemd service in a configuration nix import</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=TigerVNC&amp;diff=29971&amp;oldid=prev"/>
		<updated>2026-02-13T23:12:23Z</updated>

		<summary type="html">&lt;p&gt;Explain how to configure a systemd service in a configuration nix import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In order to get TigerVNC to run on nixos without further hassle you can use the following config.&lt;br /&gt;
(AI was heavily used to create it)&lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/configuration.nix|nix|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  imports = [&lt;br /&gt;
    ./tigervnc.nix&lt;br /&gt;
  ];&lt;br /&gt;
&lt;br /&gt;
  ### tigervnc&lt;br /&gt;
  services.xserver.enable = true;  # Prerequisite&lt;br /&gt;
&lt;br /&gt;
  services.tigervnc = {&lt;br /&gt;
    enable = true;&lt;br /&gt;
    users = {&lt;br /&gt;
      YOURUSERNAME = {&lt;br /&gt;
        localhost = false;  # true for SSH-only&lt;br /&gt;
      };&lt;br /&gt;
    };&lt;br /&gt;
  };&lt;br /&gt;
  ### tigervnc END&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Here you need to replace all &amp;lt;code&amp;gt;YOURUSERNAME&amp;lt;/code&amp;gt; with your user name.&lt;br /&gt;
&lt;br /&gt;
Now the tigervnc file to import.&lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/tigervnc.nix|nix|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{ config, pkgs, lib, ... }:&lt;br /&gt;
&lt;br /&gt;
let&lt;br /&gt;
  cfg = config.services.tigervnc;&lt;br /&gt;
in&lt;br /&gt;
{&lt;br /&gt;
  options.services.tigervnc = {&lt;br /&gt;
    enable = lib.mkEnableOption &amp;quot;TigerVNC x0vncserver (mirrors :0)&amp;quot;;&lt;br /&gt;
    users = lib.mkOption {&lt;br /&gt;
      type = lib.types.attrsOf (lib.types.submodule ({ name, config, ... }: {&lt;br /&gt;
        options = {&lt;br /&gt;
          enableSharing = lib.mkOption { type = lib.types.bool; default = true; };&lt;br /&gt;
          port = lib.mkOption { type = lib.types.int; default = 5901; };&lt;br /&gt;
          localhost = lib.mkOption { type = lib.types.bool; default = false; };&lt;br /&gt;
          #geometry = lib.mkOption { type = lib.types.str; default = &amp;quot;&amp;quot;; };&lt;br /&gt;
        };&lt;br /&gt;
      }));&lt;br /&gt;
      default = { };&lt;br /&gt;
    };&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  config = lib.mkIf cfg.enable {&lt;br /&gt;
    environment.systemPackages = [ pkgs.tigervnc pkgs.xorg.xhost pkgs.xorg.xauth ];&lt;br /&gt;
&lt;br /&gt;
    systemd.user.services = lib.mapAttrs&amp;#039; (user: opts:&lt;br /&gt;
      let svcName = &amp;quot;tigervnc-x0vncserver-${user}&amp;quot;;&lt;br /&gt;
      in {&lt;br /&gt;
        name = svcName;&lt;br /&gt;
        value = lib.mkIf opts.enableSharing {&lt;br /&gt;
          description = &amp;quot;TigerVNC x0vncserver sharing :0 for ${user}&amp;quot;;&lt;br /&gt;
          after = [ &amp;quot;graphical-session.target&amp;quot; ];&lt;br /&gt;
          partOf = [ &amp;quot;graphical-session.target&amp;quot; ];&lt;br /&gt;
          wantedBy = [ &amp;quot;graphical-session.target&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
          path = [ pkgs.tigervnc pkgs.xorg.xhost pkgs.xorg.xauth pkgs.coreutils ];&lt;br /&gt;
&lt;br /&gt;
          script = let&lt;br /&gt;
            # Build args array to avoid shell escaping hell&lt;br /&gt;
            vncArgs = [&lt;br /&gt;
              &amp;quot;-display :0&amp;quot;&lt;br /&gt;
              &amp;quot;-rfbport ${toString opts.port}&amp;quot;&lt;br /&gt;
              &amp;quot;-rfbauth $HOME/.vnc/passwd&amp;quot;&lt;br /&gt;
              &amp;quot;-AcceptSetDesktopSize=0&amp;quot;&lt;br /&gt;
              &amp;quot;-AlwaysShared&amp;quot;&lt;br /&gt;
            ] #++ lib.optionals (opts.geometry != &amp;quot;&amp;quot;) [ &amp;quot;-Geometry ${opts.geometry}&amp;quot; ]&lt;br /&gt;
              ++ lib.optionals opts.localhost [ &amp;quot;-localhost&amp;quot; ];&lt;br /&gt;
          in &amp;#039;&amp;#039;&lt;br /&gt;
            set -euxo pipefail&lt;br /&gt;
&lt;br /&gt;
            # Password check&lt;br /&gt;
            mkdir -p &amp;quot;$HOME/.vnc&amp;quot;&lt;br /&gt;
            if [ ! -r &amp;quot;$HOME/.vnc/passwd&amp;quot; ]; then&lt;br /&gt;
              echo &amp;quot;ERROR: Run: vncpasswd ~/.vnc/passwd&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
              exit 1&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            # X authority&lt;br /&gt;
            xhost +local:&lt;br /&gt;
&lt;br /&gt;
            # Clean x0vncserver args&lt;br /&gt;
            ${pkgs.tigervnc}/bin/x0vncserver ${lib.concatStringsSep &amp;quot; &amp;quot; (map (arg: &amp;quot;${arg}&amp;quot;) vncArgs)}&lt;br /&gt;
          &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
          preStop = &amp;#039;&amp;#039;&lt;br /&gt;
            xhost -local:&lt;br /&gt;
            pkill -f &amp;quot;x0vncserver.*${toString opts.port}&amp;quot;&lt;br /&gt;
          &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
          serviceConfig = {&lt;br /&gt;
            Type = &amp;quot;simple&amp;quot;;&lt;br /&gt;
            Restart = &amp;quot;always&amp;quot;;&lt;br /&gt;
            RestartSec = &amp;quot;5s&amp;quot;;&lt;br /&gt;
            RuntimeDirectory = &amp;quot;vnc-${user}&amp;quot;;&lt;br /&gt;
          };&lt;br /&gt;
        };&lt;br /&gt;
      }&lt;br /&gt;
    ) cfg.users;&lt;br /&gt;
&lt;br /&gt;
    networking.firewall.allowedTCPPorts =&lt;br /&gt;
      lib.mapAttrsToList (_: opts: opts.port) cfg.users;&lt;br /&gt;
  };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
For an initial setup you need to set your password with &amp;lt;code&amp;gt;vncpasswd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I had issues due to an existing .vnc folder so I did:&lt;br /&gt;
&amp;lt;code&amp;gt;echo &amp;quot;YOUR_PW&amp;quot; | vncpasswd -f &amp;gt; ~/.vnc/passwd&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Johanno</name></author>
	</entry>
</feed>