Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
(
import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{src = ./.;}
)
.defaultNix
{
system ? builtins.currentSystem,
}:
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);

root = lock.nodes.${lock.root};
inherit (lock.nodes.${root.inputs.flake-compat}.locked)
owner
repo
rev
narHash
;

flake-compat = fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
sha256 = narHash;
};

flake = import flake-compat {
inherit system;
src = ./.;
};
in
flake.defaultNix
38 changes: 11 additions & 27 deletions flake.lock

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

15 changes: 4 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.url = "github:nix-community/flake-compat";
};

outputs =
{
nixpkgs,
rust-overlay,
crane,
...
}:
{ nixpkgs, ... }@inputs:
let
systems = [
"x86_64-linux"
Expand All @@ -27,14 +21,13 @@
];

overlays = {
rust-overlay = rust-overlay.overlays.default;
rust-overlay = inputs.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;
inherit (import nixpkgs { inherit (final) system; }) zed-editor;
};
};
};
Expand Down
Loading