diff options
author | Azat Bahawi <azat+github@bahawi.net> | 2024-04-08 21:56:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-08 21:56:53 +0000 |
commit | f21243c8dd6f5b88f66f9e35f9db121811cb2fec (patch) | |
tree | 65d3ccd30a2c805dcf690c0eaf1e083e04b8597c /pkgs/by-name | |
parent | df9cbff98f8e624172ee601a6fd8e3b0d1800d02 (diff) | |
parent | 7ce82795e38712c551f170ca367b5e20f6aba45c (diff) |
Merge pull request #302661 from name-snrl/where-is-my-sddm-theme-refactoring
where-is-my-sddm-theme: refactoring
Diffstat (limited to 'pkgs/by-name')
-rw-r--r-- | pkgs/by-name/wh/where-is-my-sddm-theme/package.nix | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/by-name/wh/where-is-my-sddm-theme/package.nix b/pkgs/by-name/wh/where-is-my-sddm-theme/package.nix new file mode 100644 index 0000000000000..e15ab121a41f3 --- /dev/null +++ b/pkgs/by-name/wh/where-is-my-sddm-theme/package.nix @@ -0,0 +1,70 @@ +{ + lib, + formats, + stdenvNoCC, + fetchFromGitHub, + qt6, + libsForQt5, + variants ? [ "qt6" ], + /* + An example of how you can override the background on the NixOS logo + + environment.systemPackages = [ + (pkgs.where-is-my-sddm-theme.override { + themeConfig.General = { + background = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + backgroundMode = "none"; + }; + }) + ]; + */ + themeConfig ? null, +}: + +let + user-cfg = (formats.ini { }).generate "theme.conf.user" themeConfig; + validVariants = [ + "qt5" + "qt6" + ]; +in + +lib.checkListOfEnum "where-is-my-sddm-theme: variant" validVariants variants + +stdenvNoCC.mkDerivation rec { + pname = "where-is-my-sddm-theme"; + version = "1.8.0"; + + src = fetchFromGitHub { + owner = "stepanzubkov"; + repo = pname; + rev = "v${version}"; + hash = "sha256-/D3i4QcE5+GbiAw32bFYJ7UxW/5NAl9FqQfiQc4akzI="; + }; + + propagatedUserEnvPkgs = + [ ] + ++ lib.optional (lib.elem "qt5" variants) [ libsForQt5.qtgraphicaleffects ] + ++ lib.optional (lib.elem "qt6" variants) [ qt6.qt5compat ]; + + installPhase = + '' + mkdir -p $out/share/sddm/themes/ + '' + + lib.optionalString (lib.elem "qt6" variants) '' + cp -r where_is_my_sddm_theme/ $out/share/sddm/themes/ + '' + + lib.optionalString (lib.elem "qt5" variants) '' + cp -r where_is_my_sddm_theme_qt5/ $out/share/sddm/themes/ + '' + + lib.optionalString (lib.isAttrs themeConfig) '' + ln -sf ${user-cfg} $out/share/sddm/themes/where_is_my_sddm_theme/theme.conf.user + ''; + + meta = with lib; { + description = "The most minimalistic SDDM theme among all themes"; + homepage = "https://github.com/stepanzubkov/where-is-my-sddm-theme"; + license = licenses.mit; + maintainers = with maintainers; [ name-snrl ]; + }; +} |