From 9f1bf3168f9ce301ad8cf2fc81cdd3b001a55b35 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 21 Oct 2021 15:52:16 +0800 Subject: [PATCH 1/4] gnome.file-roller: format --- .../gnome/apps/file-roller/default.nix | 52 +++++++++++++++++-- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/pkgs/desktops/gnome/apps/file-roller/default.nix b/pkgs/desktops/gnome/apps/file-roller/default.nix index a2642865200..fce36e23bba 100644 --- a/pkgs/desktops/gnome/apps/file-roller/default.nix +++ b/pkgs/desktops/gnome/apps/file-roller/default.nix @@ -1,6 +1,27 @@ -{ lib, stdenv, fetchurl, glib, gtk3, meson, ninja, pkg-config, gnome, gettext, itstool, libxml2, libarchive -, file, json-glib, python3, wrapGAppsHook, desktop-file-utils, libnotify, nautilus, glibcLocales -, unzip, cpio }: +{ lib +, stdenv +, fetchurl +, desktop-file-utils +, gettext +, glibcLocales +, itstool +, libxml2 +, meson +, ninja +, pkg-config +, python3 +, wrapGAppsHook +, cpio +, file +, glib +, gnome +, gtk3 +, json-glib +, libarchive +, libnotify +, nautilus +, unzip +}: stdenv.mkDerivation rec { pname = "file-roller"; @@ -13,9 +34,30 @@ stdenv.mkDerivation rec { LANG = "en_US.UTF-8"; # postinstall.py - nativeBuildInputs = [ meson ninja gettext itstool pkg-config libxml2 python3 wrapGAppsHook glibcLocales desktop-file-utils ]; + nativeBuildInputs = [ + desktop-file-utils + gettext + glibcLocales + itstool + libxml2 + meson + ninja + pkg-config + python3 + wrapGAppsHook + ]; - buildInputs = [ glib gtk3 json-glib libarchive file gnome.adwaita-icon-theme libnotify nautilus cpio ]; + buildInputs = [ + cpio + file + glib + gnome.adwaita-icon-theme + gtk3 + json-glib + libarchive + libnotify + nautilus + ]; PKG_CONFIG_LIBNAUTILUS_EXTENSION_EXTENSIONDIR = "${placeholder "out"}/lib/nautilus/extensions-3.0"; From af97bf5624a4bf22d7e50fded4a23e32231ab4f7 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 21 Oct 2021 17:07:23 +0800 Subject: [PATCH 2/4] pantheon.file-roller: init --- pkgs/desktops/gnome/apps/file-roller/default.nix | 16 +++++++++++++++- pkgs/desktops/pantheon/default.nix | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome/apps/file-roller/default.nix b/pkgs/desktops/gnome/apps/file-roller/default.nix index fce36e23bba..c4c489dae08 100644 --- a/pkgs/desktops/gnome/apps/file-roller/default.nix +++ b/pkgs/desktops/gnome/apps/file-roller/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, fetchpatch , desktop-file-utils , gettext , glibcLocales @@ -20,7 +21,9 @@ , libarchive , libnotify , nautilus +, pantheon , unzip +, withPantheon ? false }: stdenv.mkDerivation rec { @@ -32,6 +35,15 @@ stdenv.mkDerivation rec { sha256 = "039w1dcpa5ypmv6sm634alk9vbcdkyvy595vkh5gn032jsiqca2a"; }; + patches = lib.optionals withPantheon [ + # Make this respect dark mode settings from Pantheon + # https://github.com/elementary/fileroller/ + (fetchpatch { + url = "https://raw.githubusercontent.com/elementary/fileroller/f183eac36c68c9c9441e72294d4e305cf5fe36ed/fr-application-prefers-color-scheme.patch"; + sha256 = "sha256-d/sqf4Oen9UrzYqru7Ck15o/6g6WfxRDH/iAGFXgYAA="; + }) + ]; + LANG = "en_US.UTF-8"; # postinstall.py nativeBuildInputs = [ @@ -57,6 +69,8 @@ stdenv.mkDerivation rec { libarchive libnotify nautilus + ] ++ lib.optionals withPantheon [ + pantheon.granite ]; PKG_CONFIG_LIBNAUTILUS_EXTENSION_EXTENSIONDIR = "${placeholder "out"}/lib/nautilus/extensions-3.0"; @@ -86,6 +100,6 @@ stdenv.mkDerivation rec { description = "Archive manager for the GNOME desktop environment"; license = licenses.gpl2Plus; platforms = platforms.linux; - maintainers = teams.gnome.members; + maintainers = teams.gnome.members ++ teams.pantheon.members; }; } diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix index 668638c1bfe..61436ba57ae 100644 --- a/pkgs/desktops/pantheon/default.nix +++ b/pkgs/desktops/pantheon/default.nix @@ -73,6 +73,8 @@ lib.makeScope pkgs.newScope (self: with self; { evince = pkgs.evince.override { withPantheon = true; }; + file-roller = pkgs.gnome.file-roller.override { withPantheon = true; }; + sideload = callPackage ./apps/sideload { }; #### DESKTOP From d34be690548c285e73b0343cc38898480ae99eaf Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 21 Oct 2021 17:08:22 +0800 Subject: [PATCH 3/4] nixos/file-roller: add option for specify package --- nixos/modules/programs/file-roller.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/nixos/modules/programs/file-roller.nix b/nixos/modules/programs/file-roller.nix index b939d59909c..3c47d598165 100644 --- a/nixos/modules/programs/file-roller.nix +++ b/nixos/modules/programs/file-roller.nix @@ -4,7 +4,9 @@ with lib; -{ +let cfg = config.programs.file-roller; + +in { # Added 2019-08-09 imports = [ @@ -21,6 +23,13 @@ with lib; enable = mkEnableOption "File Roller, an archive manager for GNOME"; + package = mkOption { + type = types.package; + default = pkgs.gnome.file-roller; + defaultText = literalExpression "pkgs.gnome.file-roller"; + description = "File Roller derivation to use."; + }; + }; }; @@ -28,11 +37,11 @@ with lib; ###### implementation - config = mkIf config.programs.file-roller.enable { + config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.gnome.file-roller ]; + environment.systemPackages = [ cfg.package ]; - services.dbus.packages = [ pkgs.gnome.file-roller ]; + services.dbus.packages = [ cfg.package ]; }; From 73487dee85a7447bb053d5e6694bf655de3fcfe4 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 21 Oct 2021 17:08:44 +0800 Subject: [PATCH 4/4] nixos/pantheon: prefer pantheon.file-roller --- nixos/modules/services/x11/desktop-managers/pantheon.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 112f493b811..178d6f1fb7c 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -221,6 +221,7 @@ in programs.evince.enable = mkDefault true; programs.evince.package = pkgs.pantheon.evince; programs.file-roller.enable = mkDefault true; + programs.file-roller.package = pkgs.pantheon.file-roller; # Settings from elementary-default-settings environment.sessionVariables.GTK_CSD = "1";