Skip to content

Commit

Permalink
Add a Nix flake for development (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre authored Jan 9, 2024
1 parent 864ec25 commit 0b54630
Show file tree
Hide file tree
Showing 4 changed files with 292 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake . --impure
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ config/*
storage/
lib/
srv/
/.devenv
/.direnv

# Derived from /src/parsers/jsonschemas
/src/backends/jsontypes
Expand Down
252 changes: 252 additions & 0 deletions flake.lock

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

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "Conference Bot";

inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixos-23.05";
devenv.url = "github:cachix/devenv/v0.6.3";
};

outputs = inputs @ { self, nixpkgs, utils, devenv }:
utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages."${system}";
in rec {
# `nix develop`
devShell = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
languages = {
javascript.enable = true;
typescript.enable = true;
};

env = {
# Work around 'digital envelope routines::unsupported'
# source: https://stackoverflow.com/a/75536711
NODE_OPTIONS = "--openssl-legacy-provider";
};

packages = with pkgs; [
yarn
];
}
];
};
});
}

0 comments on commit 0b54630

Please sign in to comment.