-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
918 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
if [[ ! -d "/home/alex/workspace/rupurt/typerutils" ]]; then | ||
echo "Cannot find source directory; Did you move it?" | ||
echo "(Looking for "/home/alex/workspace/rupurt/typerutils")" | ||
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again' | ||
exit 1 | ||
fi | ||
|
||
# rebuild the cache forcefully | ||
_nix_direnv_force_reload=1 direnv exec "/home/alex/workspace/rupurt/typerutils" true | ||
|
||
# Update the mtime for .envrc. | ||
# This will cause direnv to reload again - but without re-building. | ||
touch "/home/alex/workspace/rupurt/typerutils/.envrc" | ||
|
||
# Also update the timestamp of whatever profile_rc we have. | ||
# This makes sure that we know we are up to date. | ||
touch -r "/home/alex/workspace/rupurt/typerutils/.envrc" "/home/alex/workspace/rupurt/typerutils/.direnv"/*.rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w=" | ||
fi | ||
|
||
export APP_NAME="typerutils" | ||
export REPO="$(expand_path .)" | ||
export LOCAL="$REPO/.local" | ||
export LOCAL_ENVRC="$LOCAL/dev.envrc" | ||
export SCRIPTS="$REPO/scripts" | ||
|
||
source_env_if_exists $LOCAL_ENVRC | ||
|
||
PATH_add bin | ||
|
||
if [[ $AUTO_ACTIVATE != "false" ]]; then | ||
use flake . | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
config, | ||
lib, | ||
dream2nix, | ||
... | ||
}: let | ||
pyproject = lib.importTOML (config.mkDerivation.src + /pyproject.toml); | ||
in { | ||
imports = [ | ||
dream2nix.modules.dream2nix.pip | ||
dream2nix.modules.dream2nix.flags | ||
]; | ||
|
||
deps = { | ||
nixpkgs, | ||
self, | ||
... | ||
}: { | ||
stdenv = nixpkgs.stdenv; | ||
python = nixpkgs.python311; | ||
}; | ||
|
||
flagsOffered = { | ||
groupDev = "include dependencies for optional [dev] pip group"; | ||
}; | ||
|
||
flags = { | ||
groupDev = lib.mkDefault false; | ||
}; | ||
|
||
inherit (pyproject.project) name version; | ||
|
||
mkDerivation = { | ||
src = ./.; | ||
buildInputs = [ | ||
config.deps.python | ||
]; | ||
}; | ||
|
||
buildPythonPackage = { | ||
format = lib.mkForce "pyproject"; | ||
}; | ||
|
||
pip = { | ||
requirementsList = | ||
pyproject.build-system.requires | ||
or [] | ||
++ pyproject.project.dependencies | ||
++ lib.optionals (config.flags.groupDev) pyproject.project.optional-dependencies.dev; | ||
flattenDependencies = true; | ||
overrideAll.deps.python = lib.mkForce config.deps.python; | ||
overrides = { }; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.