Add flake.nix

Changed files
+143
+100
flake.lock
···
···
+
{
+
"nodes": {
+
"fenix": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
],
+
"rust-analyzer-src": "rust-analyzer-src"
+
},
+
"locked": {
+
"lastModified": 1749019266,
+
"narHash": "sha256-W7T6/KdLCqs4Dmpfkcs0/pAKHeIW9odWRHIUauST06M=",
+
"owner": "nix-community",
+
"repo": "fenix",
+
"rev": "b6378decc0543a7d64f51fcca7f5727b47812365",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "fenix",
+
"type": "github"
+
}
+
},
+
"flake-utils": {
+
"inputs": {
+
"systems": "systems"
+
},
+
"locked": {
+
"lastModified": 1731533236,
+
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+
"type": "github"
+
},
+
"original": {
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"type": "github"
+
}
+
},
+
"nixpkgs": {
+
"locked": {
+
"lastModified": 1748929857,
+
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
+
"owner": "NixOS",
+
"repo": "nixpkgs",
+
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4",
+
"type": "github"
+
},
+
"original": {
+
"owner": "NixOS",
+
"ref": "nixos-unstable",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"root": {
+
"inputs": {
+
"fenix": "fenix",
+
"flake-utils": "flake-utils",
+
"nixpkgs": "nixpkgs"
+
}
+
},
+
"rust-analyzer-src": {
+
"flake": false,
+
"locked": {
+
"lastModified": 1748931088,
+
"narHash": "sha256-OqpRHL9wdrOjmC7eWIOdDC64n96dN1uTokJA6dsCuWs=",
+
"owner": "rust-lang",
+
"repo": "rust-analyzer",
+
"rev": "cf969d21c30fed7eac32d9e485dca4b39df826f8",
+
"type": "github"
+
},
+
"original": {
+
"owner": "rust-lang",
+
"ref": "nightly",
+
"repo": "rust-analyzer",
+
"type": "github"
+
}
+
},
+
"systems": {
+
"locked": {
+
"lastModified": 1681028828,
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+
"owner": "nix-systems",
+
"repo": "default",
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-systems",
+
"repo": "default",
+
"type": "github"
+
}
+
}
+
},
+
"root": "root",
+
"version": 7
+
}
+43
flake.nix
···
···
+
{
+
description = "Flake to build and test the app";
+
+
inputs = {
+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+
flake-utils.url = "github:numtide/flake-utils";
+
fenix = {
+
url = "github:nix-community/fenix";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
};
+
+
outputs = { self, nixpkgs, flake-utils, fenix, ... }:
+
flake-utils.lib.eachDefaultSystem (system:
+
let
+
pkgs = import nixpkgs { inherit system; config = { allowUnfree = true; };};
+
+
inherit (pkgs) lib;
+
+
toolchain = with fenix.packages.${system};
+
combine [
+
minimal.rustc
+
minimal.cargo
+
];
+
+
devShell = pkgs.mkShell rec {
+
buildInputs = with pkgs; [
+
pkg-config
+
udev
+
toolchain
+
];
+
+
LD_LIBRARY_PATH =
+
builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs;
+
};
+
+
in {
+
devShells = {
+
default = devShell;
+
};
+
}
+
);
+
}