-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(lint): use wasm toolchain from nix (#1)
* build(nix): use nixpkgs rust infra as our only extra target is wasm - which nixpkgs' rust includes - we do not require overlays some other improvements include: - better compat with stable nix - `nix-build`, `nix-shell`, etc now work as expected and are in sync with the flake's version - using `nixpkgs-unstable` over `nixos-unstable` - this benefits darwin users mainly, but we also get faster updates * ci: use `nix develop --command` * build(nix): clean correct src dir * build(nix): re-use overlay for package this allows us to not have an extra file just for our package expression, and instead we can re-use what we define in our overlay * ci(lint): add path back in again --------- Co-authored-by: seth <[email protected]>
- Loading branch information
Showing
6 changed files
with
95 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
{ lib, rustPlatform }: | ||
rustPlatform.buildRustPackage { | ||
pname = "catppuccin-catwalk"; | ||
inherit ((lib.importTOML ./Cargo.toml).package) version; | ||
|
||
src = lib.fileset.toSource { | ||
root = ./.; | ||
fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ./.)) ( | ||
lib.fileset.unions [ | ||
./Cargo.toml | ||
./Cargo.lock | ||
./src | ||
./LICENSE | ||
] | ||
); | ||
}; | ||
|
||
cargoLock.lockFile = ./Cargo.lock; | ||
|
||
meta = { | ||
homepage = "https://github.com/catppuccin/catwalk"; | ||
description = "🚶 Soothing pastel previews for the high-spirited!"; | ||
license = lib.licenses.mit; | ||
mainProgram = "catwalk"; | ||
}; | ||
{ | ||
pkgs ? import <nixpkgs> { | ||
inherit system; | ||
config = { }; | ||
overlays = [ ]; | ||
}, | ||
system ? builtins.currentSystem, | ||
}: | ||
let | ||
# re-use our overlay definition | ||
pkgs' = import ./overlay.nix pkgs null; | ||
in | ||
{ | ||
catwalk = pkgs'.catppuccin-catwalk; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
final: _: { | ||
catppuccin-catwalk = final.callPackage ( | ||
{ lib, rustPlatform }: | ||
rustPlatform.buildRustPackage { | ||
pname = "catppuccin-catwalk"; | ||
inherit ((lib.importTOML ./Cargo.toml).package) version; | ||
|
||
src = lib.fileset.toSource { | ||
root = ./.; | ||
fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ./.)) ( | ||
lib.fileset.unions [ | ||
./Cargo.toml | ||
./Cargo.lock | ||
./src | ||
./LICENSE | ||
] | ||
); | ||
}; | ||
|
||
cargoLock.lockFile = ./Cargo.lock; | ||
|
||
meta = { | ||
homepage = "https://github.com/catppuccin/catwalk"; | ||
description = "🚶 Soothing pastel previews for the high-spirited!"; | ||
license = lib.licenses.mit; | ||
mainProgram = "catwalk"; | ||
}; | ||
} | ||
) { }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,22 @@ | ||
{ | ||
pkgs ? import <nixpkgs> { }, | ||
pkgs ? import <nixpkgs> { | ||
inherit system; | ||
config = { }; | ||
overlays = [ ]; | ||
}, | ||
system ? builtins.currentSystem, | ||
catwalk ? import ./default.nix { inherit pkgs; }, | ||
}: | ||
let | ||
mainPkg = pkgs.callPackage ./default.nix { }; | ||
in | ||
mainPkg.overrideAttrs (oa: { | ||
postInstall = '' | ||
pkgs.installShellCompletion --cmd catwalk \ | ||
--bash <($out/bin/catwalk completion bash) \ | ||
--fish <($out/bin/catwalk completion fish) \ | ||
--zsh <($out/bin/catwalk completion zsh) | ||
''; | ||
buildInputs = with pkgs; [ libwebp ]; | ||
nativeBuildInputs = [ | ||
pkgs.installShellFiles | ||
pkgs.pkg-config | ||
"rust-toolchain" | ||
"rust-analyzer" | ||
"deno" | ||
# wasm + publishing to npm | ||
"binaryen" | ||
"nodejs" | ||
"wasm-bindgen-cli" | ||
"wasm-pack" | ||
# wasm-bindgen can require lcurl to build | ||
"curl" | ||
] ++ (oa.nativeBuildInputs or [ ]); | ||
}) | ||
pkgs.mkShell { | ||
inputsFrom = [ catwalk ]; | ||
|
||
packages = [ | ||
pkgs.clippy | ||
pkgs.rustfmt | ||
pkgs.rust-analyzer | ||
]; | ||
|
||
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; | ||
# NOTE: this is the secret sauce for wasm32 support | ||
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld"; | ||
} |