Skip to content

Instantly share code, notes, and snippets.

@mikelane
Created March 29, 2024 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikelane/899d6619f38458f7d08ad1b0f7192059 to your computer and use it in GitHub Desktop.
Save mikelane/899d6619f38458f7d08ad1b0f7192059 to your computer and use it in GitHub Desktop.
$HOME/my-company/infrastructure/flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devenv.url = "github:cachix/devenv";
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
outputs = { self, nixpkgs, devenv, ... } @ inputs:
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
devShell.x86_64-linux = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
({ pkgs, config, ... }: {
# This is your devenv configuration
env = {
PTPYTHON_CONFIG_HOME = "/home/mikelane/.local/share/ptpython/";
};
dotenv.enable = true;
packages = with pkgs; [
poetry
pre-commit
python312Full
isort
ruff
ruff-lsp
yarn
];
enterShell = ''
echo
echo "===================================================================================================================================================="
echo " Python Executable: $(which python)"
echo " Ruff Executable: $(which ruff)"
echo " iSort Executable: $(which isort)"
echo "===================================================================================================================================================="
echo
'';
})
];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment