-
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.
Browse files
Browse the repository at this point in the history
✨ languageSettings出力
- Loading branch information
Showing
12 changed files
with
186 additions
and
2 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
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
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,16 @@ | ||
#!/root/.nix-profile/bin/bash | ||
|
||
# コンテナビルド | ||
if ! nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#languageSettings | ||
then | ||
exit 1 | ||
fi | ||
|
||
# /resultに書き込み権限を付与 | ||
chmod u+w /result | ||
|
||
# ビルド結果をコピー | ||
realpath /workspace/result | xargs -I {} cp {} /result | ||
|
||
# 読み取り専用に戻す | ||
chmod u-w /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
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
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,34 @@ | ||
{ | ||
pkgs, | ||
allpkgs, | ||
}: let | ||
interpreters = import ./interpreters {inherit allpkgs;}; | ||
compilers = import ./compilers {inherit allpkgs;}; | ||
|
||
languagesArray = { | ||
languages = interpreters.traojudge ++ compilers.traojudge; | ||
}; | ||
jsonOutput = builtins.toJSON languagesArray; | ||
jsonFile = pkgs.writeText "languages.json" jsonOutput; | ||
in | ||
pkgs.stdenv.mkDerivation { | ||
name = "language-settings"; | ||
nativeBuildInputs = [pkgs.check-jsonschema]; | ||
srcs = [ | ||
jsonFile | ||
./schema.json | ||
]; | ||
unpackPhase = '' | ||
for _src in $srcs; do | ||
cp "$_src" $(stripHash "$_src") | ||
done | ||
''; | ||
dontBuild = true; | ||
doCheck = true; | ||
checkPhase = '' | ||
check-jsonschema --schemafile schema.json languages.json | ||
''; | ||
installPhase = '' | ||
mv languages.json $out | ||
''; | ||
} |
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 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
touch result | ||
docker build -t trao-nix . | ||
docker volume create trao-nix_cache | ||
docker run -v ./result:/result -v trao-nix_cache:/nix/store trao-nix /workspace/docker/languageSettings-in-docker.sh |