Desktop¶
Source directory: modules/desktop/
default.nix¶
modules/desktop/cloud-sync/default.nix
No option declarations; see source for implementation.
cosmic-remote-desktop.nix¶
modules/desktop/cosmic-remote-desktop.nix
- Enable option: Remote Desktop support for COSMIC Desktop Environment
Options: enable, protocol, rdpPort, vncPort, allowedNetworks, disableScreenLock, disablePowerManagement, vncPassword
Options declaration (Nix)
options.features.desktop.cosmic-remote-desktop = {
enable = mkEnableOption "Remote Desktop support for COSMIC Desktop Environment";
protocol = mkOption {
type = types.enum [ "rdp" "vnc" "both" ];
default = "both";
description = "Remote desktop protocol to enable (RDP, VNC, or both)";
};
rdpPort = mkOption {
type = types.port;
default = 3389;
description = "RDP server port";
};
vncPort = mkOption {
type = types.port;
default = 5900;
description = "VNC server port";
};
allowedNetworks = mkOption {
type = types.listOf types.str;
default = [ "192.168.1.0/24" "10.0.0.0/8" ];
description = "Networks allowed to connect to remote desktop";
};
disableScreenLock = mkOption {
type = types.bool;
default = false;
description = "Disable automatic screen locking for remote sessions";
};
disablePowerManagement = mkOption {
type = types.bool;
default = true;
description = "Disable sleep/suspend for remote desktop availability";
};
vncPassword = mkOption {
type = types.str;
default = "nixos";
description = "VNC password for authentication (change this for security!)";
};
}
cosmic.nix¶
- Enable option: COSMIC Desktop Environment
Options: enable, useCosmicGreeter, defaultSession, installAllApps, enableTailscaleApplet, enableNextMeetingApplet, enableSpotifyApplet, enableForecastApp
Options declaration (Nix)
options.features.desktop.cosmic = {
enable = mkEnableOption "COSMIC Desktop Environment";
useCosmicGreeter = mkOption {
type = types.bool;
default = true;
description = "Use COSMIC Greeter as the display manager";
};
defaultSession = mkOption {
type = types.bool;
default = false;
description = "Set COSMIC as the default desktop session";
};
installAllApps = mkOption {
type = types.bool;
default = true;
description = "Install all COSMIC applications and extensions";
};
enableTailscaleApplet = mkOption {
type = types.bool;
default = true;
description = "Enable Tailscale management applet for COSMIC panel. Requires Tailscale to be installed and users to have operator privileges.";
};
enableNextMeetingApplet = mkOption {
type = types.bool;
default = true;
description = "Enable next meeting calendar applet for COSMIC panel. Shows upcoming meetings with one-click join for video calls. Requires Evolution Data Server.";
};
enableSpotifyApplet = mkOption {
type = types.bool;
default = true;
description = ''
Enable Spotify applet for COSMIC panel.
Displays currently playing Spotify track information (artist and title) in the system panel.
Shows playback status indicators (playing, paused, stopped) with 500ms refresh intervals.
Requires Spotify with MPRIS support on Wayland.
'';
};
enableForecastApp = mkOption {
type = types.bool;
default = true;
description = ''
Enable Forecast weather application for COSMIC desktop.
Weather app written in Rust and libcosmic providing weather information display.
Integrates with COSMIC desktop environment for native experience.
'';
};
}
ddcutil.nix¶
- Enable option: ddcutil DDC/CI control of external monitors (brightness/contrast/input over I2C)
Options declaration (Nix)
options.modules.hardware.ddcutil.enable =
mkEnableOption "ddcutil DDC/CI control of external monitors (brightness/contrast/input over I2C)";
config = mkIf cfg.enable {
# Loads the i2c-dev kernel module and installs udev rules giving the `i2c`
# group read/write on /dev/i2c-*.
hardware.i2c.enable = true;
environment.systemPackages = [ pkgs.ddcutil ];
# Put every normal user in the i2c group so `ddcutil` works without sudo.
users.groups.i2c.members =
builtins.attrNames (filterAttrs (_: u: u.isNormalUser) config.users.users);
}
default.nix¶
No option declarations; see source for implementation.
display-manager.nix¶
modules/desktop/display-manager.nix
- Enable option: auto-login at boot (recommended only for headless RDP hosts)
Options: enable, backend, user
Options declaration (Nix)
options.desktop.displayManager = {
backend = mkOption {
type = types.enum [ "gdm" "cosmic-greeter" "none" ];
default = "none";
description = ''
Which display manager runs at boot.
- gdm: GDM (used by the headless RDP host for auto-login GNOME)
- cosmic-greeter: COSMIC's own greeter (used by hosts with COSMIC)
- none: no DM enabled (e.g. host uses start* command directly)
This option exists to keep the wiring in one place and prevent
lightdm from sneaking back in (nixpkgs enables it by default
when xserver is enabled).
'';
};
autoLogin = {
enable = mkEnableOption "auto-login at boot (recommended only for headless RDP hosts)";
user = mkOption {
type = types.str;
default = "";
description = "User to auto-login as. Required when autoLogin.enable = true.";
};
};
}
electron-config.nix¶
modules/desktop/electron-config.nix
No option declarations; see source for implementation.
gnome-remote-desktop.nix¶
modules/desktop/gnome-remote-desktop.nix
- Enable option: GNOME Remote Desktop (system-mode RDP)
Options: enable, credentialsFile, credentialsUser
Options declaration (Nix)
options.features.gnome-remote-desktop = {
enable = mkEnableOption "GNOME Remote Desktop (system-mode RDP)";
credentialsFile = mkOption {
type = types.nullOr types.path;
default =
if rdpSecretExists
then config.age.secrets.grd-rdp-password.path
else null;
defaultText = lib.literalExpression ''
config.age.secrets.grd-rdp-password.path # when secrets/grd-rdp-password.age exists
'';
example = "/run/agenix/grd-rdp-password";
description = ''
Path to a file containing the RDP password (plaintext, no trailing
newline). When set, the grd-bootstrap oneshot writes the password
into the system gnome-remote-desktop daemon's credential store on
every boot.
Auto-defaults to the agenix-decrypted path
`config.age.secrets.grd-rdp-password.path` when
`secrets/grd-rdp-password.age` is present in the repo. The file is
read at runtime — its contents never enter the Nix store.
'';
};
credentialsUser = mkOption {
type = types.str;
default = "olafkfreund";
description = ''
Username RDP clients authenticate as. Written into the system
gnome-remote-desktop credentials store alongside the password.
'';
};
}
default.nix¶
modules/desktop/gtk/default.nix
No option declarations; see source for implementation.
plasma.nix¶
modules/desktop/plasma/plasma.nix
No option declarations; see source for implementation.
default.nix¶
modules/desktop/remote/default.nix
No option declarations; see source for implementation.
stylix-theme.nix¶
modules/desktop/stylix-theme.nix
No option declarations; see source for implementation.
sunshine.nix¶
- Enable option: Sunshine desktop streaming host (for Moonlight clients)
Options: enable, openFirewall, wakeDisplay, webOrigins
Options declaration (Nix)
options.features.sunshine = {
enable = mkEnableOption "Sunshine desktop streaming host (for Moonlight clients)";
openFirewall = mkOption {
type = types.bool;
default = true;
description = ''
Open the ports Sunshine needs. It is not one port: 47984/47989/48010
TCP and 47998-48000/48002/48010 UDP, which is why this defers to
upstream's own option rather than listing them here and drifting.
Sunshine's web UI (47990) is HTTPS with a self-signed certificate and
its own login, set on first visit. Leave this on only on a network
where that is an acceptable front door.
'';
};
wakeDisplay = mkOption {
type = types.bool;
default = false;
description = ''
Turn the display back on when a client connects.
Sunshine streams what the compositor renders to the monitor, so a
screen that has been switched off produces a black stream and a
completely clean log -- CLIENT CONNECTED, capture on the correct
monitor, encoder running, no errors. Nothing distinguishes "the
picture is dark" from "the picture is missing", which makes it an
expensive half hour to diagnose.
Sunshine cannot wake an output on its own, and it will not be woken by
the client's input either, so without this every session that starts
while the screen is off is a black one.
Implemented as global_prep_cmd, not per-application, so it covers
every entry including any still defined in the web UI's own apps
list. Hyprland only.
'';
};
webOrigins = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "https://192.168.1.75:47990" "https://myhost:47990" ];
description = ''
Origins allowed to use Sunshine's web UI, as scheme://host:port.
Sunshine trusts only localhost, 127.0.0.1 and [::1] by default and
refuses every POST from anywhere else with
CSRF Protection Error
The request was blocked by CSRF protection.
That includes the request that creates the first username and
password, so reaching the UI across the LAN is not merely restricted
-- the page loads and nothing on it can be submitted. Every host that
is administered from another machine needs its own address here.
Include the port: the browser sends it in the Origin header, so
"https://host" does not match "https://host:47990".
Setting this has a side effect worth knowing, and it comes from
upstream's module rather than from here: Sunshine is only handed a
config file when some setting differs from the default, and that file
lives in the Nix store, read-only. So as soon as this list is
non-empty the web UI's Configuration tab can no longer save --
settings belong in this repository from then on. Credentials and
client pairings are not affected; those live in
~/.config/sunshine/sunshine_state.json, which stays writable.
'';
};
}
theme-owner.nix¶
modules/desktop/theme-owner.nix
- Enable option: session-scoped theme ownership (DMS in DMS sessions, omarchy in the Omarchy session)
Options: enable, user
Options declaration (Nix)
default.nix¶
modules/desktop/wlr/default.nix
No option declarations; see source for implementation.