From 578ddba8c16f6394d86b362da053c059a1dedcff Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Thu, 27 Mar 2025 11:09:41 +0100 Subject: [PATCH] initial commit --- .gitignore | 1 + LICENSE | 24 ++++++++++++++++++++++++ README.md | 5 +++++ flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 16 ++++++++++++++++ shell.nix | 28 ++++++++++++++++++++++++++++ 6 files changed, 117 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87a15c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.venv diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/README.md b/README.md new file mode 100644 index 0000000..7cd7be0 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +## Venv for Kathara + +### Usage: + +run `nix develop`. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..957dc1d --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1742889210, + "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "698214a32beb4f4c8e3942372c694f40848b360d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..61d2e26 --- /dev/null +++ b/flake.nix @@ -0,0 +1,16 @@ +{ + description = "kathara venv"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + systems.url = "github:nix-systems/default-linux"; + }; + + outputs = inputs: let + eachSystem = inputs.nixpkgs.lib.genAttrs (import inputs.systems); + pkgsFor = inputs.nixpkgs.legacyPackages; + in { + devShells = eachSystem (system: { + default = pkgsFor.${system}.callPackage ./shell.nix {}; + }); + }; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..07c89e2 --- /dev/null +++ b/shell.nix @@ -0,0 +1,28 @@ +{ + mkShell, + python3Packages, +}: let + inherit (python3Packages) python venvShellHook; +in + mkShell { + name = "impurePythonEnv"; + venvDir = "./.venv"; + buildInputs = [ + python + + venvShellHook + ]; + + # Run this command, only after creating the virtual environment + postVenvCreation = '' + unset SOURCE_DATE_EPOCH + pip install kathara + ''; + + # Now we can execute any commands within the virtual environment. + # This is optional and can be left out to run pip manually. + postShellHook = '' + # allow pip to install wheels + unset SOURCE_DATE_EPOCH + ''; + }