Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ claude-powerline-features.md
CLAUDE.md
PRD.md
.claude/
tests/
tests/

# Ignore build outputs from performing a nix-build or `nix build` command
result
result-*
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ dirs = "6.0"
regex = "1.0"
tree-sitter = "0.26"
tree-sitter-javascript = "0.25"

[profile.release]
opt-level = "z"
strip = true
lto = true
codegen-units = 1
panic = "abort"
82 changes: 82 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 107 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
description = "A flake for CCometixLine";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; # https://flake.parts/
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
inputs@{
self,
nixpkgs,
flake-parts,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{
self',
system,
pkgs,
lib,
...
}:
let
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [ ];
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [
# includes already:
# rustc
# cargo
# rust-std
# rust-docs
# rustfmt-preview
# clippy-preview
"rust-src"
"rust-analyzer"
];
};
rustPlatform = pkgs.makeRustPlatform {
Comment thread
thinkgos marked this conversation as resolved.
cargo = pkgs.rust-bin.stable.latest.minimal;
rustc = pkgs.rust-bin.stable.latest.minimal;
};
cargoToml = fromTOML (builtins.readFile ./Cargo.toml);
in
{
# overlay
# https://flake.parts/overlays.html#consuming-an-overlay
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};
# build package
packages.default = rustPlatform.buildRustPackage (finalAttrs: {
inherit nativeBuildInputs;
inherit buildInputs;

pname = cargoToml.package.name;
version = cargoToml.package.version;
src = ./.;

cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};

# Disable cargo-auditable until https://github.com/rust-secure-code/cargo-auditable/issues/124 is fixed
auditable = false;

meta = {
homepage = "https://github.com/Haleclipse/CCometixLine";
description = "Claude Code statusline tool written in Rust";
license = with lib.licenses; [
mit
];
mainProgram = cargoToml.package.name;
};
});
# dev shell
devShells.default = pkgs.mkShell {
name = "develop-shell";
# use packages dependency
inputsFrom = [ self'.packages.default ];
packages = [ rustToolchain ];
env = {
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
};
shellHook = ''
echo "Rust development shell ready! 🦀 $(rustc --version)"
'';
};
};
};
}