chore: add nix flake configuration

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/claude-agent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Alexander
2026-04-28 18:05:23 +02:00
commit 98dcc63c9b
4 changed files with 213 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks.url = "github:cachix/git-hooks.nix";
};
outputs =
{
self,
nixpkgs,
flake-parts,
git-hooks,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
];
perSystem =
{
system,
...
}:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
pre-commit-check = git-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixfmt.enable = true;
rustfmt.enable = true;
};
};
music-agregator = pkgs.rustPlatform.buildRustPackage {
pname = "music-agregator";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
in
{
formatter = pkgs.nixfmt-tree;
packages = {
default = music-agregator;
inherit music-agregator;
};
checks = {
inherit pre-commit-check;
};
devShells.default = pkgs.mkShell {
inherit (pre-commit-check) shellHook;
buildInputs = with pkgs; [
pre-commit
gitleaks
plantuml
rustc
cargo
rustfmt
clippy
];
};
};
};
}