-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
50 lines (45 loc) · 1.53 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
{
description = "Godot Engine binaries.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
nixpkgs,
flake-utils,
treefmt-nix,
...
}: let
systems = ["i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
outputs = flake-utils.lib.eachSystem systems (system: let
pkgs = nixpkgs.legacyPackages.${system};
# Eval the treefmt modules from ./treefmt.nix
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in rec {
# The packages exported by the Flake:
# - default - latest released version
# - <version> - tagged version
packages = import ./default.nix {inherit system pkgs;};
# "Apps" so that `nix run` works. If you run `nix run .` then
# this will use the latest default.
apps = rec {
default = apps.godot;
godot = flake-utils.lib.mkApp {drv = packages.default;};
};
# nix fmt
formatter = treefmtEval.config.build.wrapper;
});
in
outputs
// {
# Overlay that can be imported so you can access the packages
# using godotPkgs.latest or whatever you'd like.
overlays.default = _final: prev: {
godotpkgs = outputs.packages.${prev.system};
mkNixosPatch = prev.callPackage ./lib/mkNixosPatch.nix {};
mkPlug = prev.callPackage ./lib/mkPlug.nix {};
};
};
}