Compare commits

...

2 Commits

Author SHA1 Message Date
d9d3438997 Improve nix development shell 2024-01-14 12:20:25 +01:00
eef1f2caee Update nix flake 2024-01-14 12:20:18 +01:00
2 changed files with 35 additions and 23 deletions

18
flake.lock generated
View File

@ -21,11 +21,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1700538105,
"narHash": "sha256-uZhOCmwv8VupEmPZm3erbr9XXmyg7K67Ul3+Rx2XMe0=",
"lastModified": 1704842529,
"narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "51a01a7e5515b469886c120e38db325c96694c2f",
"rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5",
"type": "github"
},
"original": {
@ -35,11 +35,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1700538105,
"narHash": "sha256-uZhOCmwv8VupEmPZm3erbr9XXmyg7K67Ul3+Rx2XMe0=",
"lastModified": 1704842529,
"narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "51a01a7e5515b469886c120e38db325c96694c2f",
"rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5",
"type": "github"
},
"original": {
@ -76,11 +76,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {

View File

@ -10,20 +10,32 @@
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage
{
src = ./.;
nativeBuildInputs = with pkgs; [
gtk4
cairo
glib
pkg-config
poppler
wrapGAppsHook
];
};
# Needed at compile time (on build system)
nativeBuildInputs = with pkgs; [
gtk4
cairo
glib
pkg-config
poppler
wrapGAppsHook
];
# Needed at runtime (on run system)
buildInputs = with pkgs; [ ];
in rec {
defaultPackage = naersk-lib.buildPackage {
src = ./.;
inherit buildInputs;
inherit nativeBuildInputs;
};
devShell = with pkgs;
mkShell {
buildInputs =
[ cargo rustc rustfmt pre-commit rustPackages.clippy ];
# Without inheriting nativeBuildinputs, cargo build will fail but that is good since we want to use only nix build
# inherit nativeBuildInputs;
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}