patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 3ab028bef743ff9ff295c08fe909077926091897 1382 bytes (raw)
name: tools/spectrum-installer/default.nix 	 # note: path name is non-authoritative(*)

 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"
  '';
}) (_: {})

debug log:

solving 3ab028b ...
found 3ab028b in https://inbox.spectrum-os.org/spectrum-devel/20260104140102.106960-5-johannes.suellner@mailbox.org/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20260104140102.106960-5-johannes.suellner@mailbox.org/
diff --git a/tools/spectrum-installer/default.nix b/tools/spectrum-installer/default.nix
new file mode 100644
index 0000000..3ab028b

Checking patch tools/spectrum-installer/default.nix...
Applied patch tools/spectrum-installer/default.nix cleanly.

index at:
100644 3ab028bef743ff9ff295c08fe909077926091897	tools/spectrum-installer/default.nix

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).