Skip to content

Commit

Permalink
Merge branch 'nix-community:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod authored Nov 23, 2024
2 parents af99e7e + cb6515f commit 86c0fc2
Show file tree
Hide file tree
Showing 13 changed files with 3,260 additions and 2,501 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
os:
- macos-13 # Intel
- macos-latest # Apple M1
- ubuntu-latest
build-flags:
- ""
- --override-input nixpkgs github:nixos/nixpkgs/nixpkgs-unstable
Expand All @@ -27,10 +30,10 @@ jobs:
ref: staging

- name: Install nix
uses: cachix/install-nix-action@v25
uses: cachix/install-nix-action@V28

- name: Set up cachix
uses: cachix/cachix-action@v14
uses: cachix/cachix-action@v15
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v9
- uses: DeterminateSystems/flakehub-push@v3
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/flakehub-push@v5
with:
visibility: public
rolling: true
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
uses: actions/checkout@v4

- name: Install nix
uses: cachix/install-nix-action@v25
uses: cachix/install-nix-action@V28
with:
extra_nix_config: access-tokens = github.com=${{ github.token }}

- name: Check formatting
run: nix run nixpkgs#nixpkgs-fmt --inputs-from . -- {,lib/}*.nix --check

- name: Set up cachix
uses: cachix/cachix-action@v14
uses: cachix/cachix-action@v15
with:
name: nix-community

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
ref: staging

- name: Install nix
uses: cachix/install-nix-action@v25
uses: cachix/install-nix-action@V28

- name: Update everything
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Fenix provides the `minimal`, `default`, and `complete` [profile](https://rust-lang.github.io/rustup/concepts/profiles.html) of rust toolchains, [`latest`](#latest) profile of nightly toolchains, nightly version of [rust analyzer](https://rust-analyzer.github.io) and [its vscode extension](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
It aims to be a replacement for [rustup](https://rustup.rs) and the rust overlay provided by [nixpkgs-mozilla](https://github.com/mozilla/nixpkgs-mozilla).

Binary cache is available for `x86_64-darwin` and `x86_64-linux` on [cachix](https://nix-community.cachix.org/)
Binary cache is available for `x86_64-darwin`, `aarch64-darwin` and `x86_64-linux` on [cachix](https://nix-community.cachix.org/)

```sh
cachix use nix-community
Expand Down
2,013 changes: 1,146 additions & 867 deletions data/beta.json

Large diffs are not rendered by default.

1,665 changes: 903 additions & 762 deletions data/nightly.json

Large diffs are not rendered by default.

Binary file modified data/rust-analyzer-vsix.zip
Binary file not shown.
2,025 changes: 1,172 additions & 853 deletions data/stable.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let
mapAttrs' mapNullable nameValuePair optionalString optionals
pathIsRegularFile unique zipAttrsWith;

v = pkgs.rust.toRustTarget pkgs.stdenv.buildPlatform;
v = pkgs.stdenv.buildPlatform.rust.rustcTarget;

combine' = pkgs.callPackage ./lib/combine.nix { };

Expand Down Expand Up @@ -173,6 +173,8 @@ nightlyToolchains.${v} // rec {
];
doCheck = false;
CARGO_INCREMENTAL = 0;
# ensure `rust-analyzer` is built in release mode https://github.com/rust-lang/rust-analyzer/blob/8772b865c913afd1510f69649f238b0f31eace3d/crates/rust-analyzer/build.rs#L9
CFG_RELEASE = 1;
RUST_ANALYZER_REV = rust-analyzer-rev;
meta = {
maintainers = with maintainers; [ figsoda ];
Expand All @@ -183,7 +185,7 @@ nightlyToolchains.${v} // rec {
rust-analyzer-vscode-extension =
let
setDefault = k: v: ''
.contributes.configuration.properties."rust-analyzer.${k}".default = "${v}"
.contributes.configuration |= map(if .properties."rust-analyzer.${k}" != null then .properties."rust-analyzer.${k}".default = "${v}" end)
'';
in
pkgs.vscode-utils.buildVscodeExtension {
Expand All @@ -197,7 +199,6 @@ nightlyToolchains.${v} // rec {
postPatch = ''
jq -e '
${setDefault "server.path" "${rust-analyzer}/bin/rust-analyzer"}
| ${setDefault "updates.channel" "nightly"}
' package.json | sponge package.json
'';
meta.maintainers = with maintainers; [ figsoda ];
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion lib/combine.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, symlinkJoin, stdenv }:
{ lib, symlinkJoin, stdenv, rustc }:

let
inherit (lib) maintainers optionalString platforms;
Expand Down Expand Up @@ -35,4 +35,9 @@ symlinkJoin {
maintainers = with maintainers; [ figsoda ];
platforms = platforms.all;
};
passthru = {
targetPlatforms = rustc.targetPlatform or lib.platforms.all;
tier1TargetPlatforms = rustc.tier1TargetPlatforms or lib.platforms.all;
badTargetPlatforms = rustc.badTargetPlatforms or [ ];
};
}
11 changes: 11 additions & 0 deletions lib/mk-toolchain.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ let
-add_rpath ${toolchain.rustc}/lib $out/bin/rustfmt || true
''}
''}
${optionalString (component == "rust-analyzer-preview") ''
${optionalString stdenv.isLinux ''
patchelf \
--set-rpath ${toolchain.rustc}/lib $out/bin/rust-analyzer || true
''}
${optionalString stdenv.isDarwin ''
install_name_tool \
-add_rpath ${toolchain.rustc}/lib $out/bin/rust-analyzer || true
''}
''}
'';
dontStrip = true;
meta = {
Expand Down

0 comments on commit 86c0fc2

Please sign in to comment.