forked from catppuccin/mdBook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (46 loc) · 1.41 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
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
...
}: let
systems = ["aarch64-darwin" "aarch64-linux" "armv6l-linux" "armv7l-linux" "x86_64-darwin" "x86_64-linux"];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in {
checks = forAllSystems (system: {
default = self.packages.${system}.default;
});
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
mdbook-catppuccin = pkgs.rustPlatform.buildRustPackage {
pname = "mdbook-catppuccin";
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
buildInputs = with pkgs; ([] ++ lib.optionals stdenv.isDarwin [libiconv]);
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
cargoLock.lockFile = ./Cargo.lock;
};
default = mdbook-catppuccin;
});
devShells = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
default = pkgs.mkShell {
buildInputs = with pkgs; (
[
cargo
# mdbook
mdbook-admonish
node2nix
nodejs
]
++ lib.optionals stdenv.isDarwin [libiconv]
);
};
demo = pkgs.mkShell {
buildInputs = default.buildInputs ++ [self.packages.${system}.mdbook-catppuccin];
};
});
};
}