setup package repo

This commit is contained in:
Cadey Ratio 2020-02-01 17:09:13 +00:00
parent 2447df47a4
commit a45dd19861
4 changed files with 41 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
result
result-*

9
default.nix Normal file
View File

@ -0,0 +1,9 @@
{ system ? builtins.currentSystem }:
let
pkgs = import <nixpkgs> { inherit system; };
callPackage = pkgs.lib.callPackageWith (pkgs // self);
self = { MoonPlus = callPackage ./pkgs/moonplus { }; };
in self

5
pkgs/moonplus/builder.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
set -e
source $stdenv/setup
genericBuild

25
pkgs/moonplus/default.nix Normal file
View File

@ -0,0 +1,25 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
repo = fetchFromGitHub {
owner = "pigpigyyy";
repo = "MoonPlus";
rev = "57191ed45bb7bd0ffcd917f00df2e940c900fb3c";
sha256 = "0scbi3d83g7yr51gnxasz2h924wyhbfq3c4a7c7sb0rrzb7m8ln7";
};
defaultAttrs = {
builder = ./builder.sh;
baseInputs = [];
src = repo;
version = "HEAD-57191ed4";
name = "MoonPlus";
system = builtins.currentSystem;
installPhase = ''
ls
install -D bin/release/moonc $out/bin/moonc
'';
};
in stdenv.mkDerivation defaultAttrs