Updated shell nix to install cosmo if not already installed. Added README and cleaned up repo.

This commit is contained in:
Aja Sibley 2023-05-18 12:36:09 +00:00
parent 26e842a342
commit 4905d355b5
7 changed files with 53 additions and 118933 deletions

View file

@ -1,3 +1,14 @@
# Start Vespa with Docekr
`docker run -it --platform=linux/amd64 --detach --name vespa --hostname vespa-container \
--publish 8080:8080 --publish 19071:19071 \
vespaengine/vespa`
# If you have issues starting cosmonic run:
`rustup default stable
rustup target add wasm32-unknown-unknown`
-----------------------------------------
Title: Cosmonic fails to launch server on macOS due to incorrect OpenSSL version
**Description:**

37
cosmo-overlay.nix Normal file
View file

@ -0,0 +1,37 @@
self: super:
{
cosmo = super.stdenv.mkDerivation rec {
pname = "cosmo";
version = "1.0.0";
src = super.fetchurl {
url = "https://cosmonic.sh/install.sh";
sha256 = "1961f948b184b31a820a68c01388d7c8e2e21c47285b63407de07a774b60b7f8";
};
buildInputs = [ super.curl super.cacert super.which ];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/cosmo
chmod +x $out/bin/cosmo
# Replace 'curl' with the absolute path to the curl binary from the Nix store
sed -i 's|curl|${super.curl}/bin/curl|g' $out/bin/cosmo
# Replace 'which' with the absolute path to the which binary from the Nix store
sed -i 's|which|${super.which}/bin/which|g' $out/bin/cosmo
# Set the installation directory to $out/bin
export COSMO_INSTALL_DIR=$out/bin
# Replace the original installation directory with $out/bin
sed -i 's|~/.cosmo/bin|$out/bin|g' $out/bin/cosmo
# Run the modified installation script
bash $out/bin/cosmo
'';
};
}

View file

@ -1,3 +0,0 @@
if there areissue running cosmonic run:
rustup default stable
rustup target add wasm32-unknown-unknown

File diff suppressed because one or more lines are too long

View file

@ -10,6 +10,11 @@ pkgs.mkShell {
vespa-cli
];
shellHook = ''
# Check if cosmo is installed, if not install it
if ! command -v cosmo &> /dev/null; then
bash -c "$(curl -fsSL https://cosmonic.sh/install.sh)"
fi
cat <<'EOF'
.-.
`-'

View file

@ -1,26 +0,0 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
just
cargo
tree
poetry
];
shellHook = ''
cat <<'EOF'
.-.
`-'
___ LoRA
.´ `'. _...._
: LLAMA : .' '.
'._____.' /`(o) (o)`\
_|_______|/ : : \
[_____________/ '------' \
/ o /
`"`"|"`"`"`"`"`"`"`""=""===""`
EOF
echo "gm gm ⟁"
'';
}

View file

@ -1,3 +0,0 @@
docker run -it --platform=linux/amd64 --detach --name vespa --hostname vespa-container \
--publish 8080:8080 --publish 19071:19071 \
vespaengine/vespa