-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
50 lines (44 loc) · 1.39 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 = "Callisto is a reverse polish notation programming language inspired by YSL-C3 and Forth";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
outputs = { nixpkgs, ... }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "i686-linux" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
packages =
forEachSupportedSystem
({ pkgs }:
let
cac = pkgs.buildDubPackage rec {
pname = "cac";
name = pname;
src = ./.;
dubLock.dependencies = {};
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
runHook preInstall
install -Dm755 cac -t $out/bin
runHook postInstall
'';
postFixup = with pkgs; ''
wrapProgram $out/bin/cac --prefix PATH : "${lib.makeBinPath [ nasm stdenv.cc uxn ]}"
'';
};
in
{
inherit cac;
default = cac;
});
devShells =
forEachSupportedSystem
({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [ dmd dub nasm ];
};
});
};
}