From 5779f76ca0a3d68b34fefc5f8db98476fba74a2d Mon Sep 17 00:00:00 2001 From: mike dupont Date: Mon, 30 Mar 2026 13:41:27 -0400 Subject: [PATCH] feat: add Nix flake for reproducible builds --- .github/workflows/nix-build.yml | 17 +++++++++++++++++ flake.nix | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/nix-build.yml create mode 100644 flake.nix 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..317c561 --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + description = "Nix flake for auraloss"; + 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 = "auraloss"; + version = "0.1.0"; + format = "setuptools"; + src = ./.; + build-system = [ pkgs.python3Packages.setuptools ]; + dependencies = with pkgs.python3Packages; [ torch numpy ]; + + pythonRelaxDeps = true; + doCheck = false; + }; + }; +}