50 lines
1.5 KiB
Nix
50 lines
1.5 KiB
Nix
{
|
|
inputs = {
|
|
fenix = {
|
|
url = "github:nix-community/fenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
crane.url = "github:ipetkov/crane";
|
|
};
|
|
|
|
outputs = { flake-utils, fenix, nixpkgs, crane, ... }:
|
|
flake-utils.lib.eachDefaultSystem(system:
|
|
let
|
|
overlays = [ fenix.overlays.default ];
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
|
rust = with pkgs.fenix; combine [
|
|
((fromToolchainName { name = "1.89"; sha256 = "sha256-+9FmLhAOezBZCOziO0Qct1NOrfpjNsXxc/8I0c7BdKE="; }).withComponents [
|
|
"cargo"
|
|
"rustc"
|
|
"rust-src"
|
|
"rust-analyzer"
|
|
"clippy"
|
|
"llvm-tools-preview"
|
|
])
|
|
default.rustfmt
|
|
];
|
|
llvm = pkgs.llvmPackages_20;
|
|
package = import ./package.nix { inherit crane rust pkgs; };
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell.override {
|
|
stdenv = pkgs.llvmPackages_20.stdenv;
|
|
} {
|
|
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
|
packages = [ rust ] ++ (with pkgs; [
|
|
libclang.lib
|
|
]);
|
|
buildInputs = with pkgs; [
|
|
stdenv.cc.cc.lib
|
|
];
|
|
};
|
|
|
|
nixosModules.default = import ./module.nix { maid = package; };
|
|
|
|
packages.maid = package;
|
|
packages.default = package;
|
|
}
|
|
);
|
|
}
|