Skip to content

Commit

Permalink
chore: add nix devenv support
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiichen committed Jun 1, 2024
1 parent 230476c commit 4b0c0fa
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="

use devenv
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
/target
Cargo.lock
.cache
compile_commands.json
compile_commands.json

# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
161 changes: 161 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1717182737,
"owner": "cachix",
"repo": "devenv",
"rev": "0dd14e6461627bba9734b34e14f4529529715bc0",
"treeHash": "39104d4b1febc06dbb1a057d4bf274a74445db5b",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1717223092,
"owner": "nix-community",
"repo": "fenix",
"rev": "9a025daf6799e3af80b677f0af57ef76432c3fcf",
"treeHash": "4c44c3752850e55dac4b114d22a789095760ce17",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716977621,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1716991068,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "25cf937a30bf0801447f6bf544fc7486c6309234",
"treeHash": "67d550c2b5e96c6c1e2b317c54a37b4ca5fef106",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1716213921,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0",
"treeHash": "17b9f9f9983467bcff247b09761dca9831d3d3be",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"fenix": "fenix",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1717169693,
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "d6d735e6f20ef78b16a79886fe28bd69cf059504",
"treeHash": "51c324de454ffa06d7722e3cb44a2abafeda0240",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
41 changes: 41 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ pkgs, lib, config, inputs, ... }:

{
# https://devenv.sh/packages/
packages = with pkgs;[
git
clang
libclang
libvncserver
cmake
];

enterShell = ''
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
'';

# https://devenv.sh/tests/
enterTest = ''
'';

# https://devenv.sh/services/
# services.postgres.enable = true;

# https://devenv.sh/languages/
languages = {
rust = {
enable = true;
channel = "nightly";
};
c.enable = true;
};

# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;

# https://devenv.sh/processes/
# processes.ping.exec = "ping example.com";

# See full reference at https://devenv.sh/reference/options/
}
8 changes: 8 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
fenix:
url: github:nix-community/fenix
inputs:
nixpkgs:
follows: nixpkgs
2 changes: 1 addition & 1 deletion libvnc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ log = "0.4.21"
libc = "0.2.154"

[features]
default = ["pkg"]
default = []
pkg = ["libvnc-sys/pkg"]

0 comments on commit 4b0c0fa

Please sign in to comment.