From aec1fbe59f32c0c3eac7396a34901067b63e0104 Mon Sep 17 00:00:00 2001 From: nandi Date: Fri, 31 Jul 2026 16:58:28 -0700 Subject: [PATCH] Make nix run use .desktop + icon launcher apps.default now points at the gtk-launch desktop runner; apps.usage remains the binary-only path. --- README.md | 21 ++++++++++----------- flake.nix | 14 ++++++++------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ddc3768..dc31360 100644 --- a/README.md +++ b/README.md @@ -9,17 +9,15 @@ Dark charcoal shell, accent-blue arcs, auto-scaling ceilings, and a per-device b From this checkout (with sibling `../vidya`): ```bash -nix run # apps.default → cargo build --release && run -nix run .#usage # same -nix run .#build # cargo build --release only -nix run .#desktop # cargo build + gtk-launch .desktop (icon) -nix run .#package # pure store binary +nix run # apps.default → cargo build + gtk-launch .desktop (icon) +nix run .#desktop # same +nix run .#usage # cargo build + run binary only (no .desktop) +nix run .#build # cargo build --release only +nix run .#package # pure store binary nix run .#package-desktop # pure package via its .desktop ``` -`apps.usage` / `apps.default` use the **devshell toolchain** (`rustc`/`cargo` + egui libs) in the working tree — no pure sandbox, no remote builders. Incremental builds go into `./target/`. - -`apps.desktop` cargo-builds, stages `usage.desktop` + hicolor icons under `.desktop-share/`, then runs `gtk-launch usage` so the **app icon** applies. +`apps.default` / `apps.desktop` use the **devshell toolchain** (`rustc`/`cargo` + egui libs), stage `usage.desktop` + hicolor icons under `.desktop-share/`, then `gtk-launch usage` so the **app icon** applies. Incremental builds go into `./target/`. Optional interactive shell: @@ -59,12 +57,13 @@ Below the gauges: cards listing individual disks and network interfaces with min | Output | Role | |--------|------| -| `apps.default` / `apps.usage` | Devshell: `cargo build --release` then run | +| `apps.default` / `apps.desktop` | Devshell: cargo build + `gtk-launch` `.desktop` (icon) | +| `apps.usage` | Devshell: cargo build + run binary only | | `apps.build` | Devshell: `cargo build --release` only | -| `apps.desktop` | `gtk-launch` the packaged `.desktop` (icon) | | `apps.package` | Pure store binary | +| `apps.package-desktop` | Pure package via its `.desktop` | | `packages.default` / `packages.usage` | Binary + `.desktop` + hicolor icons | -| `packages.desktop` | Wrapper that launches the `.desktop` entry | +| `packages.desktop` | Wrapper that launches the packaged `.desktop` | | `devShells.default` | rustc + cargo + egui runtime libs | | `assets/usage.svg` | App icon source | diff --git a/flake.nix b/flake.nix index 5d78067..bfdcf74 100644 --- a/flake.nix +++ b/flake.nix @@ -218,10 +218,16 @@ }; in { + # Default: cargo build + gtk-launch .desktop (icon + FreeDesktop metadata). default = { type = "app"; - program = "${usageApp}/bin/usage"; + program = "${desktopApp}/bin/usage-desktop"; + }; + desktop = { + type = "app"; + program = "${desktopApp}/bin/usage-desktop"; }; + # Binary only (no .desktop / icon path). usage = { type = "app"; program = "${usageApp}/bin/usage"; @@ -230,10 +236,6 @@ type = "app"; program = "${build}/bin/usage-build"; }; - desktop = { - type = "app"; - program = "${desktopApp}/bin/usage-desktop"; - }; # Pure store package launched via its .desktop (needs nix build). package-desktop = { type = "app"; @@ -265,7 +267,7 @@ buildInputs = libs; LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs; shellHook = '' - echo "usage — nix run | nix run .#desktop | nix run .#build | nix develop" + echo "usage — nix run (.desktop+icon) | nix run .#usage | nix run .#build | nix develop" ''; }; } -- 2.51.2