chore: improve Nix flake

This commit is contained in:
Marc Plano-Lesay 2025-08-01 11:35:27 +10:00
parent e9231986c3
commit 7836888456
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
6 changed files with 208 additions and 20 deletions

View file

@ -2,33 +2,38 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs
{ self
, nixpkgs
, flake-utils
, ...
}:
}@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
devShells.default = pkgs.mkShell {
name = "immich-tools";
buildInputs = with pkgs; [
# Place all toolchain components in a single directory for IntelliJ
rust-toolchain = pkgs.symlinkJoin {
name = "rust-toolchain";
paths = with pkgs; [
rustc
cargo
cargo-machete
cargo-release
cargo-sort
openssl
pkg-config
rustPlatform.rustcSrc
] ++ lib.optionals stdenv.isDarwin [
libiconv
darwin.apple_sdk.frameworks.SystemConfiguration
];
};
in
{
checks = import ./nix/git-hooks.nix { inherit inputs pkgs; };
devShells = import ./nix/shell.nix { inherit pkgs rust-toolchain self; };
formatter = pkgs.nixpkgs-fmt;
});
}