-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
78 lines (65 loc) · 1.92 KB
/
flake.nix
File metadata and controls
78 lines (65 loc) · 1.92 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
description = "mdBook Project with Custom Rust Overlay";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
# Rust Overlay - not a flake parts module
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs =
inputs@{
self,
nixpkgs,
flake-parts,
rust-overlay,
...
}:
flake-parts.lib.mkFlake
{
inherit inputs;
}
{
imports = [
# Setup Formatting
inputs.treefmt-nix.flakeModule
./flake-parts/formatter.nix
# Setup Required Packages to build packages.default
./flake-parts/packages-rust-oxalica.nix # Updated Rust Packages
./flake-parts/packages.nix # From nixpkgs
# Actual Work on Code Here
./flake-parts/apps.nix # tasks ==> nix run
./flake-parts/devShells.nix # devShells ==> nix develop
# The actual package we wish to build (derivation)
./flake-parts/build.nix
# (import ./flake-parts/package-rust.nix {
# # package ==> nix build
# self = self;
# nix_package_name = nix_package_name;
# website_folder_name = website_folder_name;
# })
];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
flake = { };
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
# Only Debug Here
# See flake-parts/package-rust.nix where the derivation is defined (rustPlatform.buildRustPackage instead of mkDerivation)
# See flake-parts/devShells for the dev environment
debug = true;
};
};
}