Setup nix run
This commit is contained in:
37
flake.nix
37
flake.nix
@@ -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";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
src = ./.;
|
||||
inputs = [
|
||||
pkgs.python3
|
||||
pkgs.python3Packages.selenium
|
||||
pkgs.chromedriver
|
||||
pkgs.chromium
|
||||
];
|
||||
in {
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.python3
|
||||
pkgs.python3Packages.selenium
|
||||
pkgs.chromedriver
|
||||
pkgs.chromium
|
||||
];
|
||||
|
||||
buildInputs = inputs;
|
||||
shellHook = ''
|
||||
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
14
setup.py
Normal 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",
|
||||
],
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user