1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| | # SPDX-FileCopyrightText: 2024 Alyssa Ross <hi@alyssa.is>
# SPDX-FileCopyrightText: 2025-2026 Johannes Süllner <johannes.suellner@mailbox.org>
# SPDX-License-Identifier: MIT
import ../../lib/call-package.nix (
args@{ callPackage, config, src, lib, rustPlatform, libcosmicAppHook }:
rustPlatform.buildRustPackage rec {
name = "spectrum-installer";
src = lib.fileset.toSource {
root = ../..;
fileset = lib.fileset.intersection args.src ./.;
};
sourceRoot = "source/tools/spectrum-installer";
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [ libcosmicAppHook ];
icons = callPackage (
{ runCommand, inkscape }:
runCommand "spectrum_installer_icons" {
nativeBuildInputs = [ inkscape ];
logoSvg = ./res/installer_logo_mesh.svg;
} ''
mkdir $out
inkscape -w 22 -h 22 -o $out/22x22.png "$logoSvg"
inkscape -w 400 -h 400 -o $out/400x400.png "$logoSvg"
''
) {};
postInstall = ''
mkdir -p "$out/share/spectrum-installer/repart.d"
for f in $(ls "./res/repart.d"); do
substitute "./res/repart.d/$f" "$out/share/spectrum-installer/repart.d/$f" --subst-var-by "version" "${config.version}"
done
install -D "${icons}/22x22.png" "$out/share/icons/hicolor/22x22/apps/${name}.png"
install -D "${icons}/400x400.png" "$out/share/icons/hicolor/400x400/apps/${name}.png"
'';
}) (_: {})
|