Setup nix run

This commit is contained in:
2025-02-17 12:22:04 -08:00
parent 75948c5271
commit 0685229d19
2 changed files with 42 additions and 9 deletions

View File

@@ -1,24 +1,43 @@
{ {
description = "Development shell for google-cookie-retrieval"; description = "Development shell + app for google-cookie-retrieval";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
in { src = ./.;
devShells.${system}.default = pkgs.mkShell { inputs = [
buildInputs = [
pkgs.python3 pkgs.python3
pkgs.python3Packages.selenium pkgs.python3Packages.selenium
pkgs.chromedriver pkgs.chromedriver
pkgs.chromium pkgs.chromium
]; ];
in {
devShells.${system}.default = pkgs.mkShell {
buildInputs = inputs;
shellHook = '' shellHook = ''
echo "Development shell with Python, Selenium, and Chromedriver loaded." echo "Development shell with Python, Selenium, and Chromedriver loaded."
''; '';
}; };
packages.${system}.default = pkgs.python3Packages.buildPythonApplication {
pname = "google-cookie-retrieval";
version = "0.1.0";
src = self;
propagatedBuildInputs = inputs;
installPhase = ''
mkdir -p $out/bin
cp selenium_cookie_extractor_json.py $out/bin/google-cookie-retrieval
chmod +x $out/bin/google-cookie-retrieval
'';
};
apps.${system}.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/google-cookie-retrieval";
};
}; };
} }

14
setup.py Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python3
from setuptools import setup
setup(
name="google-cookie-retrieval",
version="0.1.0",
py_modules=["google_cookie_retrieval"], # The filename minus `.py`
entry_points={
"console_scripts": [
"google-cookie-retrieval = google_cookie_retrieval:main",
],
},
)