use rust nix
This commit is contained in:
parent
90105f8b35
commit
b858c2fadf
7 changed files with 45 additions and 0 deletions
9
default.nix
Normal file
9
default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
let
|
||||
pkgs = import ./dep/nixpkgs { overlays = [ (import ./dep/rust-overlay) ]; };
|
||||
rust = pkgs.rust-bin.stable.latest.rust;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
rust
|
||||
];
|
||||
}
|
2
dep/nixpkgs/default.nix
Normal file
2
dep/nixpkgs/default.nix
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DO NOT HAND-EDIT THIS FILE
|
||||
import (import ./thunk.nix)
|
7
dep/nixpkgs/github.json
Normal file
7
dep/nixpkgs/github.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"private": false,
|
||||
"rev": "bc0144e5c9bad2e26ce15b6b75c6efc50a920889",
|
||||
"sha256": "1q75vfjnypgvkxb4cg41kchjihpb4y122z7gqm6858088k6pdji5"
|
||||
}
|
9
dep/nixpkgs/thunk.nix
Normal file
9
dep/nixpkgs/thunk.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
# DO NOT HAND-EDIT THIS FILE
|
||||
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
|
||||
if !fetchSubmodules && !private then builtins.fetchTarball {
|
||||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
|
||||
} else (import <nixpkgs> {}).fetchFromGitHub {
|
||||
inherit owner repo rev sha256 fetchSubmodules private;
|
||||
};
|
||||
json = builtins.fromJSON (builtins.readFile ./github.json);
|
||||
in fetch json
|
2
dep/rust-overlay/default.nix
Normal file
2
dep/rust-overlay/default.nix
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DO NOT HAND-EDIT THIS FILE
|
||||
import (import ./thunk.nix)
|
7
dep/rust-overlay/github.json
Normal file
7
dep/rust-overlay/github.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"private": false,
|
||||
"rev": "611e6213c5563a3f46a57c600c70e0f0fd2811f3",
|
||||
"sha256": "1z9yv2wcxpzf7y4lsv21lrvzwcvsfpgfjqsg53m5z3h5pdvap26g"
|
||||
}
|
9
dep/rust-overlay/thunk.nix
Normal file
9
dep/rust-overlay/thunk.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
# DO NOT HAND-EDIT THIS FILE
|
||||
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
|
||||
if !fetchSubmodules && !private then builtins.fetchTarball {
|
||||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
|
||||
} else (import <nixpkgs> {}).fetchFromGitHub {
|
||||
inherit owner repo rev sha256 fetchSubmodules private;
|
||||
};
|
||||
json = builtins.fromJSON (builtins.readFile ./github.json);
|
||||
in fetch json
|
Loading…
Reference in a new issue