My Nix Configuration
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[templates] uv: init

dish 68ff8ae5 e775778f

+166
+3
flake.nix
··· 240 240 ]; 241 241 }; 242 242 }; 243 + templates = { 244 + uv.description = "Python template flake that uses uv"; 245 + }; 243 246 244 247 outputs-builder = channels: { 245 248 # Define default packages to use everywhere
+17
templates/uv/.envrc
··· 1 + if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then 2 + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=" 3 + fi 4 + 5 + # uncomment all commented lines once uv venv has been set up 6 + 7 + # if test -n "$FISH_VERSION"; then 8 + # source ./.venv/bin/activate.fish 9 + # elif test -n "$BASH_VERSION"; then 10 + # source ./.venv/bin/activate 11 + # elif test -n "$NU_VERSION"; then 12 + # source ./.venv/bin/activate.nu 13 + # fi 14 + 15 + # export UV_PYTHON=${PWD}/.venv/bin/python3 16 + 17 + use flake
+1
templates/uv/README.md
··· 1 + # dish's `uv` project template
+59
templates/uv/flake.nix
··· 1 + { 2 + inputs = { 3 + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 4 + pre-commit-hooks.url = "github:cachix/git-hooks.nix"; 5 + pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; 6 + }; 7 + outputs = 8 + { 9 + self, 10 + nixpkgs, 11 + pre-commit-hooks, 12 + ... 13 + }: 14 + let 15 + eachSystem = nixpkgs.lib.genAttrs [ "x86_64-linux" ]; 16 + in 17 + { 18 + devShells = eachSystem ( 19 + system: 20 + let 21 + pkgs = import nixpkgs { inherit system; }; 22 + in 23 + { 24 + default = pkgs.mkShell { 25 + inherit (self.checks.${system}.pre-commit-check) shellHook; 26 + buildInputs = 27 + with pkgs; 28 + [ 29 + python3 30 + just 31 + nixfmt-rfc-style 32 + ruff 33 + uv 34 + ] 35 + ++ self.checks.${system}.pre-commit-check.enabledPackages; 36 + }; 37 + } 38 + ); 39 + checks = eachSystem (system: { 40 + pre-commit-check = pre-commit-hooks.lib.${system}.run { 41 + src = ./.; 42 + hooks = { 43 + check-added-large-files.enable = true; 44 + check-executables-have-shebangs.enable = true; 45 + check-shebang-scripts-are-executable.enable = true; 46 + check-symlinks.enable = true; 47 + end-of-file-fixer.enable = true; 48 + nixfmt-rfc-style.enable = true; 49 + pyright.enable = true; 50 + ruff-format.enable = true; 51 + ruff.enable = true; 52 + # Uncomment for django projects 53 + # ruff-format.excludes = [ "^.*migrations/" ]; 54 + # pyright.excludes = [ "^.*migrations/" ]; 55 + }; 56 + }; 57 + }); 58 + }; 59 + }
+86
templates/uv/pyproject.toml
··· 1 + [build-system] 2 + requires = ["setuptools"] 3 + build-backend = "setuptools.build_meta" 4 + 5 + [project] 6 + name = "uv-template" 7 + version = "0.1.0" 8 + description = "project description" 9 + readme = "README.md" 10 + requires-python = ">=3.12" 11 + authors = [{ name = "Pyrox/dish", email = "pyrox@pyrox.dev" }] 12 + maintainers = [{ name = "Pyrox/dish", email = "pyrox@pyrox.dev" }] 13 + keywords = [] 14 + classifiers = [] 15 + dependencies = [] 16 + 17 + [project.urls] 18 + Homepage = "https://git.pyrox.dev/pyrox/nix" 19 + Documentation = "https://git.pyrox.dev/pyrox/nix" 20 + Repository = "https://git.pyrox.dev/pyrox/nix" 21 + Issues = "https://git.pyrox.dev/pyrox/nix/issues" 22 + 23 + [dependency-groups] 24 + dev = [] 25 + 26 + # Uncomment for django 27 + # [tool.djlint] 28 + # ignore = "H006" 29 + # indent = 2 30 + # profile = "django" 31 + # use_gitignore = true 32 + 33 + [tool.pyright] 34 + venvPath = "." 35 + venv = ".venv" 36 + # Uncomment for django 37 + # exclude = ["**/migrations/*.py", "manage.py", "scripts/*.py"] 38 + 39 + [tool.ruff] 40 + indent-width = 4 41 + 42 + [tool.ruff.format] 43 + # Uncomment for django 44 + # exclude = ["**/migrations/*.py", "manage.py", "scripts/*.py"] 45 + line-ending = "lf" 46 + indent-style = "space" 47 + 48 + [tool.ruff.lint] 49 + select = [ 50 + "A", 51 + "ANN", 52 + "ARG", 53 + "COM", 54 + "DTZ", 55 + "ERA", 56 + "E4", 57 + "E7", 58 + "E9", 59 + "F", 60 + "FURB", 61 + "FLY", 62 + "INP", 63 + "LOG", 64 + "PERF", 65 + "PIE", 66 + "PTH", 67 + "Q", 68 + "RET", 69 + "RUF", 70 + "S", 71 + "SIM", 72 + "T20", 73 + "TCH", 74 + "TID", 75 + "UP", 76 + ] 77 + ignore = ["ANN003", "COM812"] 78 + 79 + [tool.setuptools] 80 + packages = [""] 81 + 82 + [tool.uv] 83 + compile-bytecode = true 84 + package = false 85 + 86 + [tool.uv.sources]