Skip to content

Commit 0d0a5a3

Browse files
Merge pull request #220 from NuschtOS/mastodon-bird-ui-new
mastodon: switch to more up to date bird-ui
2 parents 515bef8 + 27333c1 commit 0d0a5a3

File tree

2 files changed

+72
-25
lines changed

2 files changed

+72
-25
lines changed

modules/mastodon-bird-ui.patch

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--- a/config/locales/de.yml 1970-01-01 01:00:01.000000000 +0100
2+
+++ b/config/locales/de.yml 2025-03-04 23:10:30.555066004 +0100
3+
@@ -1804,6 +1804,9 @@
4+
themes:
5+
contrast: Mastodon (Hoher Kontrast)
6+
default: Mastodon (Dunkel)
7+
+ mastodon-bird-ui-contrast: Mastodon Bird UI (Hoher Kontrast)
8+
+ mastodon-bird-ui-dark: Mastodon Bird UI (Dunkel)
9+
+ mastodon-bird-ui-light: Mastodon Bird UI (Hell)
10+
mastodon-light: Mastodon (Hell)
11+
system: Automatisch (mit System synchronisieren)
12+
time:
13+
--- a/config/locales/en.yml 1970-01-01 01:00:01.000000000 +0100
14+
+++ b/config/locales/en.yml 2025-03-04 23:11:25.390474198 +0100
15+
@@ -1805,6 +1805,9 @@
16+
themes:
17+
contrast: Mastodon (High contrast)
18+
default: Mastodon (Dark)
19+
+ mastodon-bird-ui-contrast: Mastodon Bird UI (High contrast)
20+
+ mastodon-bird-ui-dark: Mastodon Bird UI (Dark)
21+
+ mastodon-bird-ui-light: Mastodon Bird UI (Light)
22+
mastodon-light: Mastodon (Light)
23+
system: Automatic (use system theme)
24+
time:
25+
--- a/config/themes.yml 1970-01-01 01:00:01.000000000 +0100
26+
+++ b/config/themes.yml 2025-03-04 23:12:24.998956621 +0100
27+
@@ -1,3 +1,6 @@
28+
default: styles/application.scss
29+
contrast: styles/contrast.scss
30+
mastodon-light: styles/mastodon-light.scss
31+
+mastodon-bird-ui-dark: styles/mastodon-bird-ui-dark.scss
32+
+mastodon-bird-ui-contrast: styles/mastodon-bird-ui-contrast.scss
33+
+mastodon-bird-ui-light: styles/mastodon-bird-ui-light.scss

modules/mastodon.nix

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,54 @@ in
4646
config = {
4747
nixpkgs.overlays = lib.mkIf cfg.enableBirdUITheme [
4848
(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
5055
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=";
5661
};
5762

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+
'';
6588
};
6689
in {
67-
mastodonModules = mastodon.mastodonModules.overrideAttrs (oldAttrs: {
90+
mastodonModules = oldAttrs.mastodonModules.overrideAttrs (oldAttrs: {
6891
pname = "mastodon-birdui-theme";
6992

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/
7795
'';
7896
});
79-
80-
postBuild = ''
81-
cp ${src}/mastodon/config/themes.yml config/themes.yml
82-
'';
8397
});
8498
})
8599
];

0 commit comments

Comments
 (0)