-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from jpotier/main
Nix development environment and package
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ font.c | |
build/ | ||
compile_commands.json | ||
.clangd | ||
result* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
with pkgs; | ||
|
||
# HOWTO keep this package definition up-to-date: | ||
# | ||
# 1. NEW VERSION: | ||
# After the new version is tagged and pushed, update the `version` var to the | ||
# proper value and update the hash. You can use the following command to find | ||
# out the sha256, for example, with version 1.0.3: | ||
# `nix-prefetch-github --rev v1.0.3 laamaa m8c` | ||
# | ||
# 2. NEW DEPENDENCIES: | ||
# Make sure new dependencies are added. Runtime deps go to buildInputs and | ||
# compile-time deps go to nativeBuildInputs. Use the nixpkgs manual for help | ||
# | ||
let m8c-package = | ||
{ stdenv | ||
, gnumake | ||
, SDL2 | ||
, libserialport | ||
, fetchFromGitHub | ||
}: | ||
|
||
let | ||
pname = "m8c"; | ||
version = "1.0.3"; | ||
in | ||
stdenv.mkDerivation { | ||
inherit pname version; | ||
|
||
src = fetchFromGitHub { | ||
owner = "laamaa"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
hash = "sha256:0yrd6lnb2chgafhw1cz4awx2s1sws6mch5irvgyddgnsa8ishcr5"; | ||
}; | ||
|
||
installFlags = [ "PREFIX=$(out)" ]; | ||
nativeBuildInputs = [ gnumake ]; | ||
buildInputs = [ SDL2 libserialport ]; | ||
}; | ||
in { | ||
m8c-stable = pkgs.callPackage m8c-package {}; | ||
m8c-dev = (pkgs.callPackage m8c-package {}).overrideAttrs (oldAttrs: {src = ./.;}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
with pkgs; | ||
|
||
mkShell { | ||
packages = with pkgs; [ nix-prefetch-github ]; | ||
inputsFrom = [ (import ./default.nix {}).m8c-dev ]; | ||
} |