TigerVNC: Difference between revisions
Explain how to configure a systemd service in a configuration nix import |
m The xorg package set has been deprecated, 'xorg.xhost' has been renamed to 'xhost' and 'xorg.xauth' has been renamed to 'xauth' |
||
| (One intermediate revision by one other user not shown) | |||
| Line 50: | Line 50: | ||
config = lib.mkIf cfg.enable { | config = lib.mkIf cfg.enable { | ||
environment.systemPackages = [ pkgs.tigervnc pkgs | environment.systemPackages = [ pkgs.tigervnc pkgs.xhost pkgs.xauth ]; | ||
systemd.user.services = lib.mapAttrs' (user: opts: | systemd.user.services = lib.mapAttrs' (user: opts: | ||
| Line 62: | Line 62: | ||
wantedBy = [ "graphical-session.target" ]; | wantedBy = [ "graphical-session.target" ]; | ||
path = [ pkgs.tigervnc pkgs | path = [ pkgs.tigervnc pkgs.xhost pkgs.xauth pkgs.coreutils ]; | ||
script = let | script = let | ||
| Line 81: | Line 81: | ||
if [ ! -r "$HOME/.vnc/passwd" ]; then | if [ ! -r "$HOME/.vnc/passwd" ]; then | ||
echo "ERROR: Run: vncpasswd ~/.vnc/passwd" >&2 | echo "ERROR: Run: vncpasswd ~/.vnc/passwd" >&2 | ||
### CHANGE THE > in the above line TO A GREATER THAN SIGN! ### | |||
exit 1 | exit 1 | ||
fi | fi | ||
| Line 111: | Line 112: | ||
} | } | ||
</nowiki>}} | </nowiki>|name=/etc/nixos/tigervnc.nix|lang=nix}} | ||
For an initial setup you need to set your password with <code>vncpasswd</code> | For an initial setup you need to set your password with <code>vncpasswd</code> | ||