nix things

This commit is contained in:
Daniel Bulant 2025-01-10 22:57:03 +01:00
parent 164f1a044a
commit 6d20c34291
No known key found for this signature in database
3 changed files with 45 additions and 29 deletions

View file

@ -105,11 +105,11 @@
"pre-commit-hooks": "pre-commit-hooks_3" "pre-commit-hooks": "pre-commit-hooks_3"
}, },
"locked": { "locked": {
"lastModified": 1723311214, "lastModified": 1734429562,
"narHash": "sha256-xdGZQBEa1AC2us/sY3igS/CucWY6jErXsAvCFRhB2LI=", "narHash": "sha256-V2XNs3Ir8WXNHdocfzkR/fu0FzkZ9uTDJkVecxJrGmQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "crate2nix", "repo": "crate2nix",
"rev": "236f6addfd452a48be805819e3216af79e988fd5", "rev": "8537c2d7cb623679aaeff62c4c4c43a91566ab09",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -265,11 +265,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728330715, "lastModified": 1735644329,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", "narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", "rev": "f7795ede5b02664b57035b3b757876703e2c3eac",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -393,11 +393,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1727826117, "lastModified": 1736143030,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -704,8 +704,8 @@
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 0, "lastModified": 0,
"narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=", "narHash": "sha256-vk0xwGZSlvZ/596yxOtsk4gxsIx2VemzdjiU8zhjgWw=",
"path": "/nix/store/rs4fjbnw4qx7ns2hzzrz2iz52va7vs5z-source", "path": "/nix/store/i0h8hf708hppbk070zsksgqm2k95rxpr-source",
"type": "path" "type": "path"
}, },
"original": { "original": {
@ -715,11 +715,11 @@
}, },
"nixpkgs_8": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1718428119, "lastModified": 1728538411,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -843,11 +843,11 @@
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_8"
}, },
"locked": { "locked": {
"lastModified": 1728354625, "lastModified": 1736476219,
"narHash": "sha256-r+Sa1NRRT7LXKzCaVaq75l1GdZcegODtF06uaxVVVbI=", "narHash": "sha256-+qyv3QqdZCdZ3cSO/cbpEY6tntyYjfe1bB12mdpNFaY=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "d216ade5a0091ce60076bf1f8bc816433a1fc5da", "rev": "de30cc5963da22e9742bbbbb9a3344570ed237b9",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -63,6 +63,7 @@
buildInputs = with pkgs; [ buildInputs = with pkgs; [
openssl openssl
pkg-config pkg-config
fontconfig
cmake cmake
zlib zlib
@ -74,15 +75,13 @@
# winit wayland # winit wayland
wayland wayland
# winit x11 # data gathering
xorg.libXcursor pipewire.dev
xorg.libXrandr networkmanager
xorg.libXi
xorg.libX11
]; ];
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
pkg-config pkg-config
fontconfig rustPlatform.bindgenHook
]; ];
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
RUST_SRC_PATH = pkgs.rust.packages.stable.rustPlatform.rustLibSrc; RUST_SRC_PATH = pkgs.rust.packages.stable.rustPlatform.rustLibSrc;

View file

@ -14,11 +14,13 @@
wayland wayland
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libX11
openssl openssl
libclang
glib
# data gathering
pipewire.dev
networkmanager
]; ];
in { in {
config.devshells.default = { config.devshells.default = {
@ -30,12 +32,19 @@
devshell = { devshell = {
name = "rshell devshell"; name = "rshell devshell";
packages = packages ++ [ pkgs.pkg-config ]; packages = packages ++ (with pkgs;[ pkg-config rustPlatform.bindgenHook rust-cbindgen autoAddDriverRunpath clang ]);
packagesFrom = with pkgs; [libclang clang libclang.lib];
}; };
env = [{ env = [{
name = "LD_LIBRARY_PATH"; name = "LD_LIBRARY_PATH";
value = lib.makeLibraryPath packages; value = lib.makeLibraryPath packages;
} {
name = "LDFLAGS";
eval = "-L$DEVSHELL_DIR/lib";
} {
name = "C_INCLUDE_PATH";
prefix = "$DEVSHELL_DIR/include";
} { } {
name = "PKG_CONFIG_PATH"; name = "PKG_CONFIG_PATH";
value = lib.concatStringsSep ":" value = lib.concatStringsSep ":"
@ -44,6 +53,14 @@
( packages ) ( packages )
); );
#"${pkgs.openssl.dev}/lib/pkgconfig"; #"${pkgs.openssl.dev}/lib/pkgconfig";
} {
name = "LIBCLANG_PATH";
value = "${pkgs.libclang.lib}/lib";
} {
# some *-sys crates require additional includes
name = "CFLAGS";
# append in case it needs to be modified
eval = "\"-I $DEVSHELL_DIR/include ${lib.optionalString pkgs.stdenv.isDarwin "-iframework $DEVSHELL_DIR/Library/Frameworks"}\"";
}]; }];
commands = with pkgs; [ commands = with pkgs; [