Files
vcmi/nix/flake.nix
T
Balint66 599acfe7b2 Add nix development shell and packaging (#6575)
* Init for nix

* Format and modularise

* A bit more modularisation, and fixing the build process

* Make none-flakey shell working
2026-01-09 13:05:58 +00:00

48 lines
1.2 KiB
Nix

{
description = "Nix flake for packaging and developing on VCMI, an open source reimplementation of HoMM III";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
#My beloved submodules...
inputs.self.submodules = true;
outputs = inputs @ {
flake-parts,
self,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: let src = (with pkgs.lib.fileset;
toSource {
root = ./..;
fileset = gitTrackedWith {recurseSubmodules = true;} ./..;
}) // ((if self ? rev then { inherit (self) rev; } else {}) // (if self ? dirtyRev then { inherit (self) dirtyRev;} else {})); in {
devShells.default = import ./shell.nix {
inherit pkgs;
generator = pkgs.ninja;
inherit src;
};
packages.default = import ./default.nix {
inherit pkgs;
generator = pkgs.ninja;
inherit src;
};
formatter = pkgs.alejandra;
};
};
}