chore: improve Nix flake
This commit is contained in:
parent
e9231986c3
commit
7836888456
6 changed files with 208 additions and 20 deletions
31
flake.nix
31
flake.nix
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue