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

[#188] Develop NIX configuration for frontend #448

Merged
merged 3 commits into from
Mar 12, 2024
Merged
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
5 changes: 1 addition & 4 deletions govtool/backend/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# TODO: Remove the sources file and use the nixpkgs version provided from the
# flakes lock file instead when the flakes feature is present and enabled in the
# root of the project.
{ pkgs ? (import ./sources.nix).pkgs }:
{ pkgs ? import <nixpkgs> {} }:
let
# This is the version of the Haskell compiler we reccommend using.
ghcPackages = pkgs.haskell.packages.ghc927;
Expand Down
16 changes: 16 additions & 0 deletions govtool/backend/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> {} }:
let
project = import ./default.nix { inherit pkgs; };
in
project.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ (with pkgs; [
awscli
docker
git
gnumake
]);

shellHook = ''
ln -s ${project}/libexec/yarn-nix-example/node_modules node_modules
'';
})
21 changes: 7 additions & 14 deletions govtool/frontend/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
# This file has been generated by node2nix 1.11.1. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_18"}:

{ pkgs ? import <nixpkgs> {} }:
let
nodeEnv = import ./node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
project = pkgs.mkYarnPackage {
name = "govtool-frontend";
src = ./.;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
project
Loading