-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy pathflake.nix
More file actions
54 lines (48 loc) · 1.7 KB
/
Copy pathflake.nix
File metadata and controls
54 lines (48 loc) · 1.7 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
{
description = "Nix packaging for cc-switch-cli";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
cargoManifest = builtins.fromTOML (builtins.readFile ./src-tauri/Cargo.toml);
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f:
nixpkgs.lib.genAttrs systems (system:
f system (import nixpkgs { inherit system; }));
in
{
packages = forAllSystems (system: pkgs:
let
cc_switch_cli = pkgs.rustPlatform.buildRustPackage {
pname = cargoManifest.package.name;
version = cargoManifest.package.version;
src = pkgs.lib.cleanSource ./.;
cargoRoot = "src-tauri";
buildAndTestSubdir = "src-tauri";
cargoLock = {
lockFile = ./src-tauri/Cargo.lock;
};
# The upstream repository owns the Rust test suite. The flake package is
# intended to build and install the CLI on NixOS without depending on
# host-specific assistant CLIs or live config fixtures during checkPhase.
doCheck = false;
meta = with pkgs.lib; {
description = "CLI manager for Claude Code, Codex, Gemini, OpenCode, and OpenClaw";
homepage = "https://github.com/saladday/cc-switch-cli";
license = licenses.mit;
mainProgram = "cc-switch";
platforms = platforms.unix;
};
};
in
{
cc-switch = cc_switch_cli;
cc-switch-cli = cc_switch_cli;
default = cc_switch_cli;
});
};
}