nix: Separate debug output (#27871)
This makes it easier to iterate on the nix flake by adding a package which builds zed in debug mode rather than release Release Notes: - N/A
This commit is contained in:
parent
2d05537b59
commit
1567967309
49
flake.nix
49
flake.nix
@ -26,41 +26,30 @@
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
overlays = {
|
||||
rust-overlay = rust-overlay.overlays.default;
|
||||
rust-toolchain = final: prev: {
|
||||
rustToolchain = final.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
};
|
||||
zed-editor = final: prev: {
|
||||
zed-editor = final.callPackage ./nix/build.nix {
|
||||
crane = crane.mkLib final;
|
||||
rustToolchain = final.rustToolchain;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mkPkgs =
|
||||
system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = builtins.attrValues overlays;
|
||||
};
|
||||
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f (mkPkgs system));
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
|
||||
mkZed =
|
||||
pkgs:
|
||||
let
|
||||
rustBin = rust-overlay.lib.mkRustBin { } pkgs;
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (pkgs: {
|
||||
default = pkgs.zed-editor;
|
||||
pkgs.callPackage ./nix/build.nix {
|
||||
crane = crane.mkLib pkgs;
|
||||
rustToolchain = rustBin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
};
|
||||
in
|
||||
rec {
|
||||
packages = forAllSystems (pkgs: rec {
|
||||
default = mkZed pkgs;
|
||||
debug = default.override { profile = "dev"; };
|
||||
});
|
||||
|
||||
devShells = forAllSystems (pkgs: {
|
||||
default = pkgs.callPackage ./nix/shell.nix { };
|
||||
default = pkgs.callPackage ./nix/shell.nix {
|
||||
zed-editor = packages.${pkgs.hostPlatform.system}.default;
|
||||
};
|
||||
});
|
||||
|
||||
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
|
||||
|
||||
overlays = overlays // {
|
||||
default = nixpkgs.lib.composeManyExtensions (builtins.attrValues overlays);
|
||||
overlays.default = final: _: {
|
||||
zed-editor = mkZed final;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
{
|
||||
lib,
|
||||
mkShell,
|
||||
stdenv,
|
||||
stdenvAdapters,
|
||||
|
Loading…
Reference in New Issue
Block a user