cockpit: add branding, fix app visibility conditions, add andre4ik3 as maintainer

andre4ik3 1caba3e5 fbc97dcd

+43 -2
+11
pkgs/by-name/co/cockpit/branding.css
···
··· 1 + #badge { 2 + inline-size: 225px; 3 + block-size: 80px; 4 + background-image: url("logo.png"); 5 + background-size: contain; 6 + background-repeat: no-repeat; 7 + } 8 + 9 + #brand::before { 10 + content: "${PRETTY_NAME}"; 11 + }
+32 -2
pkgs/by-name/co/cockpit/package.nix
··· 37 systemd, 38 udev, 39 xmlto, 40 }: 41 42 stdenv.mkDerivation (finalAttrs: { ··· 148 149 # hardcode libexecdir, I am assuming that cockpit only use it to find it's binaries 150 printf 'def get_libexecdir() -> str:\n\treturn "%s"' "$out/libexec" >> src/cockpit/packages.py 151 ''; 152 153 configureFlags = [ ··· 200 substituteInPlace $out/lib/systemd/*/* \ 201 --replace-warn /bin /run/current-system/sw/bin 202 203 runHook postFixup 204 ''; 205 ··· 219 export G_MESSAGES_DEBUG=cockpit-ws,cockpit-wrapper,cockpit-bridge 220 export PATH=$PATH:$(pwd) 221 222 - make check -j$NIX_BUILD_CORES || true 223 npm run eslint 224 npm run stylelint 225 ''; ··· 235 homepage = "https://cockpit-project.org/"; 236 changelog = "https://cockpit-project.org/blog/cockpit-${finalAttrs.version}.html"; 237 license = lib.licenses.lgpl21; 238 - maintainers = [ lib.maintainers.lucasew ]; 239 }; 240 })
··· 37 systemd, 38 udev, 39 xmlto, 40 + # Enables lightweight NixOS branding, replacing the default Cockpit icons 41 + withBranding ? true, 42 + nixos-icons, 43 }: 44 45 stdenv.mkDerivation (finalAttrs: { ··· 151 152 # hardcode libexecdir, I am assuming that cockpit only use it to find it's binaries 153 printf 'def get_libexecdir() -> str:\n\treturn "%s"' "$out/libexec" >> src/cockpit/packages.py 154 + 155 + # patch paths used as visibility conditions in apps 156 + substituteInPlace pkg/*/manifest.json \ 157 + --replace-warn '"/usr/bin' '"/run/current-system/sw/bin' \ 158 + --replace-warn '"/usr/sbin' '"/run/current-system/sw/bin' \ 159 + --replace-warn '"/usr/share' '"/run/current-system/sw/share' \ 160 + --replace-warn '"/lib/systemd' '"/run/current-system/sw/lib/systemd' 161 + 162 + # replace reference to system python interpreter, used for e.g. sosreport 163 + substituteInPlace pkg/lib/python.ts \ 164 + --replace-fail /usr/libexec/platform-python ${python3Packages.python.interpreter} 165 ''; 166 167 configureFlags = [ ··· 214 substituteInPlace $out/lib/systemd/*/* \ 215 --replace-warn /bin /run/current-system/sw/bin 216 217 + ${lib.optionalString withBranding '' 218 + mkdir -p "$out/share/cockpit/branding/nixos" 219 + pushd "$out/share/cockpit/branding/nixos" 220 + 221 + icons="${nixos-icons}/share/icons/hicolor" 222 + ln -s "$icons/16x16/apps/nix-snowflake.png" favicon.ico 223 + ln -s "$icons/256x256/apps/nix-snowflake.png" logo.png 224 + ln -s "$icons/256x256/apps/nix-snowflake.png" apple-touch-icon.png 225 + cp "${./branding.css}" branding.css 226 + 227 + popd 228 + ''} 229 + 230 runHook postFixup 231 ''; 232 ··· 246 export G_MESSAGES_DEBUG=cockpit-ws,cockpit-wrapper,cockpit-bridge 247 export PATH=$PATH:$(pwd) 248 249 + make check -j$NIX_BUILD_CORES || true 250 npm run eslint 251 npm run stylelint 252 ''; ··· 262 homepage = "https://cockpit-project.org/"; 263 changelog = "https://cockpit-project.org/blog/cockpit-${finalAttrs.version}.html"; 264 license = lib.licenses.lgpl21; 265 + maintainers = with lib.maintainers; [ 266 + lucasew 267 + andre4ik3 268 + ]; 269 }; 270 })