3 { config, pkgs, lib, ... }:
7 # GNOME initial setup's run is conditioned on whether
8 # the gnome-initial-setup-done file exists in XDG_CONFIG_HOME
9 # Because of this, every existing user will have initial setup
10 # running because they never ran it before.
12 # To prevent this we create the file if the users stateVersion
13 # is older than 20.03 (the release we added this module).
15 script = pkgs.writeScript "create-gis-stamp-files" ''
16 #!${pkgs.runtimeShell}
17 setup_done=$HOME/.config/gnome-initial-setup-done
19 echo "Creating g-i-s stamp file $setup_done ..."
20 cat - > $setup_done <<- EOF
25 createGisStampFilesAutostart = pkgs.writeTextFile rec {
26 name = "create-g-i-s-stamp-files";
27 destination = "/etc/xdg/autostart/${name}.desktop";
31 Name=Create GNOME Initial Setup stamp files
36 AutostartCondition=unless-exists gnome-initial-setup-done
37 X-GNOME-Autostart-Phase=EarlyInitialization
46 maintainers = lib.teams.gnome.members;
53 services.gnome.gnome-initial-setup = {
55 enable = lib.mkEnableOption "GNOME Initial Setup, a Simple, easy, and safe way to prepare a new system";
64 config = lib.mkIf config.services.gnome.gnome-initial-setup.enable {
66 environment.systemPackages = [
67 pkgs.gnome-initial-setup
69 ++ lib.optional (lib.versionOlder config.system.stateVersion "20.03") createGisStampFilesAutostart
73 pkgs.gnome-initial-setup
76 systemd.user.targets."gnome-session".wants = [
77 "gnome-initial-setup-copy-worker.service"
78 "gnome-initial-setup-first-login.service"
79 "gnome-welcome-tour.service"
82 systemd.user.targets."gnome-session@gnome-initial-setup".wants = [
83 "gnome-initial-setup.service"
86 programs.dconf.profiles.gnome-initial-setup.databases = [
87 "${pkgs.gnome-initial-setup}/share/gnome-initial-setup/initial-setup-dconf-defaults"