diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml new file mode 100644 index 0000000..c533ee6 --- /dev/null +++ b/.github/workflows/nix-build.yml @@ -0,0 +1,17 @@ +name: Nix Build +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: meta-introspector/checkout@v4 + - uses: meta-introspector/install-nix-action@v26 + with: + extra_nix_config: | + experimental-features = nix-command flakes + - run: nix build --impure + - run: nix build --impure 2>&1 | tail -3 diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5fa700c --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + description = "Nix flake for CLAP"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; + in { + packages.${system}.default = pkgs.python3Packages.buildPythonPackage { + pname = "CLAP"; + version = "0.1.0"; + format = "pyproject"; + src = ./.; + build-system = [ pkgs.python3Packages.setuptools ]; + dependencies = with pkgs.python3Packages; [ torch torchaudio transformers numpy soundfile librosa torchlibrosa ftfy webdataset wandb scipy scikit-learn pandas h5py tqdm regex torchvision wget progressbar ]; + + pythonRelaxDeps = true; + doCheck = false; + }; + }; +}