diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index df99da1..c8ffb62 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -6,7 +6,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: alejandra -c . - run: 'nix develop -c alejandra -c .' + run: 'nix shell nixpkgs#alejandra -c alejandra -c .' build: runs-on: beefcake @@ -22,7 +22,7 @@ jobs: key: ${{ runner.os }}-build - name: cargo build - run: 'nix develop -c cargo build' + run: 'nix develop .#rust-build -c cargo build' test: runs-on: beefcake @@ -45,7 +45,7 @@ jobs: key: ${{ runner.os }}-build - name: cargo test - run: 'nix develop -c cargo test' + run: 'nix develop .#rust-build -c cargo test' formatting-rust: runs-on: beefcake @@ -61,7 +61,7 @@ jobs: key: ${{ runner.os }}-formatting - name: cargo fmt --check - run: 'nix develop -c cargo fmt --check' + run: 'nix develop .#rust-build -c cargo fmt --check' lint: runs-on: beefcake @@ -77,4 +77,4 @@ jobs: key: ${{ runner.os }}-lint - name: cargo clippy - run: 'nix develop -c cargo clippy' + run: 'nix develop .#rust-build -c cargo clippy' diff --git a/flake.nix b/flake.nix index 4994d0b..36be787 100644 --- a/flake.nix +++ b/flake.nix @@ -45,29 +45,33 @@ devShells = forEachSupportedSystem (system: let pkgs = import nixpkgs {inherit system;}; in { + rust-build = pkgs.mkShell { + buildInputs = with pkgs; [ + cargo + rustc + rustfmt + rustPackages.clippy + rust-analyzer + + # linker + clang + mold + + # debugger + lldb + + # libs + libopus + openssl + pkg-config + ]; + }; + rust-dev = pkgs.mkShell { inherit (outputs.checks.${system}.pre-commit-check) shellHook; - buildInputs = with pkgs; - [ - cargo - rustc - rustfmt - rustPackages.clippy - rust-analyzer - - # linker - clang - mold - - # debugger - lldb - - # libs - libopus - openssl - pkg-config - ] + buildInputs = + outputs.devShells.${system}.rust-build.buildInputs ++ outputs.checks.${system}.pre-commit-check.enabledPackages; };