Merge remote-tracking branch 'origin/staging-next' into staging

This commit is contained in:
K900
2025-01-01 10:07:33 +03:00
295 changed files with 2215 additions and 2057 deletions
-4
View File
@@ -35,10 +35,6 @@ jobs:
pairs:
- from: master
into: haskell-updates
- from: release-24.05
into: staging-next-24.05
- from: staging-next-24.05
into: staging-24.05
- from: release-24.11
into: staging-next-24.11
- from: staging-next-24.11
+3 -4
View File
@@ -94,10 +94,7 @@
stdenvNoCC.mkDerivation {
name = "nixpkgs-lib-docs";
src = lib.fileset.toSource {
root = ../..;
fileset = ../../lib;
};
src = ../../lib;
nativeBuildInputs = [
nixdoc
@@ -105,6 +102,8 @@ stdenvNoCC.mkDerivation {
];
installPhase = ''
cd ..
export NIX_STATE_DIR=$(mktemp -d)
nix-instantiate --eval --strict --json ${./lib-function-locations.nix} \
--arg nixpkgsPath "./." \
+16 -10
View File
@@ -25,16 +25,22 @@ stdenvNoCC.mkDerivation (
nativeBuildInputs = [ nixos-render-docs ];
src = lib.fileset.toSource {
root = ../.;
fileset = lib.fileset.unions [
(lib.fileset.fileFilter (file: file.hasExt "md" || file.hasExt "md.in") ../.)
../style.css
../anchor-use.js
../anchor.min.js
../manpage-urls.json
../redirects.json
];
src = lib.cleanSourceWith {
src = ../.;
filter =
path: type:
type == "directory"
|| lib.hasSuffix ".md" path
|| lib.hasSuffix ".md.in" path
|| lib.elem path (
map toString [
../style.css
../anchor-use.js
../anchor.min.js
../manpage-urls.json
../redirects.json
]
);
};
postPatch = ''
+1 -1
View File
@@ -416,7 +416,7 @@ in {
*/
oldestSupportedRelease =
# Update on master only. Do not backport.
2405;
2411;
/**
Whether a feature is supported in all supported releases (at the time of
+1 -11
View File
@@ -14,22 +14,12 @@
extraPythonPackages ? (_: [ ]),
nixosTests,
}:
let
fs = lib.fileset;
in
python3Packages.buildPythonApplication {
pname = "nixos-test-driver";
version = "1.1";
pyproject = true;
src = fs.toSource {
root = ./.;
fileset = fs.unions [
./pyproject.toml
./test_driver
./extract-docstrings.py
];
};
src = ./src;
build-system = with python3Packages; [
setuptools
@@ -11,6 +11,6 @@ in
runCommand "nixos-test-driver-docstrings" env ''
mkdir $out
python3 ${./extract-docstrings.py} ${./test_driver/machine.py} \
python3 ${./src/extract-docstrings.py} ${./src/test_driver/machine.py} \
> $out/machine-methods.md
''
@@ -515,12 +515,12 @@ in
''
set -eou pipefail
compression=$(sed -nr 's/compress_build_logs_compression = ()/\1/p' ${baseDir}/hydra.conf)
if [[ $compression == "" ]]; then
compression="bzip2"
if [[ $compression == "" || $compression == bzip2 ]]; then
compressionCmd=(bzip2)
elif [[ $compression == zstd ]]; then
compression="zstd --rm"
compressionCmd=(zstd --rm)
fi
find ${baseDir}/build-logs -type f -name "*.drv" -mtime +3 -size +0c -print0 | xargs -0 -r "$compression" --force --quiet
find ${baseDir}/build-logs -type f -name "*.drv" -mtime +3 -size +0c -print0 | xargs -0 -r "''${compressionCmd[@]}" --force --quiet
'';
startAt = "Sun 01:45";
serviceConfig.Slice = "system-hydra.slice";
+5 -2
View File
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.colord;
@@ -14,12 +17,12 @@ in
options = {
services.colord = {
enable = lib.mkEnableOption "colord, the color management daemon";
enable = mkEnableOption "colord, the color management daemon";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.colord ];
@@ -4,16 +4,19 @@
pkgs,
...
}:
with lib;
let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.cde;
in
{
options.services.xserver.desktopManager.cde = {
enable = lib.mkEnableOption "Common Desktop Environment";
enable = mkEnableOption "Common Desktop Environment";
extraPackages = lib.mkOption {
type = with lib.types; listOf package;
extraPackages = mkOption {
type = with types; listOf package;
default = with pkgs.xorg; [
xclock
bitmap
@@ -26,7 +29,7 @@ in
xwd
xwud
];
defaultText = lib.literalExpression ''
defaultText = literalExpression ''
with pkgs.xorg; [
xclock bitmap xlsfonts xfd xrefresh xload xwininfo xdpyinfo xwd xwud
]
@@ -37,7 +40,7 @@ in
};
};
config = lib.mkIf (xcfg.enable && cfg.enable) {
config = mkIf (xcfg.enable && cfg.enable) {
environment.systemPackages = cfg.extraPackages;
services.rpcbind.enable = true;
@@ -1,4 +1,7 @@
{ config, lib, pkgs, utils, ... }:
with lib;
let
cfg = config.services.xserver.desktopManager.cinnamon;
@@ -15,16 +18,16 @@ in
{
options = {
services.cinnamon = {
apps.enable = lib.mkEnableOption "Cinnamon default applications";
apps.enable = mkEnableOption "Cinnamon default applications";
};
services.xserver.desktopManager.cinnamon = {
enable = lib.mkEnableOption "the cinnamon desktop manager";
enable = mkEnableOption "the cinnamon desktop manager";
sessionPath = lib.mkOption {
sessionPath = mkOption {
default = [];
type = lib.types.listOf lib.types.package;
example = lib.literalExpression "[ pkgs.gpaste ]";
type = types.listOf types.package;
example = literalExpression "[ pkgs.gpaste ]";
description = ''
Additional list of packages to be added to the session search path.
Useful for GSettings-conditional autostart.
@@ -33,53 +36,53 @@ in
'';
};
extraGSettingsOverrides = lib.mkOption {
extraGSettingsOverrides = mkOption {
default = "";
type = lib.types.lines;
type = types.lines;
description = "Additional gsettings overrides.";
};
extraGSettingsOverridePackages = lib.mkOption {
extraGSettingsOverridePackages = mkOption {
default = [];
type = lib.types.listOf lib.types.path;
type = types.listOf types.path;
description = "List of packages for which gsettings are overridden.";
};
};
environment.cinnamon.excludePackages = lib.mkOption {
environment.cinnamon.excludePackages = mkOption {
default = [];
example = lib.literalExpression "[ pkgs.blueman ]";
type = lib.types.listOf lib.types.package;
example = literalExpression "[ pkgs.blueman ]";
type = types.listOf types.package;
description = "Which packages cinnamon should exclude from the default environment";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
config = mkMerge [
(mkIf cfg.enable {
services.displayManager.sessionPackages = [ pkgs.cinnamon-common ];
services.xserver.displayManager.lightdm.greeters.slick = {
enable = lib.mkDefault true;
enable = mkDefault true;
# Taken from mint-artwork.gschema.override
theme = lib.mkIf (notExcluded pkgs.mint-themes) {
name = lib.mkDefault "Mint-Y-Aqua";
package = lib.mkDefault pkgs.mint-themes;
theme = mkIf (notExcluded pkgs.mint-themes) {
name = mkDefault "Mint-Y-Aqua";
package = mkDefault pkgs.mint-themes;
};
iconTheme = lib.mkIf (notExcluded pkgs.mint-y-icons) {
name = lib.mkDefault "Mint-Y-Sand";
package = lib.mkDefault pkgs.mint-y-icons;
iconTheme = mkIf (notExcluded pkgs.mint-y-icons) {
name = mkDefault "Mint-Y-Sand";
package = mkDefault pkgs.mint-y-icons;
};
cursorTheme = lib.mkIf (notExcluded pkgs.mint-cursor-themes) {
name = lib.mkDefault "Bibata-Modern-Classic";
package = lib.mkDefault pkgs.mint-cursor-themes;
cursorTheme = mkIf (notExcluded pkgs.mint-cursor-themes) {
name = mkDefault "Bibata-Modern-Classic";
package = mkDefault pkgs.mint-cursor-themes;
};
};
# Have to take care of GDM + Cinnamon on Wayland users
environment.extraInit = ''
${lib.concatMapStrings (p: ''
${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
@@ -92,30 +95,30 @@ in
'';
# Default services
services.blueman.enable = lib.mkDefault (notExcluded pkgs.blueman);
hardware.bluetooth.enable = lib.mkDefault true;
services.blueman.enable = mkDefault (notExcluded pkgs.blueman);
hardware.bluetooth.enable = mkDefault true;
security.polkit.enable = true;
services.accounts-daemon.enable = true;
services.system-config-printer.enable = (lib.mkIf config.services.printing.enable (lib.mkDefault true));
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.dbus.packages = with pkgs; [
cinnamon-common
cinnamon-screensaver
nemo-with-extensions
xapp
];
services.cinnamon.apps.enable = lib.mkDefault true;
services.cinnamon.apps.enable = mkDefault true;
services.gnome.evolution-data-server.enable = true;
services.gnome.glib-networking.enable = true;
services.gnome.gnome-keyring.enable = true;
services.gvfs.enable = true;
services.power-profiles-daemon.enable = lib.mkDefault true;
services.switcherooControl.enable = lib.mkDefault true; # xapp-gpu-offload-helper
services.touchegg.enable = lib.mkDefault true;
services.power-profiles-daemon.enable = mkDefault true;
services.switcherooControl.enable = mkDefault true; # xapp-gpu-offload-helper
services.touchegg.enable = mkDefault true;
services.udisks2.enable = true;
services.upower.enable = lib.mkDefault config.powerManagement.enable;
services.libinput.enable = lib.mkDefault true;
services.upower.enable = mkDefault config.powerManagement.enable;
services.libinput.enable = mkDefault true;
services.xserver.updateDbusEnvironment = true;
networking.networkmanager.enable = lib.mkDefault true;
networking.networkmanager.enable = mkDefault true;
# Enable colord server
services.colord.enable = true;
@@ -201,9 +204,9 @@ in
pkgs.xdg-desktop-portal-gtk
];
services.orca.enable = lib.mkDefault (notExcluded pkgs.orca);
services.orca.enable = mkDefault (notExcluded pkgs.orca);
xdg.portal.configPackages = lib.mkDefault [ pkgs.cinnamon-common ];
xdg.portal.configPackages = mkDefault [ pkgs.cinnamon-common ];
# Override GSettings schemas
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
@@ -214,8 +217,8 @@ in
];
# Shell integration for VTE terminals
programs.bash.vteIntegration = lib.mkDefault true;
programs.zsh.vteIntegration = lib.mkDefault true;
programs.bash.vteIntegration = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Default Fonts
fonts.packages = with pkgs; [
@@ -224,10 +227,10 @@ in
];
})
(lib.mkIf serviceCfg.apps.enable {
programs.gnome-disks.enable = lib.mkDefault (notExcluded pkgs.gnome-disk-utility);
programs.gnome-terminal.enable = lib.mkDefault (notExcluded pkgs.gnome-terminal);
programs.file-roller.enable = lib.mkDefault (notExcluded pkgs.file-roller);
(mkIf serviceCfg.apps.enable {
programs.gnome-disks.enable = mkDefault (notExcluded pkgs.gnome-disk-utility);
programs.gnome-terminal.enable = mkDefault (notExcluded pkgs.gnome-terminal);
programs.file-roller.enable = mkDefault (notExcluded pkgs.file-roller);
environment.systemPackages = with pkgs; utils.removePackagesByName [
# cinnamon team apps
@@ -5,6 +5,9 @@
utils,
...
}:
with lib;
let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.deepin;
@@ -18,68 +21,68 @@ in
options = {
services.xserver.desktopManager.deepin = {
enable = lib.mkEnableOption "Deepin desktop manager";
extraGSettingsOverrides = lib.mkOption {
enable = mkEnableOption "Deepin desktop manager";
extraGSettingsOverrides = mkOption {
default = "";
type = lib.types.lines;
type = types.lines;
description = "Additional gsettings overrides.";
};
extraGSettingsOverridePackages = lib.mkOption {
extraGSettingsOverridePackages = mkOption {
default = [ ];
type = lib.types.listOf lib.types.path;
type = types.listOf types.path;
description = "List of packages for which gsettings are overridden.";
};
};
environment.deepin.excludePackages = lib.mkOption {
environment.deepin.excludePackages = mkOption {
default = [ ];
type = lib.types.listOf lib.types.package;
type = types.listOf types.package;
description = "List of default packages to exclude from the configuration";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.displayManager.sessionPackages = [ pkgs.deepin.dde-session ];
services.displayManager.defaultSession = lib.mkDefault "dde-x11";
services.displayManager.defaultSession = mkDefault "dde-x11";
# Update the DBus activation environment after launching the desktop manager.
services.xserver.displayManager.sessionCommands = ''
${lib.getBin pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all
'';
hardware.bluetooth.enable = lib.mkDefault true;
hardware.bluetooth.enable = mkDefault true;
security.polkit.enable = true;
services.deepin.dde-daemon.enable = lib.mkForce true;
services.deepin.dde-api.enable = lib.mkForce true;
services.deepin.app-services.enable = lib.mkForce true;
services.deepin.dde-daemon.enable = mkForce true;
services.deepin.dde-api.enable = mkForce true;
services.deepin.app-services.enable = mkForce true;
services.colord.enable = lib.mkDefault true;
services.accounts-daemon.enable = lib.mkDefault true;
services.gvfs.enable = lib.mkDefault true;
services.gnome.glib-networking.enable = lib.mkDefault true;
services.gnome.gnome-keyring.enable = lib.mkDefault true;
services.bamf.enable = lib.mkDefault true;
services.colord.enable = mkDefault true;
services.accounts-daemon.enable = mkDefault true;
services.gvfs.enable = mkDefault true;
services.gnome.glib-networking.enable = mkDefault true;
services.gnome.gnome-keyring.enable = mkDefault true;
services.bamf.enable = mkDefault true;
services.libinput.enable = lib.mkDefault true;
services.libinput.enable = mkDefault true;
services.udisks2.enable = true;
services.upower.enable = lib.mkDefault config.powerManagement.enable;
networking.networkmanager.enable = lib.mkDefault true;
programs.dconf.enable = lib.mkDefault true;
programs.gnupg.agent.pinentryPackage = lib.mkDefault pkgs.pinentry-qt;
services.upower.enable = mkDefault config.powerManagement.enable;
networking.networkmanager.enable = mkDefault true;
programs.dconf.enable = mkDefault true;
programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-qt;
fonts.packages = with pkgs; [ noto-fonts ];
xdg.mime.enable = true;
xdg.menus.enable = true;
xdg.icons.enable = true;
xdg.portal.enable = lib.mkDefault true;
xdg.portal.extraPortals = lib.mkDefault [
xdg.portal.enable = mkDefault true;
xdg.portal.extraPortals = mkDefault [
pkgs.xdg-desktop-portal-gtk
];
# https://github.com/NixOS/nixpkgs/pull/247766#issuecomment-1722839259
xdg.portal.config.deepin.default = lib.mkDefault [ "gtk" ];
xdg.portal.config.deepin.default = mkDefault [ "gtk" ];
environment.sessionVariables = {
NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
@@ -4,6 +4,9 @@
lib,
...
}:
with lib;
let
e = pkgs.enlightenment;
@@ -20,11 +23,11 @@ in
{
meta = {
maintainers = lib.teams.enlightenment.members;
maintainers = teams.enlightenment.members;
};
imports = [
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "e19" "enable" ]
[ "services" "xserver" "desktopManager" "enlightenment" "enable" ]
)
@@ -32,15 +35,15 @@ in
options = {
services.xserver.desktopManager.enlightenment.enable = lib.mkOption {
type = lib.types.bool;
services.xserver.desktopManager.enlightenment.enable = mkOption {
type = types.bool;
default = false;
description = "Enable the Enlightenment desktop environment.";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
enlightenment.econnman
@@ -102,7 +105,7 @@ in
services.udisks2.enable = true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = lib.mkDefault true;
services.libinput.enable = mkDefault true;
services.dbus.packages = [ e.efl ];
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.kodi;
in
@@ -11,19 +14,19 @@ in
{
options = {
services.xserver.desktopManager.kodi = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the kodi multimedia center.";
};
package = lib.mkPackageOption pkgs "kodi" {
package = mkPackageOption pkgs "kodi" {
example = "kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])";
};
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.desktopManager.session = [
{
name = "kodi";
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
xcfg = config.services.xserver;
@@ -13,20 +16,20 @@ in
{
meta = {
maintainers = lib.teams.lumina.members;
maintainers = teams.lumina.members;
};
options = {
services.xserver.desktopManager.lumina.enable = lib.mkOption {
type = lib.types.bool;
services.xserver.desktopManager.lumina.enable = mkOption {
type = types.bool;
default = false;
description = "Enable the Lumina desktop manager";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.displayManager.sessionPackages = [
pkgs.lumina.lumina
@@ -1,4 +1,7 @@
{ config, lib, pkgs, utils, ... }:
with lib;
let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.lxqt;
@@ -7,29 +10,29 @@ in
{
meta = {
maintainers = lib.teams.lxqt.members;
maintainers = teams.lxqt.members;
};
options = {
services.xserver.desktopManager.lxqt.enable = lib.mkOption {
type = lib.types.bool;
services.xserver.desktopManager.lxqt.enable = mkOption {
type = types.bool;
default = false;
description = "Enable the LXQt desktop manager";
};
environment.lxqt.excludePackages = lib.mkOption {
environment.lxqt.excludePackages = mkOption {
default = [];
example = lib.literalExpression "[ pkgs.lxqt.qterminal ]";
type = lib.types.listOf lib.types.package;
example = literalExpression "[ pkgs.lxqt.qterminal ]";
type = types.listOf types.package;
description = "Which LXQt packages to exclude from the default environment";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.desktopManager.session = lib.singleton {
services.xserver.desktopManager.session = singleton {
name = "lxqt";
bgSupport = true;
start = ''
@@ -59,19 +62,19 @@ in
# Link some extra directories in /run/current-system/software/share
environment.pathsToLink = [ "/share" ];
programs.gnupg.agent.pinentryPackage = lib.mkDefault pkgs.pinentry-qt;
programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-qt;
# virtual file systems support for PCManFM-QT
services.gvfs.enable = true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = lib.mkDefault true;
services.libinput.enable = mkDefault true;
xdg.portal.lxqt.enable = lib.mkDefault true;
xdg.portal.lxqt.enable = mkDefault true;
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050804
xdg.portal.config.lxqt.default = lib.mkDefault [ "lxqt" "gtk" ];
xdg.portal.config.lxqt.default = mkDefault [ "lxqt" "gtk" ];
};
}
@@ -5,6 +5,9 @@
utils,
...
}:
with lib;
let
xcfg = config.services.xserver;
@@ -16,48 +19,48 @@ in
options = {
services.xserver.desktopManager.mate = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the MATE desktop environment";
};
debug = lib.mkEnableOption "mate-session debug messages";
debug = mkEnableOption "mate-session debug messages";
extraPanelApplets = lib.mkOption {
extraPanelApplets = mkOption {
default = [ ];
example = lib.literalExpression "with pkgs.mate; [ mate-applets ]";
type = lib.types.listOf lib.types.package;
example = literalExpression "with pkgs.mate; [ mate-applets ]";
type = types.listOf types.package;
description = "Extra applets to add to mate-panel.";
};
extraCajaExtensions = lib.mkOption {
extraCajaExtensions = mkOption {
default = [ ];
example = lib.literalExpression "with pkgs.mate; [ caja-extensions ]";
type = lib.types.listOf lib.types.package;
type = types.listOf types.package;
description = "Extra extensions to add to caja.";
};
enableWaylandSession = lib.mkEnableOption "MATE Wayland session";
enableWaylandSession = mkEnableOption "MATE Wayland session";
};
environment.mate.excludePackages = lib.mkOption {
environment.mate.excludePackages = mkOption {
default = [ ];
example = lib.literalExpression "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]";
type = lib.types.listOf lib.types.package;
example = literalExpression "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]";
type = types.listOf types.package;
description = "Which MATE packages to exclude from the default environment";
};
};
config = lib.mkMerge [
(lib.mkIf (cfg.enable || cfg.enableWaylandSession) {
config = mkMerge [
(mkIf (cfg.enable || cfg.enableWaylandSession) {
services.displayManager.sessionPackages = [
pkgs.mate.mate-session-manager
];
# Debugging
environment.sessionVariables.MATE_SESSION_DEBUG = lib.mkIf cfg.debug "1";
environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";
environment.systemPackages = utils.removePackagesByName (
pkgs.mate.basePackages
@@ -80,13 +83,11 @@ in
programs.dconf.enable = true;
# Shell integration for VTE terminals
programs.bash.vteIntegration = lib.mkDefault true;
programs.zsh.vteIntegration = lib.mkDefault true;
programs.bash.vteIntegration = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Mate uses this for printing
programs.system-config-printer.enable = (
lib.mkIf config.services.printing.enable (lib.mkDefault true)
);
programs.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.gnome.at-spi2-core.enable = true;
services.gnome.glib-networking.enable = true;
@@ -94,15 +95,15 @@ in
services.udev.packages = [ pkgs.mate.mate-settings-daemon ];
services.gvfs.enable = true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = lib.mkDefault true;
services.libinput.enable = mkDefault true;
security.pam.services.mate-screensaver.unixAuth = true;
xdg.portal.configPackages = lib.mkDefault [ pkgs.mate.mate-desktop ];
xdg.portal.configPackages = mkDefault [ pkgs.mate.mate-desktop ];
environment.pathsToLink = [ "/share" ];
})
(lib.mkIf cfg.enableWaylandSession {
(mkIf cfg.enableWaylandSession {
programs.wayfire.enable = true;
programs.wayfire.plugins = [ pkgs.wayfirePlugins.firedecor ];
@@ -4,13 +4,14 @@
pkgs,
...
}:
with lib;
let
runXdgAutostart = config.services.xserver.desktopManager.runXdgAutostartIfNone;
in
{
options = {
services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkOption {
type = lib.types.bool;
services.xserver.desktopManager.runXdgAutostartIfNone = mkOption {
type = types.bool;
default = false;
description = ''
Whether to run XDG autostart files for sessions without a desktop manager
@@ -26,18 +27,18 @@ in
};
};
config = lib.mkMerge [
config = mkMerge [
{
services.xserver.desktopManager.session = [
{
name = "none";
start = lib.optionalString runXdgAutostart ''
start = optionalString runXdgAutostart ''
/run/current-system/systemd/bin/systemctl --user start xdg-autostart-if-no-desktop-manager.target
'';
}
];
}
(lib.mkIf runXdgAutostart {
(mkIf runXdgAutostart {
systemd.user.targets.xdg-autostart-if-no-desktop-manager = {
description = "Run XDG autostart files";
# From `plasma-workspace`, `share/systemd/user/plasma-workspace@.target`.
@@ -1,4 +1,7 @@
{ config, lib, utils, pkgs, ... }:
with lib;
let
cfg = config.services.xserver.desktopManager.pantheon;
@@ -16,7 +19,7 @@ in
meta = {
doc = ./pantheon.md;
maintainers = lib.teams.pantheon.members;
maintainers = teams.pantheon.members;
};
options = {
@@ -24,24 +27,24 @@ in
services.pantheon = {
contractor = {
enable = lib.mkEnableOption "contractor, a desktop-wide extension service used by Pantheon";
enable = mkEnableOption "contractor, a desktop-wide extension service used by Pantheon";
};
apps.enable = lib.mkEnableOption "Pantheon default applications";
apps.enable = mkEnableOption "Pantheon default applications";
};
services.xserver.desktopManager.pantheon = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the pantheon desktop manager";
};
sessionPath = lib.mkOption {
sessionPath = mkOption {
default = [];
type = lib.types.listOf lib.types.package;
example = lib.literalExpression "[ pkgs.gpaste ]";
type = types.listOf types.package;
example = literalExpression "[ pkgs.gpaste ]";
description = ''
Additional list of packages to be added to the session search path.
Useful for GSettings-conditional autostart.
@@ -50,46 +53,46 @@ in
'';
};
extraWingpanelIndicators = lib.mkOption {
extraWingpanelIndicators = mkOption {
default = null;
type = with lib.types; nullOr (listOf package);
type = with types; nullOr (listOf package);
description = "Indicators to add to Wingpanel.";
};
extraSwitchboardPlugs = lib.mkOption {
extraSwitchboardPlugs = mkOption {
default = null;
type = with lib.types; nullOr (listOf package);
type = with types; nullOr (listOf package);
description = "Plugs to add to Switchboard.";
};
extraGSettingsOverrides = lib.mkOption {
extraGSettingsOverrides = mkOption {
default = "";
type = lib.types.lines;
type = types.lines;
description = "Additional gsettings overrides.";
};
extraGSettingsOverridePackages = lib.mkOption {
extraGSettingsOverridePackages = mkOption {
default = [];
type = lib.types.listOf lib.types.path;
type = types.listOf types.path;
description = "List of packages for which gsettings are overridden.";
};
debug = lib.mkEnableOption "gnome-session debug messages";
debug = mkEnableOption "gnome-session debug messages";
};
environment.pantheon.excludePackages = lib.mkOption {
environment.pantheon.excludePackages = mkOption {
default = [];
example = lib.literalExpression "[ pkgs.pantheon.elementary-camera ]";
type = lib.types.listOf lib.types.package;
example = literalExpression "[ pkgs.pantheon.elementary-camera ]";
type = types.listOf types.package;
description = "Which packages pantheon should exclude from the default environment";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
config = mkMerge [
(mkIf cfg.enable {
services.xserver.desktopManager.pantheon.sessionPath = utils.removePackagesByName [
pkgs.pantheon.pantheon-agent-geoclue2
] config.environment.pantheon.excludePackages;
@@ -98,21 +101,21 @@ in
# Ensure lightdm is used when Pantheon is enabled
# Without it screen locking will be nonfunctional because of the use of lightlocker
warnings = lib.optional (config.services.xserver.displayManager.lightdm.enable != true)
warnings = optional (config.services.xserver.displayManager.lightdm.enable != true)
''
Using Pantheon without LightDM as a displayManager will break screenlocking from the UI.
'';
services.xserver.displayManager.lightdm.greeters.pantheon.enable = lib.mkDefault true;
services.xserver.displayManager.lightdm.greeters.pantheon.enable = mkDefault true;
# Without this, elementary LightDM greeter will pre-select non-existent `default` session
# https://github.com/elementary/greeter/issues/368
services.displayManager.defaultSession = lib.mkDefault "pantheon";
services.displayManager.defaultSession = mkDefault "pantheon";
services.xserver.displayManager.sessionCommands = ''
if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then
true
${lib.concatMapStrings (p: ''
${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
@@ -126,38 +129,38 @@ in
'';
# Default services
hardware.bluetooth.enable = lib.mkDefault true;
hardware.bluetooth.enable = mkDefault true;
security.polkit.enable = true;
services.accounts-daemon.enable = true;
services.bamf.enable = true;
services.colord.enable = lib.mkDefault true;
services.fwupd.enable = lib.mkDefault true;
services.colord.enable = mkDefault true;
services.fwupd.enable = mkDefault true;
# TODO: Enable once #177946 is resolved
# services.packagekit.enable = mkDefault true;
services.power-profiles-daemon.enable = lib.mkDefault true;
services.touchegg.enable = lib.mkDefault true;
services.power-profiles-daemon.enable = mkDefault true;
services.touchegg.enable = mkDefault true;
services.touchegg.package = pkgs.pantheon.touchegg;
services.tumbler.enable = lib.mkDefault true;
services.system-config-printer.enable = (lib.mkIf config.services.printing.enable (lib.mkDefault true));
services.tumbler.enable = mkDefault true;
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.dbus.packages = with pkgs.pantheon; [
switchboard-plug-power
elementary-default-settings # accountsservice extensions
];
services.pantheon.apps.enable = lib.mkDefault true;
services.pantheon.contractor.enable = lib.mkDefault true;
services.pantheon.apps.enable = mkDefault true;
services.pantheon.contractor.enable = mkDefault true;
services.gnome.at-spi2-core.enable = true;
services.gnome.evolution-data-server.enable = true;
services.gnome.glib-networking.enable = true;
services.gnome.gnome-keyring.enable = true;
services.gvfs.enable = true;
services.gnome.rygel.enable = lib.mkDefault true;
services.gnome.rygel.enable = mkDefault true;
services.udisks2.enable = true;
services.upower.enable = config.powerManagement.enable;
services.libinput.enable = lib.mkDefault true;
services.switcherooControl.enable = lib.mkDefault true;
services.libinput.enable = mkDefault true;
services.switcherooControl.enable = mkDefault true;
services.xserver.updateDbusEnvironment = true;
services.zeitgeist.enable = lib.mkDefault true;
services.geoclue2.enable = lib.mkDefault true;
services.zeitgeist.enable = mkDefault true;
services.geoclue2.enable = mkDefault true;
# pantheon has pantheon-agent-geoclue2
services.geoclue2.enableDemoAgent = false;
services.geoclue2.appConfig."io.elementary.desktop.agent-geoclue2" = {
@@ -170,7 +173,7 @@ in
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
pkgs.pantheon.mutter
];
services.orca.enable = lib.mkDefault (notExcluded pkgs.orca);
services.orca.enable = mkDefault (notExcluded pkgs.orca);
systemd.packages = with pkgs; [
gnome-session
pantheon.gala
@@ -178,7 +181,7 @@ in
pantheon.elementary-session-settings
];
programs.dconf.enable = true;
networking.networkmanager.enable = lib.mkDefault true;
networking.networkmanager.enable = mkDefault true;
systemd.user.targets."gnome-session-x11-services".wants = [
"org.gnome.SettingsDaemon.XSettings.service"
@@ -243,12 +246,12 @@ in
xdg-desktop-portal-pantheon
]);
xdg.portal.configPackages = lib.mkDefault [ pkgs.pantheon.elementary-default-settings ];
xdg.portal.configPackages = mkDefault [ pkgs.pantheon.elementary-default-settings ];
# Override GSettings schemas
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
environment.sessionVariables.GNOME_SESSION_DEBUG = lib.mkIf cfg.debug "1";
environment.sessionVariables.GNOME_SESSION_DEBUG = mkIf cfg.debug "1";
environment.pathsToLink = [
# FIXME: modules should link subdirs of `/share` rather than relying on this
@@ -262,8 +265,8 @@ in
programs.nm-applet.indicator = false;
# Shell integration for VTE terminals
programs.bash.vteIntegration = lib.mkDefault true;
programs.zsh.vteIntegration = lib.mkDefault true;
programs.bash.vteIntegration = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Default Fonts
fonts.packages = with pkgs; [
@@ -279,9 +282,9 @@ in
};
})
(lib.mkIf serviceCfg.apps.enable {
programs.evince.enable = lib.mkDefault (notExcluded pkgs.evince);
programs.file-roller.enable = lib.mkDefault (notExcluded pkgs.file-roller);
(mkIf serviceCfg.apps.enable {
programs.evince.enable = mkDefault (notExcluded pkgs.evince);
programs.file-roller.enable = mkDefault (notExcluded pkgs.file-roller);
environment.systemPackages = utils.removePackagesByName ([
pkgs.gnome-font-viewer
@@ -312,7 +315,7 @@ in
];
})
(lib.mkIf serviceCfg.contractor.enable {
(mkIf serviceCfg.contractor.enable {
environment.systemPackages = with pkgs.pantheon; [
contractor
file-roller-contract
@@ -4,20 +4,23 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.retroarch;
in
{
options.services.xserver.desktopManager.retroarch = {
enable = lib.mkEnableOption "RetroArch";
enable = mkEnableOption "RetroArch";
package = lib.mkPackageOption pkgs "retroarch" {
package = mkPackageOption pkgs "retroarch" {
example = "retroarch-full";
};
extraArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
extraArgs = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"--verbose"
@@ -27,12 +30,12 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.desktopManager.session = [
{
name = "RetroArch";
start = ''
${cfg.package}/bin/retroarch -f ${lib.escapeShellArgs cfg.extraArgs} &
${cfg.package}/bin/retroarch -f ${escapeShellArgs cfg.extraArgs} &
waitPID=$!
'';
}
@@ -41,5 +44,5 @@ in
environment.systemPackages = [ cfg.package ];
};
meta.maintainers = with lib.maintainers; [ j0hax ];
meta.maintainers = with maintainers; [ j0hax ];
}
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.surf-display;
@@ -48,18 +51,18 @@ in
{
options = {
services.xserver.desktopManager.surf-display = {
enable = lib.mkEnableOption "surf-display as a kiosk browser session";
enable = mkEnableOption "surf-display as a kiosk browser session";
defaultWwwUri = lib.mkOption {
type = lib.types.str;
defaultWwwUri = mkOption {
type = types.str;
default = "${pkgs.surf-display}/share/surf-display/empty-page.html";
defaultText = lib.literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"'';
defaultText = literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"'';
example = "https://www.example.com/";
description = "Default URI to display.";
};
inactivityInterval = lib.mkOption {
type = lib.types.int;
inactivityInterval = mkOption {
type = types.int;
default = 300;
example = 0;
description = ''
@@ -72,16 +75,16 @@ in
'';
};
screensaverSettings = lib.mkOption {
type = lib.types.separatedString " ";
screensaverSettings = mkOption {
type = types.separatedString " ";
default = "";
description = ''
Screensaver settings, see `man 1 xset` for possible options.
'';
};
pointerButtonMap = lib.mkOption {
type = lib.types.str;
pointerButtonMap = mkOption {
type = types.str;
default = "1 0 0 4 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0";
description = ''
Disable right and middle pointer device click in browser sessions
@@ -90,15 +93,15 @@ in
'';
};
hideIdlePointer = lib.mkOption {
type = lib.types.str;
hideIdlePointer = mkOption {
type = types.str;
default = "yes";
example = "no";
description = "Hide idle mouse pointer.";
};
extraConfig = lib.mkOption {
type = lib.types.lines;
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
# Enforce fixed resolution for all displays (default: not set):
@@ -121,7 +124,7 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.displayManager.sessionPackages = [
pkgs.surf-display
];
@@ -1,4 +1,7 @@
{ config, lib, pkgs, utils, ... }:
with lib;
let
cfg = config.services.xserver.desktopManager.xfce;
excludePackages = config.environment.xfce.excludePackages;
@@ -6,70 +9,70 @@ let
in
{
meta = {
maintainers = lib.teams.xfce.members;
maintainers = teams.xfce.members;
};
imports = [
# added 2019-08-18
# needed to preserve some semblance of UI familarity
# with original XFCE module
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce4-14" "extraSessionCommands" ]
[ "services" "xserver" "displayManager" "sessionCommands" ])
# added 2019-11-04
# xfce4-14 module removed and promoted to xfce.
# Needed for configs that used xfce4-14 module to migrate to this one.
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce4-14" "enable" ]
[ "services" "xserver" "desktopManager" "xfce" "enable" ])
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce4-14" "noDesktop" ]
[ "services" "xserver" "desktopManager" "xfce" "noDesktop" ])
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce4-14" "enableXfwm" ]
[ "services" "xserver" "desktopManager" "xfce" "enableXfwm" ])
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce" "extraSessionCommands" ]
[ "services" "xserver" "displayManager" "sessionCommands" ])
(lib.mkRemovedOptionModule [ "services" "xserver" "desktopManager" "xfce" "screenLock" ] "")
(mkRemovedOptionModule [ "services" "xserver" "desktopManager" "xfce" "screenLock" ] "")
# added 2022-06-26
# thunar has its own module
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "desktopManager" "xfce" "thunarPlugins" ]
[ "programs" "thunar" "plugins" ])
];
options = {
services.xserver.desktopManager.xfce = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = "Enable the Xfce desktop environment.";
};
noDesktop = lib.mkOption {
type = lib.types.bool;
noDesktop = mkOption {
type = types.bool;
default = false;
description = "Don't install XFCE desktop components (xfdesktop and panel).";
};
enableXfwm = lib.mkOption {
type = lib.types.bool;
enableXfwm = mkOption {
type = types.bool;
default = true;
description = "Enable the XFWM (default) window manager.";
};
enableScreensaver = lib.mkOption {
type = lib.types.bool;
enableScreensaver = mkOption {
type = types.bool;
default = true;
description = "Enable the XFCE screensaver.";
};
enableWaylandSession = lib.mkEnableOption "the experimental Xfce Wayland session";
enableWaylandSession = mkEnableOption "the experimental Xfce Wayland session";
waylandSessionCompositor = lib.mkOption {
waylandSessionCompositor = mkOption {
type = lib.types.str;
default = "";
example = "wayfire";
@@ -84,15 +87,15 @@ in
};
};
environment.xfce.excludePackages = lib.mkOption {
environment.xfce.excludePackages = mkOption {
default = [];
example = lib.literalExpression "[ pkgs.xfce.xfce4-volumed-pulse ]";
type = lib.types.listOf lib.types.package;
example = literalExpression "[ pkgs.xfce.xfce4-volumed-pulse ]";
type = types.listOf types.package;
description = "Which packages XFCE should exclude from the default environment";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
environment.systemPackages = utils.removePackagesByName (with pkgs; [
glib # for gsettings
gtk3.out # gtk-update-icon-cache
@@ -127,27 +130,27 @@ in
xfce.xfce4-taskmanager
xfce.xfce4-terminal
] # TODO: NetworkManager doesn't belong here
++ optional config.networking.networkmanager.enable networkmanagerapplet
++ optional config.powerManagement.enable xfce.xfce4-power-manager
++ optionals (config.services.pulseaudio.enable || config.services.pipewire.pulse.enable) [
++ lib.optional config.networking.networkmanager.enable networkmanagerapplet
++ lib.optional config.powerManagement.enable xfce.xfce4-power-manager
++ lib.optionals (config.services.pulseaudio.enable || config.services.pipewire.pulse.enable) [
pavucontrol
# volume up/down keys support:
# xfce4-pulseaudio-plugin includes all the functionalities of xfce4-volumed-pulse
# but can only be used with xfce4-panel, so for no-desktop usage we still include
# xfce4-volumed-pulse
(if cfg.noDesktop then xfce.xfce4-volumed-pulse else xfce.xfce4-pulseaudio-plugin)
] ++ optionals cfg.enableXfwm [
] ++ lib.optionals cfg.enableXfwm [
xfce.xfwm4
xfce.xfwm4-themes
] ++ optionals (!cfg.noDesktop) [
] ++ lib.optionals (!cfg.noDesktop) [
xfce.xfce4-panel
xfce.xfdesktop
] ++ optional cfg.enableScreensaver xfce.xfce4-screensaver) excludePackages;
] ++ lib.optional cfg.enableScreensaver xfce.xfce4-screensaver) excludePackages;
programs.gnupg.agent.pinentryPackage = lib.mkDefault pkgs.pinentry-gtk2;
programs.gnupg.agent.pinentryPackage = mkDefault pkgs.pinentry-gtk2;
programs.xfconf.enable = true;
programs.thunar.enable = true;
programs.labwc.enable = lib.mkDefault (cfg.enableWaylandSession && (
programs.labwc.enable = mkDefault (cfg.enableWaylandSession && (
cfg.waylandSessionCompositor == "" || lib.substring 0 5 cfg.waylandSessionCompositor == "labwc"));
environment.pathsToLink = [
@@ -170,7 +173,7 @@ in
# Copied from https://gitlab.xfce.org/xfce/xfce4-session/-/blob/xfce4-session-4.19.2/xfce-wayland.desktop.in
# to maintain consistent l10n state with X11 session file and to support the waylandSessionCompositor option.
services.displayManager.sessionPackages = lib.optionals cfg.enableWaylandSession [
services.displayManager.sessionPackages = optionals cfg.enableWaylandSession [
((pkgs.writeTextDir "share/wayland-sessions/xfce-wayland.desktop" ''
[Desktop Entry]
Version=1.0
@@ -195,16 +198,16 @@ in
services.gnome.glib-networking.enable = true;
services.gvfs.enable = true;
services.tumbler.enable = true;
services.system-config-printer.enable = (lib.mkIf config.services.printing.enable (lib.mkDefault true));
services.libinput.enable = lib.mkDefault true; # used in xfce4-settings-manager
services.colord.enable = lib.mkDefault true;
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.libinput.enable = mkDefault true; # used in xfce4-settings-manager
services.colord.enable = mkDefault true;
# Enable default programs
programs.dconf.enable = true;
# Shell integration for VTE terminals
programs.bash.vteIntegration = lib.mkDefault true;
programs.zsh.vteIntegration = lib.mkDefault true;
programs.bash.vteIntegration = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Systemd services
systemd.packages = utils.removePackagesByName (with pkgs.xfce; [
@@ -213,6 +216,6 @@ in
security.pam.services.xfce4-screensaver.unixAuth = cfg.enableScreensaver;
xdg.portal.configPackages = lib.mkDefault [ pkgs.xfce.xfce4-session ];
xdg.portal.configPackages = mkDefault [ pkgs.xfce.xfce4-session ];
};
}
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.desktopManager.xterm;
@@ -14,18 +17,18 @@ in
{
options = {
services.xserver.desktopManager.xterm.enable = lib.mkOption {
type = lib.types.bool;
default = lib.versionOlder config.system.stateVersion "19.09" && xSessionEnabled;
defaultText = lib.literalExpression ''versionOlder config.system.stateVersion "19.09" && config.services.xserver.enable;'';
services.xserver.desktopManager.xterm.enable = mkOption {
type = types.bool;
default = versionOlder config.system.stateVersion "19.09" && xSessionEnabled;
defaultText = literalExpression ''versionOlder config.system.stateVersion "19.09" && config.services.xserver.enable;'';
description = "Enable a xterm terminal as a desktop manager.";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.desktopManager.session = lib.singleton {
services.xserver.desktopManager.session = singleton {
name = "xterm";
start = ''
${pkgs.xterm}/bin/xterm -ls &
@@ -4,6 +4,8 @@
pkgs,
...
}:
with lib;
let
dmcfg = config.services.xserver.displayManager;
ldmcfg = dmcfg.lightdm;
@@ -27,8 +29,8 @@ in
{
options = {
services.xserver.displayManager.lightdm.greeters.enso = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable enso-os-greeter as the lightdm greeter
@@ -36,17 +38,17 @@ in
};
theme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.gnome-themes-extra;
defaultText = lib.literalExpression "pkgs.gnome-themes-extra";
defaultText = literalExpression "pkgs.gnome-themes-extra";
description = ''
The package path that contains the theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Adwaita";
description = ''
Name of the theme to use for the lightdm-enso-os-greeter
@@ -55,17 +57,17 @@ in
};
iconTheme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.papirus-icon-theme;
defaultText = lib.literalExpression "pkgs.papirus-icon-theme";
defaultText = literalExpression "pkgs.papirus-icon-theme";
description = ''
The package path that contains the icon theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "ePapirus";
description = ''
Name of the icon theme to use for the lightdm-enso-os-greeter
@@ -74,17 +76,17 @@ in
};
cursorTheme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.capitaine-cursors;
defaultText = lib.literalExpression "pkgs.capitaine-cursors";
defaultText = literalExpression "pkgs.capitaine-cursors";
description = ''
The package path that contains the cursor theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "capitane-cursors";
description = ''
Name of the cursor theme to use for the lightdm-enso-os-greeter
@@ -92,24 +94,24 @@ in
};
};
blur = lib.mkOption {
type = lib.types.bool;
blur = mkOption {
type = types.bool;
default = false;
description = ''
Whether or not to enable blur
'';
};
brightness = lib.mkOption {
type = lib.types.int;
brightness = mkOption {
type = types.int;
default = 7;
description = ''
Brightness
'';
};
extraConfig = lib.mkOption {
type = lib.types.lines;
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the greeter.conf
@@ -119,7 +121,7 @@ in
};
};
config = lib.mkIf (ldmcfg.enable && cfg.enable) {
config = mkIf (ldmcfg.enable && cfg.enable) {
environment.etc."lightdm/greeter.conf".source = ensoGreeterConf;
environment.systemPackages = [
@@ -129,14 +131,14 @@ in
];
services.xserver.displayManager.lightdm = {
greeter = lib.mkDefault {
greeter = mkDefault {
package = pkgs.lightdm-enso-os-greeter.xgreeters;
name = "pantheon-greeter";
};
greeters = {
gtk = {
enable = lib.mkDefault false;
enable = mkDefault false;
};
};
};
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
dmcfg = config.services.xserver.displayManager;
@@ -24,11 +27,9 @@ let
cursor-theme-name = ${cfg.cursorTheme.name}
cursor-theme-size = ${toString cfg.cursorTheme.size}
background = ${ldmcfg.background}
${lib.optionalString (cfg.clock-format != null) "clock-format = ${cfg.clock-format}"}
${lib.optionalString (
cfg.indicators != null
) "indicators = ${lib.concatStringsSep ";" cfg.indicators}"}
${lib.optionalString (xcfg.dpi != null) "xft-dpi=${toString xcfg.dpi}"}
${optionalString (cfg.clock-format != null) "clock-format = ${cfg.clock-format}"}
${optionalString (cfg.indicators != null) "indicators = ${concatStringsSep ";" cfg.indicators}"}
${optionalString (xcfg.dpi != null) "xft-dpi=${toString xcfg.dpi}"}
${cfg.extraConfig}
'';
@@ -38,8 +39,8 @@ in
services.xserver.displayManager.lightdm.greeters.gtk = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = true;
description = ''
Whether to enable lightdm-gtk-greeter as the lightdm greeter.
@@ -48,17 +49,17 @@ in
theme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.gnome-themes-extra;
defaultText = lib.literalExpression "pkgs.gnome-themes-extra";
defaultText = literalExpression "pkgs.gnome-themes-extra";
description = ''
The package path that contains the theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Adwaita";
description = ''
Name of the theme to use for the lightdm-gtk-greeter.
@@ -69,17 +70,17 @@ in
iconTheme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.adwaita-icon-theme;
defaultText = lib.literalExpression "pkgs.adwaita-icon-theme";
defaultText = literalExpression "pkgs.adwaita-icon-theme";
description = ''
The package path that contains the icon theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Adwaita";
description = ''
Name of the icon theme to use for the lightdm-gtk-greeter.
@@ -90,25 +91,25 @@ in
cursorTheme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.adwaita-icon-theme;
defaultText = lib.literalExpression "pkgs.adwaita-icon-theme";
defaultText = literalExpression "pkgs.adwaita-icon-theme";
description = ''
The package path that contains the cursor theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Adwaita";
description = ''
Name of the cursor theme to use for the lightdm-gtk-greeter.
'';
};
size = lib.mkOption {
type = lib.types.int;
size = mkOption {
type = types.int;
default = 16;
description = ''
Size of the cursor theme to use for the lightdm-gtk-greeter.
@@ -116,8 +117,8 @@ in
};
};
clock-format = lib.mkOption {
type = lib.types.nullOr lib.types.str;
clock-format = mkOption {
type = types.nullOr types.str;
default = null;
example = "%F";
description = ''
@@ -128,8 +129,8 @@ in
'';
};
indicators = lib.mkOption {
type = lib.types.nullOr (lib.types.listOf lib.types.str);
indicators = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
example = [
"~host"
@@ -154,8 +155,8 @@ in
'';
};
extraConfig = lib.mkOption {
type = lib.types.lines;
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the lightdm-gtk-greeter.conf
@@ -167,9 +168,9 @@ in
};
config = lib.mkIf (ldmcfg.enable && cfg.enable) {
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeter = lib.mkDefault {
services.xserver.displayManager.lightdm.greeter = mkDefault {
package = pkgs.lightdm-gtk-greeter.xgreeters;
name = "lightdm-gtk-greeter";
};
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
dmcfg = config.services.xserver.displayManager;
@@ -53,8 +56,8 @@ in
services.xserver.displayManager.lightdm.greeters.mini = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable lightdm-mini-greeter as the lightdm greeter.
@@ -65,16 +68,16 @@ in
'';
};
user = lib.mkOption {
type = lib.types.str;
user = mkOption {
type = types.str;
default = "root";
description = ''
The user to login as.
'';
};
extraConfig = lib.mkOption {
type = lib.types.lines;
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the lightdm-mini-greeter.conf
@@ -86,11 +89,11 @@ in
};
config = lib.mkIf (ldmcfg.enable && cfg.enable) {
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
services.xserver.displayManager.lightdm.greeter = lib.mkDefault {
services.xserver.displayManager.lightdm.greeter = mkDefault {
package = pkgs.lightdm-mini-greeter.xgreeters;
name = "lightdm-mini-greeter";
};
@@ -4,6 +4,8 @@
pkgs,
...
}:
with lib;
let
dmcfg = config.services.xserver.displayManager;
ldmcfg = dmcfg.lightdm;
@@ -12,14 +14,14 @@ in
{
options = {
services.xserver.displayManager.lightdm.greeters.mobile = {
enable = lib.mkEnableOption "lightdm-mobile-greeter as the lightdm greeter";
enable = mkEnableOption "lightdm-mobile-greeter as the lightdm greeter";
};
};
config = lib.mkIf (ldmcfg.enable && cfg.enable) {
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
services.xserver.displayManager.lightdm.greeter = lib.mkDefault {
services.xserver.displayManager.lightdm.greeter = mkDefault {
package = pkgs.lightdm-mobile-greeter.xgreeters;
name = "lightdm-mobile-greeter";
};
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
dmcfg = config.services.xserver.displayManager;
@@ -20,8 +23,8 @@ in
services.xserver.displayManager.lightdm.greeters.pantheon = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable elementary-greeter as the lightdm greeter.
@@ -32,11 +35,11 @@ in
};
config = lib.mkIf (ldmcfg.enable && cfg.enable) {
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
services.xserver.displayManager.lightdm.greeter = lib.mkDefault {
services.xserver.displayManager.lightdm.greeter = mkDefault {
package = pkgs.pantheon.elementary-greeter.xgreeters;
name = "io.elementary.greeter";
};
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
ldmcfg = config.services.xserver.displayManager.lightdm;
cfg = ldmcfg.greeters.slick;
@@ -23,27 +26,27 @@ let
font-name=${cfg.font.name}
cursor-theme-name=${cfg.cursorTheme.name}
cursor-theme-size=${toString cfg.cursorTheme.size}
draw-user-backgrounds=${lib.boolToString cfg.draw-user-backgrounds}
draw-user-backgrounds=${boolToString cfg.draw-user-backgrounds}
${cfg.extraConfig}
'';
in
{
options = {
services.xserver.displayManager.lightdm.greeters.slick = {
enable = lib.mkEnableOption "lightdm-slick-greeter as the lightdm greeter";
enable = mkEnableOption "lightdm-slick-greeter as the lightdm greeter";
theme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.gnome-themes-extra;
defaultText = lib.literalExpression "pkgs.gnome-themes-extra";
defaultText = literalExpression "pkgs.gnome-themes-extra";
description = ''
The package path that contains the theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Adwaita";
description = ''
Name of the theme to use for the lightdm-slick-greeter.
@@ -52,17 +55,17 @@ in
};
iconTheme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.adwaita-icon-theme;
defaultText = lib.literalExpression "pkgs.adwaita-icon-theme";
defaultText = literalExpression "pkgs.adwaita-icon-theme";
description = ''
The package path that contains the icon theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Adwaita";
description = ''
Name of the icon theme to use for the lightdm-slick-greeter.
@@ -71,17 +74,17 @@ in
};
font = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.ubuntu-classic;
defaultText = lib.literalExpression "pkgs.ubuntu-classic";
defaultText = literalExpression "pkgs.ubuntu-classic";
description = ''
The package path that contains the font given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Ubuntu 11";
description = ''
Name of the font to use.
@@ -90,25 +93,25 @@ in
};
cursorTheme = {
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
default = pkgs.adwaita-icon-theme;
defaultText = lib.literalExpression "pkgs.adwaita-icon-theme";
defaultText = literalExpression "pkgs.adwaita-icon-theme";
description = ''
The package path that contains the cursor theme given in the name option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
default = "Adwaita";
description = ''
Name of the cursor theme to use for the lightdm-slick-greeter.
'';
};
size = lib.mkOption {
type = lib.types.int;
size = mkOption {
type = types.int;
default = 24;
description = ''
Size of the cursor theme to use for the lightdm-slick-greeter.
@@ -116,10 +119,10 @@ in
};
};
draw-user-backgrounds = lib.mkEnableOption "draw user backgrounds";
draw-user-backgrounds = mkEnableOption "draw user backgrounds";
extraConfig = lib.mkOption {
type = lib.types.lines;
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the lightdm-slick-greeter.conf
@@ -129,10 +132,10 @@ in
};
};
config = lib.mkIf (ldmcfg.enable && cfg.enable) {
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm = {
greeters.gtk.enable = false;
greeter = lib.mkDefault {
greeter = mkDefault {
package = pkgs.lightdm-slick-greeter.xgreeters;
name = "lightdm-slick-greeter";
};
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
dmcfg = config.services.xserver.displayManager;
@@ -16,8 +19,8 @@ in
services.xserver.displayManager.lightdm.greeters.tiny = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable lightdm-tiny-greeter as the lightdm greeter.
@@ -29,16 +32,16 @@ in
};
label = {
user = lib.mkOption {
type = lib.types.str;
user = mkOption {
type = types.str;
default = "Username";
description = ''
The string to represent the user_text label.
'';
};
pass = lib.mkOption {
type = lib.types.str;
pass = mkOption {
type = types.str;
default = "Password";
description = ''
The string to represent the pass_text label.
@@ -46,8 +49,8 @@ in
};
};
extraConfig = lib.mkOption {
type = lib.types.lines;
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Section to describe style and ui.
@@ -58,7 +61,7 @@ in
};
config = lib.mkIf (ldmcfg.enable && cfg.enable) {
config = mkIf (ldmcfg.enable && cfg.enable) {
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
@@ -70,10 +73,10 @@ in
static const char *pass_text = "${cfg.label.pass}";
static const char *session = "${dmcfg.defaultSession}";
'';
config = lib.optionalString (cfg.extraConfig != "") (configHeader + cfg.extraConfig);
config = optionalString (cfg.extraConfig != "") (configHeader + cfg.extraConfig);
package = pkgs.lightdm-tiny-greeter.override { conf = config; };
in
lib.mkDefault {
mkDefault {
package = package.xgreeters;
name = "lightdm-tiny-greeter";
};
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
xcfg = config.services.xserver;
@@ -19,7 +22,7 @@ let
# lightdm runs with clearenv(), but we need a few things in the environment for X to startup
xserverWrapper = writeScript "xserver-wrapper" ''
#! ${pkgs.bash}/bin/bash
${lib.concatMapStrings (n: "export ${n}=\"${lib.getAttr n xEnv}\"\n") (lib.attrNames xEnv)}
${concatMapStrings (n: "export ${n}=\"${getAttr n xEnv}\"\n") (attrNames xEnv)}
display=$(echo "$@" | xargs -n 1 | grep -P ^:\\d\$ | head -n 1 | sed s/^://)
if [ -z "$display" ]
@@ -33,13 +36,13 @@ let
usersConf = writeText "users.conf" ''
[UserList]
minimum-uid=1000
hidden-users=${lib.concatStringsSep " " dmcfg.hiddenUsers}
hidden-users=${concatStringsSep " " dmcfg.hiddenUsers}
hidden-shells=/run/current-system/sw/bin/nologin
'';
lightdmConf = writeText "lightdm.conf" ''
[LightDM]
${lib.optionalString cfg.greeter.enable ''
${optionalString cfg.greeter.enable ''
greeter-user = ${config.users.users.lightdm.name}
greeters-directory = ${cfg.greeter.package}
''}
@@ -49,15 +52,15 @@ let
[Seat:*]
xserver-command = ${xserverWrapper}
session-wrapper = ${dmcfg.sessionData.wrapper}
${lib.optionalString cfg.greeter.enable ''
${optionalString cfg.greeter.enable ''
greeter-session = ${cfg.greeter.name}
''}
${lib.optionalString dmcfg.autoLogin.enable ''
${optionalString dmcfg.autoLogin.enable ''
autologin-user = ${dmcfg.autoLogin.user}
autologin-user-timeout = ${toString cfg.autoLogin.timeout}
autologin-session = ${sessionData.autologinSession}
''}
${lib.optionalString (xcfg.displayManager.setupCommands != "") ''
${optionalString (xcfg.displayManager.setupCommands != "") ''
display-setup-script=${pkgs.writeScript "lightdm-display-setup" ''
#!${pkgs.bash}/bin/bash
${xcfg.displayManager.setupCommands}
@@ -84,7 +87,7 @@ in
./lightdm-greeters/tiny.nix
./lightdm-greeters/slick.nix
./lightdm-greeters/mobile.nix
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "displayManager" "lightdm" "autoLogin" "enable" ]
[
"services"
@@ -93,7 +96,7 @@ in
"enable"
]
)
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "xserver" "displayManager" "lightdm" "autoLogin" "user" ]
[
"services"
@@ -108,8 +111,8 @@ in
services.xserver.displayManager.lightdm = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable lightdm as the display manager.
@@ -117,24 +120,24 @@ in
};
greeter = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = true;
description = ''
If set to false, run lightdm in greeterless mode. This only works if autologin
is enabled and autoLogin.timeout is zero.
'';
};
package = lib.mkOption {
type = lib.types.package;
package = mkOption {
type = types.package;
description = ''
The LightDM greeter to login via. The package should be a directory
containing a .desktop file matching the name in the 'name' option.
'';
};
name = lib.mkOption {
type = lib.types.str;
name = mkOption {
type = types.str;
description = ''
The name of a .desktop file in the directory specified
in the 'package' option.
@@ -142,8 +145,8 @@ in
};
};
extraConfig = lib.mkOption {
type = lib.types.lines;
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
user-authority-in-system-dir = true
@@ -151,17 +154,17 @@ in
description = "Extra lines to append to LightDM section.";
};
background = lib.mkOption {
type = lib.types.either lib.types.path (lib.types.strMatching "^#[0-9]\{6\}$");
background = mkOption {
type = types.either types.path (types.strMatching "^#[0-9]\{6\}$");
# Manual cannot depend on packages, we are actually setting the default in config below.
defaultText = lib.literalExpression "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath";
defaultText = literalExpression "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath";
description = ''
The background image or color to use.
'';
};
extraSeatDefaults = lib.mkOption {
type = lib.types.lines;
extraSeatDefaults = mkOption {
type = types.lines;
default = "";
example = ''
greeter-show-manual-login=true
@@ -170,8 +173,8 @@ in
};
# Configuration for automatic login specific to LightDM
autoLogin.timeout = lib.mkOption {
type = lib.types.int;
autoLogin.timeout = mkOption {
type = types.int;
default = 0;
description = ''
Show the greeter for this many seconds before automatic login occurs.
@@ -181,7 +184,7 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
assertions = [
{
@@ -207,12 +210,12 @@ in
# Keep in sync with the defaultText value from the option definition.
services.xserver.displayManager.lightdm.background =
lib.mkDefault pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath;
mkDefault pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath;
# Set default session in session chooser to a specified values basically ignore session history.
# Auto-login is already covered by a config value.
services.displayManager.preStart =
lib.optionalString (!dmcfg.autoLogin.enable && dmcfg.defaultSession != null)
optionalString (!dmcfg.autoLogin.enable && dmcfg.defaultSession != null)
''
${setSessionScript}/bin/set-session ${dmcfg.defaultSession}
'';
@@ -4,10 +4,13 @@
pkgs,
...
}:
with lib;
{
# added 2019-11-11
imports = [
(lib.mkRemovedOptionModule [ "services" "xserver" "displayManager" "slim" ] ''
(mkRemovedOptionModule [ "services" "xserver" "displayManager" "slim" ] ''
The SLIM project is abandoned and their last release was in 2013.
Because of this it poses a security risk to your system.
Other issues include it not fully supporting systemd and logind sessions.
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.displayManager.startx;
@@ -16,8 +19,8 @@ in
options = {
services.xserver.displayManager.startx = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the dummy "startx" pseudo-display manager,
@@ -33,7 +36,7 @@ in
###### implementation
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver = {
exportConfiguration = true;
};
@@ -43,7 +46,7 @@ in
#
# To send log to Xorg's default log location ($XDG_DATA_HOME/xorg/), we do
# not specify a log file when running X
services.xserver.logFile = lib.mkDefault null;
services.xserver.logFile = mkDefault null;
# Implement xserverArgs via xinit's system-wide xserverrc
environment.etc."X11/xinit/xserverrc".source = pkgs.writeShellScript "xserverrc" ''
@@ -1,4 +1,7 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xserver.displayManager.xpra;
dmcfg = config.services.xserver.displayManager;
@@ -10,46 +13,46 @@ in
options = {
services.xserver.displayManager.xpra = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable xpra as display manager.";
};
bindTcp = lib.mkOption {
bindTcp = mkOption {
default = "127.0.0.1:10000";
example = "0.0.0.0:10000";
type = lib.types.nullOr lib.types.str;
type = types.nullOr types.str;
description = "Bind xpra to TCP";
};
desktop = lib.mkOption {
type = lib.types.nullOr lib.types.str;
desktop = mkOption {
type = types.nullOr types.str;
default = null;
example = "gnome-shell";
description = "Start a desktop environment instead of seamless mode";
};
auth = lib.mkOption {
type = lib.types.str;
auth = mkOption {
type = types.str;
default = "pam";
example = "password:value=mysecret";
description = "Authentication to use when connecting to xpra";
};
pulseaudio = lib.mkEnableOption "pulseaudio audio streaming";
pulseaudio = mkEnableOption "pulseaudio audio streaming";
extraOptions = lib.mkOption {
extraOptions = mkOption {
description = "Extra xpra options";
default = [];
type = lib.types.listOf lib.types.str;
type = types.listOf types.str;
};
};
};
###### implementation
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.videoDrivers = ["dummy"];
services.xserver.monitorSection = ''
@@ -224,7 +227,7 @@ in
'';
services.displayManager.execCmd = ''
${lib.optionalString (cfg.pulseaudio)
${optionalString (cfg.pulseaudio)
"export PULSE_COOKIE=/run/pulse/.config/pulse/cookie"}
exec ${pkgs.xpra}/bin/xpra ${if cfg.desktop == null then "start" else "start-desktop --start=${cfg.desktop}"} \
--daemon=off \
@@ -236,20 +239,20 @@ in
--speaker=yes \
--mdns=no \
--pulseaudio=no \
${lib.optionalString (cfg.pulseaudio) "--sound-source=pulse"} \
${optionalString (cfg.pulseaudio) "--sound-source=pulse"} \
--socket-dirs=/run/xpra \
--xvfb="xpra_Xdummy ${lib.concatStringsSep " " dmcfg.xserverArgs}" \
${lib.optionalString (cfg.bindTcp != null) "--bind-tcp=${cfg.bindTcp}"} \
--xvfb="xpra_Xdummy ${concatStringsSep " " dmcfg.xserverArgs}" \
${optionalString (cfg.bindTcp != null) "--bind-tcp=${cfg.bindTcp}"} \
--auth=${cfg.auth} \
${lib.concatStringsSep " " cfg.extraOptions}
${concatStringsSep " " cfg.extraOptions}
'';
services.xserver.terminateOnReset = false;
environment.systemPackages = [pkgs.xpra];
services.pulseaudio.enable = lib.mkDefault cfg.pulseaudio;
services.pulseaudio.systemWide = lib.mkDefault cfg.pulseaudio;
services.pulseaudio.enable = mkDefault cfg.pulseaudio;
services.pulseaudio.systemWide = mkDefault cfg.pulseaudio;
};
}
+21 -18
View File
@@ -4,26 +4,29 @@
pkgs,
...
}:
with lib;
let
layouts = config.services.xserver.xkb.extraLayouts;
layoutOpts = {
options = {
description = lib.mkOption {
type = lib.types.str;
description = mkOption {
type = types.str;
description = "A short description of the layout.";
};
languages = lib.mkOption {
type = lib.types.listOf lib.types.str;
languages = mkOption {
type = types.listOf types.str;
description = ''
A list of languages provided by the layout.
(Use ISO 639-2 codes, for example: "eng" for english)
'';
};
compatFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
compatFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
The path to the xkb compat file.
@@ -33,8 +36,8 @@ let
'';
};
geometryFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
geometryFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
The path to the xkb geometry file.
@@ -44,8 +47,8 @@ let
'';
};
keycodesFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
keycodesFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
The path to the xkb keycodes file.
@@ -55,8 +58,8 @@ let
'';
};
symbolsFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
symbolsFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
The path to the xkb symbols file.
@@ -66,8 +69,8 @@ let
'';
};
typesFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
typesFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
The path to the xkb types file.
@@ -108,10 +111,10 @@ in
###### interface
options.services.xserver.xkb = {
extraLayouts = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule layoutOpts);
extraLayouts = mkOption {
type = types.attrsOf (types.submodule layoutOpts);
default = { };
example = lib.literalExpression ''
example = literalExpression ''
{
mine = {
description = "My custom xkb layout.";
@@ -133,7 +136,7 @@ in
###### implementation
config = lib.mkIf (layouts != { }) {
config = mkIf (layouts != { }) {
environment.sessionVariables = {
# runtime override supported by multiple libraries e. g. libxkbcommon
+10 -9
View File
@@ -4,38 +4,39 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.fractalart;
in
{
options.services.fractalart = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = "Enable FractalArt for generating colorful wallpapers on login";
};
width = lib.mkOption {
type = lib.types.nullOr lib.types.int;
width = mkOption {
type = types.nullOr types.int;
default = null;
example = 1920;
description = "Screen width";
};
height = lib.mkOption {
type = lib.types.nullOr lib.types.int;
height = mkOption {
type = types.nullOr types.int;
default = null;
example = 1080;
description = "Screen height";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.haskellPackages.FractalArt ];
services.xserver.displayManager.sessionCommands =
"${pkgs.haskellPackages.FractalArt}/bin/FractalArt --no-bg -f .background-image"
+ lib.optionalString (cfg.width != null) " -w ${toString cfg.width}"
+ lib.optionalString (cfg.height != null) " -h ${toString cfg.height}";
+ optionalString (cfg.width != null) " -w ${toString cfg.width}"
+ optionalString (cfg.height != null) " -h ${toString cfg.height}";
};
}
+8 -5
View File
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.cmt;
@@ -15,13 +18,13 @@ in
options = {
services.xserver.cmt = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = "Enable chrome multitouch input (cmt). Touchpad drivers that are configured for chromebooks.";
};
models = lib.mkOption {
type = lib.types.enum [
models = mkOption {
type = types.enum [
"atlas"
"banjo"
"candy"
@@ -80,7 +83,7 @@ in
}; # closes services
}; # closes options
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.modules = [ pkgs.xf86_input_cmt ];
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.digimend;
@@ -18,13 +21,13 @@ in
services.xserver.digimend = {
enable = lib.mkEnableOption "the digimend drivers for Huion/XP-Pen/etc. tablets";
enable = mkEnableOption "the digimend drivers for Huion/XP-Pen/etc. tablets";
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
# digimend drivers use xsetwacom and wacom X11 drivers
services.xserver.wacom.enable = true;
@@ -5,6 +5,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.synaptics;
opt = options.services.xserver.synaptics;
@@ -32,14 +35,14 @@ in
services.xserver.synaptics = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable touchpad support. Deprecated: Consider services.libinput.enable.";
};
dev = lib.mkOption {
type = lib.types.nullOr lib.types.str;
dev = mkOption {
type = types.nullOr types.str;
default = null;
example = "/dev/input/event0";
description = ''
@@ -48,73 +51,73 @@ in
'';
};
accelFactor = lib.mkOption {
type = lib.types.nullOr lib.types.str;
accelFactor = mkOption {
type = types.nullOr types.str;
default = "0.001";
description = "Cursor acceleration (how fast speed increases from minSpeed to maxSpeed).";
};
minSpeed = lib.mkOption {
type = lib.types.nullOr lib.types.str;
minSpeed = mkOption {
type = types.nullOr types.str;
default = "0.6";
description = "Cursor speed factor for precision finger motion.";
};
maxSpeed = lib.mkOption {
type = lib.types.nullOr lib.types.str;
maxSpeed = mkOption {
type = types.nullOr types.str;
default = "1.0";
description = "Cursor speed factor for highest-speed finger motion.";
};
scrollDelta = lib.mkOption {
type = lib.types.nullOr lib.types.int;
scrollDelta = mkOption {
type = types.nullOr types.int;
default = null;
example = 75;
description = "Move distance of the finger for a scroll event.";
};
twoFingerScroll = lib.mkOption {
type = lib.types.bool;
twoFingerScroll = mkOption {
type = types.bool;
default = false;
description = "Whether to enable two-finger drag-scrolling. Overridden by horizTwoFingerScroll and vertTwoFingerScroll.";
};
horizTwoFingerScroll = lib.mkOption {
type = lib.types.bool;
horizTwoFingerScroll = mkOption {
type = types.bool;
default = cfg.twoFingerScroll;
defaultText = lib.literalExpression "config.${opt.twoFingerScroll}";
defaultText = literalExpression "config.${opt.twoFingerScroll}";
description = "Whether to enable horizontal two-finger drag-scrolling.";
};
vertTwoFingerScroll = lib.mkOption {
type = lib.types.bool;
vertTwoFingerScroll = mkOption {
type = types.bool;
default = cfg.twoFingerScroll;
defaultText = lib.literalExpression "config.${opt.twoFingerScroll}";
defaultText = literalExpression "config.${opt.twoFingerScroll}";
description = "Whether to enable vertical two-finger drag-scrolling.";
};
horizEdgeScroll = lib.mkOption {
type = lib.types.bool;
horizEdgeScroll = mkOption {
type = types.bool;
default = !cfg.horizTwoFingerScroll;
defaultText = lib.literalExpression "! config.${opt.horizTwoFingerScroll}";
defaultText = literalExpression "! config.${opt.horizTwoFingerScroll}";
description = "Whether to enable horizontal edge drag-scrolling.";
};
vertEdgeScroll = lib.mkOption {
type = lib.types.bool;
vertEdgeScroll = mkOption {
type = types.bool;
default = !cfg.vertTwoFingerScroll;
defaultText = lib.literalExpression "! config.${opt.vertTwoFingerScroll}";
defaultText = literalExpression "! config.${opt.vertTwoFingerScroll}";
description = "Whether to enable vertical edge drag-scrolling.";
};
tapButtons = lib.mkOption {
type = lib.types.bool;
tapButtons = mkOption {
type = types.bool;
default = true;
description = "Whether to enable tap buttons.";
};
buttonsMap = lib.mkOption {
type = lib.types.listOf lib.types.int;
buttonsMap = mkOption {
type = types.listOf types.int;
default = [
1
2
@@ -129,8 +132,8 @@ in
apply = map toString;
};
fingersMap = lib.mkOption {
type = lib.types.listOf lib.types.int;
fingersMap = mkOption {
type = types.listOf types.int;
default = [
1
2
@@ -145,34 +148,34 @@ in
apply = map toString;
};
palmDetect = lib.mkOption {
type = lib.types.bool;
palmDetect = mkOption {
type = types.bool;
default = false;
description = "Whether to enable palm detection (hardware support required)";
};
palmMinWidth = lib.mkOption {
type = lib.types.nullOr lib.types.int;
palmMinWidth = mkOption {
type = types.nullOr types.int;
default = null;
example = 5;
description = "Minimum finger width at which touch is considered a palm";
};
palmMinZ = lib.mkOption {
type = lib.types.nullOr lib.types.int;
palmMinZ = mkOption {
type = types.nullOr types.int;
default = null;
example = 20;
description = "Minimum finger pressure at which touch is considered a palm";
};
horizontalScroll = lib.mkOption {
type = lib.types.bool;
horizontalScroll = mkOption {
type = types.bool;
default = true;
description = "Whether to enable horizontal scrolling (on touchpad)";
};
additionalOptions = lib.mkOption {
type = lib.types.str;
additionalOptions = mkOption {
type = types.str;
default = "";
example = ''
Option "RTCornerButton" "2"
@@ -187,7 +190,7 @@ in
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.modules = [ pkg.out ];
@@ -200,12 +203,12 @@ in
Section "InputClass"
Identifier "synaptics touchpad catchall"
MatchIsTouchpad "on"
${lib.optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''}
${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''}
Driver "synaptics"
${lib.optionalString (cfg.minSpeed != null) ''Option "MinSpeed" "${cfg.minSpeed}"''}
${lib.optionalString (cfg.maxSpeed != null) ''Option "MaxSpeed" "${cfg.maxSpeed}"''}
${lib.optionalString (cfg.accelFactor != null) ''Option "AccelFactor" "${cfg.accelFactor}"''}
${lib.optionalString cfg.tapButtons tapConfig}
${optionalString (cfg.minSpeed != null) ''Option "MinSpeed" "${cfg.minSpeed}"''}
${optionalString (cfg.maxSpeed != null) ''Option "MaxSpeed" "${cfg.maxSpeed}"''}
${optionalString (cfg.accelFactor != null) ''Option "AccelFactor" "${cfg.accelFactor}"''}
${optionalString cfg.tapButtons tapConfig}
Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}"
Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}"
Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}"
@@ -213,19 +216,19 @@ in
Option "HorizTwoFingerScroll" "${if cfg.horizTwoFingerScroll then "1" else "0"}"
Option "VertEdgeScroll" "${if cfg.vertEdgeScroll then "1" else "0"}"
Option "HorizEdgeScroll" "${if cfg.horizEdgeScroll then "1" else "0"}"
${lib.optionalString cfg.palmDetect ''Option "PalmDetect" "1"''}
${lib.optionalString (
${optionalString cfg.palmDetect ''Option "PalmDetect" "1"''}
${optionalString (
cfg.palmMinWidth != null
) ''Option "PalmMinWidth" "${toString cfg.palmMinWidth}"''}
${lib.optionalString (cfg.palmMinZ != null) ''Option "PalmMinZ" "${toString cfg.palmMinZ}"''}
${lib.optionalString (
${optionalString (cfg.palmMinZ != null) ''Option "PalmMinZ" "${toString cfg.palmMinZ}"''}
${optionalString (
cfg.scrollDelta != null
) ''Option "VertScrollDelta" "${toString cfg.scrollDelta}"''}
${
if !cfg.horizontalScroll then
''Option "HorizScrollDelta" "0"''
else
(lib.optionalString (
(optionalString (
cfg.scrollDelta != null
) ''Option "HorizScrollDelta" "${toString cfg.scrollDelta}"'')
}
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.wacom;
@@ -16,8 +19,8 @@ in
services.xserver.wacom = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the Wacom touchscreen/digitizer/tablet.
@@ -34,7 +37,7 @@ in
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.xf86_input_wacom ]; # provides xsetwacom
+10 -9
View File
@@ -4,16 +4,17 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.imwheel;
in
{
options = {
services.xserver.imwheel = {
enable = lib.mkEnableOption "IMWheel service";
enable = mkEnableOption "IMWheel service";
extraOptions = lib.mkOption {
type = lib.types.listOf lib.types.str;
extraOptions = mkOption {
type = types.listOf types.str;
default = [ "--buttons=45" ];
example = [ "--debug" ];
description = ''
@@ -22,10 +23,10 @@ in
'';
};
rules = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
rules = mkOption {
type = types.attrsOf types.str;
default = { };
example = lib.literalExpression ''
example = literalExpression ''
{
".*" = '''
None, Up, Button4, 8
@@ -48,11 +49,11 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.imwheel ];
environment.etc."X11/imwheel/imwheelrc".source = pkgs.writeText "imwheelrc" (
lib.concatStringsSep "\n\n" (lib.mapAttrsToList (rule: conf: "\"${rule}\"\n${conf}") cfg.rules)
concatStringsSep "\n\n" (mapAttrsToList (rule: conf: "\"${rule}\"\n${conf}") cfg.rules)
);
systemd.user.services.imwheel = {
@@ -62,7 +63,7 @@ in
serviceConfig = {
ExecStart =
"${pkgs.imwheel}/bin/imwheel "
+ lib.escapeShellArgs (
+ escapeShellArgs (
[
"--detach"
"--kill"
+67 -64
View File
@@ -5,6 +5,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.picom;
@@ -12,46 +15,46 @@ let
pairOf =
x:
with lib.types;
with types;
addCheck (listOf x) (y: length y == 2) // { description = "pair of ${x.description}"; };
mkDefaultAttrs = lib.mapAttrs (n: v: lib.mkDefault v);
mkDefaultAttrs = mapAttrs (n: v: mkDefault v);
# Basically a tinkered lib.generators.mkKeyValueDefault
# It either serializes a top-level definition "key: { values };"
# or an expression "key = { values };"
mkAttrsString =
top:
lib.mapAttrsToList (
mapAttrsToList (
k: v:
let
sep = if (top && lib.isAttrs v) then ":" else "=";
sep = if (top && isAttrs v) then ":" else "=";
in
"${lib.escape [ sep ] k}${sep}${mkValueString v};"
"${escape [ sep ] k}${sep}${mkValueString v};"
);
# This serializes a Nix expression to the libconfig format.
mkValueString =
v:
if lib.types.bool.check v then
lib.boolToString v
else if lib.types.int.check v then
if types.bool.check v then
boolToString v
else if types.int.check v then
toString v
else if lib.types.float.check v then
else if types.float.check v then
toString v
else if lib.types.str.check v then
"\"${lib.escape [ "\"" ] v}\""
else if types.str.check v then
"\"${escape [ "\"" ] v}\""
else if builtins.isList v then
"[ ${lib.concatMapStringsSep " , " mkValueString v} ]"
else if lib.types.attrs.check v then
"{ ${lib.concatStringsSep " " (mkAttrsString false v)} }"
"[ ${concatMapStringsSep " , " mkValueString v} ]"
else if types.attrs.check v then
"{ ${concatStringsSep " " (mkAttrsString false v)} }"
else
throw ''
invalid expression used in option services.picom.settings:
${v}
'';
toConf = attrs: lib.concatStringsSep "\n" (mkAttrsString true cfg.settings);
toConf = attrs: concatStringsSep "\n" (mkAttrsString true cfg.settings);
configFile = pkgs.writeText "picom.conf" (toConf cfg.settings);
@@ -59,38 +62,38 @@ in
{
imports = [
(lib.mkAliasOptionModuleMD [ "services" "compton" ] [ "services" "picom" ])
(lib.mkRemovedOptionModule [ "services" "picom" "refreshRate" ] ''
(mkAliasOptionModuleMD [ "services" "compton" ] [ "services" "picom" ])
(mkRemovedOptionModule [ "services" "picom" "refreshRate" ] ''
This option corresponds to `refresh-rate`, which has been unused
since picom v6 and was subsequently removed by upstream.
See https://github.com/yshui/picom/commit/bcbc410
'')
(lib.mkRemovedOptionModule [ "services" "picom" "experimentalBackends" ] ''
(mkRemovedOptionModule [ "services" "picom" "experimentalBackends" ] ''
This option was removed by upstream since picom v10.
'')
];
options.services.picom = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether or not to enable Picom as the X.org composite manager.
'';
};
package = lib.mkPackageOption pkgs "picom" { };
package = mkPackageOption pkgs "picom" { };
fade = lib.mkOption {
type = lib.types.bool;
fade = mkOption {
type = types.bool;
default = false;
description = ''
Fade windows in and out.
'';
};
fadeDelta = lib.mkOption {
type = lib.types.ints.positive;
fadeDelta = mkOption {
type = types.ints.positive;
default = 10;
example = 5;
description = ''
@@ -98,8 +101,8 @@ in
'';
};
fadeSteps = lib.mkOption {
type = pairOf (lib.types.numbers.between 0.01 1);
fadeSteps = mkOption {
type = pairOf (types.numbers.between 0.01 1);
default = [
0.028
0.03
@@ -113,8 +116,8 @@ in
'';
};
fadeExclude = lib.mkOption {
type = lib.types.listOf lib.types.str;
fadeExclude = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"window_type *= 'menu'"
@@ -127,16 +130,16 @@ in
'';
};
shadow = lib.mkOption {
type = lib.types.bool;
shadow = mkOption {
type = types.bool;
default = false;
description = ''
Draw window shadows.
'';
};
shadowOffsets = lib.mkOption {
type = pairOf lib.types.int;
shadowOffsets = mkOption {
type = pairOf types.int;
default = [
(-15)
(-15)
@@ -150,8 +153,8 @@ in
'';
};
shadowOpacity = lib.mkOption {
type = lib.types.numbers.between 0 1;
shadowOpacity = mkOption {
type = types.numbers.between 0 1;
default = 0.75;
example = 0.8;
description = ''
@@ -159,8 +162,8 @@ in
'';
};
shadowExclude = lib.mkOption {
type = lib.types.listOf lib.types.str;
shadowExclude = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"window_type *= 'menu'"
@@ -173,8 +176,8 @@ in
'';
};
activeOpacity = lib.mkOption {
type = lib.types.numbers.between 0 1;
activeOpacity = mkOption {
type = types.numbers.between 0 1;
default = 1.0;
example = 0.8;
description = ''
@@ -182,8 +185,8 @@ in
'';
};
inactiveOpacity = lib.mkOption {
type = lib.types.numbers.between 0.1 1;
inactiveOpacity = mkOption {
type = types.numbers.between 0.1 1;
default = 1.0;
example = 0.8;
description = ''
@@ -191,8 +194,8 @@ in
'';
};
menuOpacity = lib.mkOption {
type = lib.types.numbers.between 0 1;
menuOpacity = mkOption {
type = types.numbers.between 0 1;
default = 1.0;
example = 0.8;
description = ''
@@ -200,8 +203,8 @@ in
'';
};
wintypes = lib.mkOption {
type = lib.types.attrs;
wintypes = mkOption {
type = types.attrs;
default = {
popup_menu = {
opacity = cfg.menuOpacity;
@@ -210,7 +213,7 @@ in
opacity = cfg.menuOpacity;
};
};
defaultText = lib.literalExpression ''
defaultText = literalExpression ''
{
popup_menu = { opacity = config.${opt.menuOpacity}; };
dropdown_menu = { opacity = config.${opt.menuOpacity}; };
@@ -222,8 +225,8 @@ in
'';
};
opacityRules = lib.mkOption {
type = lib.types.listOf lib.types.str;
opacityRules = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"95:class_g = 'URxvt' && !_NET_WM_STATE@:32a"
@@ -234,8 +237,8 @@ in
'';
};
backend = lib.mkOption {
type = lib.types.enum [
backend = mkOption {
type = types.enum [
"egl"
"glx"
"xrender"
@@ -247,9 +250,9 @@ in
'';
};
vSync = lib.mkOption {
vSync = mkOption {
type =
with lib.types;
with types;
either bool (enum [
"none"
"drm"
@@ -265,9 +268,9 @@ in
res = x != "none";
msg =
"The type of services.picom.vSync has changed to bool:"
+ " interpreting ${x} as ${lib.boolToString res}";
+ " interpreting ${x} as ${boolToString res}";
in
if lib.isBool x then x else lib.warn msg res;
if isBool x then x else warn msg res;
description = ''
Enable vertical synchronization. Chooses the best method
@@ -277,7 +280,7 @@ in
};
settings =
with lib.types;
with types;
let
scalar =
oneOf [
@@ -310,10 +313,10 @@ in
};
in
lib.mkOption {
mkOption {
type = topLevel;
default = { };
example = lib.literalExpression ''
example = literalExpression ''
blur =
{ method = "gaussian";
size = 10;
@@ -328,19 +331,19 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.picom.settings = mkDefaultAttrs {
# fading
fading = cfg.fade;
fade-delta = cfg.fadeDelta;
fade-in-step = lib.elemAt cfg.fadeSteps 0;
fade-out-step = lib.elemAt cfg.fadeSteps 1;
fade-in-step = elemAt cfg.fadeSteps 0;
fade-out-step = elemAt cfg.fadeSteps 1;
fade-exclude = cfg.fadeExclude;
# shadows
shadow = cfg.shadow;
shadow-offset-x = lib.elemAt cfg.shadowOffsets 0;
shadow-offset-y = lib.elemAt cfg.shadowOffsets 1;
shadow-offset-x = elemAt cfg.shadowOffsets 0;
shadow-offset-y = elemAt cfg.shadowOffsets 1;
shadow-opacity = cfg.shadowOpacity;
shadow-exclude = cfg.shadowExclude;
@@ -363,12 +366,12 @@ in
partOf = [ "graphical-session.target" ];
# Temporarily fixes corrupt colours with Mesa 18
environment = lib.mkIf (cfg.backend == "glx") {
environment = mkIf (cfg.backend == "glx") {
allow_rgb10_configs = "false";
};
serviceConfig = {
ExecStart = "${lib.getExe cfg.package} --config ${configFile}";
ExecStart = "${getExe cfg.package} --config ${configFile}";
RestartSec = 3;
Restart = "always";
};
+24 -21
View File
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.redshift;
@@ -13,32 +16,32 @@ in
{
imports = [
(lib.mkChangedOptionModule [ "services" "redshift" "latitude" ] [ "location" "latitude" ] (
(mkChangedOptionModule [ "services" "redshift" "latitude" ] [ "location" "latitude" ] (
config:
let
value = lib.getAttrFromPath [ "services" "redshift" "latitude" ] config;
value = getAttrFromPath [ "services" "redshift" "latitude" ] config;
in
if value == null then
throw "services.redshift.latitude is set to null, you can remove this"
else
builtins.fromJSON value
))
(lib.mkChangedOptionModule [ "services" "redshift" "longitude" ] [ "location" "longitude" ] (
(mkChangedOptionModule [ "services" "redshift" "longitude" ] [ "location" "longitude" ] (
config:
let
value = lib.getAttrFromPath [ "services" "redshift" "longitude" ] config;
value = getAttrFromPath [ "services" "redshift" "longitude" ] config;
in
if value == null then
throw "services.redshift.longitude is set to null, you can remove this"
else
builtins.fromJSON value
))
(lib.mkRenamedOptionModule [ "services" "redshift" "provider" ] [ "location" "provider" ])
(mkRenamedOptionModule [ "services" "redshift" "provider" ] [ "location" "provider" ])
];
options.services.redshift = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable Redshift to change your screen's colour temperature depending on
@@ -47,16 +50,16 @@ in
};
temperature = {
day = lib.mkOption {
type = lib.types.int;
day = mkOption {
type = types.int;
default = 5500;
description = ''
Colour temperature to use during the day, between
`1000` and `25000` K.
'';
};
night = lib.mkOption {
type = lib.types.int;
night = mkOption {
type = types.int;
default = 3700;
description = ''
Colour temperature to use at night, between
@@ -66,16 +69,16 @@ in
};
brightness = {
day = lib.mkOption {
type = lib.types.str;
day = mkOption {
type = types.str;
default = "1";
description = ''
Screen brightness to apply during the day,
between `0.1` and `1.0`.
'';
};
night = lib.mkOption {
type = lib.types.str;
night = mkOption {
type = types.str;
default = "1";
description = ''
Screen brightness to apply during the night,
@@ -84,10 +87,10 @@ in
};
};
package = lib.mkPackageOption pkgs "redshift" { };
package = mkPackageOption pkgs "redshift" { };
executable = lib.mkOption {
type = lib.types.str;
executable = mkOption {
type = types.str;
default = "/bin/redshift";
example = "/bin/redshift-gtk";
description = ''
@@ -95,8 +98,8 @@ in
'';
};
extraOptions = lib.mkOption {
type = lib.types.listOf lib.types.str;
extraOptions = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"-v"
@@ -109,7 +112,7 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
# needed so that .desktop files are installed, which geoclue cares about
environment.systemPackages = [ cfg.package ];
+7 -4
View File
@@ -4,24 +4,27 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.touchegg;
in
{
meta = {
maintainers = lib.teams.pantheon.members;
maintainers = teams.pantheon.members;
};
###### interface
options.services.touchegg = {
enable = lib.mkEnableOption "touchegg, a multi-touch gesture recognizer";
enable = mkEnableOption "touchegg, a multi-touch gesture recognizer";
package = lib.mkPackageOption pkgs "touchegg" { };
package = mkPackageOption pkgs "touchegg" { };
};
###### implementation
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
systemd.services.touchegg = {
description = "Touchegg Daemon";
serviceConfig = {
+14 -11
View File
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.unclutter-xfixes;
@@ -11,29 +14,29 @@ in
{
options.services.unclutter-xfixes = {
enable = lib.mkOption {
enable = mkOption {
description = "Enable unclutter-xfixes to hide your mouse cursor when inactive.";
type = lib.types.bool;
type = types.bool;
default = false;
};
package = lib.mkPackageOption pkgs "unclutter-xfixes" { };
package = mkPackageOption pkgs "unclutter-xfixes" { };
timeout = lib.mkOption {
timeout = mkOption {
description = "Number of seconds before the cursor is marked inactive.";
type = lib.types.int;
type = types.int;
default = 1;
};
threshold = lib.mkOption {
threshold = mkOption {
description = "Minimum number of pixels considered cursor movement.";
type = lib.types.int;
type = types.int;
default = 1;
};
extraOptions = lib.mkOption {
extraOptions = mkOption {
description = "More arguments to pass to the unclutter-xfixes command.";
type = lib.types.listOf lib.types.str;
type = types.listOf types.str;
default = [ ];
example = [
"exclude-root"
@@ -43,7 +46,7 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
systemd.user.services.unclutter-xfixes = {
description = "unclutter-xfixes";
wantedBy = [ "graphical-session.target" ];
@@ -52,7 +55,7 @@ in
${cfg.package}/bin/unclutter \
--timeout ${toString cfg.timeout} \
--jitter ${toString (cfg.threshold - 1)} \
${lib.concatMapStrings (x: " --" + x) cfg.extraOptions} \
${concatMapStrings (x: " --" + x) cfg.extraOptions} \
'';
serviceConfig.RestartSec = 3;
serviceConfig.Restart = "always";
+21 -18
View File
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.unclutter;
@@ -11,42 +14,42 @@ in
{
options.services.unclutter = {
enable = lib.mkOption {
enable = mkOption {
description = "Enable unclutter to hide your mouse cursor when inactive";
type = lib.types.bool;
type = types.bool;
default = false;
};
package = lib.mkPackageOption pkgs "unclutter" { };
package = mkPackageOption pkgs "unclutter" { };
keystroke = lib.mkOption {
keystroke = mkOption {
description = "Wait for a keystroke before hiding the cursor";
type = lib.types.bool;
type = types.bool;
default = false;
};
timeout = lib.mkOption {
timeout = mkOption {
description = "Number of seconds before the cursor is marked inactive";
type = lib.types.int;
type = types.int;
default = 1;
};
threshold = lib.mkOption {
threshold = mkOption {
description = "Minimum number of pixels considered cursor movement";
type = lib.types.int;
type = types.int;
default = 1;
};
excluded = lib.mkOption {
excluded = mkOption {
description = "Names of windows where unclutter should not apply";
type = lib.types.listOf lib.types.str;
type = types.listOf types.str;
default = [ ];
example = [ "" ];
};
extraOptions = lib.mkOption {
extraOptions = mkOption {
description = "More arguments to pass to the unclutter command";
type = lib.types.listOf lib.types.str;
type = types.listOf types.str;
default = [ ];
example = [
"noevent"
@@ -55,7 +58,7 @@ in
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
systemd.user.services.unclutter = {
description = "unclutter";
wantedBy = [ "graphical-session.target" ];
@@ -64,9 +67,9 @@ in
${cfg.package}/bin/unclutter \
-idle ${toString cfg.timeout} \
-jitter ${toString (cfg.threshold - 1)} \
${lib.optionalString cfg.keystroke "-keystroke"} \
${lib.concatMapStrings (x: " -" + x) cfg.extraOptions} \
-not ${lib.concatStringsSep " " cfg.excluded} \
${optionalString cfg.keystroke "-keystroke"} \
${concatMapStrings (x: " -" + x) cfg.extraOptions} \
-not ${concatStringsSep " " cfg.excluded} \
'';
serviceConfig.PassEnvironment = "DISPLAY";
serviceConfig.RestartSec = 3;
@@ -75,7 +78,7 @@ in
};
imports = [
(lib.mkRenamedOptionModule
(mkRenamedOptionModule
[ "services" "unclutter" "threeshold" ]
[ "services" "unclutter" "threshold" ]
)
+8 -4
View File
@@ -4,14 +4,18 @@
pkgs,
...
}:
# maintainer: siddharthist
with lib;
let
cfg = config.services.urxvtd;
in
{
options.services.urxvtd = {
enable = lib.mkOption {
type = lib.types.bool;
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
@@ -19,10 +23,10 @@ in
'';
};
package = lib.mkPackageOption pkgs "rxvt-unicode" { };
package = mkPackageOption pkgs "rxvt-unicode" { };
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
systemd.user.services.urxvtd = {
description = "urxvt terminal daemon";
wantedBy = [ "graphical-session.target" ];
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager."2bwm";
@@ -15,14 +18,14 @@ in
###### interface
options = {
services.xserver.windowManager."2bwm".enable = lib.mkEnableOption "2bwm";
services.xserver.windowManager."2bwm".enable = mkEnableOption "2bwm";
};
###### implementation
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
services.xserver.windowManager.session = singleton {
name = "2bwm";
start = ''
${pkgs._2bwm}/bin/2bwm &
@@ -4,18 +4,21 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.afterstep;
in
{
###### interface
options = {
services.xserver.windowManager.afterstep.enable = lib.mkEnableOption "afterstep";
services.xserver.windowManager.afterstep.enable = mkEnableOption "afterstep";
};
###### implementation
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "afterstep";
start = ''
${pkgs.afterstep}/bin/afterstep &
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.awesome;
@@ -22,20 +25,20 @@ in
services.xserver.windowManager.awesome = {
enable = lib.mkEnableOption "Awesome window manager";
enable = mkEnableOption "Awesome window manager";
luaModules = lib.mkOption {
luaModules = mkOption {
default = [ ];
type = lib.types.listOf lib.types.package;
type = types.listOf types.package;
description = "List of lua packages available for being used in the Awesome configuration.";
example = lib.literalExpression "[ pkgs.luaPackages.vicious ]";
example = literalExpression "[ pkgs.luaPackages.vicious ]";
};
package = lib.mkPackageOption pkgs "awesome" { };
package = mkPackageOption pkgs "awesome" { };
noArgb = lib.mkOption {
noArgb = mkOption {
default = false;
type = lib.types.bool;
type = types.bool;
description = "Disable client transparency support, which can be greatly detrimental to performance in some setups";
};
};
@@ -44,9 +47,9 @@ in
###### implementation
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
services.xserver.windowManager.session = singleton {
name = "awesome";
start = ''
${awesome}/bin/awesome ${lib.optionalString cfg.noArgb "--no-argb"} ${makeSearchPath cfg.luaModules} &
@@ -4,18 +4,21 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.berry;
in
{
###### interface
options = {
services.xserver.windowManager.berry.enable = lib.mkEnableOption "berry";
services.xserver.windowManager.berry.enable = mkEnableOption "berry";
};
###### implementation
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "berry";
start = ''
${pkgs.berry}/bin/berry &
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.bspwm;
in
@@ -11,14 +14,14 @@ in
{
options = {
services.xserver.windowManager.bspwm = {
enable = lib.mkEnableOption "bspwm";
enable = mkEnableOption "bspwm";
package = lib.mkPackageOption pkgs "bspwm" {
package = mkPackageOption pkgs "bspwm" {
example = "bspwm-unstable";
};
configFile = lib.mkOption {
type = with lib.types; nullOr path;
example = lib.literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
configFile = mkOption {
type = with types; nullOr path;
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
default = null;
description = ''
Path to the bspwm configuration file.
@@ -27,12 +30,12 @@ in
};
sxhkd = {
package = lib.mkPackageOption pkgs "sxhkd" {
package = mkPackageOption pkgs "sxhkd" {
example = "sxhkd-unstable";
};
configFile = lib.mkOption {
type = with lib.types; nullOr path;
example = lib.literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
configFile = mkOption {
type = with types; nullOr path;
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
default = null;
description = ''
Path to the sxhkd configuration file.
@@ -43,15 +46,15 @@ in
};
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "bspwm";
start = ''
export _JAVA_AWT_WM_NONREPARENTING=1
SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${
lib.optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\""
optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\""
} &
${cfg.package}/bin/bspwm ${lib.optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} &
${cfg.package}/bin/bspwm ${optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} &
waitPID=$!
'';
};
@@ -59,17 +62,17 @@ in
};
imports = [
(lib.mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ]
(mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ]
"Use services.xserver.windowManager.bspwm.enable and set services.xserver.windowManager.bspwm.package to pkgs.bspwm-unstable to use the unstable version of bspwm."
)
(lib.mkRemovedOptionModule [
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
"bspwm"
"startThroughSession"
] "bspwm package does not provide bspwm-session anymore.")
(lib.mkRemovedOptionModule [
(mkRemovedOptionModule [
"services"
"xserver"
"windowManager"
@@ -4,6 +4,9 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.clfswm;
in
@@ -11,13 +14,13 @@ in
{
options = {
services.xserver.windowManager.clfswm = {
enable = lib.mkEnableOption "clfswm";
package = lib.mkPackageOption pkgs [ "sbclPackages" "clfswm" ] { };
enable = mkEnableOption "clfswm";
package = mkPackageOption pkgs [ "sbclPackages" "clfswm" ] { };
};
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "clfswm";
start = ''
${cfg.package}/bin/clfswm &
@@ -4,15 +4,18 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.cwm;
in
{
options = {
services.xserver.windowManager.cwm.enable = lib.mkEnableOption "cwm";
services.xserver.windowManager.cwm.enable = mkEnableOption "cwm";
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "cwm";
start = ''
cwm &
@@ -1,4 +1,7 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xserver.windowManager.dwm;
@@ -11,8 +14,8 @@ in
options = {
services.xserver.windowManager.dwm = {
enable = lib.mkEnableOption "dwm";
package = lib.mkPackageOption pkgs "dwm" {
enable = mkEnableOption "dwm";
package = mkPackageOption pkgs "dwm" {
example = ''
pkgs.dwm.overrideAttrs (oldAttrs: rec {
patches = [
@@ -30,9 +33,9 @@ in
###### implementation
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton
services.xserver.windowManager.session = singleton
{ name = "dwm";
start =
''
@@ -4,18 +4,21 @@
pkgs,
...
}:
with lib;
let
cfg = config.services.xserver.windowManager.e16;
in
{
###### interface
options = {
services.xserver.windowManager.e16.enable = lib.mkEnableOption "e16";
services.xserver.windowManager.e16.enable = mkEnableOption "e16";
};
###### implementation
config = lib.mkIf cfg.enable {
services.xserver.windowManager.session = lib.singleton {
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "E16";
start = ''
${pkgs.e16}/bin/e16 &
@@ -29,7 +29,6 @@
, libltc
, libogg
, libpulseaudio
, librdf_raptor
, librdf_rasqal
, libsamplerate
, libsigcxx
@@ -133,7 +132,6 @@ stdenv.mkDerivation rec {
libltc
libogg
libpulseaudio
librdf_raptor
librdf_rasqal
libsamplerate
libsigcxx
@@ -3,13 +3,13 @@
buildGoModule rec {
pname = "discordo";
version = "0-unstable-2024-12-12";
version = "0-unstable-2024-12-22";
src = fetchFromGitHub {
owner = "ayn2op";
repo = pname;
rev = "c97307d5425ba0fef24f0bdd5b9d63f660e11b20";
hash = "sha256-I2rO0PKtxQUiyaAt4BmE4zvOmqShbydGwWbPmnzUjHY=";
rev = "9f15a6342413f68531402b8aeb5ed272159fc370";
hash = "sha256-8VBw7DsX/xnNkfiIe8jiG2oXjIp1tNT6wy6eTDBZxUg=";
};
vendorHash = "sha256-UTZIx4zXIMdQBQXfzk3+j43yx7vlitw4Mwmon8oYjd8=";
@@ -12,13 +12,13 @@
stdenv.mkDerivation rec {
pname = "treesheets";
version = "0-unstable-2024-12-11";
version = "0-unstable-2024-12-22";
src = fetchFromGitHub {
owner = "aardappel";
repo = "treesheets";
rev = "81e74a0f3f325ada0abe35211e90b74132f91470";
hash = "sha256-6Ao1dl0tRLAZZxx0xV7uaojuCO9i3bUIdccsZ37Jm/g=";
rev = "b3bf8f2763aa9efaac428107d62194582839df1b";
hash = "sha256-qY5DSFW6jnngvHCBgz9Go9Xsfo2nd7xDyZWuKSpyMMM=";
};
nativeBuildInputs = [
+5 -4
View File
@@ -120,12 +120,12 @@ in
stdenv.mkDerivation rec {
pname = "mplayer";
version = "1.5-unstable-2024-07-03";
version = "1.5-unstable-2024-12-21";
src = fetchsvn {
url = "svn://svn.mplayerhq.hu/mplayer/trunk";
rev = "38637";
hash = "sha256-9KQOB6QIs1VZhazJqW8dY4ASiMgoxV6davfpKgLPbmE=";
rev = "38668";
hash = "sha256-ezWYBkhiSBgf/SeTrO6sKGbL/IrX+82KXCIlqYMEtgY=";
};
prePatch = ''
@@ -276,7 +276,8 @@ stdenv.mkDerivation rec {
description = "Movie player that supports many video formats";
homepage = "http://mplayerhq.hu";
license = licenses.gpl2Only;
maintainers = [ ];
# Picking it up: no idea about the origin of some choices (but seems fine)
maintainers = [ maintainers.raskin ];
platforms = [
"i686-linux"
"x86_64-linux"
@@ -11,7 +11,9 @@
, lm_sensors
, iw
, iproute2
, pipewire
, withICUCalendar ? false
, withPipewire ? true
}:
rustPlatform.buildRustPackage rec {
@@ -27,15 +29,18 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-9jbJVnZhFbMYldBkRVSIiorUYDNtF3AAwNEpyNJXpjo=";
nativeBuildInputs = [ pkg-config makeWrapper ];
nativeBuildInputs = [ pkg-config makeWrapper ]
++ (lib.optionals withPipewire [ rustPlatform.bindgenHook ]);
buildInputs = [ dbus libpulseaudio notmuch openssl lm_sensors ];
buildInputs = [ dbus libpulseaudio notmuch openssl lm_sensors ]
++ (lib.optionals withPipewire [ pipewire ]);
buildFeatures = [
"notmuch"
"maildir"
"pulseaudio"
] ++ (lib.optionals withICUCalendar [ "icu_calendar" ]);
] ++ (lib.optionals withICUCalendar [ "icu_calendar" ])
++ (lib.optionals withPipewire [ "pipewire" ]);
prePatch = ''
substituteInPlace src/util.rs \
@@ -2,6 +2,7 @@
{
lib,
stdenv,
runCommand,
shellcheck,
}:
@@ -10,7 +11,7 @@
# Tests: ./tests.nix
{ src }:
let
inherit (lib) fileset pathType isPath;
inherit (lib) pathType isPath;
in
stdenv.mkDerivation {
name = "run-shellcheck";
@@ -18,10 +19,10 @@ stdenv.mkDerivation {
if
isPath src && pathType src == "regular" # note that for strings this would have been IFD, which we prefer to avoid
then
fileset.toSource {
root = dirOf src;
fileset = src;
}
runCommand "testers-shellcheck-src" { } ''
mkdir $out
cp ${src} $out
''
else
src;
nativeBuildInputs = [ shellcheck ];
@@ -6,9 +6,6 @@
testers,
runCommand,
}:
let
inherit (lib) fileset;
in
lib.recurseIntoAttrs {
example-dir =
@@ -16,12 +13,7 @@ lib.recurseIntoAttrs {
{
failure = testers.testBuildFailure (
testers.shellcheck {
src = fileset.toSource {
root = ./.;
fileset = fileset.unions [
./example.sh
];
};
src = ./src;
}
);
}
@@ -37,7 +29,7 @@ lib.recurseIntoAttrs {
{
failure = testers.testBuildFailure (
testers.shellcheck {
src = ./example.sh;
src = ./src/example.sh;
}
);
}
+3 -3
View File
@@ -6,20 +6,20 @@
buildGoModule rec {
pname = "atlantis";
version = "0.30.0";
version = "0.32.0";
src = fetchFromGitHub {
owner = "runatlantis";
repo = "atlantis";
rev = "v${version}";
hash = "sha256-hM4IycRE3/jiwFLqkU/jz9sPP9KTfeu8ouIJlqgPxmk=";
hash = "sha256-7D7msKDnHym3uiMJur2kCRf6MurwkMEKI+aYcwqOVX0=";
};
ldflags = [
"-X=main.version=${version}"
"-X=main.date=1970-01-01T00:00:00Z"
];
vendorHash = "sha256-uH+Q5NXBL1+LFa6tw3x2CE1B5QElqK9KuFeYQpCFAW0=";
vendorHash = "sha256-wPsEE6sR1GDD3Npdcf/JmeZc451+x9UBE8+DwXkj/qE=";
subPackages = [ "." ];
@@ -0,0 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19059a41b..6e3ae0ad7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,15 +82,7 @@ endif ()
find_package (Boost 1.38 REQUIRED
COMPONENTS filesystem iostreams program_options regex system)
-include(FetchContent)
-FetchContent_Declare(
- fmt
- GIT_REPOSITORY https://github.com/fmtlib/fmt.git
- GIT_TAG 10.2.1
- GIT_PROGRESS TRUE
- USES_TERMINAL_DOWNLOAD TRUE
-)
-FetchContent_MakeAvailable(fmt)
+find_package(fmt REQUIRED)
find_package(Snappy)
if (SNAPPY_FOUND)
+19 -16
View File
@@ -2,41 +2,44 @@
lib,
stdenv,
fetchurl,
fetchpatch,
cmake,
boost,
python3,
fmt,
versionCheckHook,
}:
stdenv.mkDerivation rec {
pname = "avro-c++";
version = "1.11.3";
version = "1.12.0";
src = fetchurl {
url = "mirror://apache/avro/avro-${version}/cpp/avro-cpp-${version}.tar.gz";
hash = "sha256-+6JCrvd+yBnQdWH8upN1FyGVbejQyujh8vMAtUszG64=";
hash = "sha256-8u33cSanWw7BrRZncr4Fg1HOo9dESL5+LO8gBQwPmKs=";
};
patches = [
# This patch fixes boost compatibility and can be removed when
# upgrading beyond 1.11.3 https://github.com/apache/avro/pull/1920
(fetchpatch {
name = "fix-boost-compatibility.patch";
url = "https://github.com/apache/avro/commit/016323828f147f185d03f50d2223a2f50bfafce1.patch";
hash = "sha256-hP/5J2JzSplMvg8EjEk98Vim8DfTyZ4hZ/WGiVwvM1A=";
})
./0001-get-rid-of-fmt-fetchcontent.patch
];
patchFlags = [ "-p3" ];
nativeBuildInputs = [
cmake
python3
];
buildInputs = [ boost ];
preConfigure = ''
substituteInPlace test/SchemaTests.cc --replace "BOOST_CHECKPOINT" "BOOST_TEST_CHECKPOINT"
substituteInPlace test/buffertest.cc --replace "BOOST_MESSAGE" "BOOST_TEST_MESSAGE"
'';
propagatedBuildInputs = [
boost
fmt
];
doCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/avrogencpp";
versionCheckProgramArg = [ "--version" ];
meta = {
description = "C++ library which implements parts of the Avro Specification";
+2 -2
View File
@@ -17,11 +17,11 @@ let
in
stdenv.mkDerivation rec {
pname = "bazarr";
version = "1.4.5";
version = "1.5.0";
src = fetchzip {
url = "https://github.com/morpheus65535/bazarr/releases/download/v${version}/bazarr.zip";
hash = "sha256-BV+ON+SavPc0ZUlIk6tlsvmWub8TiYSSJSRutZb1q+g=";
hash = "sha256-Q/KlqvVWhegSxkxHls0WwCClaQwkmLAfuzfi3X4xgAY=";
stripRoot = false;
};
+2 -2
View File
@@ -18,13 +18,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "bitwuzla";
version = "0.6.1";
version = "0.7.0";
src = fetchFromGitHub {
owner = "bitwuzla";
repo = "bitwuzla";
rev = finalAttrs.version;
hash = "sha256-auW+YeUCpl7SzVAMTyHxrWh6ShwElq6wTEP7Qf2M7jk=";
hash = "sha256-S8CtK8WEehUdOoqOmu5KnoqHFpCGrYWjZKv1st4M7bo=";
};
strictDeps = true;
+2 -2
View File
@@ -8,13 +8,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "bkcrack";
version = "1.7.0";
version = "1.7.1";
src = fetchFromGitHub {
owner = "kimci86";
repo = "bkcrack";
rev = "v${finalAttrs.version}";
hash = "sha256-smDmnqmYuFT3ip3ULQfiiF5YxkwzPwPYBujqq9GUyMs=";
hash = "sha256-88zAR1XE+C5UNmvY/ph1I1tL2nVGbywqh6zHRGbImXU=";
};
passthru.updateScript = nix-update-script { };
+3 -3
View File
@@ -7,13 +7,13 @@
buildGoModule {
pname = "bodyclose";
version = "0-unstable-2024-10-17";
version = "0-unstable-2024-12-22";
src = fetchFromGitHub {
owner = "timakin";
repo = "bodyclose";
rev = "adbc21e6bf369ca6d936dbb140733f34867639bd";
hash = "sha256-GNZNzXEZnIxep5BS1sBZsMl876FwwIkOBwHAMk/73fo=";
rev = "1db5c5ca4d6719fe28430df1ae8d337ee2ac09c7";
hash = "sha256-s5bWvpV6gHGEsuiNXJl2ZuyDaffD82/rCbusov3zsyw=";
};
vendorHash = "sha256-8grdJuV8aSETsJr2VazC/3ctfnGh3UgjOWD4/xf3uC8=";
+3 -3
View File
@@ -8,16 +8,16 @@
rustPlatform.buildRustPackage rec {
pname = "cairo";
version = "2.8.5";
version = "2.9.2";
src = fetchFromGitHub {
owner = "starkware-libs";
repo = "cairo";
rev = "v${version}";
hash = "sha256-zNSQVMF5ciGGUBQyPFvIVtePNMbJ3e0LXBmRWMohoGA=";
hash = "sha256-zjgCOrTlIPN4aU0+FCohJmISPiwpppj3zO/7unVi/iU=";
};
cargoHash = "sha256-jVQErw89rCm9f3uJftmyytru1xQa+FKsUkszHJWBGNU=";
cargoHash = "sha256-2qm2hL4M2xHidRYF9Fhxxn2IG22mPEBZW5yhu6wPVDY=";
# openssl crate requires perl during build process
nativeBuildInputs = [
+3 -3
View File
@@ -9,16 +9,16 @@
buildGoModule rec {
pname = "clusterctl";
version = "1.9.0";
version = "1.9.2";
src = fetchFromGitHub {
owner = "kubernetes-sigs";
repo = "cluster-api";
rev = "v${version}";
hash = "sha256-ENbNgstu+YsNESJ2RsJri3B4zO8UI3Dt60/8AFgsxn8=";
hash = "sha256-H86EkdGmzvQDGC/a+J6ISB0aYkJabBjE2P6Ab5FRlv4=";
};
vendorHash = "sha256-rjo8fwUAnVDM7XvY31I5z6RMRSrNSur6wH7NfGTIdcc=";
vendorHash = "sha256-JSWk6FgjWnDcVmp/9+M0x7QsiX08QtIOn5RRifjs2mI=";
subPackages = [ "cmd/clusterctl" ];
+5 -5
View File
@@ -23,10 +23,10 @@ let
hash =
{
x86_64-linux = "sha256-xbMiPmFGte4I6p+Zt4HaLL4MuHoMs++gf5iVPl7+h70=";
aarch64-linux = "sha256-2bu8cI0u8Q3mCxZFoM0W/gQ4BipLUIoVe2e0a16ZQco=";
x86_64-darwin = "sha256-lGRqxZxIpioTA5I9lsWIQ8S7AN8AXR7NGgSMCNN3cQI=";
aarch64-darwin = "sha256-MGqT4Jhq81rvnMhQtg+N0C4ElOfUvLpVBq7EtwKztOE=";
x86_64-linux = "sha256-/VkobDCai9+Lac0TCzm9gg/pNFDA1T2OJiad3qdz/2o=";
aarch64-linux = "sha256-glJRQIFSs5D7b3BVblaL0o8Rndh3QuCup45AfRWymG0=";
x86_64-darwin = "sha256-TBCgbaJ5Yyp+I8VCljYf3tlNnVaLkfwusJMlfY+Rggo=";
aarch64-darwin = "sha256-MfJ/zIfmKJN4Fe6a50NwAqvetxB/W+BriQ+5mEIhWMg=";
}
.${system} or throwSystem;
@@ -35,7 +35,7 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "codeium";
version = "1.30.2";
version = "1.30.18";
src = fetchurl {
name = "${finalAttrs.pname}-${finalAttrs.version}.gz";
url = "https://github.com/Exafunction/codeium/releases/download/language-server-v${finalAttrs.version}/language_server_${plat}.gz";
@@ -7,16 +7,16 @@
buildGoModule rec {
pname = "coroot-node-agent";
version = "1.22.2";
version = "1.23.1";
src = fetchFromGitHub {
owner = "coroot";
repo = "coroot-node-agent";
rev = "v${version}";
hash = "sha256-b9JI0q6CF4D+sdfuwTkouAwJF/ghJByzsQBehwXttoU=";
hash = "sha256-kisYm0bM+IZJ9qRx1lDlcFtZIdjsNfu6Ao75q84ruDM=";
};
vendorHash = "sha256-OZj3t8eFDbk2zZ+zGlgV8o9VC4/vYalIEm2dhD2JwK8=";
vendorHash = "sha256-EXI4xpo4j/EzugW8zyu0Dvk2i6bYFBIF+SsL6GZ+J2Q=";
buildInputs = [ systemdLibs ];
+2 -2
View File
@@ -20,11 +20,11 @@ let
in
stdenv.mkDerivation rec {
pname = "coursier";
version = "2.1.19";
version = "2.1.22";
src = fetchurl {
url = "https://github.com/coursier/coursier/releases/download/v${version}/coursier";
hash = "sha256-E6LEi2m/BMCT9T5UYzMbIcoj42MKP2OIc27XGDMUI7w=";
hash = "sha256-0ugWgvG3AHt7h8F8W8kCksyx93YO51i5StqGAEZXGmg=";
};
dontUnpack = true;
+3 -3
View File
@@ -8,13 +8,13 @@
buildGoModule rec {
pname = "deck";
version = "1.40.3";
version = "1.42.1";
src = fetchFromGitHub {
owner = "Kong";
repo = "deck";
rev = "refs/tags/v${version}";
hash = "sha256-n6WASCtDwBX4FASSWI17JpU7rDXIeSidPWhj/MB2tUs=";
hash = "sha256-+HXTBTE8oEvyEwzwJbM0snVV0sKcKFHFnHB1iJ+4LJc=";
};
nativeBuildInputs = [ installShellFiles ];
@@ -27,7 +27,7 @@ buildGoModule rec {
];
proxyVendor = true; # darwin/linux hash mismatch
vendorHash = "sha256-csoSvu7uce1diB4EsQCRRt08mX+rJoxfZqAtaoo0x4M=";
vendorHash = "sha256-YFEiv+mbU8ZE9u1lL4cZUo+7sVSu9P1UEkuKyAGwlkg=";
postInstall = ''
installShellCompletion --cmd deck \
+3 -3
View File
@@ -2,18 +2,18 @@
buildGoModule rec {
pname = "dolt";
version = "1.44.0";
version = "1.45.1";
src = fetchFromGitHub {
owner = "dolthub";
repo = "dolt";
rev = "v${version}";
sha256 = "sha256-sumd663G9Tztkuo21w7AE7ylzH2GnwNIL+/cGQz1SX8=";
sha256 = "sha256-O5y3AdFOtxNwpt8uGkTC7XHY1M/6Cv3vTyeHyVlTRGw=";
};
modRoot = "./go";
subPackages = [ "cmd/dolt" ];
vendorHash = "sha256-bHLudlThXd4ttgmDyVwGD+SI9KJxIMo2iZARREZUSxk=";
vendorHash = "sha256-h9HE90mOaDid2/uZcDBKZdbi6K1P2o27LZDnLAm+XSE=";
proxyVendor = true;
doCheck = false;
+3 -3
View File
@@ -8,16 +8,16 @@
rustPlatform.buildRustPackage rec {
pname = "dumbpipe";
version = "0.21.0";
version = "0.22.0";
src = fetchFromGitHub {
owner = "n0-computer";
repo = pname;
rev = "v${version}";
hash = "sha256-WJwjxVtv022Qm1NUnibh2jq1g0P/hi0HjeA9l7fMdRw=";
hash = "sha256-NNSR8qAikwXC0bJ4jGQQ2gZZmgPin5M6xAaY2YhuBvw=";
};
cargoHash = "sha256-oq8jWRFVEB9sMZ7ufke5D1BMpGms8WJWVL/LGV+g/GI=";
cargoHash = "sha256-yAz/VjdS4FeKKM9vjOPcASGByNQp2StvrFHwJnk2YUg=";
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin (
with darwin.apple_sdk.frameworks;
+2 -2
View File
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "duo-unix";
version = "2.0.2";
version = "2.0.4";
src = fetchurl {
url = "https://dl.duosecurity.com/duo_unix-${version}.tar.gz";
sha256 = "sha256-7huWd71SdnTe1ef8OoHgQKjYQKVpE8k/oNT7bA+OJR0=";
sha256 = "sha256-P7IVX4RyMER2BX99FJUgv2JZx7KddktiJ101rTJJwmQ=";
};
buildInputs = [ pam openssl zlib ];
+2 -1
View File
@@ -88,7 +88,8 @@ let
paramiko
pyasn1
pycrypto
pydrive2
# Currently marked as broken.
# pydrive2
future
]
++ paramiko.optional-dependencies.invoke;
+3 -3
View File
@@ -6,16 +6,16 @@
buildGoModule rec {
pname = "eclint";
version = "0.5.0";
version = "0.5.1";
src = fetchFromGitLab {
owner = "greut";
repo = pname;
rev = "v${version}";
hash = "sha256-x0dBiRHaDxKrTCR2RfP2/bpBo6xewu8FX7Bv4ugaUAY=";
hash = "sha256-XY+D0bRIgWTm2VH+uDVodYeyGeu+8Xyyq4xDvTDLii4=";
};
vendorHash = "sha256-aNQuALDe37lsmTGpClIBOQJlL0NFSAZCgcmTjx0kP+U=";
vendorHash = "sha256-4bka3GRl75aUYpZrWuCIvKNwPY8ykp25e+kn+G6JQ/I=";
ldflags = [ "-X main.version=${version}" ];
@@ -1,25 +1,19 @@
{
callPackage,
lib,
nix-gitignore,
python3Packages,
}:
let
inherit (lib) fileset;
helpers = callPackage ./helpers.nix { };
pythonPackages = python3Packages;
in
pythonPackages.buildPythonApplication {
version = "0.1.0";
pname = "flatten-references-graph";
src = fileset.toSource {
root = ./src;
fileset = fileset.unions [
./src/.flake8
./src/flatten_references_graph
./src/setup.py
];
};
# Note: this uses only ./src/.gitignore
src = nix-gitignore.gitignoreSource [ ] ./src;
propagatedBuildInputs = with pythonPackages; [
igraph
+69 -11
View File
@@ -1,12 +1,13 @@
{
lib,
python3,
python3Packages,
fetchFromGitHub,
stdenv,
}:
python3.pkgs.buildPythonApplication rec {
python3Packages.buildPythonApplication rec {
pname = "flexget";
version = "3.13.2";
version = "3.13.5";
pyproject = true;
# Fetch from GitHub in order to use `requirements.in`
@@ -14,15 +15,15 @@ python3.pkgs.buildPythonApplication rec {
owner = "Flexget";
repo = "Flexget";
tag = "v${version}";
hash = "sha256-UjKYHZwAOOv3Adj13r2zJkVmxwEpJLQk87UslddX9Qk=";
hash = "sha256-R6E5NWnrnezJsDm+Nnqgibv4e6mXVrOrKaCl/MBqUnY=";
};
# relax dep constrains, keep environment constraints
pythonRelaxDeps = true;
build-system = with python3.pkgs; [ setuptools ];
build-system = with python3Packages; [ setuptools ];
dependencies = with python3.pkgs; [
dependencies = with python3Packages; [
# See https://github.com/Flexget/Flexget/blob/master/pyproject.toml
# and https://github.com/Flexget/Flexget/blob/develop/requirements.txt
apscheduler
@@ -40,6 +41,7 @@ python3.pkgs.buildPythonApplication rec {
pyrss2gen
python-dateutil
pyyaml
rarfile
rebulk
requests
rich
@@ -66,6 +68,7 @@ python3.pkgs.buildPythonApplication rec {
deluge-client
cloudscraper
python-telegram-bot
boto3
];
pythonImportsCheck = [
@@ -93,14 +96,69 @@ python3.pkgs.buildPythonApplication rec {
"flexget.plugins.services.pogcal_acquired"
];
# ~400 failures
doCheck = false;
nativeCheckInputs = [
python3Packages.pytestCheckHook
python3Packages.pytest-vcr
python3Packages.paramiko
];
meta = with lib; {
doCheck = !stdenv.isDarwin;
disabledTests = [
# reach the Internet
"TestExistsMovie"
"TestImdb"
"TestImdbLookup"
"TestImdbParser"
"TestInputHtml"
"TestInputSites"
"TestNfoLookupWithMovies"
"TestNpoWatchlistInfo"
"TestNpoWatchlistLanguageTheTVDBLookup"
"TestNpoWatchlistPremium"
"TestPlex"
"TestRadarrListActions"
"TestRssOnline"
"TestSeriesRootAPI"
"TestSftpDownload"
"TestSftpList"
"TestSonarrListActions"
"TestSubtitleList"
"TestTMDBMovieLookupAPI"
"TestTVDBEpisodeABSLookupAPI"
"TestTVDBEpisodeAirDateLookupAPI"
"TestTVDBEpisodeLookupAPI"
"TestTVDBExpire"
"TestTVDBFavorites"
"TestTVDBLanguages"
"TestTVDBList"
"TestTVDBLookup"
"TestTVDBLookup"
"TestTVDBSeriesActorsLookupAPI"
"TestTVDBSeriesLookupAPI"
"TestTVDSearchIMDBLookupAPI"
"TestTVDSearchNameLookupAPI"
"TestTVDSearchZAP2ITLookupAPI"
"TestTVMAzeSeriesLookupAPI"
"TestTVMazeSeasonLookup"
"TestTVMazeShowLookup"
"TestTVMazeUnicodeLookup"
"TestTaskParsing::test_selected_parser_cleared"
"TestTheTVDBLanguages"
"TestTheTVDBList"
"TestTmdbLookup"
"TestURLRewriters"
"TestURLRewriters::test_ettv"
# others
"TestRegexp"
"TestYamlLists"
];
meta = {
homepage = "https://flexget.com/";
changelog = "https://github.com/Flexget/Flexget/releases/tag/v${version}";
description = "Multipurpose automation tool for all of your media";
license = licenses.mit;
maintainers = with maintainers; [ pbsds ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pbsds ];
};
}
-62
View File
@@ -1,62 +0,0 @@
{
pname,
version,
outputs,
meta,
lib,
stdenvNoCC,
fetchurl,
_7zz,
makeWrapper,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
inherit pname version outputs;
src = fetchurl {
url = "https://release.files.ghostty.org/${finalAttrs.version}/Ghostty.dmg";
sha256 = "sha256-CR96Kz9BYKFtfVKygiEku51XFJk4FfYqfXACeYQ3JlI=";
};
nativeBuildInputs = [
_7zz
makeWrapper
];
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
mv Ghostty.app $out/Applications/
makeWrapper $out/Applications/Ghostty.app/Contents/MacOS/ghostty $out/bin/ghostty
runHook postInstall
'';
postFixup =
let
resources = "$out/Applications/Ghostty.app/Contents/Resources";
in
''
mkdir -p $man/share
ln -s ${resources}/man $man/share/man
mkdir -p $terminfo/share
ln -s ${resources}/terminfo $terminfo/share/terminfo
mkdir -p $shell_integration
for folder in "${resources}/ghostty/shell-integration"/*; do
ln -s $folder $shell_integration/$(basename "$folder")
done
mkdir -p $vim
for folder in "${resources}/vim/vimfiles"/*; do
ln -s $folder $vim/$(basename "$folder")
done
'';
meta = meta // {
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
})
+7 -7
View File
@@ -1,4 +1,5 @@
# generated by zon2nix (https://github.com/Cloudef/zig2nix)
{
lib,
linkFarm,
@@ -8,14 +9,13 @@
zig,
name ? "zig-packages",
}:
with builtins;
with lib;
let
unpackZigArtifact =
{
name,
artifact,
}:
{ name, artifact }:
runCommandLocal name
{
nativeBuildInputs = [ zig ];
@@ -169,11 +169,11 @@ linkFarm name [
};
}
{
name = "12204358b2848ffd993d3425055bff0a5ba9b1b60bead763a6dea0517965d7290a6c";
name = "1220cc25b537556a42b0948437c791214c229efb78b551c80b1e9b18d70bf0498620";
path = fetchZigArtifact {
name = "iterm2_themes";
url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/d6c42066b3045292e0b1154ad84ff22d6863ebf7.tar.gz";
hash = "sha256-s6us3PkOPmQCtLS9QNPM7BDLt7x+37KbmYF9d4NMD/c=";
url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/e030599a6a6e19fcd1ea047c7714021170129d56.tar.gz";
hash = "sha256-hFGjD0rNfZ7Qd7uJZgVn+FmIVXunbjLT+E1BoXhXoJE=";
};
}
{
-178
View File
@@ -1,178 +0,0 @@
{
pname,
version,
outputs,
meta,
lib,
stdenv,
bzip2,
callPackage,
fetchFromGitHub,
fontconfig,
freetype,
glib,
glslang,
harfbuzz,
libGL,
libX11,
libadwaita,
ncurses,
nixosTests,
oniguruma,
pandoc,
pkg-config,
removeReferencesTo,
versionCheckHook,
wrapGAppsHook4,
zig_0_13,
# Usually you would override `zig.hook` with this, but we do that internally
# since upstream recommends a non-default level
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/PACKAGING.md#build-options
optimizeLevel ? "ReleaseFast",
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/build.zig#L106
withAdwaita ? true,
}:
let
zig_hook = zig_0_13.hook.overrideAttrs {
zig_default_flags = "-Dcpu=baseline -Doptimize=${optimizeLevel} --color off";
};
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/apprt.zig#L72-L76
appRuntime = if stdenv.hostPlatform.isLinux then "gtk" else "none";
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/font/main.zig#L94
fontBackend = if stdenv.hostPlatform.isDarwin then "coretext" else "fontconfig_freetype";
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/renderer.zig#L51-L52
renderer = if stdenv.hostPlatform.isDarwin then "metal" else "opengl";
in
stdenv.mkDerivation (finalAttrs: {
inherit
pname
version
outputs
meta
;
src = fetchFromGitHub {
owner = "ghostty-org";
repo = "ghostty";
tag = "v${finalAttrs.version}";
hash = "sha256-AHI1Z4mfgXkNwQA8xYq4tS0/BARbHL7gQUT41vCxQTM=";
};
# Avoid using runtime hacks to help find X11
postPatch = lib.optionalString (appRuntime == "gtk") ''
substituteInPlace src/apprt/gtk/x11.zig \
--replace-warn 'std.DynLib.open("libX11.so");' 'std.DynLib.open("${lib.getLib libX11}/lib/libX11.so");'
'';
deps = callPackage ./deps.nix {
name = "${finalAttrs.pname}-cache-${finalAttrs.version}";
};
strictDeps = true;
nativeBuildInputs =
[
ncurses
pandoc
pkg-config
removeReferencesTo
zig_hook
]
++ lib.optionals (appRuntime == "gtk") [
glib # Required for `glib-compile-schemas`
wrapGAppsHook4
];
buildInputs =
[
glslang
oniguruma
]
++ lib.optional (appRuntime == "gtk" && withAdwaita) libadwaita
++ lib.optional (appRuntime == "gtk") libX11
++ lib.optional (renderer == "opengl") libGL
++ lib.optionals (fontBackend == "fontconfig_freetype") [
bzip2
fontconfig
freetype
harfbuzz
];
zigBuildFlags =
[
"--system"
"${finalAttrs.deps}"
"-Dversion-string=${finalAttrs.version}"
"-Dapp-runtime=${appRuntime}"
"-Dfont-backend=${fontBackend}"
"-Dgtk-adwaita=${lib.boolToString withAdwaita}"
"-Drenderer=${renderer}"
]
++ lib.mapAttrsToList (name: package: "-fsys=${name} --search-prefix ${lib.getLib package}") {
inherit glslang;
};
zigCheckFlags = finalAttrs.zigBuildFlags;
# Unit tests currently fail inside the sandbox
doCheck = false;
/**
Ghostty really likes all of it's resources to be in the same directory, so link them back after we split them
- https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/os/resourcesdir.zig#L11-L52
- https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/termio/Exec.zig#L745-L750
- https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/termio/Exec.zig#L818-L834
terminfo and shell integration should also be installable on remote machines
```nix
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.ghostty.terminfo ];
programs.bash = {
interactiveShellInit = ''
if [[ "$TERM" == "xterm-ghostty" ]]; then
builtin source ${pkgs.ghostty.shell_integration}/bash/ghostty.bash
fi
'';
};
}
```
*/
postFixup = ''
ln -s $man/share/man $out/share/man
moveToOutput share/terminfo $terminfo
ln -s $terminfo/share/terminfo $out/share/terminfo
mv $out/share/ghostty/shell-integration $shell_integration
ln -s $shell_integration $out/share/ghostty/shell-integration
mv $out/share/vim/vimfiles $vim
rmdir $out/share/vim
ln -s $vim $out/share/vim-plugins
remove-references-to -t ${finalAttrs.deps} $out/bin/.ghostty-wrapped
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgramArg = [ "--version" ];
passthru = {
tests = lib.optionalAttrs stdenv.hostPlatform.isLinux {
inherit (nixosTests) allTerminfo;
nixos = nixosTests.terminal-emulators.ghostty;
};
};
})
+163 -25
View File
@@ -1,12 +1,50 @@
{
stdenvNoCC,
callPackage,
lib,
stdenv,
bzip2,
callPackage,
fetchFromGitHub,
fontconfig,
freetype,
glib,
glslang,
harfbuzz,
libGL,
libX11,
libadwaita,
ncurses,
nixosTests,
oniguruma,
pandoc,
pkg-config,
removeReferencesTo,
versionCheckHook,
wrapGAppsHook4,
zig_0_13,
# Usually you would override `zig.hook` with this, but we do that internally
# since upstream recommends a non-default level
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/PACKAGING.md#build-options
optimizeLevel ? "ReleaseFast",
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/build.zig#L106
withAdwaita ? true,
}:
let
zig_hook = zig_0_13.hook.overrideAttrs {
zig_default_flags = "-Dcpu=baseline -Doptimize=${optimizeLevel} --color off";
};
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/apprt.zig#L72-L76
appRuntime = if stdenv.hostPlatform.isLinux then "gtk" else "none";
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/font/main.zig#L94
fontBackend = if stdenv.hostPlatform.isDarwin then "coretext" else "fontconfig_freetype";
# https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/renderer.zig#L51-L52
renderer = if stdenv.hostPlatform.isDarwin then "metal" else "opengl";
in
stdenv.mkDerivation (finalAttrs: {
pname = "ghostty";
version = "1.0.0";
version = "1.0.1";
outputs = [
"out"
"man"
@@ -14,6 +52,122 @@ let
"terminfo"
"vim"
];
src = fetchFromGitHub {
owner = "ghostty-org";
repo = "ghostty";
tag = "v${finalAttrs.version}";
hash = "sha256-BiXFNeoL+BYpiqzCuDIrZGQ6JVI8cBOXerJH48CbnxU=";
};
deps = callPackage ./deps.nix {
name = "${finalAttrs.pname}-cache-${finalAttrs.version}";
};
strictDeps = true;
nativeBuildInputs =
[
ncurses
pandoc
pkg-config
removeReferencesTo
zig_hook
]
++ lib.optionals (appRuntime == "gtk") [
glib # Required for `glib-compile-schemas`
wrapGAppsHook4
];
buildInputs =
[
glslang
oniguruma
]
++ lib.optional (appRuntime == "gtk" && withAdwaita) libadwaita
++ lib.optional (appRuntime == "gtk") libX11
++ lib.optional (renderer == "opengl") libGL
++ lib.optionals (fontBackend == "fontconfig_freetype") [
bzip2
fontconfig
freetype
harfbuzz
];
zigBuildFlags =
[
"--system"
"${finalAttrs.deps}"
"-Dversion-string=${finalAttrs.version}"
"-Dapp-runtime=${appRuntime}"
"-Dfont-backend=${fontBackend}"
"-Dgtk-adwaita=${lib.boolToString withAdwaita}"
"-Drenderer=${renderer}"
]
++ lib.mapAttrsToList (name: package: "-fsys=${name} --search-prefix ${lib.getLib package}") {
inherit glslang;
};
zigCheckFlags = finalAttrs.zigBuildFlags;
doCheck = true;
/**
Ghostty really likes all of it's resources to be in the same directory, so link them back after we split them
- https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/os/resourcesdir.zig#L11-L52
- https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/termio/Exec.zig#L745-L750
- https://github.com/ghostty-org/ghostty/blob/4b4d4062dfed7b37424c7210d1230242c709e990/src/termio/Exec.zig#L818-L834
terminfo and shell integration should also be installable on remote machines
```nix
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.ghostty.terminfo ];
programs.bash = {
interactiveShellInit = ''
if [[ "$TERM" == "xterm-ghostty" ]]; then
builtin source ${pkgs.ghostty.shell_integration}/bash/ghostty.bash
fi
'';
};
}
```
*/
postFixup = ''
ln -s $man/share/man $out/share/man
moveToOutput share/terminfo $terminfo
ln -s $terminfo/share/terminfo $out/share/terminfo
mv $out/share/ghostty/shell-integration $shell_integration
ln -s $shell_integration $out/share/ghostty/shell-integration
mv $out/share/vim/vimfiles $vim
rmdir $out/share/vim
ln -s $vim $out/share/vim-plugins
remove-references-to -t ${finalAttrs.deps} $out/bin/.ghostty-wrapped
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgramArg = [ "--version" ];
passthru = {
tests = lib.optionalAttrs stdenv.hostPlatform.isLinux {
inherit (nixosTests) allTerminfo;
nixos = nixosTests.terminal-emulators.ghostty;
};
};
meta = {
description = "Fast, native, feature-rich terminal emulator pushing modern features";
longDescription = ''
@@ -24,14 +178,15 @@ let
'';
homepage = "https://ghostty.org/";
downloadPage = "https://ghostty.org/download";
changelog = "https://ghostty.org/docs/install/release-notes/${
builtins.replaceStrings [ "." ] [ "-" ] finalAttrs.version
}";
license = lib.licenses.mit;
mainProgram = "ghostty";
maintainers = with lib.maintainers; [
jcollie
pluiedev
getchoo
DimitarNestorov
];
outputsToInstall = [
"out"
@@ -40,24 +195,7 @@ let
"terminfo"
];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
# Issues finding the SDK in the sandbox
broken = stdenv.hostPlatform.isDarwin;
};
in
if stdenvNoCC.hostPlatform.isDarwin then
callPackage ./darwin.nix {
inherit
pname
version
outputs
meta
;
}
else
callPackage ./linux.nix {
inherit
pname
version
outputs
meta
;
}
})
+2 -2
View File
@@ -7,13 +7,13 @@
}:
crystal.buildCrystalPackage rec {
pname = "gi-crystal";
version = "0.22.2";
version = "0.24.0";
src = fetchFromGitHub {
owner = "hugopl";
repo = "gi-crystal";
rev = "v${version}";
hash = "sha256-JfBbKqobikpTGMryeO86zZ46EbOHybem+Cc5FZEL6i4=";
hash = "sha256-0LsYREn4zWLQYUTpNWJhLLHWmg7UQzxOoQiAMmw3ZXQ=";
};
# Make sure gi-crystal picks up the name of the so or dylib and not the leading nix store path

Some files were not shown because too many files have changed in this diff Show More