diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-21 06:05:12 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-21 06:05:12 +0100 |
commit | f107be784e6d5da5f90735765a68fdff96acfbb4 (patch) | |
tree | 145573a598009fb6adbd5ef7fbce0a850681f5f0 /infra/libkookie/nixpkgs/nixos/modules/services/desktops | |
parent | 2e04b35e5ac3a9123cafffbc84494fa4d389cca0 (diff) | |
parent | e9158eca70ae59e73fae23be5d13d3fa0cfc78b4 (diff) |
Add 'infra/libkookie/nixpkgs/' from commit 'e9158eca70ae59e73fae23be5d13d3fa0cfc78b4'
git-subtree-dir: infra/libkookie/nixpkgs
git-subtree-mainline: 2e04b35e5ac3a9123cafffbc84494fa4d389cca0
git-subtree-split: e9158eca70ae59e73fae23be5d13d3fa0cfc78b4
Diffstat (limited to 'infra/libkookie/nixpkgs/nixos/modules/services/desktops')
35 files changed, 1899 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/accountsservice.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/accountsservice.nix new file mode 100644 index 000000000000..ae2ecb5ffeb7 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/accountsservice.nix @@ -0,0 +1,58 @@ +# AccountsService daemon. + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.freedesktop.members; + }; + + ###### interface + + options = { + + services.accounts-daemon = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable AccountsService, a DBus service for accessing + the list of user accounts and information attached to those accounts. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.accounts-daemon.enable { + + environment.systemPackages = [ pkgs.accountsservice ]; + + # Accounts daemon looks for dbus interfaces in $XDG_DATA_DIRS/accountsservice + environment.pathsToLink = [ "/share/accountsservice" ]; + + services.dbus.packages = [ pkgs.accountsservice ]; + + systemd.packages = [ pkgs.accountsservice ]; + + systemd.services.accounts-daemon = recursiveUpdate { + + wantedBy = [ "graphical.target" ]; + + # Accounts daemon looks for dbus interfaces in $XDG_DATA_DIRS/accountsservice + environment.XDG_DATA_DIRS = "${config.system.path}/share"; + + } (optionalAttrs (!config.users.mutableUsers) { + environment.NIXOS_USERS_PURE = "true"; + }); + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/bamf.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/bamf.nix new file mode 100644 index 000000000000..4b35146d0844 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/bamf.nix @@ -0,0 +1,27 @@ +# Bamf + +{ config, lib, pkgs, ... }: + +with lib; + +{ + meta = { + maintainers = with maintainers; [ worldofpeace ]; + }; + + ###### interface + + options = { + services.bamf = { + enable = mkEnableOption "bamf"; + }; + }; + + ###### implementation + + config = mkIf config.services.bamf.enable { + services.dbus.packages = [ pkgs.bamf ]; + + systemd.packages = [ pkgs.bamf ]; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/blueman.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/blueman.nix new file mode 100644 index 000000000000..18ad610247ed --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/blueman.nix @@ -0,0 +1,25 @@ +# blueman service +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.blueman; +in { + ###### interface + options = { + services.blueman = { + enable = mkEnableOption "blueman"; + }; + }; + + ###### implementation + config = mkIf cfg.enable { + + environment.systemPackages = [ pkgs.blueman ]; + + services.dbus.packages = [ pkgs.blueman ]; + + systemd.packages = [ pkgs.blueman ]; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/dleyna-renderer.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/dleyna-renderer.nix new file mode 100644 index 000000000000..7f88605f627c --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/dleyna-renderer.nix @@ -0,0 +1,28 @@ +# dleyna-renderer service. +{ config, lib, pkgs, ... }: + +with lib; + +{ + ###### interface + options = { + services.dleyna-renderer = { + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable dleyna-renderer service, a DBus service + for handling DLNA renderers. + ''; + }; + }; + }; + + + ###### implementation + config = mkIf config.services.dleyna-renderer.enable { + environment.systemPackages = [ pkgs.dleyna-renderer ]; + + services.dbus.packages = [ pkgs.dleyna-renderer ]; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/dleyna-server.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/dleyna-server.nix new file mode 100644 index 000000000000..9a131a5e700f --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/dleyna-server.nix @@ -0,0 +1,28 @@ +# dleyna-server service. +{ config, lib, pkgs, ... }: + +with lib; + +{ + ###### interface + options = { + services.dleyna-server = { + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable dleyna-server service, a DBus service + for handling DLNA servers. + ''; + }; + }; + }; + + + ###### implementation + config = mkIf config.services.dleyna-server.enable { + environment.systemPackages = [ pkgs.dleyna-server ]; + + services.dbus.packages = [ pkgs.dleyna-server ]; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/espanso.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/espanso.nix new file mode 100644 index 000000000000..cd2eadf88168 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/espanso.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +with lib; +let cfg = config.services.espanso; +in { + meta = { maintainers = with lib.maintainers; [ numkem ]; }; + + options = { + services.espanso = { enable = options.mkEnableOption "Espanso"; }; + }; + + config = mkIf cfg.enable { + systemd.user.services.espanso = { + description = "Espanso daemon"; + path = with pkgs; [ espanso libnotify xclip ]; + serviceConfig = { + ExecStart = "${pkgs.espanso}/bin/espanso daemon"; + Restart = "on-failure"; + }; + wantedBy = [ "default.target" ]; + }; + + environment.systemPackages = [ pkgs.espanso ]; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/flatpak.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/flatpak.nix new file mode 100644 index 000000000000..d0f6b66328a4 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/flatpak.nix @@ -0,0 +1,66 @@ +# flatpak service. +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.flatpak; +in { + meta = { + doc = ./flatpak.xml; + maintainers = pkgs.flatpak.meta.maintainers; + }; + + ###### interface + options = { + services.flatpak = { + enable = mkEnableOption "flatpak"; + + guiPackages = mkOption { + internal = true; + type = types.listOf types.package; + default = []; + example = literalExample "[ pkgs.gnome3.gnome-software ]"; + description = '' + Packages that provide an interface for flatpak + (like gnome-software) that will be automatically available + to all users when flatpak is enabled. + ''; + }; + }; + }; + + + ###### implementation + config = mkIf cfg.enable { + + assertions = [ + { assertion = (config.xdg.portal.enable == true); + message = "To use Flatpak you must enable XDG Desktop Portals with xdg.portal.enable."; + } + ]; + + environment.systemPackages = [ pkgs.flatpak ] ++ cfg.guiPackages; + + services.dbus.packages = [ pkgs.flatpak ]; + + systemd.packages = [ pkgs.flatpak ]; + + environment.profiles = [ + "$HOME/.local/share/flatpak/exports" + "/var/lib/flatpak/exports" + ]; + + # It has been possible since https://github.com/flatpak/flatpak/releases/tag/1.3.2 + # to build a SELinux policy module. + + # TODO: use sysusers.d + users.users.flatpak = { + description = "Flatpak system helper"; + group = "flatpak"; + isSystemUser = true; + }; + + users.groups.flatpak = { }; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/flatpak.xml b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/flatpak.xml new file mode 100644 index 000000000000..8f080b250228 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/flatpak.xml @@ -0,0 +1,56 @@ +<chapter xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude" + version="5.0" + xml:id="module-services-flatpak"> + <title>Flatpak</title> + <para> + <emphasis>Source:</emphasis> + <filename>modules/services/desktop/flatpak.nix</filename> + </para> + <para> + <emphasis>Upstream documentation:</emphasis> + <link xlink:href="https://github.com/flatpak/flatpak/wiki"/> + </para> + <para> + Flatpak is a system for building, distributing, and running sandboxed desktop + applications on Linux. + </para> + <para> + To enable Flatpak, add the following to your + <filename>configuration.nix</filename>: +<programlisting> + <xref linkend="opt-services.flatpak.enable"/> = true; +</programlisting> + </para> + <para> + For the sandboxed apps to work correctly, desktop integration portals need to + be installed. If you run GNOME, this will be handled automatically for you; + in other cases, you will need to add something like the following to your + <filename>configuration.nix</filename>: +<programlisting> + <xref linkend="opt-xdg.portal.extraPortals"/> = [ pkgs.xdg-desktop-portal-gtk ]; +</programlisting> + </para> + <para> + Then, you will need to add a repository, for example, + <link xlink:href="https://github.com/flatpak/flatpak/wiki">Flathub</link>, + either using the following commands: +<screen> +<prompt>$ </prompt>flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +<prompt>$ </prompt>flatpak update +</screen> + or by opening the + <link xlink:href="https://flathub.org/repo/flathub.flatpakrepo">repository + file</link> in GNOME Software. + </para> + <para> + Finally, you can search and install programs: +<screen> +<prompt>$ </prompt>flatpak search bustle +<prompt>$ </prompt>flatpak install flathub org.freedesktop.Bustle +<prompt>$ </prompt>flatpak run org.freedesktop.Bustle +</screen> + Again, GNOME Software offers graphical interface for these tasks. + </para> +</chapter> diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/geoclue2.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/geoclue2.nix new file mode 100644 index 000000000000..6702bd395a03 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/geoclue2.nix @@ -0,0 +1,268 @@ +# GeoClue 2 daemon. + +{ config, lib, pkgs, ... }: + +with lib; + +let + # the demo agent isn't built by default, but we need it here + package = pkgs.geoclue2.override { withDemoAgent = config.services.geoclue2.enableDemoAgent; }; + + cfg = config.services.geoclue2; + + defaultWhitelist = [ "gnome-shell" "io.elementary.desktop.agent-geoclue2" ]; + + appConfigModule = types.submodule ({ name, ... }: { + options = { + desktopID = mkOption { + type = types.str; + description = "Desktop ID of the application."; + }; + + isAllowed = mkOption { + type = types.bool; + default = null; + description = '' + Whether the application will be allowed access to location information. + ''; + }; + + isSystem = mkOption { + type = types.bool; + default = null; + description = '' + Whether the application is a system component or not. + ''; + }; + + users = mkOption { + type = types.listOf types.str; + default = []; + description = '' + List of UIDs of all users for which this application is allowed location + info access, Defaults to an empty string to allow it for all users. + ''; + }; + }; + + config.desktopID = mkDefault name; + }); + + appConfigToINICompatible = _: { desktopID, isAllowed, isSystem, users, ... }: { + name = desktopID; + value = { + allowed = isAllowed; + system = isSystem; + users = concatStringsSep ";" users; + }; + }; + +in +{ + + ###### interface + + options = { + + services.geoclue2 = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable GeoClue 2 daemon, a DBus service + that provides location information for accessing. + ''; + }; + + enableDemoAgent = mkOption { + type = types.bool; + default = true; + description = '' + Whether to use the GeoClue demo agent. This should be + overridden by desktop environments that provide their own + agent. + ''; + }; + + enableNmea = mkOption { + type = types.bool; + default = true; + description = '' + Whether to fetch location from NMEA sources on local network. + ''; + }; + + enable3G = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable 3G source. + ''; + }; + + enableCDMA = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable CDMA source. + ''; + }; + + enableModemGPS = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable Modem-GPS source. + ''; + }; + + enableWifi = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable WiFi source. + ''; + }; + + geoProviderUrl = mkOption { + type = types.str; + default = "https://location.services.mozilla.com/v1/geolocate?key=geoclue"; + example = "https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_KEY"; + description = '' + The url to the wifi GeoLocation Service. + ''; + }; + + submitData = mkOption { + type = types.bool; + default = false; + description = '' + Whether to submit data to a GeoLocation Service. + ''; + }; + + submissionUrl = mkOption { + type = types.str; + default = "https://location.services.mozilla.com/v1/submit?key=geoclue"; + description = '' + The url to submit data to a GeoLocation Service. + ''; + }; + + submissionNick = mkOption { + type = types.str; + default = "geoclue"; + description = '' + A nickname to submit network data with. + Must be 2-32 characters long. + ''; + }; + + appConfig = mkOption { + type = types.attrsOf appConfigModule; + default = {}; + example = literalExample '' + "com.github.app" = { + isAllowed = true; + isSystem = true; + users = [ "300" ]; + }; + ''; + description = '' + Specify extra settings per application. + ''; + }; + + }; + + }; + + + ###### implementation + config = mkIf cfg.enable { + + environment.systemPackages = [ package ]; + + services.dbus.packages = [ package ]; + + systemd.packages = [ package ]; + + # we cannot use DynamicUser as we need the the geoclue user to exist for the dbus policy to work + users = { + users.geoclue = { + isSystemUser = true; + home = "/var/lib/geoclue"; + group = "geoclue"; + description = "Geoinformation service"; + }; + + groups.geoclue = {}; + }; + + systemd.services.geoclue = { + # restart geoclue service when the configuration changes + restartTriggers = [ + config.environment.etc."geoclue/geoclue.conf".source + ]; + serviceConfig.StateDirectory = "geoclue"; + }; + + # this needs to run as a user service, since it's associated with the + # user who is making the requests + systemd.user.services = mkIf cfg.enableDemoAgent { + geoclue-agent = { + description = "Geoclue agent"; + # this should really be `partOf = [ "geoclue.service" ]`, but + # we can't be part of a system service, and the agent should + # be okay with the main service coming and going + wantedBy = [ "default.target" ]; + serviceConfig = { + Type = "exec"; + ExecStart = "${package}/libexec/geoclue-2.0/demos/agent"; + Restart = "on-failure"; + PrivateTmp = true; + }; + }; + }; + + services.geoclue2.appConfig.epiphany = { + isAllowed = true; + isSystem = false; + }; + + services.geoclue2.appConfig.firefox = { + isAllowed = true; + isSystem = false; + }; + + environment.etc."geoclue/geoclue.conf".text = + generators.toINI {} ({ + agent = { + whitelist = concatStringsSep ";" + (optional cfg.enableDemoAgent "geoclue-demo-agent" ++ defaultWhitelist); + }; + network-nmea = { + enable = cfg.enableNmea; + }; + "3g" = { + enable = cfg.enable3G; + }; + cdma = { + enable = cfg.enableCDMA; + }; + modem-gps = { + enable = cfg.enableModemGPS; + }; + wifi = { + enable = cfg.enableWifi; + url = cfg.geoProviderUrl; + submit-data = boolToString cfg.submitData; + submission-url = cfg.submissionUrl; + submission-nick = cfg.submissionNick; + }; + } // mapAttrs' appConfigToINICompatible cfg.appConfig); + }; + + meta.maintainers = with lib.maintainers; [ worldofpeace ]; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/at-spi2-core.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/at-spi2-core.nix new file mode 100644 index 000000000000..492242e3296d --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/at-spi2-core.nix @@ -0,0 +1,49 @@ +# at-spi2-core daemon. + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.at-spi2-core = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable at-spi2-core, a service for the Assistive Technologies + available on the GNOME platform. + + Enable this if you get the error or warning + <literal>The name org.a11y.Bus was not provided by any .service files</literal>. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkMerge [ + (mkIf config.services.gnome3.at-spi2-core.enable { + environment.systemPackages = [ pkgs.at-spi2-core ]; + services.dbus.packages = [ pkgs.at-spi2-core ]; + systemd.packages = [ pkgs.at-spi2-core ]; + }) + + (mkIf (!config.services.gnome3.at-spi2-core.enable) { + environment.variables.NO_AT_BRIDGE = "1"; + }) + ]; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/chrome-gnome-shell.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/chrome-gnome-shell.nix new file mode 100644 index 000000000000..3c7f217b18df --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/chrome-gnome-shell.nix @@ -0,0 +1,33 @@ +# Chrome GNOME Shell native host connector. +{ config, lib, pkgs, ... }: + +with lib; + +{ + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + options = { + services.gnome3.chrome-gnome-shell.enable = mkEnableOption '' + Chrome GNOME Shell native host connector, a DBus service + allowing to install GNOME Shell extensions from a web browser. + ''; + }; + + + ###### implementation + config = mkIf config.services.gnome3.chrome-gnome-shell.enable { + environment.etc = { + "chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/etc/chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json"; + "opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/etc/opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json"; + }; + + environment.systemPackages = [ pkgs.chrome-gnome-shell ]; + + services.dbus.packages = [ pkgs.chrome-gnome-shell ]; + + nixpkgs.config.firefox.enableGnomeExtensions = true; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/evolution-data-server.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/evolution-data-server.nix new file mode 100644 index 000000000000..bd62d16f61ce --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/evolution-data-server.nix @@ -0,0 +1,45 @@ +# Evolution Data Server daemon. + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.evolution-data-server = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable Evolution Data Server, a collection of services for + storing addressbooks and calendars. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.evolution-data-server.enable { + + environment.systemPackages = [ pkgs.gnome3.evolution-data-server ]; + + services.dbus.packages = [ pkgs.gnome3.evolution-data-server ]; + + systemd.packages = [ pkgs.gnome3.evolution-data-server ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/glib-networking.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/glib-networking.nix new file mode 100644 index 000000000000..7e667b6b1f04 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/glib-networking.nix @@ -0,0 +1,37 @@ +# GLib Networking + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.glib-networking = { + + enable = mkEnableOption "network extensions for GLib"; + + }; + + }; + + ###### implementation + + config = mkIf config.services.gnome3.glib-networking.enable { + + services.dbus.packages = [ pkgs.glib-networking ]; + + systemd.packages = [ pkgs.glib-networking ]; + + environment.variables.GIO_EXTRA_MODULES = [ "${pkgs.glib-networking.out}/lib/gio/modules" ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-initial-setup.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-initial-setup.nix new file mode 100644 index 000000000000..c391ad9694c9 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-initial-setup.nix @@ -0,0 +1,90 @@ +# GNOME Initial Setup. + +{ config, pkgs, lib, ... }: + +with lib; + +let + + # GNOME initial setup's run is conditioned on whether + # the gnome-initial-setup-done file exists in XDG_CONFIG_HOME + # Because of this, every existing user will have initial setup + # running because they never ran it before. + # + # To prevent this we create the file if the users stateVersion + # is older than 20.03 (the release we added this module). + + script = pkgs.writeScript "create-gis-stamp-files" '' + #!${pkgs.runtimeShell} + setup_done=$HOME/.config/gnome-initial-setup-done + + echo "Creating g-i-s stamp file $setup_done ..." + cat - > $setup_done <<- EOF + yes + EOF + ''; + + createGisStampFilesAutostart = pkgs.writeTextFile rec { + name = "create-g-i-s-stamp-files"; + destination = "/etc/xdg/autostart/${name}.desktop"; + text = '' + [Desktop Entry] + Type=Application + Name=Create GNOME Initial Setup stamp files + Exec=${script} + StartupNotify=false + NoDisplay=true + OnlyShowIn=GNOME; + AutostartCondition=unless-exists gnome-initial-setup-done + X-GNOME-Autostart-Phase=EarlyInitialization + ''; + }; + +in + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.gnome-initial-setup = { + + enable = mkEnableOption "GNOME Initial Setup, a Simple, easy, and safe way to prepare a new system"; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.gnome-initial-setup.enable { + + environment.systemPackages = [ + pkgs.gnome3.gnome-initial-setup + ] + ++ optional (versionOlder config.system.stateVersion "20.03") createGisStampFilesAutostart + ; + + systemd.packages = [ + pkgs.gnome3.gnome-initial-setup + ]; + + systemd.user.targets."gnome-session".wants = [ + "gnome-initial-setup-copy-worker.service" + "gnome-initial-setup-first-login.service" + "gnome-welcome-tour.service" + ]; + + systemd.user.targets."gnome-session@gnome-initial-setup".wants = [ + "gnome-initial-setup.service" + ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-keyring.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-keyring.nix new file mode 100644 index 000000000000..2916a3c82b34 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-keyring.nix @@ -0,0 +1,53 @@ +# GNOME Keyring daemon. + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.gnome-keyring = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable GNOME Keyring daemon, a service designed to + take care of the user's security credentials, + such as user names and passwords. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.gnome-keyring.enable { + + environment.systemPackages = [ pkgs.gnome3.gnome-keyring ]; + + services.dbus.packages = [ pkgs.gnome3.gnome-keyring pkgs.gcr ]; + + xdg.portal.extraPortals = [ pkgs.gnome3.gnome-keyring ]; + + security.pam.services.login.enableGnomeKeyring = true; + + security.wrappers.gnome-keyring-daemon = { + source = "${pkgs.gnome3.gnome-keyring}/bin/gnome-keyring-daemon"; + capabilities = "cap_ipc_lock=ep"; + }; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-online-accounts.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-online-accounts.nix new file mode 100644 index 000000000000..3f9ced5e86b1 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-online-accounts.nix @@ -0,0 +1,43 @@ +# GNOME Online Accounts daemon. + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.gnome-online-accounts = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable GNOME Online Accounts daemon, a service that provides + a single sign-on framework for the GNOME desktop. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.gnome-online-accounts.enable { + + environment.systemPackages = [ pkgs.gnome-online-accounts ]; + + services.dbus.packages = [ pkgs.gnome-online-accounts ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-online-miners.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-online-miners.nix new file mode 100644 index 000000000000..39d669e8b30f --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-online-miners.nix @@ -0,0 +1,43 @@ +# GNOME Online Miners daemon. + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.gnome-online-miners = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable GNOME Online Miners, a service that + crawls through your online content. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.gnome-online-miners.enable { + + environment.systemPackages = [ pkgs.gnome3.gnome-online-miners ]; + + services.dbus.packages = [ pkgs.gnome3.gnome-online-miners ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-remote-desktop.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-remote-desktop.nix new file mode 100644 index 000000000000..164a0a44f8c8 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-remote-desktop.nix @@ -0,0 +1,24 @@ +# Remote desktop daemon using Pipewire. +{ config, lib, pkgs, ... }: + +with lib; + +{ + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + options = { + services.gnome3.gnome-remote-desktop = { + enable = mkEnableOption "Remote Desktop support using Pipewire"; + }; + }; + + ###### implementation + config = mkIf config.services.gnome3.gnome-remote-desktop.enable { + services.pipewire.enable = true; + + systemd.packages = [ pkgs.gnome3.gnome-remote-desktop ]; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-settings-daemon.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-settings-daemon.nix new file mode 100644 index 000000000000..1c33ed064a19 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-settings-daemon.nix @@ -0,0 +1,78 @@ +# GNOME Settings Daemon + +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.gnome3.gnome-settings-daemon; + +in + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + imports = [ + (mkRemovedOptionModule + ["services" "gnome3" "gnome-settings-daemon" "package"] + "") + ]; + + ###### interface + + options = { + + services.gnome3.gnome-settings-daemon = { + + enable = mkEnableOption "GNOME Settings Daemon"; + + }; + + }; + + + ###### implementation + + config = mkIf cfg.enable { + + environment.systemPackages = [ + pkgs.gnome3.gnome-settings-daemon + ]; + + services.udev.packages = [ + pkgs.gnome3.gnome-settings-daemon + ]; + + systemd.packages = [ + pkgs.gnome3.gnome-settings-daemon + ]; + + systemd.user.targets."gnome-session-initialized".wants = [ + "gsd-color.target" + "gsd-datetime.target" + "gsd-keyboard.target" + "gsd-media-keys.target" + "gsd-print-notifications.target" + "gsd-rfkill.target" + "gsd-screensaver-proxy.target" + "gsd-sharing.target" + "gsd-smartcard.target" + "gsd-sound.target" + "gsd-wacom.target" + "gsd-wwan.target" + "gsd-a11y-settings.target" + "gsd-housekeeping.target" + "gsd-power.target" + ]; + + systemd.user.targets."gnome-session-x11-services".wants = [ + "gsd-xsettings.target" + ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-user-share.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-user-share.nix new file mode 100644 index 000000000000..f2fe8b41a9e2 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/gnome-user-share.nix @@ -0,0 +1,40 @@ +# GNOME User Share daemon. + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.gnome-user-share = { + + enable = mkEnableOption "GNOME User Share, a user-level file sharing service for GNOME"; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.gnome-user-share.enable { + + environment.systemPackages = [ + pkgs.gnome3.gnome-user-share + ]; + + systemd.packages = [ + pkgs.gnome3.gnome-user-share + ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/rygel.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/rygel.nix new file mode 100644 index 000000000000..917a1d6541e0 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/rygel.nix @@ -0,0 +1,36 @@ +# rygel service. +{ config, lib, pkgs, ... }: + +with lib; + +{ + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + options = { + services.gnome3.rygel = { + enable = mkOption { + default = false; + description = '' + Whether to enable Rygel UPnP Mediaserver. + + You will need to also allow UPnP connections in firewall, see the following <link xlink:href="https://github.com/NixOS/nixpkgs/pull/45045#issuecomment-416030795">comment</link>. + ''; + type = types.bool; + }; + }; + }; + + ###### implementation + config = mkIf config.services.gnome3.rygel.enable { + environment.systemPackages = [ pkgs.gnome3.rygel ]; + + services.dbus.packages = [ pkgs.gnome3.rygel ]; + + systemd.packages = [ pkgs.gnome3.rygel ]; + + environment.etc."rygel.conf".source = "${pkgs.gnome3.rygel}/etc/rygel.conf"; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/sushi.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/sushi.nix new file mode 100644 index 000000000000..83b17365d5dd --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/sushi.nix @@ -0,0 +1,42 @@ +# GNOME Sushi daemon. + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.sushi = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable Sushi, a quick previewer for nautilus. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.sushi.enable { + + environment.systemPackages = [ pkgs.gnome3.sushi ]; + + services.dbus.packages = [ pkgs.gnome3.sushi ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/tracker-miners.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/tracker-miners.nix new file mode 100644 index 000000000000..f2af40249271 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/tracker-miners.nix @@ -0,0 +1,44 @@ +# Tracker Miners daemons. + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.tracker-miners = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable Tracker miners, indexing services for Tracker + search engine and metadata storage system. + ''; + }; + + }; + + }; + + ###### implementation + + config = mkIf config.services.gnome3.tracker-miners.enable { + + environment.systemPackages = [ pkgs.tracker-miners ]; + + services.dbus.packages = [ pkgs.tracker-miners ]; + + systemd.packages = [ pkgs.tracker-miners ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/tracker.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/tracker.nix new file mode 100644 index 000000000000..cd196e385539 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gnome3/tracker.nix @@ -0,0 +1,45 @@ +# Tracker daemon. + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.gnome3.tracker = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable Tracker services, a search engine, + search tool and metadata storage system. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.gnome3.tracker.enable { + + environment.systemPackages = [ pkgs.tracker ]; + + services.dbus.packages = [ pkgs.tracker ]; + + systemd.packages = [ pkgs.tracker ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gsignond.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gsignond.nix new file mode 100644 index 000000000000..5ab9add9f32d --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gsignond.nix @@ -0,0 +1,45 @@ +# Accounts-SSO gSignOn daemon + +{ config, lib, pkgs, ... }: + +with lib; + +let + package = pkgs.gsignond.override { plugins = config.services.gsignond.plugins; }; +in +{ + + meta.maintainers = pkgs.pantheon.maintainers; + + ###### interface + + options = { + + services.gsignond = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable gSignOn daemon, a DBus service + which performs user authentication on behalf of its clients. + ''; + }; + + plugins = mkOption { + type = types.listOf types.package; + default = []; + description = '' + What plugins to use with the gSignOn daemon. + ''; + }; + }; + }; + + ###### implementation + config = mkIf config.services.gsignond.enable { + environment.etc."gsignond.conf".source = "${package}/etc/gsignond.conf"; + services.dbus.packages = [ package ]; + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gvfs.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gvfs.nix new file mode 100644 index 000000000000..250ea6d4575f --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/gvfs.nix @@ -0,0 +1,63 @@ +# GVfs + +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.gvfs; + +in + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + # Added 2019-08-19 + imports = [ + (mkRenamedOptionModule + [ "services" "gnome3" "gvfs" "enable" ] + [ "services" "gvfs" "enable" ]) + ]; + + ###### interface + + options = { + + services.gvfs = { + + enable = mkEnableOption "GVfs, a userspace virtual filesystem"; + + # gvfs can be built with multiple configurations + package = mkOption { + type = types.package; + default = pkgs.gnome3.gvfs; + description = "Which GVfs package to use."; + }; + + }; + + }; + + + ###### implementation + + config = mkIf cfg.enable { + + environment.systemPackages = [ cfg.package ]; + + services.dbus.packages = [ cfg.package ]; + + systemd.packages = [ cfg.package ]; + + services.udev.packages = [ pkgs.libmtp.bin ]; + + # Needed for unwrapped applications + environment.variables.GIO_EXTRA_MODULES = [ "${cfg.package}/lib/gio/modules" ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/malcontent.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/malcontent.nix new file mode 100644 index 000000000000..1fbeb17e6aeb --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/malcontent.nix @@ -0,0 +1,40 @@ +# Malcontent daemon. + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + ###### interface + + options = { + + services.malcontent = { + + enable = mkEnableOption "Malcontent, parental control support for applications"; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.malcontent.enable { + + environment.systemPackages = with pkgs; [ + malcontent + malcontent-ui + ]; + + services.dbus.packages = [ + # D-Bus services are in `out`, not the default `bin` output that would be picked up by `makeDbusConf`. + pkgs.malcontent.out + ]; + + services.accounts-daemon.enable = true; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/neard.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/neard.nix new file mode 100644 index 000000000000..9b0f8d1b3a77 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/neard.nix @@ -0,0 +1,23 @@ +# neard service. +{ config, lib, pkgs, ... }: + +with lib; + +{ + ###### interface + options = { + services.neard = { + enable = mkEnableOption "neard, NFC daemon"; + }; + }; + + + ###### implementation + config = mkIf config.services.neard.enable { + environment.systemPackages = [ pkgs.neard ]; + + services.dbus.packages = [ pkgs.neard ]; + + systemd.packages = [ pkgs.neard ]; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/pantheon/files.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/pantheon/files.nix new file mode 100644 index 000000000000..8cee9f42b62f --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/pantheon/files.nix @@ -0,0 +1,13 @@ +# pantheon files daemon. + +{ config, pkgs, lib, ... }: + +with lib; + +{ + + imports = [ + (mkRemovedOptionModule [ "services" "pantheon" "files" "enable" ] "Use `environment.systemPackages [ pkgs.pantheon.elementary-files ];`") + ]; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/pipewire.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/pipewire.nix new file mode 100644 index 000000000000..0ef988d9e69f --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/pipewire.nix @@ -0,0 +1,183 @@ +# pipewire service. +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.pipewire; + enable32BitAlsaPlugins = cfg.alsa.support32Bit + && pkgs.stdenv.isx86_64 + && pkgs.pkgsi686Linux.pipewire != null; + + # The package doesn't output to $out/lib/pipewire directly so that the + # overlays can use the outputs to replace the originals in FHS environments. + # + # This doesn't work in general because of missing development information. + jack-libs = pkgs.runCommand "jack-libs" {} '' + mkdir -p "$out/lib" + ln -s "${cfg.package.jack}/lib" "$out/lib/pipewire" + ''; +in { + + meta = { + maintainers = teams.freedesktop.members; + }; + + ###### interface + options = { + services.pipewire = { + enable = mkEnableOption "pipewire service"; + + package = mkOption { + type = types.package; + default = pkgs.pipewire; + defaultText = "pkgs.pipewire"; + example = literalExample "pkgs.pipewire"; + description = '' + The pipewire derivation to use. + ''; + }; + + socketActivation = mkOption { + default = true; + type = types.bool; + description = '' + Automatically run pipewire when connections are made to the pipewire socket. + ''; + }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + description = '' + Literal string to append to /etc/pipewire/pipewire.conf. + ''; + }; + + sessionManager = mkOption { + type = types.nullOr types.string; + default = null; + example = literalExample ''"''${pipewire}/bin/pipewire-media-session"''; + description = '' + Path to the pipewire session manager executable. + ''; + }; + + sessionManagerArguments = mkOption { + type = types.listOf types.string; + default = []; + example = literalExample ''[ "-p" "bluez5.msbc-support=true" ]''; + description = '' + Arguments passed to the pipewire session manager. + ''; + }; + + alsa = { + enable = mkEnableOption "ALSA support"; + support32Bit = mkEnableOption "32-bit ALSA support on 64-bit systems"; + }; + + jack = { + enable = mkEnableOption "JACK audio emulation"; + }; + + pulse = { + enable = mkEnableOption "PulseAudio server emulation"; + }; + }; + }; + + + ###### implementation + config = mkIf cfg.enable { + assertions = [ + { + assertion = cfg.pulse.enable -> !config.hardware.pulseaudio.enable; + message = "PipeWire based PulseAudio server emulation replaces PulseAudio"; + } + { + assertion = cfg.jack.enable -> !config.services.jack.jackd.enable; + message = "PipeWire based JACK emulation doesn't use the JACK service"; + } + ]; + + services.pipewire.sessionManager = mkDefault "${cfg.package}/bin/pipewire-media-session"; + + environment.systemPackages = [ cfg.package ] + ++ lib.optional cfg.jack.enable jack-libs; + + systemd.packages = [ cfg.package ] + ++ lib.optional cfg.pulse.enable cfg.package.pulse; + + # PipeWire depends on DBUS but doesn't list it. Without this booting + # into a terminal results in the service crashing with an error. + systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ]; + systemd.user.sockets.pipewire-pulse.wantedBy = lib.mkIf (cfg.socketActivation && cfg.pulse.enable) ["sockets.target"]; + systemd.user.services.pipewire.bindsTo = [ "dbus.service" ]; + services.udev.packages = [ cfg.package ]; + + # If any paths are updated here they must also be updated in the package test. + environment.etc."alsa/conf.d/49-pipewire-modules.conf" = mkIf cfg.alsa.enable { + text = '' + pcm_type.pipewire { + libs.native = ${cfg.package.lib}/lib/alsa-lib/libasound_module_pcm_pipewire.so ; + ${optionalString enable32BitAlsaPlugins + "libs.32Bit = ${pkgs.pkgsi686Linux.pipewire.lib}/lib/alsa-lib/libasound_module_pcm_pipewire.so ;"} + } + ctl_type.pipewire { + libs.native = ${cfg.package.lib}/lib/alsa-lib/libasound_module_ctl_pipewire.so ; + ${optionalString enable32BitAlsaPlugins + "libs.32Bit = ${pkgs.pkgsi686Linux.pipewire.lib}/lib/alsa-lib/libasound_module_ctl_pipewire.so ;"} + } + ''; + }; + environment.etc."alsa/conf.d/50-pipewire.conf" = mkIf cfg.alsa.enable { + source = "${cfg.package}/share/alsa/alsa.conf.d/50-pipewire.conf"; + }; + environment.etc."alsa/conf.d/99-pipewire-default.conf" = mkIf cfg.alsa.enable { + source = "${cfg.package}/share/alsa/alsa.conf.d/99-pipewire-default.conf"; + }; + environment.sessionVariables.LD_LIBRARY_PATH = + lib.optional cfg.jack.enable "/run/current-system/sw/lib/pipewire"; + + environment.etc."pipewire/pipewire.conf" = { + # Adapted from src/daemon/pipewire.conf.in + text = '' + set-prop link.max-buffers 16 # version < 3 clients can't handle more + + add-spa-lib audio.convert* audioconvert/libspa-audioconvert + add-spa-lib api.alsa.* alsa/libspa-alsa + add-spa-lib api.v4l2.* v4l2/libspa-v4l2 + add-spa-lib api.libcamera.* libcamera/libspa-libcamera + add-spa-lib api.bluez5.* bluez5/libspa-bluez5 + add-spa-lib api.vulkan.* vulkan/libspa-vulkan + add-spa-lib api.jack.* jack/libspa-jack + add-spa-lib support.* support/libspa-support + + load-module libpipewire-module-rtkit # rt.prio=20 rt.time.soft=200000 rt.time.hard=200000 + load-module libpipewire-module-protocol-native + load-module libpipewire-module-profiler + load-module libpipewire-module-metadata + load-module libpipewire-module-spa-device-factory + load-module libpipewire-module-spa-node-factory + load-module libpipewire-module-client-node + load-module libpipewire-module-client-device + load-module libpipewire-module-portal + load-module libpipewire-module-access + load-module libpipewire-module-adapter + load-module libpipewire-module-link-factory + load-module libpipewire-module-session-manager + + create-object spa-node-factory factory.name=support.node.driver node.name=Dummy priority.driver=8000 + + exec ${cfg.sessionManager} ${lib.concatStringsSep " " cfg.sessionManagerArguments} + + ${cfg.extraConfig} + ''; + }; + + environment.etc."pipewire/media-session.d/with-alsa" = mkIf cfg.alsa.enable { text = ""; }; + environment.etc."pipewire/media-session.d/with-pulseaudio" = mkIf cfg.pulse.enable { text = ""; }; + environment.etc."pipewire/media-session.d/with-jack" = mkIf cfg.jack.enable { text = ""; }; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/profile-sync-daemon.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/profile-sync-daemon.nix new file mode 100644 index 000000000000..6206295272fc --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/profile-sync-daemon.nix @@ -0,0 +1,77 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.services.psd; +in { + options.services.psd = with types; { + enable = mkOption { + type = bool; + default = false; + description = '' + Whether to enable the Profile Sync daemon. + ''; + }; + resyncTimer = mkOption { + type = str; + default = "1h"; + example = "1h 30min"; + description = '' + The amount of time to wait before syncing browser profiles back to the + disk. + + Takes a systemd.unit time span. The time unit defaults to seconds if + omitted. + ''; + }; + }; + + config = mkIf cfg.enable { + systemd = { + user = { + services = { + psd = { + enable = true; + description = "Profile Sync daemon"; + wants = [ "psd-resync.service" ]; + wantedBy = [ "default.target" ]; + path = with pkgs; [ rsync kmod gawk nettools util-linux profile-sync-daemon ]; + unitConfig = { + RequiresMountsFor = [ "/home/" ]; + }; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = "yes"; + ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon sync"; + ExecStop = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon unsync"; + }; + }; + + psd-resync = { + enable = true; + description = "Timed profile resync"; + after = [ "psd.service" ]; + wants = [ "psd-resync.timer" ]; + partOf = [ "psd.service" ]; + wantedBy = [ "default.target" ]; + path = with pkgs; [ rsync kmod gawk nettools util-linux profile-sync-daemon ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon resync"; + }; + }; + }; + + timers.psd-resync = { + description = "Timer for profile sync daemon - ${cfg.resyncTimer}"; + partOf = [ "psd-resync.service" "psd.service" ]; + + timerConfig = { + OnUnitActiveSec = "${cfg.resyncTimer}"; + }; + }; + }; + }; + }; +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/system-config-printer.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/system-config-printer.nix new file mode 100644 index 000000000000..09c68c587b43 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/system-config-printer.nix @@ -0,0 +1,41 @@ +{ config, pkgs, lib, ... }: + +with lib; + +{ + + ###### interface + + options = { + + services.system-config-printer = { + + enable = mkEnableOption "system-config-printer, a service for CUPS administration used by printing interfaces"; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.system-config-printer.enable { + + services.dbus.packages = [ + pkgs.system-config-printer + ]; + + systemd.packages = [ + pkgs.system-config-printer + ]; + + services.udev.packages = [ + pkgs.system-config-printer + ]; + + # for $out/bin/install-printer-driver + services.packagekit.enable = true; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/telepathy.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/telepathy.nix new file mode 100644 index 000000000000..8c50d860e5bb --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/telepathy.nix @@ -0,0 +1,48 @@ +# Telepathy daemon. + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + ###### interface + + options = { + + services.telepathy = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable Telepathy service, a communications framework + that enables real-time communication via pluggable protocol backends. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.telepathy.enable { + + environment.systemPackages = [ pkgs.telepathy-mission-control ]; + + services.dbus.packages = [ pkgs.telepathy-mission-control ]; + + # Enable runtime optional telepathy in gnome-shell + services.xserver.desktopManager.gnome3.sessionPath = with pkgs; [ + telepathy-glib + telepathy-logger + ]; + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/tumbler.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/tumbler.nix new file mode 100644 index 000000000000..a09079517f04 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/tumbler.nix @@ -0,0 +1,52 @@ +# Tumbler + +{ config, pkgs, lib, ... }: + +with lib; + +let + + cfg = config.services.tumbler; + +in + +{ + + imports = [ + (mkRemovedOptionModule + [ "services" "tumbler" "package" ] + "") + ]; + + meta = { + maintainers = with maintainers; [ worldofpeace ]; + }; + + ###### interface + + options = { + + services.tumbler = { + + enable = mkEnableOption "Tumbler, A D-Bus thumbnailer service"; + + }; + + }; + + + ###### implementation + + config = mkIf cfg.enable { + + environment.systemPackages = with pkgs.xfce; [ + tumbler + ]; + + services.dbus.packages = with pkgs.xfce; [ + tumbler + ]; + + }; + +} diff --git a/infra/libkookie/nixpkgs/nixos/modules/services/desktops/zeitgeist.nix b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/zeitgeist.nix new file mode 100644 index 000000000000..cf7dd5fe3a13 --- /dev/null +++ b/infra/libkookie/nixpkgs/nixos/modules/services/desktops/zeitgeist.nix @@ -0,0 +1,31 @@ +# Zeitgeist + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + meta = { + maintainers = with maintainers; [ worldofpeace ]; + }; + + ###### interface + + options = { + services.zeitgeist = { + enable = mkEnableOption "zeitgeist"; + }; + }; + + ###### implementation + + config = mkIf config.services.zeitgeist.enable { + + environment.systemPackages = [ pkgs.zeitgeist ]; + + services.dbus.packages = [ pkgs.zeitgeist ]; + + systemd.packages = [ pkgs.zeitgeist ]; + }; +} |