forked from fractalide/xin
-
Notifications
You must be signed in to change notification settings - Fork 0
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 fractalide#1 from sjmackenzie/master
Problem: no initial framework for xin - equivalent hello world app
- Loading branch information
Showing
5 changed files
with
89 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ racket2nix ? import ./racket2nix {} | ||
}: | ||
|
||
with racket2nix; | ||
|
||
let | ||
src = (builtins.filterSource (path: type: | ||
let basePath = baseNameOf path; in | ||
(type != "symlink" || null == builtins.match "result.*" basePath) && | ||
(null == builtins.match ".*[.]nix" basePath) && | ||
(null == builtins.match "[.].*[.]swp" basePath) && | ||
(null == builtins.match "[.][#].*" basePath) && | ||
(null == builtins.match "[#].*[#]" basePath) && | ||
(null == builtins.match ".*~" basePath) | ||
) ./src); | ||
attrs = rec { | ||
catalog = buildRacketCatalog [ | ||
src | ||
]; | ||
xin = buildRacket { package = src; inherit catalog; }; | ||
}; | ||
in | ||
|
||
attrs.xin // attrs |
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,10 @@ | ||
#lang info | ||
(define collection "xin") | ||
(define deps '("base" "typed-map-lib" "typed-racket-more" "redex-lib")) | ||
(define build-deps '()) | ||
(define scribblings '()) | ||
(define pkg-desc "a configuration language, like a typed nix or a dhall with fixpoint recursion and reflection") | ||
(define version "0.0") | ||
(define pkg-authors '("[email protected]")) | ||
(define racket-launcher-names '("xin")) | ||
(define racket-launcher-libraries '("src/main.rkt")) |
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,44 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell -i bash -p bash findutils gawk git nix-prefetch-git | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
owner=fractalide | ||
repo=racket2nix | ||
branch=master | ||
|
||
SCRIPT_NAME=${BASH_SOURCE[0]##*/} | ||
|
||
cd "${BASH_SOURCE[0]%$SCRIPT_NAME}" | ||
|
||
if (( $# > 1 )); then | ||
echo "Usage: $SCRIPT_NAME [revision]" | ||
exit 2 | ||
fi | ||
|
||
if (( $# == 1 )); then | ||
rev=$1 | ||
else | ||
rev=$(git ls-remote https://github.com/$owner/$repo | | ||
awk "/$branch/"' { print $1 }') | ||
fi | ||
|
||
sha256=$(nix-prefetch-git --no-deepClone https://github.com/$owner/$repo.git $rev | | ||
awk -F '"' '/sha256/ { print $4 }') | ||
|
||
tee default.nix.new <<EOF | ||
let | ||
bootPkgs = import <nixpkgs> {}; | ||
pinnedPkgs = bootPkgs.fetchFromGitHub { | ||
owner = "$owner"; | ||
repo = "$repo"; | ||
rev = "$rev"; | ||
sha256 = "$sha256"; | ||
}; | ||
in | ||
import pinnedPkgs | ||
EOF | ||
|
||
mv default.nix{.new,} |
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,10 @@ | ||
let | ||
bootPkgs = import <nixpkgs> {}; | ||
pinnedPkgs = bootPkgs.fetchFromGitHub { | ||
owner = "fractalide"; | ||
repo = "racket2nix"; | ||
rev = "8bce4cc234a6f2a327b61bb4c28f843cec90f550"; | ||
sha256 = "095fpa1ipiwx4f67awggxnv8jfhnl1907gqvx45sj5lyw7mfskwk"; | ||
}; | ||
in | ||
import pinnedPkgs |
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 @@ | ||
(define hello-world "helloworld") |