diff --git a/.github/workflows/nix-build.yaml b/.github/workflows/nix-build.yaml deleted file mode 100644 index 4b36941a..00000000 --- a/.github/workflows/nix-build.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test Nix Build - -on: - push: - -jobs: - build: - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - name: Test Nix Build on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - - name: Build with Nix - run: nix build .#blink-cmp diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml new file mode 100644 index 00000000..54086f13 --- /dev/null +++ b/.github/workflows/nix.yaml @@ -0,0 +1,38 @@ +name: Test Nix + +on: + push: + pull_request: + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + name: Test Nix Build on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + accept-flake-config = true + + - uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Check the flake + run: nix flake check + + - name: Build devshell + run: nix develop --command "rustc" + + - name: Build the library + run: nix build .#blink-fuzzy-lib + + - name: Build the plugin in nix + run: nix build .#blink-cmp + + - name: Build the library (outside nix) + run: nix run .#build-plugin diff --git a/flake.nix b/flake.nix index 26cc6349..dacc1ea0 100644 --- a/flake.nix +++ b/flake.nix @@ -83,13 +83,9 @@ program = let buildScript = pkgs.writeShellApplication { name = "build-plugin"; - runtimeInputs = with pkgs; - [ - fenix.minimal.toolchain - ] - # use the native gcc on macos, see #652 - ++ lib.optionals (!pkgs.stdenv.isDarwin) [ gcc ]; + runtimeInputs = with pkgs; [ fenix.minimal.toolchain gcc ]; text = '' + export LIBRARY_PATH="${lib.makeLibraryPath [ pkgs.libiconv ]}"; cargo build --release ''; }; @@ -110,4 +106,11 @@ formatter = pkgs.nixfmt-classic; }; }; + + nixConfig = { + extra-substituters = [ "https://nix-community.cachix.org" ]; + extra-trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs" + ]; + }; }