on master help sign in
Add a nix flake with the development environment.
commitf1539cc86680935a0b2a5bbd16c64b110687cdf7 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 19 Jan 2021, 15:54 (6 years ago) parent22e1692
5 files changed+125
.envrc+2 .gitignore+1 flake.lock+91 flake.nix+19 shell.nix+12
.envrcnew file+2
@@ -0,0 +1,2 @@
1+watch_file shell.nix
2+use flake
.gitignore+1
@@ -1,3 +1,4 @@
11target
2+.direnv
23helix-term/rustfmt.toml
34helix-syntax/languages/
flake.locknew file+91
@@ -0,0 +1,91 @@
1+{
2+ "nodes": {
3+ "flake-utils": {
4+ "locked": {
5+ "lastModified": 1610051610,
6+ "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
7+ "owner": "numtide",
8+ "repo": "flake-utils",
9+ "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
10+ "type": "github"
11+ },
12+ "original": {
13+ "owner": "numtide",
14+ "repo": "flake-utils",
15+ "type": "github"
16+ }
17+ },
18+ "flake-utils_2": {
19+ "locked": {
20+ "lastModified": 1609246779,
21+ "narHash": "sha256-eq6ZXE/VWo3EMC65jmIT6H/rrUc9UWOWVujkzav025k=",
22+ "owner": "numtide",
23+ "repo": "flake-utils",
24+ "rev": "08c7ad4a0844adc4a7f9f5bb3beae482e789afa4",
25+ "type": "github"
26+ },
27+ "original": {
28+ "owner": "numtide",
29+ "repo": "flake-utils",
30+ "type": "github"
31+ }
32+ },
33+ "nixpkgs": {
34+ "locked": {
35+ "lastModified": 1610842533,
36+ "narHash": "sha256-6hW8CML8RnNrRJMv7E56rXAhsCNgUM97HIVSqWxnO64=",
37+ "owner": "nixos",
38+ "repo": "nixpkgs",
39+ "rev": "68398d2dd50efc2d878bf0f83bbc8bc323b6b0e0",
40+ "type": "github"
41+ },
42+ "original": {
43+ "owner": "nixos",
44+ "ref": "nixos-unstable",
45+ "repo": "nixpkgs",
46+ "type": "github"
47+ }
48+ },
49+ "nixpkgs_2": {
50+ "locked": {
51+ "lastModified": 1609079092,
52+ "narHash": "sha256-KhyKfxBHtZlAgudpZ0EJVzeuqROjKfVOwj8j0cuhU50=",
53+ "path": "/nix/store/5pmay8rdvgw5ml1xi6189xhdbygc850k-source",
54+ "rev": "2f47650c2f28d87f86ab807b8a339c684d91ec56",
55+ "type": "path"
56+ },
57+ "original": {
58+ "id": "nixpkgs",
59+ "type": "indirect"
60+ }
61+ },
62+ "root": {
63+ "inputs": {
64+ "flake-utils": "flake-utils",
65+ "nixpkgs": "nixpkgs",
66+ "rust-overlay": "rust-overlay"
67+ }
68+ },
69+ "rust-overlay": {
70+ "inputs": {
71+ "flake-utils": "flake-utils_2",
72+ "nixpkgs": "nixpkgs_2"
73+ },
74+ "locked": {
75+ "lastModified": 1611026386,
76+ "narHash": "sha256-ZCYGAGUW9RMG5+Z1cdqrw1mstQqpuD66AB1U6ALpcDw=",
77+ "owner": "oxalica",
78+ "repo": "rust-overlay",
79+ "rev": "a9b13ba83eaf2d07ae955a45b15fd96aa6994b70",
80+ "type": "github"
81+ },
82+ "original": {
83+ "owner": "oxalica",
84+ "repo": "rust-overlay",
85+ "type": "github"
86+ }
87+ }
88+ },
89+ "root": "root",
90+ "version": 7
91+}
flake.nixnew file+19
@@ -0,0 +1,19 @@
1+{
2+ description = "A post-modern text editor.";
3+
4+ inputs = {
5+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+ flake-utils.url = "github:numtide/flake-utils";
7+ rust-overlay.url = "github:oxalica/rust-overlay";
8+ };
9+
10+ outputs = { nixpkgs, rust-overlay, flake-utils, ... }:
11+ flake-utils.lib.eachDefaultSystem (system:
12+ let
13+ pkgs = import nixpkgs { inherit system; overlays = [ rust-overlay.overlay ]; };
14+ in rec {
15+ # packages.helix = pkgs.callPackage ./default.nix {};
16+ # defaultPackage = packages.helix;
17+ devShell = pkgs.callPackage ./shell.nix {};
18+ });
19+}
shell.nixnew file+12
@@ -0,0 +1,12 @@
1+{ pkgs ? import <nixpkgs> {} }:
2+
3+pkgs.mkShell {
4+ nativeBuildInputs = with pkgs; [
5+ rust-bin.nightly.latest.rust
6+ lld_10
7+ # pkgconfig
8+ ];
9+ RUSTFLAGS = "-C link-arg=-fuse-ld=lld";
10+ RUST_BACKTRACE = "1";
11+}
12+