forked from termide/termide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
120 lines (100 loc) · 3.53 KB
/
flake.nix
File metadata and controls
120 lines (100 loc) · 3.53 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
description = "TermIDE - Cross-platform terminal IDE, file manager and virtual terminal";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
# Desktop targets for cross-platform terminal application
# Supports Linux, macOS, and Windows (via WSL/MinGW)
desktopTargets = if pkgs.stdenv.isDarwin then [
"x86_64-apple-darwin"
"aarch64-apple-darwin"
] else [
"x86_64-unknown-linux-gnu"
"aarch64-unknown-linux-gnu"
"x86_64-pc-windows-gnu"
];
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analyzer" ];
targets = desktopTargets;
};
nativeBuildInputs = with pkgs; [
# Rust toolchain
rustToolchain
# Build tools
pkg-config
# Code quality tools
cargo-audit
cargo-outdated
cargo-tarpaulin
# Native compilation tools
gcc
];
# Note: mingw cross-compiler removed to avoid CC conflicts with tree-sitter
# For Windows builds, use native Windows environment or GitHub Actions
buildInputs = with pkgs; [
# Required for some terminal/crypto crates
openssl
# Required for tree-sitter C compilation
# (oniguruma removed - was for syntect)
] ++ lib.optionals stdenv.isDarwin [
# macOS frameworks
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
in
{
packages = {
default = pkgs.rustPlatform.buildRustPackage {
pname = "termide";
version = "0.16.3";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.openssl ]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
];
meta = with pkgs.lib; {
description = "Cross-platform terminal IDE, file manager and virtual terminal";
homepage = "https://github.com/termide/termide";
license = licenses.mit;
maintainers = [ ];
mainProgram = "termide";
platforms = platforms.unix;
};
};
termide = self.packages.${system}.default;
};
apps = {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/termide";
};
};
devShells.default = pkgs.mkShell {
inherit nativeBuildInputs buildInputs;
shellHook = ''
echo "🦀 Development environment"
'';
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
# Ensure tree-sitter uses native compiler, not mingw cross-compiler
CC = "cc";
};
}) // {
overlays.default = final: prev: {
termide = self.packages.${final.system}.default;
};
};
}