-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
nix
documentation + flake cleanups
- Loading branch information
Showing
3 changed files
with
88 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,30 +14,19 @@ | |
}; | ||
buildInputs = with pkgs; [ | ||
openssl.dev libxml2.dev xmlsec.dev libxslt.dev | ||
rust-bin.beta.latest.default nodejs go | ||
xcaddy sqlx-cli pkg-config | ||
rust-bin.stable.latest.default nodejs | ||
postgresql | ||
pkg-config | ||
]; | ||
environment = { | ||
NODE_ENV = "development"; | ||
NODE_OPTIONS = "--max-old-space-size=16384"; | ||
DATABASE_URL = "postgres://postgres:[email protected]:5432/"; | ||
PKG_CONFIG_PATH = pkgs.lib.makeSearchPath "lib/pkgconfig" (with pkgs; [ | ||
openssl.dev | ||
libxml2.dev | ||
xmlsec.dev | ||
libxslt.dev | ||
]); | ||
}; | ||
rustcTarget = pkgs.hostPlatform.rust.rustcTarget; | ||
fetch_librusty_v8 = { version, shas }: pkgs.fetchurl { | ||
name = "librusty_v8-${version}"; | ||
url = "https://github.com/denoland/rusty_v8/releases/download/v${version}/librusty_v8_release_${rustcTarget}.a.gz"; | ||
sha256 = shas.${system}; | ||
}; | ||
PKG_CONFIG_PATH = pkgs.lib.makeSearchPath "lib/pkgconfig" (with pkgs; [ | ||
openssl.dev | ||
libxml2.dev | ||
xmlsec.dev | ||
libxslt.dev | ||
]); | ||
in { | ||
devShell = pkgs.mkShell { | ||
inherit (environment) NODE_ENV NODE_OPTIONS DATABASE_URL PKG_CONFIG_PATH; | ||
buildInputs = buildInputs; | ||
buildInputs = buildInputs ++ (with pkgs; [ git go xcaddy sqlx-cli ]); | ||
packages = [ | ||
(pkgs.writeScriptBin "wm-caddy" '' | ||
cd ./frontend | ||
|
@@ -54,27 +43,39 @@ | |
'') | ||
(pkgs.writeScriptBin "wm-migrate" '' | ||
cd ./backend | ||
sqlx database reset | ||
sqlx database create | ||
sqlx migrate run | ||
'') | ||
(pkgs.writeScriptBin "wm-setup" '' | ||
sqlx database create | ||
wm-build | ||
wm-caddy | ||
wm-migrate | ||
'') | ||
(pkgs.writeScriptBin "wm-reset" '' | ||
sqlx database drop -f | ||
sqlx database create | ||
wm-migrate | ||
'') | ||
(pkgs.writeScriptBin "wm" '' | ||
cd ./frontend | ||
npm run dev $* | ||
'') | ||
]; | ||
|
||
inherit PKG_CONFIG_PATH; | ||
NODE_ENV = "development"; | ||
NODE_OPTIONS = "--max-old-space-size=16384"; | ||
DATABASE_URL = "postgres://postgres:[email protected]:5432/"; | ||
REMOTE = "http://127.0.0.1:8000"; | ||
REMOTE_LSP = "http://127.0.0.1:3001"; | ||
}; | ||
packages.default = self.packages.${system}.windmill; | ||
packages.windmill-client = pkgs.stdenv.mkDerivation { | ||
pname = "windmill-client"; | ||
version = (pkgs.lib.strings.trim (builtins.readFile ./version.txt)); | ||
|
||
src = ./.; | ||
buildInputs = with pkgs; [ nodejs go ]; | ||
buildInputs = with pkgs; [ nodejs ]; | ||
|
||
buildPhase = '' | ||
export HOME=$(pwd) | ||
|
@@ -91,8 +92,6 @@ | |
''; | ||
}; | ||
packages.windmill = pkgs.rustPlatform.buildRustPackage { | ||
inherit (environment) DATABASE_URL PKG_CONFIG_PATH; | ||
|
||
pname = "windmill"; | ||
version = (pkgs.lib.strings.trim (builtins.readFile ./version.txt)); | ||
|
||
|
@@ -111,26 +110,32 @@ | |
}; | ||
}; | ||
|
||
buildFeatures = [ "enterprise" ]; | ||
buildFeatures = [ ]; | ||
doCheck = false; | ||
preBuild = '' | ||
export HOME=$(pwd) | ||
npm config set strict-ssl false | ||
cd backend | ||
sqlx database create | ||
sqlx migrate run | ||
''; | ||
|
||
inherit PKG_CONFIG_PATH; | ||
SQLX_OFFLINE = true; | ||
FRONTEND_BUILD_DIR = "${self.packages.${system}.windmill-client}/build"; | ||
RUSTY_V8_ARCHIVE = (fetch_librusty_v8 { | ||
version = "130.0.1"; | ||
shas = { | ||
x86_64-linux = pkgs.lib.fakeHash; | ||
aarch64-linux = pkgs.lib.fakeHash; | ||
x86_64-darwin = pkgs.lib.fakeHash; | ||
aarch64-darwin = "sha256-d1QTLt8gOUFxACes4oyIYgDF/srLOEk+5p5Oj1ECajQ="; | ||
RUSTY_V8_ARCHIVE = | ||
let | ||
version = "130.0.1"; | ||
target = pkgs.hostPlatform.rust.rustcTarget; | ||
sha256 = { | ||
x86_64-linux = pkgs.lib.fakeHash; | ||
aarch64-linux = pkgs.lib.fakeHash; | ||
x86_64-darwin = pkgs.lib.fakeHash; | ||
aarch64-darwin = "sha256-d1QTLt8gOUFxACes4oyIYgDF/srLOEk+5p5Oj1ECajQ="; | ||
}.${system}; | ||
in pkgs.fetchurl { | ||
name = "librusty_v8-${version}"; | ||
url = "https://github.com/denoland/rusty_v8/releases/download/v${version}/librusty_v8_release_${target}.a.gz"; | ||
inherit sha256; | ||
}; | ||
}); | ||
}; | ||
}); | ||
} |
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