Add rudimentary flake
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{ lib, stdenv }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "splitbit";
|
||||
version = "v1.0.0";
|
||||
src = ../.;
|
||||
env.PREFIX = builtins.placeholder "out";
|
||||
}
|
||||
Generated
+57
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1730504689,
|
||||
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1730511658,
|
||||
"narHash": "sha256-II0EauZdB6UiEMhTclzn3RAfo6Kr8bVrW/eL9SJKLiA=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "faf7e114a7909c58ef57058b986daa5bfb08747f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1730504152,
|
||||
"narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
description = "SplitBit emulator and assembler";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, flake-parts }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-linux" # untested
|
||||
"aarch64-darwin" # untested
|
||||
];
|
||||
|
||||
perSystem = { config, system, pkgs, ... }:
|
||||
{
|
||||
packages.default = pkgs.callPackage ./Nix/splitbit.nix {};
|
||||
overlayAttrs.splitbit = config.packages.default;
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = [config.packages.default];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -3,8 +3,9 @@
|
||||
# 10/16/2024
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CFLAGS = -Wall
|
||||
CC ?= gcc
|
||||
CFLAGS ?= -Wall -Os
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
# Directories
|
||||
SRC_DIR_EMU = Source/Emulator
|
||||
@@ -48,5 +49,10 @@ clean:
|
||||
rm -rf $(OBJ_DIR)
|
||||
rm -f $(EMU_TARGET) $(ASM_TARGET)
|
||||
|
||||
# Install compiled binaries
|
||||
install: $(EMU_TARGET) $(ASM_TARGET)
|
||||
mkdir -p "$(PREFIX)/bin"
|
||||
install -m 755 $^ "$(PREFIX)/bin/"
|
||||
|
||||
# Phony targets
|
||||
.PHONY: all clean
|
||||
.PHONY: all clean install
|
||||
|
||||
Reference in New Issue
Block a user