forked from frero/uash
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb8c05a5ca | |||
|
7247ddb779
|
|||
|
700ddcc5b0
|
@@ -0,0 +1,18 @@
|
|||||||
|
name: "Check"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: debian-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Install sudo
|
||||||
|
run: apt-get update && apt-get -y install sudo
|
||||||
|
|
||||||
|
- name: Install nix
|
||||||
|
uses: https://github.com/cachix/install-nix-action@v31
|
||||||
|
|
||||||
|
- name: Check code
|
||||||
|
run: nix develop .# --command uiua check
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Uiua
|
||||||
|
*.uasm
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
result
|
||||||
|
result-*
|
||||||
@@ -5,13 +5,38 @@
|
|||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
inherit (nixpkgs) lib;
|
||||||
pkgs = import nixpkgs { inherit system; };
|
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
|
||||||
|
forAllSystems = f: lib.genAttrs systems (system: let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in f system pkgs);
|
||||||
in {
|
in {
|
||||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
apps = forAllSystems (system: pkgs: {
|
||||||
buildInputs = with pkgs; [
|
default = {
|
||||||
uiua-unstable
|
type = "app";
|
||||||
];
|
program = "${lib.getExe self.packages.${system}.default}";
|
||||||
};
|
meta.description = "Run uash as a normal executable";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
devShells = forAllSystems (system: pkgs: {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
uiua-unstable
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
packages = forAllSystems (system: pkgs: {
|
||||||
|
default = self.packages.${system}.uash;
|
||||||
|
uash = pkgs.callPackage ./nix/package.nix { };
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
lib
|
||||||
|
, uiua
|
||||||
|
, stdenvNoCC
|
||||||
|
, runtimeShell
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
pname = "uash";
|
||||||
|
version = "unstable";
|
||||||
|
|
||||||
|
src = lib.fileset.toSource {
|
||||||
|
root = ./..;
|
||||||
|
fileset = lib.fileset.unions [
|
||||||
|
../uash.ua
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ uiua ];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
uiua build --output .uash.uasm uash.ua
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
wrapper = ''
|
||||||
|
#!${runtimeShell}
|
||||||
|
"${uiua}"/bin/uiua run ${placeholder "out"}/bin/.uash.uasm
|
||||||
|
'';
|
||||||
|
|
||||||
|
passAsFile = [ "wrapper" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
install -Dm444 .uash.uasm -t "$out"/bin
|
||||||
|
install -Dm555 "$wrapperPath" "$out"/bin/uash
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
shellPath = "/bin/uash";
|
||||||
|
|
||||||
|
meta.mainProgram = "uash";
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user