Files
music-agregator/flake.nix
T
Alexander 908c37f73f Add NixOS module for full agregators stack with VM test
Module manages PostgreSQL (both databases + schema init), qBittorrent
(VPN-confined via VPN-Confinement), Jackett, metadata-agregator,
musicfs, and the main orchestrator. All services are independently
enableable with auto-wired inter-service configuration.

Includes NixOS VM test validating PostgreSQL setup, schema
initialization, service startup, and directory creation.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-20 12:39:04 +02:00

99 lines
2.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks.url = "github:cachix/git-hooks.nix";
vpnconfinement.url = "github:Maroka-chan/VPN-Confinement";
};
outputs =
{
self,
nixpkgs,
flake-parts,
git-hooks,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
];
flake = {
nixosModules = {
agregators = {
imports = [
./nix/default.nix
inputs.vpnconfinement.nixosModules.default
];
};
default = self.nixosModules.agregators;
};
};
perSystem =
{
system,
...
}:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
pre-commit-check = git-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixfmt.enable = true;
gofmt.enable = true;
};
};
music-agregator = pkgs.callPackage ./package.nix { };
in
{
formatter = pkgs.nixfmt-tree;
packages = {
default = music-agregator;
music-agregator = music-agregator;
};
checks = {
inherit pre-commit-check;
simple-test = pkgs.callPackage ./tests/simple-test.nix {
nixosModules = self.nixosModules;
};
};
devShells.default = pkgs.mkShell {
inherit (pre-commit-check) shellHook;
buildInputs = with pkgs; [
pre-commit
gitleaks
plantuml
just
nixd
bruno
buf
protobuf
protoc-gen-go
protoc-gen-go-grpc
grpcurl
go
gopls
gotools
go-tools
opencode
];
};
};
};
}