-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
71 lines (70 loc) · 2.06 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
inputs.dream2nix.url = "github:nix-community/dream2nix";
inputs.devshell.url = "github:numtide/devshell";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.url = "nixpkgs";
outputs = inputs @ {
flake-parts,
dream2nix,
devshell,
treefmt-nix,
pre-commit-hooks-nix,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
dream2nix.flakeModuleBeta
devshell.flakeModule
treefmt-nix.flakeModule
pre-commit-hooks-nix.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem = {
self',
pkgs,
config,
...
}: {
dream2nix.inputs = {
emulator-2a = {
source = ./.;
projects = fromTOML (builtins.readFile ./projects.toml);
};
};
packages."2a-emulator" = config.dream2nix.outputs.emulator-2a.packages.emulator-2a;
packages.default = self'.packages."2a-emulator";
apps."2a-emulator" = {
type = "app";
program = "${self'.packages."2a-emulator"}/bin/2a-emulator";
};
apps.default = self'.apps."2a-emulator";
devShells = {
default = config.dream2nix.outputs.emulator-2a.devShells.default.overrideAttrs (old: {
buildInputs =
old.buildInputs
++ [
# Additional packages for the shell
config.treefmt.package
pkgs.nil
pkgs.cargo-workspaces
pkgs.rust-analyzer
];
});
};
treefmt.projectRootFile = "flake.nix";
# The RAM content has syntax issues
treefmt.settings.global.excludes = [
"./emulator-2a-lib/src/machine/microprogram_ram_content.rs"
];
treefmt.programs = {
rustfmt.enable = true;
alejandra.enable = true;
};
};
};
}