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

Nix build fixes #2184

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "GovTool and utilities monorepo.";
inputs = {
default_nixpkgs.url = "github:nixos/nixpkgs/c9ece0059f42e0ab53ac870104ca4049df41b133";
node_nixpkgs.url = "github:nixos/nixpkgs/9957cd48326fe8dbd52fdc50dd2502307f188b0d";
node_nixpkgs.url = "github:nixos/nixpkgs/23aa9e2f958310c69a94d21f6523240841a02d58";
flake-utils.url = "github:numtide/flake-utils";
nix-inclusive.url = "github:input-output-hk/nix-inclusive";
};
Expand Down
7 changes: 3 additions & 4 deletions govtool/backend/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs ? import <nixpkgs> { }, incl }:
{ pkgs ? import <nixpkgs> { }, incl, returnShellEnv ? null }:
let
inherit (pkgs.lib.trivial) pipe;
inherit (pkgs) haskell;
Expand All @@ -21,17 +21,16 @@ let

modifier = drv: pipe drv [ appendLibraries appendTools ];

project = ghcPackages.developPackage {
project = ghcPackages.developPackage ({
root = incl ./. [
./vva-be.cabal
./app
./src
./CHANGELOG.md
./sql
];
modifier = modifier;
overrides = self: super: { openapi3 = useBroken super.openapi3; };
};
} // pkgs.lib.optionalAttrs (returnShellEnv != null) { inherit returnShellEnv; });
in project.overrideAttrs (oldAttrs: {
shellHook = ''
function warn() { tput setaf $2; echo "$1"; tput sgr0; }
Expand Down
13 changes: 10 additions & 3 deletions govtool/frontend/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ let
staticSite = pkgs.stdenv.mkDerivation {
name = "govtool-website";
src = frontendSrc;
buildInputs = [pkgs.yarn nodeModules];
buildInputs = [(pkgs.yarn.override { nodejs = pkgs.nodejs_18;}) nodeModules];
inherit VITE_BASE_URL VITE_IS_DEV VITE_GTM_ID VITE_SENTRY_DSN VITE_NETWORK_FLAG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED VITE_PDF_API_URL;
buildPhase = ''
ln -s ${nodeModules}/libexec/voltaire-voting-app/node_modules node_modules
cp -R ${nodeModules}/libexec/@govtool/frontend/node_modules node_modules

# Yarn links a vite transitive dependency version to
# `node_modules/.bin` rather than the dev declared vite version which then breaks
# the build if we don't do this.
chmod +w node_modules/.bin
ln -sf ../vite/bin/vite.js node_modules/.bin/vite

yarn build
'';
installPhase = ''
Expand Down Expand Up @@ -75,7 +82,7 @@ let
warn "This is a frontend development shell." 4
warn "Read the ${./README.md} to get more info about this module." 8
rm -rf ./node_modules
ln -s ${nodeModules.out}/libexec/voltaire-voting-app/node_modules ./node_modules
ln -s ${nodeModules.out}/libexec/@govtool/frontend/node_modules ./node_modules
'';
};
in staticSite // { inherit nodeModules devShell staticSite webserver; }
Loading
Loading