This repository was archived by the owner on Sep 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 44 cfg = config . services . genesis-shell ;
55 tty = "tty${ toString cfg . vt } " ;
66 isMobileNixOS = options ? mobile ;
7+
8+ commandArgs = optional cfg . displayManager "--display-manager" ;
79in {
810 options . services . genesis-shell = {
911 enable = mkEnableOption "Genesis Shell" ;
2123 The virtual console (tty) that greetd should use. This option also disables getty on that tty.
2224 '' ;
2325 } ;
26+ displayManager = ( mkEnableOption "Genesis Shell's display manager" ) // { default = true ; } ;
27+ user = mkOption {
28+ type = types . nullOr types . str ;
29+ default = null ;
30+ description = ''
31+ The user to run Genesis Shell as, only has an effect when the display manager option is disabled.
32+ '' ;
33+ } ;
2434 } ;
2535
2636 config = mkIf cfg . enable {
37+ assertions = [
38+ {
39+ assertion = ! cfg . displayManager -> cfg . user != null ;
40+ message = "Cannot run Genesis Shell as a specific user without disabling the display manager feature." ;
41+ }
42+ {
43+ assertion = cfg . displayManager -> cfg . user == null ;
44+ message = "When running Genesis Shell with the display manager feature disabled, a user must be specified." ;
45+ }
46+ ] ;
47+
2748 hardware = {
2849 opengl . enable = mkDefault true ;
2950 sensor . iio . enable = mkDefault true ;
5273 upower . enable = mkDefault true ;
5374 } ;
5475
55- users = {
76+ users = mkIf ( ! cfg . displayManager ) {
5677 users . genesis-shell = {
5778 isSystemUser = true ;
5879 uid = 198 ;
89110 } ;
90111
91112 serviceConfig = {
92- ExecStart = "${ getExe pkgs . cage } -- ${ getExe cfg . package } --display-manager " ;
113+ ExecStart = "${ getExe pkgs . cage } -- ${ getExe cfg . package } ${ concatStringsSep " " commandArgs } " ;
93114 Type = "simple" ;
94- User = "genesis-shell" ;
115+ User = if cfg . displayManager then "genesis-shell" else cfg . user ;
95116 UtmpIdentifier = "%n" ;
96117 UtmpMode = "user" ;
97118 TTYPath = "/dev/${ tty } " ;
You can’t perform that action at this time.
0 commit comments