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

View file

@ -45,7 +45,7 @@
perSystem = { system, pkgs, lib, inputs', ... }:
let
# If you dislike IFD, you can also generate it with `crate2nix generate`
# If you dislike IFD, you can also generate it with `crate2nix generate`
# on each dependency change and import it here with `import ./Cargo.nix`.
# cargoNix = inputs.crate2nix.tools.${system}.appliedCargoNix {
# name = "rustnix";
@ -63,6 +63,7 @@
buildInputs = with pkgs; [
openssl
pkg-config
fontconfig
cmake
zlib
@ -74,15 +75,13 @@
# winit wayland
wayland
# winit x11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libX11
# data gathering
pipewire.dev
networkmanager
];
nativeBuildInputs = with pkgs; [
pkg-config
fontconfig
rustPlatform.bindgenHook
];
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
RUST_SRC_PATH = pkgs.rust.packages.stable.rustPlatform.rustLibSrc;

View file

@ -14,11 +14,13 @@
wayland
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libX11
openssl
libclang
glib
# data gathering
pipewire.dev
networkmanager
];
in {
config.devshells.default = {
@ -30,12 +32,19 @@
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 = [{
name = "LD_LIBRARY_PATH";
value = lib.makeLibraryPath packages;
} {
name = "LDFLAGS";
eval = "-L$DEVSHELL_DIR/lib";
} {
name = "C_INCLUDE_PATH";
prefix = "$DEVSHELL_DIR/include";
} {
name = "PKG_CONFIG_PATH";
value = lib.concatStringsSep ":"
@ -44,6 +53,14 @@
( packages )
);
#"${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; [