• 0 Posts
  • 8 Comments
Joined 1 year ago
cake
Cake day: May 6th, 2025

help-circle
  • Here’s an example dev environment for a web scraper provisioned in a flake:

    
    {
      description = "Generic Web Scraper";
    
      inputs = {
        nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
        utils.url = "github:numtide/flake-utils";
      };
    
      outputs = { self, nixpkgs, utils }: utils.lib.eachSystem ["x86_64-linux"] (system: let
        pkgs = import nixpkgs { system = system; };
      in rec {
        packages = {
          pythonEnv =
            pkgs.python3.withPackages (ps: with ps; [ webdriver-manager openpyxl pandas requests beautifulsoup4 websocket-client selenium keyboard ]);
        };
    
        devShell = pkgs.mkShell {
          buildInputs = [
            pkgs.chromium
            pkgs.undetected-chromedriver
            packages.pythonEnv
          ];
    
          shellHook = ''
            export PATH=${pkgs.chromium}/bin:${pkgs.undetected-chromedriver}/bin:$PATH
          '';
        };
      });
    }
    
    

    Not sure if it’s helpful but each Pypi package needs to be declared in that array. There are other ways to do it but this is an example I had laying around.







  • That’s what a winner-take-all, two party system does to you.

    It gets you talking in circles, fighting fellow leftists at the behest of think tanks to come to the defense of fascists because you can’t quite come to the conclusion the rest of us have: that it’s all stage-managed, astroturfed bullshit (these days being churned out by LLM’s posing as authentic accounts on Reddit and Lemmy and PieFED) to get legions of citizens to tacitly approve of their personal Manchurian candidate that will flip a switch when they get into office to funnel more money toward their true masters.