Skip to content

Commit

Permalink
WIP: Add flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Lykos153 committed Jun 20, 2022
1 parent d58df01 commit 57f95bd
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#TODO: Find way to inherit this part from direnv template
if ! has nix_direnv_version || ! nix_direnv_version 2.0.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.0.0/direnvrc" "sha256-gMHKKyEOq/T0XmHKgz+pN+fUQC/1EKPAuOtYM95lLnU="
fi
use flake
layout python3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ __pycache__
build/*
*.egg-info/*
*/_version.py
.direnv/*
43 changes: 43 additions & 0 deletions flake.lock

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

25 changes: 25 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
description = "Flake to setup python virtualenv with direnv";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
packages = {
pythonEnv = pkgs.python3.withPackages(
ps: with ps; [
virtualenv
]
);
};

defaultPackage = packages.pythonEnv;
devShell = packages.pythonEnv.env;
});
}

0 comments on commit 57f95bd

Please sign in to comment.