-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216737 from FedericoSchonborn/budgie
Budgie Desktop
- Loading branch information
Showing
13 changed files
with
895 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
{ lib, pkgs, config, utils, ... }: | ||
|
||
let | ||
inherit (lib) concatMapStrings literalExpression mdDoc mkDefault mkEnableOption mkIf mkOption types; | ||
|
||
cfg = config.services.xserver.desktopManager.budgie; | ||
|
||
nixos-background-light = pkgs.nixos-artwork.wallpapers.nineish; | ||
nixos-background-dark = pkgs.nixos-artwork.wallpapers.nineish-dark-gray; | ||
|
||
nixos-gsettings-overrides = pkgs.budgie.budgie-gsettings-overrides.override { | ||
inherit (cfg) extraGSettingsOverrides extraGSettingsOverridePackages; | ||
inherit nixos-background-dark nixos-background-light; | ||
}; | ||
in { | ||
options = { | ||
services.xserver.desktopManager.budgie = { | ||
enable = mkEnableOption (mdDoc "Budgie desktop"); | ||
|
||
sessionPath = mkOption { | ||
description = mdDoc "Additional list of packages to be added to the session search path. Useful for GSettings-conditional autostart."; | ||
type = with types; listOf package; | ||
example = literalExpression "[ pkgs.budgie.budgie-desktop-view ]"; | ||
default = []; | ||
}; | ||
|
||
extraGSettingsOverrides = mkOption { | ||
description = mdDoc "Additional GSettings overrides."; | ||
type = types.lines; | ||
default = ""; | ||
}; | ||
|
||
extraGSettingsOverridePackages = mkOption { | ||
description = mdDoc "List of packages for which GSettings are overridden."; | ||
type = with types; listOf path; | ||
default = []; | ||
}; | ||
}; | ||
|
||
environment.budgie.excludePackages = mkOption { | ||
description = mdDoc "Which packages Budgie should exclude from the default environment."; | ||
type = with types; listOf package; | ||
default = []; | ||
example = literalExpression "[ pkgs.mate-terminal ]"; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
services.xserver.displayManager.sessionPackages = with pkgs; [ | ||
budgie.budgie-desktop | ||
]; | ||
|
||
services.xserver.displayManager.lightdm.greeters.slick = { | ||
enable = mkDefault true; | ||
theme = mkDefault { name = "Qogir"; package = pkgs.qogir-theme; }; | ||
iconTheme = mkDefault { name = "Qogir"; package = pkgs.qogir-icon-theme; }; | ||
cursorTheme = mkDefault { name = "Qogir"; package = pkgs.qogir-icon-theme; }; | ||
}; | ||
|
||
services.xserver.desktopManager.budgie.sessionPath = [ pkgs.budgie.budgie-desktop-view ]; | ||
|
||
environment.extraInit = '' | ||
${concatMapStrings (p: '' | ||
if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then | ||
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name} | ||
fi | ||
if [ -d "${p}/lib/girepository-1.0" ]; then | ||
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0 | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib | ||
fi | ||
'') cfg.sessionPath} | ||
''; | ||
|
||
environment.systemPackages = with pkgs; | ||
[ | ||
# Budgie Desktop. | ||
budgie.budgie-backgrounds | ||
budgie.budgie-control-center | ||
budgie.budgie-desktop | ||
budgie.budgie-desktop-view | ||
budgie.budgie-screensaver | ||
|
||
# Required by the Budgie Desktop session. | ||
(gnome.gnome-session.override {gnomeShellSupport = false;}) | ||
|
||
# Required by Budgie Menu. | ||
gnome-menus | ||
|
||
# Provides `gsettings`. | ||
glib | ||
|
||
# Update user directories. | ||
xdg-user-dirs | ||
] | ||
++ (utils.removePackagesByName [ | ||
cinnamon.nemo | ||
mate.eom | ||
mate.pluma | ||
mate.atril | ||
mate.engrampa | ||
mate.mate-calc | ||
mate.mate-terminal | ||
mate.mate-system-monitor | ||
vlc | ||
|
||
# Desktop themes. | ||
qogir-theme | ||
qogir-icon-theme | ||
|
||
# Default settings. | ||
nixos-gsettings-overrides | ||
] config.environment.budgie.excludePackages) | ||
++ cfg.sessionPath; | ||
|
||
# Fonts. | ||
fonts.fonts = mkDefault [ | ||
pkgs.noto-fonts | ||
pkgs.hack-font | ||
]; | ||
fonts.fontconfig.defaultFonts = { | ||
sansSerif = mkDefault ["Noto Sans"]; | ||
monospace = mkDefault ["Hack"]; | ||
}; | ||
|
||
# Qt application style. | ||
qt = { | ||
enable = mkDefault true; | ||
style = mkDefault "gtk2"; | ||
platformTheme = mkDefault "gtk2"; | ||
}; | ||
|
||
environment.pathsToLink = [ | ||
"/share" # TODO: https://github.com/NixOS/nixpkgs/issues/47173 | ||
]; | ||
|
||
# GSettings overrides. | ||
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas"; | ||
|
||
# Required by Budgie Desktop. | ||
services.xserver.updateDbusEnvironment = true; | ||
programs.dconf.enable = true; | ||
|
||
# Required by Budgie Screensaver. | ||
security.pam.services.budgie-screensaver = {}; | ||
|
||
# Required by Budgie's Polkit Dialog. | ||
security.polkit.enable = mkDefault true; | ||
|
||
# Required by Budgie Panel plugins and/or Budgie Control Center panels. | ||
networking.networkmanager.enable = mkDefault true; # for BCC's Network panel. | ||
programs.nm-applet.enable = config.networking.networkmanager.enable; # Budgie has no Network applet. | ||
programs.nm-applet.indicator = false; # Budgie doesn't support AppIndicators. | ||
|
||
hardware.bluetooth.enable = mkDefault true; # for Budgie's Status Indicator and BCC's Bluetooth panel. | ||
hardware.pulseaudio.enable = mkDefault true; # for Budgie's Status Indicator and BCC's Sound panel. | ||
|
||
xdg.portal.enable = mkDefault true; # for BCC's Applications panel. | ||
xdg.portal.extraPortals = with pkgs; [ | ||
xdg-desktop-portal-gtk # provides a XDG Portals implementation. | ||
]; | ||
|
||
services.geoclue2.enable = mkDefault true; # for BCC's Privacy > Location Services panel. | ||
services.upower.enable = config.powerManagement.enable; # for Budgie's Status Indicator and BCC's Power panel. | ||
services.xserver.libinput.enable = mkDefault true; # for BCC's Mouse panel. | ||
services.colord.enable = mkDefault true; # for BCC's Color panel. | ||
services.gnome.at-spi2-core.enable = mkDefault true; # for BCC's A11y panel. | ||
services.accounts-daemon.enable = mkDefault true; # for BCC's Users panel. | ||
services.fprintd.enable = mkDefault true; # for BCC's Users panel. | ||
services.udisks2.enable = mkDefault true; # for BCC's Details panel. | ||
|
||
# For BCC's Online Accounts panel. | ||
services.gnome.gnome-online-accounts.enable = mkDefault true; | ||
services.gnome.gnome-online-miners.enable = true; | ||
|
||
# For BCC's Printers panel. | ||
services.printing.enable = mkDefault true; | ||
services.system-config-printer.enable = config.services.printing.enable; | ||
|
||
# For BCC's Sharing panel. | ||
services.dleyna-renderer.enable = mkDefault true; | ||
services.dleyna-server.enable = mkDefault true; | ||
services.gnome.gnome-user-share.enable = mkDefault true; | ||
services.gnome.rygel.enable = mkDefault true; | ||
|
||
# Other default services. | ||
services.gnome.evolution-data-server.enable = mkDefault true; | ||
services.gnome.glib-networking.enable = mkDefault true; | ||
services.gnome.gnome-keyring.enable = mkDefault true; | ||
services.gnome.gnome-settings-daemon.enable = mkDefault true; | ||
services.gvfs.enable = mkDefault true; | ||
|
||
# Register packages for DBus. | ||
services.dbus.packages = with pkgs; [ | ||
budgie.budgie-control-center | ||
]; | ||
|
||
# Shell integration for MATE Terminal. | ||
programs.bash.vteIntegration = true; | ||
programs.zsh.vteIntegration = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import ./make-test-python.nix ({ pkgs, lib, ... }: { | ||
name = "budgie"; | ||
|
||
meta = with lib; { | ||
maintainers = [ maintainers.federicoschonborn ]; | ||
}; | ||
|
||
nodes.machine = { ... }: { | ||
imports = [ | ||
./common/user-account.nix | ||
]; | ||
|
||
services.xserver.enable = true; | ||
|
||
services.xserver.displayManager = { | ||
lightdm.enable = true; | ||
autoLogin = { | ||
enable = true; | ||
user = "alice"; | ||
}; | ||
}; | ||
|
||
services.xserver.desktopManager.budgie.enable = true; | ||
}; | ||
|
||
testScript = { nodes, ... }: | ||
let | ||
user = nodes.machine.users.users.alice; | ||
in | ||
'' | ||
with subtest("Wait for login"): | ||
machine.wait_for_x() | ||
machine.wait_for_file("${user.home}/.Xauthority") | ||
machine.succeed("xauth merge ${user.home}/.Xauthority") | ||
with subtest("Check that logging in has given the user ownership of devices"): | ||
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}") | ||
with subtest("Check if Budgie session components actually start"): | ||
machine.wait_until_succeeds("pgrep budgie-daemon") | ||
machine.wait_for_window("budgie-daemon") | ||
machine.wait_until_succeeds("pgrep budgie-panel") | ||
machine.wait_for_window("budgie-panel") | ||
with subtest("Open MATE terminal"): | ||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 mate-terminal >&2 &'") | ||
machine.wait_for_window("Terminal") | ||
machine.sleep(20) | ||
machine.screenshot("screen") | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ lib | ||
, stdenv | ||
, fetchFromGitHub | ||
, imagemagick | ||
, jhead | ||
, meson | ||
, ninja | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "budgie-backgrounds"; | ||
version = "0.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "BuddiesOfBudgie"; | ||
repo = "budgie-backgrounds"; | ||
rev = "v${version}"; | ||
hash = "sha256-pDFd+WvWOPgDoSffmX9mzjDQbhePsJV1wGqmPDcnOlw="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
imagemagick | ||
jhead | ||
meson | ||
ninja | ||
]; | ||
|
||
preConfigure = '' | ||
chmod +x ./scripts/optimizeImage.sh | ||
patchShebangs ./scripts/optimizeImage.sh | ||
''; | ||
|
||
meta = with lib; { | ||
description = "The default background set for the Budgie Desktop"; | ||
homepage = "https://github.com/BuddiesOfBudgie/budgie-backgrounds"; | ||
platforms = platforms.linux; | ||
maintainers = [ maintainers.federicoschonborn ]; | ||
license = licenses.cc0; | ||
}; | ||
} |
Oops, something went wrong.