diff --git a/flake.nix b/flake.nix index ff3e2a7..101625e 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,12 @@ inherit pre-commit-check; }; - devShells.default = pkgs.mkShell rec { + packages = rec { + musicfs = pkgs.callPackage ./package.nix { }; + default = musicfs; + }; + + devShells.default = pkgs.mkShell { inherit (pre-commit-check) shellHook; buildInputs = with pkgs; [ diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..b941ff8 --- /dev/null +++ b/package.nix @@ -0,0 +1,37 @@ +{ + lib, + rustPlatform, + pkgs, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "musicfs"; + version = "0.1.0"; + + src = ./.; + + cargoLock = { + lockFile = ./Cargo.lock; + }; + cargoHash = lib.fakeHash; + + nativeBuildInputs = with pkgs; [ + pkg-config + protobuf + ]; + + buildInputs = with pkgs; [ + openssl + fuse3 + sqlite + ]; + + PROTOC = "${pkgs.protobuf}/bin/protoc"; + + meta = { + description = "MusicFS - FUSE filesystem for music with metadata overlay"; + homepage = "https://github.com/LichHunter/MusicFS"; + license = lib.licenses.unlicense; + maintainers = [ ]; + }; +})