-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdm.nix
102 lines (83 loc) · 2.81 KB
/
gdm.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{ config, pkgs, lib, ... }:
{
services.gvfs.enable = true;
#------------------------------------------
# GDM wayland only
#------------------------------------------
# https://github.com/NixOS/nixpkgs/issues/57602#issuecomment-657762138
services.xserver.displayManager.gdm = {
enable = true;
wayland = true;
};
# Extracted from nixos/modules/services/x11/xserver.nix
systemd.defaultUnit = "graphical.target";
systemd.services.display-manager =
let
cfg = config.services.xserver.displayManager;
in
{
description = "Display Manager";
after = [ "acpid.service" "systemd-logind.service" ];
restartIfChanged = false;
environment =
lib.optionalAttrs
config.hardware.opengl.setLdLibraryPath {
LD_LIBRARY_PATH = pkgs.addOpenGLRunpath.driverLink;
} // cfg.job.environment;
preStart =
''
${cfg.job.preStart}
rm -f /tmp/.X0-lock
'';
script = "${cfg.job.execCmd}";
serviceConfig = {
Restart = "always";
RestartSec = "200ms";
SyslogIdentifier = "display-manager";
# Stop restarting if the display manager stops (crashes) 2 times
# in one minute. Starting X typically takes 3-4s.
StartLimitInterval = "30s";
StartLimitBurst = "3";
# trace: warning: Service 'display-manager.service' uses the attribute 'StartLimitInterval' in the Service section, which is deprecated. See https://github.com/NixOS/nixpkgs/issues/45786.
};
};
# make new tabs/shells use the previous directory
#environment.interactiveShellInit = ''
#if [[ "$VTE_VERSION" > 3405 ]]; then
#source "${pkgs.gnome.vte}/etc/profile.d/vte.sh"
#fi
#'';
#------------------------------------------
# _sway
#------------------------------------------
environment.pathsToLink = [ "/libexec" ]; # enable polkit
#networking.networkmanager.enable = true;
#programs.sway = {
#enable = true;
#wrapperFeatures.gtk = true; # so that gtk works properly
#extraPackages = with pkgs; [
#swaylock # lockscreen
#swayidle
#xwayland # for legacy apps
#waybar # status bar
#mako # notification daemon
#kanshi # autorandr
#dmenu
#wofi # replacement for dmenu
#brightnessctl
#gammastep # make it red at night!
#sway-contrib.grimshot # screenshots
#swayr
#gnome.gnome-terminal
#gnome.gnome-system-monitor
#mate.caja
#gnome.nautilus
#evince
## https://discourse.nixos.org/t/some-lose-ends-for-sway-on-nixos-which-we-should-fix/17728/2?u=senorsmile
#gnome3.adwaita-icon-theme # default gnome cursors
#glib # gsettings
#dracula-theme # gtk theme (dark)
#gnome.networkmanagerapplet
#];
#};
}