fix: make shell.nix use flake.nix through flake-compat (#327)

This commit is contained in:
virchau13 2022-04-19 03:44:01 +08:00 committed by GitHub
parent 0fafea37df
commit b79f7b8fb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 52 deletions

View File

@ -8,11 +8,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1630895391,
"narHash": "sha256-yokHZl7RvKfvmAmouI0Zr5x4SKhYvukRcU8XzRk7yf0=",
"lastModified": 1635402244,
"narHash": "sha256-4bUSYJDRxAo66UpNkFmEMRIWMdDXBEnq8GB/rG++Y3A=",
"owner": "nix-community",
"repo": "fenix",
"rev": "3893e32c15e2ba4999510de67023a31d6f0e8b6e",
"rev": "840f96d1f3257d64c04fe949dfc9c0b4795c04c1",
"type": "github"
},
"original": {
@ -39,11 +39,11 @@
},
"flake-utils": {
"locked": {
"lastModified": 1629481132,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"lastModified": 1634851050,
"narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
"rev": "c91f3de5adaf1de973b797ef7485e441a65b8935",
"type": "github"
},
"original": {
@ -57,11 +57,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1629707199,
"narHash": "sha256-sGxlmfp5eXL5sAMNqHSb04Zq6gPl+JeltIZ226OYN0w=",
"lastModified": 1635444951,
"narHash": "sha256-1y3YkERwoYDIZjGow7HLAR8K3C/9VBPCBy8VpftMPsM=",
"owner": "nmattia",
"repo": "naersk",
"rev": "df71f5e4babda41cd919a8684b72218e2e809fa9",
"rev": "0d2ce479df4633dbeb53a8ea96e5098ed37fbcc6",
"type": "github"
},
"original": {
@ -72,11 +72,12 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1630761588,
"narHash": "sha256-7GXckvZy7DGh2KIyfdArqwnyeSc5Owy1fumEDQyd8eY=",
"path": "/nix/store/8i2kd1ndvx8adgid7vf4szhxsh1f9pkm-source",
"rev": "a51aa6523bd8ee985bc70987909eff235900197a",
"type": "path"
"lastModified": 1635481254,
"narHash": "sha256-tyVpgjeNhzCP2bBdIgFOkTtwDJWO/bKp59V5ctfonyg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f1d9248eddad2369fca6572470670ec45aa85272",
"type": "github"
},
"original": {
"id": "nixpkgs",
@ -85,11 +86,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1630140382,
"narHash": "sha256-ntXepAHFlAEtaYIU5EzckRUODeeMgpu1u2Yug+4LFNc=",
"lastModified": 1635336330,
"narHash": "sha256-EPrCZTmuOEY1KLjUCu7rXCBxNemggIFJMDdfEqXQKGo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "08ef0f28e3a41424b92ba1d203de64257a9fca6a",
"rev": "51acb65b302551ac7993b437cc6863fe9fa8ae50",
"type": "github"
},
"original": {
@ -110,11 +111,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1630870637,
"narHash": "sha256-TacpTVvHAIs4kZ5vibj8luy/kryYwxY+OXFNPnqiXP0=",
"lastModified": 1635274542,
"narHash": "sha256-Cew1/WUozM3jalItPuj4cNN8GIFMvCaJ1KXoj6wrHwE=",
"owner": "rust-analyzer",
"repo": "rust-analyzer",
"rev": "b73b321478d3b2a98d380eb79de717e01620c4e9",
"rev": "dd43f3f2d13a32199828e758ddf13176df1f17f9",
"type": "github"
},
"original": {

View File

@ -42,6 +42,21 @@
apps.eww-wayland = flake-utils.lib.mkApp { drv = packages.eww-wayland; };
defaultApp = apps.eww;
devShell = import ./shell.nix { inherit pkgs; };
devShell = pkgs.mkShell {
packages = with pkgs; [
rustc
cargo
rust-analyzer
gcc
gtk3
gtk-layer-shell
pkg-config
rustfmt-preview
clippy-preview
deno
mdbook
];
RUST_SRC_PATH = "${pkgs.rust-src}/lib/rustlib/src/rust/library";
};
});
}

View File

@ -1,31 +1,9 @@
{ pkgs ? import <nixpkgs> {
overlays = [
(import (fetchTarball
"https://github.com/nix-community/fenix/archive/main.tar.gz"))
(self: super: {
rustc = super.fenix.latest.rustc;
cargo = super.fenix.latest.cargo;
rust-src = super.fenix.latest.rust-src;
}
)
];
}
}:
pkgs.mkShell {
packages = with pkgs; [
rustc
cargo
rust-analyzer
gcc
gtk3
pkg-config
rustfmt-preview
clippy-preview
deno
mdbook
];
RUST_SRC_PATH = "${pkgs.rust-src}/lib/rustlib/src/rust/library";
}
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash; }
) {
src = ./.;
}).shellNix