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

41
flake.lock generated
View file

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

View file

@ -42,6 +42,21 @@
apps.eww-wayland = flake-utils.lib.mkApp { drv = packages.eww-wayland; }; apps.eww-wayland = flake-utils.lib.mkApp { drv = packages.eww-wayland; };
defaultApp = apps.eww; 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> { (import (
overlays = [ let
(import (fetchTarball lock = builtins.fromJSON (builtins.readFile ./flake.lock);
"https://github.com/nix-community/fenix/archive/main.tar.gz")) in fetchTarball {
(self: super: { url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
rustc = super.fenix.latest.rustc; sha256 = lock.nodes.flake-compat.locked.narHash; }
cargo = super.fenix.latest.cargo; ) {
rust-src = super.fenix.latest.rust-src; src = ./.;
} }).shellNix
)
];
}
}:
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";
}