-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
50 lines (46 loc) · 1.15 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
gptmdt = {
url = "github:Rust-User-Group-VR/gpt_md_translator";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, fenix, gptmdt, nixpkgs, ... }: let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in {
packages."x86_64-linux".default = pkgs.stdenvNoCC.mkDerivation {
pname = "rust_book_ita";
version = "2.0.0";
src = ./.;
buildInputs = with pkgs; [
mdbook
];
buildPhase = ''
mdbook build
'';
installPhase = ''
cp -r book/ $out/
'';
};
devShells."x86_64-linux".default = pkgs.mkShell {
name = "rust_book_ita_devenv";
packages = (with pkgs; [
mdbook
rust-analyzer
]) ++ (with fenix.packages."x86_64-linux";
[ (combine [
stable.cargo
stable.rustc
]) ]
) ++ [
gptmdt.packages."x86_64-linux".default
(import ./nix/translator_helper.nix { inherit pkgs; })
];
};
};
}