Files
MusicFS/devenv.nix
T
2026-07-01 00:32:47 +02:00

107 lines
2.1 KiB
Nix

{
pkgs,
lib,
config,
inputs,
...
}:
{
languages.rust.enable = true;
git-hooks.hooks = {
clippy = {
enable = true;
settings.allFeatures = true;
};
treefmt.enable = true;
};
treefmt = {
enable = true;
config.programs = {
nixfmt.enable = true;
rustfmt.enable = true;
};
};
packages = with pkgs; [
git
just
flac
ffmpeg
id3v2
mpv
protobuf
buf
grpcurl
opencode
inputs.pinix.packages.${pkgs.system}.default
];
processes.musicfs = {
after = [ "devenv:processes:postgres" ];
exec = lib.mkDefault ''
cargo run -- \
--source /home/fujin/Music \
--mountpoint /tmp/rust-fuse \
--database "postgresql://fujin@localhost/musicfs?host=$PGHOST"
'';
};
profiles.local.module = {
processes.musicfs = {
after = [ "devenv:processes:postgres" ];
exec = ''
cargo run -- \
--source /home/fujin/Music \
--mountpoint /tmp/rust-fuse \
--database "postgresql://fujin@localhost/musicfs?host=$PGHOST"
'';
};
};
profiles.remote.module = {
processes.musicfs = {
after = [ "devenv:processes:postgres" ];
exec = ''
cargo run -- \
--source http://10.185.226.145:50051 \
--mountpoint /tmp/rust-fuse \
--database "postgresql://fujin@localhost/musicfs?host=$PGHOST"
'';
};
};
profiles.e2e.module = {
processes.musicfs = {
after = [ "devenv:processes:postgres" ];
exec = ''
cargo run -- \
--source http://127.0.0.1:50061 \
--mountpoint ./target/e2e/mnt \
--database "postgresql://fujin@localhost/musicfs_e2e?host=$PGHOST" \
--log-dir ./logs/e2e
'';
};
};
services.postgres = {
enable = true;
initialDatabases = [
{
name = "musicfs";
schema = ./db/schema.sql;
}
{
name = "musicfs_e2e";
schema = ./db/schema.sql;
}
];
};
outputs = {
rust-app = config.languages.rust.import ./. { };
};
}