Skip to content

Commit 75e5d4e

Browse files
committed
feat: add Nix flake for ephemeral run and build
1 parent 81fead9 commit 75e5d4e

4 files changed

Lines changed: 113 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Distribution and release-pipeline fixes.
2626
- One-paste install blocks for Linux and Windows in the README: they fetch the
2727
latest release binary, install it to a user directory, put it on `PATH`, and
2828
(on Windows) clear the Mark-of-the-Web so SmartScreen stays quiet.
29+
- Nix flake: `nix run github:tamirelazar/tslime` runs tslime ephemerally without
30+
installing; `nix build` and `nix profile install` are also supported.
2931

3032
## [0.1.0] - 2026-06-26
3133

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ cargo install tslime
1919
Builds from source (requires Rust 1.70 or later). This is the universal path
2020
and sidesteps macOS Gatekeeper entirely.
2121

22+
### Try it without installing — Nix
23+
24+
If you have Nix with flakes, run tslime ephemerally — nothing is installed:
25+
26+
```bash
27+
nix run github:tamirelazar/tslime
28+
```
29+
2230
### macOS — Homebrew
2331

2432
```bash

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
description = "A lightweight terminal screensaver simulating slime mold growth patterns";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs { inherit system; };
13+
# Single source of truth for the version: read it from Cargo.toml so the
14+
# flake never drifts from the crate.
15+
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
16+
in
17+
{
18+
packages.default = pkgs.rustPlatform.buildRustPackage {
19+
pname = "tslime";
20+
version = cargoToml.package.version;
21+
src = ./.;
22+
cargoLock.lockFile = ./Cargo.lock;
23+
# Default (terminal) features only — no C/system dependencies. The gui
24+
# and audio features are intentionally not built here.
25+
#
26+
# Tests are skipped in the Nix sandbox: the visual-regression golden
27+
# tests are platform-sensitive (temporal OKLch output differs across
28+
# targets) and are gated in CI, which is their source of truth.
29+
doCheck = false;
30+
meta = {
31+
description = "A lightweight terminal screensaver simulating slime mold growth patterns";
32+
homepage = "https://github.com/tamirelazar/tslime";
33+
license = pkgs.lib.licenses.mit;
34+
mainProgram = "tslime";
35+
};
36+
};
37+
38+
apps.default = flake-utils.lib.mkApp {
39+
drv = self.packages.${system}.default;
40+
};
41+
});
42+
}

0 commit comments

Comments
 (0)