Skip to content

Commit

Permalink
add .direnv folder to .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
fidgetingbits committed Jun 14, 2024
1 parent 6eb6ed2 commit e7dc36e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ next-env.d.ts

# test subset config
packages/test-harness/testSubsetGrep.properties

# nix
.direnv/
69 changes: 32 additions & 37 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,41 @@

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

outputs = { self, nixpkgs }:
outputs =
{ self, nixpkgs }:
let
overlays = [
(final: prev: rec {
nodejs = prev.nodejs-18_x;
pnpm = prev.nodePackages.pnpm;
})
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
supportedSystems =
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs {
inherit overlays system;
};
});
pythonVersion = builtins.replaceStrings
[ "py" ]
[ "python" ]
(nixpkgs.lib.importTOML ./pyproject.toml).tool.ruff.target-version;
forEachSupportedSystem =
f: nixpkgs.lib.genAttrs supportedSystems (system: f { pkgs = import nixpkgs { inherit system; }; });
pythonVersion = builtins.replaceStrings [ "py" ] [
"python"
] (nixpkgs.lib.importTOML ./pyproject.toml).tool.ruff.target-version;
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs
pnpm
pkgs.${pythonVersion}
vsce
pre-commit
];
# To prevent weird broken non-interactive bash terminal
buildInputs = [ pkgs.bashInteractive ];
shellHook = ''
if [ ! -f .git/hooks/pre-commit ]; then
pre-commit install
fi
'';
};
});
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages = with pkgs; [
corepack
pkgs.${pythonVersion}
vsce
pre-commit
];
# To prevent weird broken non-interactive bash terminal
buildInputs = [ pkgs.bashInteractive ];
shellHook = ''
if [ ! -f .git/hooks/pre-commit ]; then
pre-commit install
fi
'';
};
}
);
};
}

0 comments on commit e7dc36e

Please sign in to comment.