Skip to content

Commit

Permalink
feat: add gdm user and group creation for gdm images
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalOughtness authored Apr 8, 2024
1 parent 66e317f commit 76e23aa
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 7 deletions.
4 changes: 4 additions & 0 deletions config/files/usr/etc/gdm/gdm-useradd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/sh

getent group gdm > /dev/null || groupadd -r gdm
getent passwd gdm > /dev/null || useradd -r -g gdm -c "GDM Greeter Account" -d /var/lib/gdm -s /usr/sbin/nologin gdm
4 changes: 4 additions & 0 deletions config/gdm-systemd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: systemd
system:
enabled:
- gdm-boot.service
1 change: 1 addition & 0 deletions config/recipe-hyprland-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
1 change: 1 addition & 0 deletions config/recipe-hyprland-nvidia-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
2 changes: 1 addition & 1 deletion config/recipe-hyprland-nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ modules:
- from-file: common-scripts.yml
- from-file: sddm-scripts.yml
- type: signing
- from-file: common-systemd.yml
- from-file: sddm-systemd.yml
2 changes: 1 addition & 1 deletion config/recipe-hyprland.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ modules:
- from-file: common-scripts.yml
- from-file: sddm-scripts.yml
- type: signing
- from-file: common-systemd.yml
- from-file: sddm-systemd.yml
1 change: 1 addition & 0 deletions config/recipe-river-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
1 change: 1 addition & 0 deletions config/recipe-river-nvidia-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
2 changes: 1 addition & 1 deletion config/recipe-river-nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ modules:
- from-file: common-scripts.yml
- from-file: sddm-scripts.yml
- type: signing
- from-file: common-systemd.yml
- from-file: sddm-systemd.yml
2 changes: 1 addition & 1 deletion config/recipe-river.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ modules:
- from-file: common-scripts.yml
- from-file: sddm-scripts.yml
- type: signing
- from-file: common-systemd.yml
- from-file: sddm-systemd.yml
1 change: 1 addition & 0 deletions config/recipe-sway-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
1 change: 1 addition & 0 deletions config/recipe-sway-nvidia-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
1 change: 1 addition & 0 deletions config/recipe-wayfire-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
1 change: 1 addition & 0 deletions config/recipe-wayfire-nvidia-gdm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ modules:
- from-file: common-scripts.yml
- from-file: gdm-scripts.yml
- type: signing
- from-file: gdm-systemd.yml
2 changes: 1 addition & 1 deletion config/recipe-wayfire-nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ modules:
- from-file: common-scripts.yml
- from-file: sddm-scripts.yml
- type: signing
- from-file: common-systemd.yml
- from-file: sddm-systemd.yml
2 changes: 1 addition & 1 deletion config/recipe-wayfire.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ modules:
- from-file: common-scripts.yml
- from-file: sddm-scripts.yml
- type: signing
- from-file: common-systemd.yml
- from-file: sddm-systemd.yml
File renamed without changes.
16 changes: 16 additions & 0 deletions config/systemd/system/gdm-boot.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Creates an GDM user before GDM runs.
# See:
# - https://github.com/ublue-os/cinnamon/blob/bf44562ddbed670cdd0d03a45ea08bdb8a6e96a7/system_files/usr/lib/systemd/system/ublue-lightdm-workaround.service#L4
# - https://github.com/ublue-os/main/issues/224#issuecomment-1987851271

[Unit]
Description=Create GDM user on system boot
Before=gdm.service

[Service]
Type=oneshot
ExecStart=/usr/etc/gdm/gdm-useradd
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion config/systemd/system/sddm-boot.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Before=sddm.service

[Service]
Type=oneshot
ExecStart=/etc/sddm/sddm-useradd
ExecStart=/usr/etc/sddm/sddm-useradd
RemainAfterExit=yes

[Install]
Expand Down

0 comments on commit 76e23aa

Please sign in to comment.