From fece49bd62f4dc0636c0816a65733e260433035b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 27 Dec 2022 04:24:56 +0100 Subject: [PATCH 1/3] vte: allow to build without any gtk --- pkgs/development/libraries/vte/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/vte/default.nix b/pkgs/development/libraries/vte/default.nix index 7a998b409c2b..b97eecc280a2 100644 --- a/pkgs/development/libraries/vte/default.nix +++ b/pkgs/development/libraries/vte/default.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { pname = "vte"; version = "0.74.1"; - outputs = [ "out" "dev" "devdoc" ]; + outputs = [ "out" "dev" ] + ++ lib.optional (gtkVersion != null) "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -75,9 +76,11 @@ stdenv.mkDerivation rec { systemd ]; - propagatedBuildInputs = assert (gtkVersion == "3" || gtkVersion == "4"); [ - # Required by vte-2.91.pc. - (if gtkVersion == "3" then gtk3 else gtk4) + # Required by vte-2.91.pc. + propagatedBuildInputs = lib.optionals (gtkVersion != null) [ + (assert (gtkVersion == "3" || gtkVersion == "4"); + if gtkVersion == "3" then gtk3 else gtk4) + ] ++ [ glib pango ]; From 8cd995ce1341e90e7433568d1c98d657276beceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 27 Dec 2022 04:25:05 +0100 Subject: [PATCH 2/3] nixos/no-x-libs: add vte --- nixos/modules/config/no-x-libs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/config/no-x-libs.nix b/nixos/modules/config/no-x-libs.nix index ec26d4b12eff..bfbef6172cb5 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -78,6 +78,7 @@ with lib; # translateManpages -> perlPackages.po4a -> texlive-combined-basic -> texlive-core-big -> libX11 util-linux = super.util-linux.override { translateManpages = false; }; vim-full = super.vim-full.override { guiSupport = false; }; + vte = super.vte.override { gtkVersion = null; }; zbar = super.zbar.override { enableVideo = false; withXorg = false; }; })); }; From 577bb277aa3ccab68942424aca71cf44b03b39df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 19 Jul 2023 13:54:16 +0200 Subject: [PATCH 3/3] nixos/vte: use vte without any GUI dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we just need the script, borrowed from environment.noXLibs On my system this reduced the closure size by ~100MB ▶ nix path-info -Sh /nix/var/nix/profiles/system-76-link/ /nix/store/adybwlzyf3qa56irabblzlyjsr74amb9-nixos-system-francium-23.11 6.5G ▶ nix path-info -S /nix/var/nix/profiles/system-76-link/ /nix/store/adybwlzyf3qa56irabblzlyjsr74amb9-nixos-system-francium-23.11 6956572064 ▶ nix path-info -Sh /nix/var/nix/profiles/system-77-link/ /nix/store/wgs6wlq2i911q2r1n5fqbs9vzmp8qy26-nixos-system-francium-23.11 6.4G ▶ nix path-info -S /nix/var/nix/profiles/system-77-link/ /nix/store/wgs6wlq2i911q2r1n5fqbs9vzmp8qy26-nixos-system-francium-23.11 6856836056 --- nixos/modules/config/vte.nix | 4 +--- pkgs/development/libraries/vte/default.nix | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/nixos/modules/config/vte.nix b/nixos/modules/config/vte.nix index a969607f6e0b..48f85246560a 100644 --- a/nixos/modules/config/vte.nix +++ b/nixos/modules/config/vte.nix @@ -1,5 +1,3 @@ -# VTE - { config, pkgs, lib, ... }: with lib; @@ -9,7 +7,7 @@ let vteInitSnippet = '' # Show current working directory in VTE terminals window title. # Supports both bash and zsh, requires interactive shell. - . ${pkgs.vte}/etc/profile.d/vte.sh + . ${pkgs.vte.override { gtkVersion = null; }}/etc/profile.d/vte.sh ''; in diff --git a/pkgs/development/libraries/vte/default.nix b/pkgs/development/libraries/vte/default.nix index b97eecc280a2..66d26b2a0849 100644 --- a/pkgs/development/libraries/vte/default.nix +++ b/pkgs/development/libraries/vte/default.nix @@ -69,6 +69,7 @@ stdenv.mkDerivation rec { cairo fribidi gnutls + pango # duplicated with propagatedBuildInputs to support gtkVersion == null pcre2 zlib icu @@ -80,7 +81,6 @@ stdenv.mkDerivation rec { propagatedBuildInputs = lib.optionals (gtkVersion != null) [ (assert (gtkVersion == "3" || gtkVersion == "4"); if gtkVersion == "3" then gtk3 else gtk4) - ] ++ [ glib pango ];