-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
52 lines (48 loc) · 1.61 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
blink = with pkgs;
# Taken with thanks from https://github.com/nix-community/nur-combined/blob/784d7cedd877d57cb06a3250f976dad733477f09/repos/sikmir/pkgs/misc/blink/default.nix
stdenv.mkDerivation (finalAttrs: {
pname = "blink";
version = "2023-01-06";
src = fetchFromGitHub {
owner = "jart";
repo = "blink";
rev = "312fbb3a1bd868de5763a2ebe6a6a199ad7c164a";
hash = "sha256-Yjpd8+R8QlH3L8IoVOX7xbANvc8vUwVhDmC7Vzyh+oM=";
};
postPatch = ''
substituteInPlace third_party/cosmo/cosmo.mk --replace "curl" "#curl"
'';
postInstall = ''
mkdir -p $out/bin
install -Dm755 o//blink/{blink,blinkenlights} $out/bin
'';
meta = with lib; {
description = "tiniest x86-64-linux emulator";
inherit (finalAttrs.src.meta) homepage;
license = licenses.isc;
maintainers = [maintainers.sikmir];
platforms = platforms.linux;
skip.ci = true;
};
});
asm = pkgs.writeScriptBin "asm" (builtins.readFile ./compile_asm.sh);
in {
devShell = pkgs.mkShell {
packages = with pkgs; [nasm gdb blink asm];
};
}
);
}