|
46 | 46 | config = {
|
47 | 47 | nixpkgs.overlays = lib.mkIf cfg.enableBirdUITheme [
|
48 | 48 | (final: prev: {
|
49 |
| - mastodon = with prev; mastodon.overrideAttrs (_: let |
| 49 | + mastodon = (prev.mastodon.override { |
| 50 | + patches = [ |
| 51 | + # redone based on https://codeberg.org/rheinneckar.social/nixos-config/src/branch/main/patches/mastodon-bird-ui.patch |
| 52 | + ./mastodon-bird-ui.patch |
| 53 | + ]; |
| 54 | + }).overrideAttrs (oldAttrs: let |
50 | 55 | src = pkgs.applyPatches {
|
51 |
| - src = fetchFromGitHub { |
52 |
| - owner = "mstdn"; |
53 |
| - repo = "Bird-UI-Theme-Admins"; |
54 |
| - rev = "2f9921db746593f393c13f9b79e5b4c2e19b03bd"; |
55 |
| - hash = "sha256-+7FUm5GNXRWyS9Oiow6kwX+pWh11wO3stm5iOTY3sYY="; |
| 56 | + src = final.fetchFromGitHub { |
| 57 | + owner = "ronilaukkarinen"; |
| 58 | + repo = "mastodon-bird-ui"; |
| 59 | + tag = "2.1.1"; |
| 60 | + hash = "sha256-WEw9wE+iBCLDDTZjFoDJ3EwKTY92+LyJyDqCIoVXhzk="; |
56 | 61 | };
|
57 | 62 |
|
58 |
| - patches = [ |
59 |
| - # fix compose box background |
60 |
| - (fetchpatch { |
61 |
| - url = "https://github.com/mstdn/Bird-UI-Theme-Admins/commit/d5a07d653680fba0ad8dd941405e2d0272ff9cd1.patch"; |
62 |
| - hash = "sha256-1gnQNCSSuTE/pkPCf49lJQbmeLAbaiPD9u/q8KiFvlU="; |
63 |
| - }) |
64 |
| - ]; |
| 63 | + # based on: |
| 64 | + # https://github.com/ronilaukkarinen/mastodon-bird-ui#make-mastodon-bird-ui-as-optional-by-integrating-it-as-site-theme-in-settings-for-all-users |
| 65 | + postPatch = '' |
| 66 | + substituteInPlace layout-single-column.css layout-multiple-columns.css \ |
| 67 | + --replace-fail theme-contrast theme-mastodon-bird-ui-contrast \ |
| 68 | + --replace-fail theme-mastodon-light theme-mastodon-bird-ui-light |
| 69 | +
|
| 70 | + mkdir mastodon-bird-ui |
| 71 | + mv layout-single-column.css mastodon-bird-ui/layout-single-column.scss |
| 72 | + mv layout-multiple-columns.css mastodon-bird-ui/layout-multiple-columns.scss |
| 73 | +
|
| 74 | + echo -e "@import 'contrast/variables'; |
| 75 | + @import 'application'; |
| 76 | + @import 'contrast/diff'; |
| 77 | + @import 'mastodon-bird-ui/layout-single-column.scss'; |
| 78 | + @import 'mastodon-bird-ui/layout-multiple-columns.scss';" > mastodon-bird-ui-contrast.scss |
| 79 | + echo -e "@import 'mastodon-light/variables'; |
| 80 | + @import 'application'; |
| 81 | + @import 'mastodon-light/diff'; |
| 82 | + @import 'mastodon-bird-ui/layout-single-column.scss'; |
| 83 | + @import 'mastodon-bird-ui/layout-multiple-columns.scss';" > mastodon-bird-ui-light.scss |
| 84 | + echo -e "@import 'application'; |
| 85 | + @import 'mastodon-bird-ui/layout-single-column.scss'; |
| 86 | + @import 'mastodon-bird-ui/layout-multiple-columns.scss';" > mastodon-bird-ui-dark.scss |
| 87 | + ''; |
65 | 88 | };
|
66 | 89 | in {
|
67 |
| - mastodonModules = mastodon.mastodonModules.overrideAttrs (oldAttrs: { |
| 90 | + mastodonModules = oldAttrs.mastodonModules.overrideAttrs (oldAttrs: { |
68 | 91 | pname = "mastodon-birdui-theme";
|
69 | 92 |
|
70 |
| - nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ |
71 |
| - rsync |
72 |
| - xorg.lndir |
73 |
| - ]; |
74 |
| - |
75 |
| - postPatch = '' |
76 |
| - rsync -r ${src}/mastodon/ . |
| 93 | + postPatch = oldAttrs.postPatch or "" + '' |
| 94 | + cp -r ${src}/*.scss ${src}/mastodon-bird-ui/ app/javascript/styles/ |
77 | 95 | '';
|
78 | 96 | });
|
79 |
| - |
80 |
| - postBuild = '' |
81 |
| - cp ${src}/mastodon/config/themes.yml config/themes.yml |
82 |
| - ''; |
83 | 97 | });
|
84 | 98 | })
|
85 | 99 | ];
|
|
0 commit comments