diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c72a6fc --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + description = "Renfe flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { self, nixpkgs }: + let + systems = [ "x86_64-darwin" "aarch64-darwin" "x86_64-linux" ]; + createDevShell = system: + let + pkgs = import nixpkgs { system = "${system}"; config.allowUnfree = true; }; + my-python = pkgs.python3; + python-with-my-packages = my-python.withPackages (p: with p; [ + selenium + python-dotenv + ]); + in + pkgs.mkShell { + buildInputs = [ + python-with-my-packages + + # Chrome driver and google-chrome dependencies + pkgs.chromedriver + pkgs.google-chrome + + # Create a script to run google-chrome-stable + (pkgs.writeShellScriptBin "google-chrome" "exec -a $0 ${pkgs.google-chrome}/bin/google-chrome-stable $@") + ]; + }; + in + { + devShell = nixpkgs.lib.genAttrs systems createDevShell; + }; +} |