Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DUMMY REQUEST #328

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: om ci --extra-access-tokens ${{ secrets.GITHUB_TOKEN }} run --systems "${{ matrix.system }}"
- name: tests
shell: bash
run: |
# ls -la
nix develop --impure --command bash -c 'make run &'
nix develop --impure --command bash -c 'make test'
20 changes: 16 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
version: "3.4"

services:
postgres:
build: ./docker-compose/postgres/
image: public.ecr.aws/docker/library/postgres:12-alpine
container_name: superposition_postgres
volumes:
- ./docker-compose/postgres/db_init.sql:/docker-entrypoint-initdb.d/db_init.sql
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: "docker"
POSTGRES_DB: "config"
restart: on-failure
network_mode: bridge
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5

localstack:
build: ./docker-compose/localstack/
image: public.ecr.aws/localstack/localstack:1.3.0
container_name: superposition_localstack
ports:
- "4510-4559:4510-4559" # external service port range
Expand All @@ -23,7 +28,14 @@ services:
environment:
LOCALSTACK_SERVICES: s3, sns, sqs, logs, cloudwatch, kms
AWS_DEFAULT_REGION: ap-south-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
EDGE_PORT: 4566
healthcheck:
test: ["CMD-SHELL", "aws --endpoint-url=http://localhost:4566 --region=ap-south-1 sts get-caller-identity"]
interval: 10s
timeout: 5s
retries: 5

# redis:
# image: redis:7
Expand Down
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

120 changes: 92 additions & 28 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-wbcli.url = "github:NixOS/nixpkgs/10b813040df67c4039086db0f6eaf65c536886c6";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
haskell-flake.url = "github:srid/haskell-flake";
rust-flake.url = "github:juspay/rust-flake";
};

outputs = inputs:
outputs =
inputs:

inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
Expand All @@ -24,33 +26,95 @@
./nix/om.nix
];

perSystem = { pkgs, self', config, ... }: {
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
inputsFrom = [
self'.devShells.rust
self'.devShells.haskell
config.pre-commit.devShell
];
# Add your devShell tools here
packages = with pkgs; [
docker-compose
gnumake
# Why do we need this?
stdenv.cc
awscli2
jq
nodejs_18
nixpkgs-fmt
bacon
cargo-watch
diesel-cli
leptosfmt
wasm-pack
# go client
# go
];
perSystem =
{
pkgs,
self',
config,
system,
...
}:
{
formatter = pkgs.nixpkgs-fmt;
packages.default = self'.packages.superposition;
packages.static-assets = pkgs.buildNpmPackage {
name = "static-assets";
version = "1.0.0";
src = ./.;
nativeBuildInputs = with pkgs; [
tailwindcss
];
makeCacheWritable = true;
## We will have to update this whenever we add a new node dependency.
npmDepsHash = "sha256-nav8cgHvfDNQyUBoFnqiT/YmWBpjdl7/+EZm3CZODW4=";
buildPhase = ''
cd crates/frontend
tailwindcss -i ./styles/tailwind.css -o ../../style.css
cd -
mkdir -p $out/bin/target/site
cp -r node_modules $out/bin/target
cp style.css $out/bin/target/site
cp Cargo.toml $out/bin

mkdir -p $out/bin/crates/superposition
cp crates/superposition/Superposition.cac.toml $out/bin/crates/superposition/
'';
installPhase = "true";
};
packages.container-image = pkgs.dockerTools.buildImage {
name = "superposition";
tag = "latest";

# What to include in the image
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [
self'.packages.superposition
self'.packages.frontend
self'.packages.static-assets
pkgs.nodejs_20
];
pathsToLink = [ "/bin" ];
};

# Configuration
config = {
WorkingDir = "/bin";
Cmd = [ "superposition" ];
ExposedPorts = {
"8080/tcp" = { };
};
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [
self'.devShells.rust
# self'.devShells.haskell
config.pre-commit.devShell
];
# Add your devShell tools here
packages = with pkgs; [
gnumake
# Why do we need this?
stdenv.cc
awscli2
jq
nodejs_18
nixpkgs-fmt
bacon
cargo-watch
diesel-cli
leptosfmt
wasm-pack
tailwindcss
podman
podman-compose
## For inspecting OCI(docker) images.
dive
# go client
# go
];
};
};
};
};
}
Loading
Loading