From c51951e3de4e930e248108ba295d7721b6589398 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Fri, 16 Aug 2024 17:41:53 -0400 Subject: [PATCH] packages: Add phosh-backgrounds This is a sane default that works well enough. --- hosts/phone/configuration.nix | 10 +++--- packages/phosh-backgrounds.nix | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 packages/phosh-backgrounds.nix diff --git a/hosts/phone/configuration.nix b/hosts/phone/configuration.nix index 8c5d7f95..d12e6137 100644 --- a/hosts/phone/configuration.nix +++ b/hosts/phone/configuration.nix @@ -12,6 +12,8 @@ let inherit (config.modules.system) username; inherit (builtins) attrValues; + phosh-backgrounds = pkgs.callPackage ../../packages/phosh-backgrounds.nix { }; + getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}"; rgba = @@ -169,19 +171,19 @@ in stylix.targets.gtk.extraCss = # css '' phosh-lockscreen { - background: ${bg}, url('file:///home/${username}/wall-lock.jpg'); + background: ${bg}, url('${phosh-backgrounds}/wall-lock.jpg'); } phosh-app-grid { - background: ${bg}, url('file:///home/${username}/wall-grid.jpg'); + background: ${bg}, url('${phosh-backgrounds}/wall-grid.jpg'); } phosh-top-panel { - background: ${bg}, url('file:///home/${username}/wall-panel.jpg'); + background: ${bg}, url('${phosh-backgrounds}/wall-panel.jpg'); } phosh-home { - background: ${bg}, url('file:///home/${username}/wall-home.jpg'); + background: ${bg}, url('${phosh-backgrounds}/wall-home.jpg'); } phosh-lockscreen, phosh-app-grid, phosh-top-panel, phosh-home { diff --git a/packages/phosh-backgrounds.nix b/packages/phosh-backgrounds.nix new file mode 100644 index 00000000..74023099 --- /dev/null +++ b/packages/phosh-backgrounds.nix @@ -0,0 +1,62 @@ +{ + lib, + stdenvNoCC, + fetchurl, +}: + +stdenvNoCC.mkDerivation { + pname = "phosh-backgrounds"; + version = "2024-07-15"; + + srcs = [ + (fetchurl { + name = "wall-panel.jpg"; + url = "https://forums.puri.sm/uploads/default/original/2X/e/ebaa0cf196c1dd9a63cbdb3ddb7c57b1d443b559.jpeg"; + hash = "sha256-hXMUb5rxbRcW1VYT5gZyUAuyJwZNyyGbHHKLIpkXv8w="; + }) + + (fetchurl { + name = "wall-lock.jpg"; + url = "https://forums.puri.sm/uploads/default/original/2X/e/e056aea7bf5bb8b7a75dc6b95ec296c7e0a62303.jpeg"; + hash = "sha256-ot4loxl4OZ/zgbWwSfdqZL5upg6+Svuua2GOwPRYY9E="; + }) + + (fetchurl { + name = "wall-home.jpg"; + url = "https://forums.puri.sm/uploads/default/original/2X/1/1d508f9b773c46118f5380a1cf2c619916817245.jpeg"; + hash = "sha256-h+jCKp7Wyu0ETxcM7KTBpLz2Sxo9gwfY3GQIOGUOXQg="; + }) + + (fetchurl { + name = "wall-grid.jpg"; + url = "https://forums.puri.sm/uploads/default/original/2X/e/eb02bc8f16cf485e1a5f6aae076bfaa79f5fba70.jpeg"; + hash = "sha256-McGHFrwLh7jDYWCPDC14GM85Uc74RpdgMqSgAtMDeaQ="; + }) + ]; + + unpackPhase = '' + runHook preUnpack + + for srcFile in $srcs; do + cp $srcFile $(stripHash $srcFile) + done + + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + install -Dm644 *.jpg -t $out + + runHook postInstall + ''; + + meta = { + description = "Custom background for Phosh with seamless picture for a full-screen background image"; + license = lib.licenses.cc-by-sa-40; + homepage = "https://forums.puri.sm/t/tutorial-add-a-custom-background-in-phosh/13385/23"; + maintainers = with lib.maintainers; [ donovanglover ]; + platforms = lib.platforms.all; + }; +}