Skip to content

Commit

Permalink
Merge pull request #67 from MatrixAI/feature-flake-indirect
Browse files Browse the repository at this point in the history
Indirect package set flake input
  • Loading branch information
brynblack authored Oct 10, 2024
2 parents 79a3850 + 516b73c commit bd752cc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 141 deletions.
116 changes: 11 additions & 105 deletions flake.lock

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

69 changes: 33 additions & 36 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
nixpkgs.follows = "nixpkgs-matrix/nixpkgs";
nixpkgs-matrix.url = "github:matrixai/nixpkgs-matrix";
nixpkgs-matrix = {
type = "indirect";
id = "nixpkgs-matrix";
inputs.nixpkgs.url =
"github:NixOS/nixpkgs?rev=e69e710edfed397959507bcee120ec8a9c7ff03e";
};
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { nixpkgs, flake-utils, ... }:
outputs = { nixpkgs-matrix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
pkgs = nixpkgs-matrix.legacyPackages.${system};

shell = { ci ? false }: with pkgs; mkShell {
nativeBuildInputs = [
nodejs_20
shellcheck
gitAndTools.gh
];
NIX_DONT_SET_RPATH = true;
NIX_NO_SELF_RPATH = true;
shellHook = ''
echo "Entering $(npm pkg get name)"
set -o allexport
. ./.env
set +o allexport
set -v
${
lib.optionalString ci
''
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
''
}
mkdir --parents "$(pwd)/tmp"
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
npm install --ignore-scripts
set +v
'';
};
in
{
shell = { ci ? false }:
with pkgs;
mkShell {
nativeBuildInputs = [ nodejs_20 shellcheck gitAndTools.gh ];
NIX_DONT_SET_RPATH = true;
NIX_NO_SELF_RPATH = true;
shellHook = ''
echo "Entering $(npm pkg get name)"
set -o allexport
. ./.env
set +o allexport
set -v
${lib.optionalString ci ''
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
''}
mkdir --parents "$(pwd)/tmp"
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
npm install --ignore-scripts
set +v
'';
};
in {
devShells = {
default = shell { ci = false; };
ci = shell { ci = true; };
Expand Down

0 comments on commit bd752cc

Please sign in to comment.