summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-12-31 14:34:47 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-12-31 18:24:34 +0100
commit843c3336314f942bb7139a2c7da7625f98db46ac (patch)
tree32a1d87b6b42e8a7535a1539e5e73f3eda3a90a4 /flake.nix
downloadrenfe-843c3336314f942bb7139a2c7da7625f98db46ac.tar.gz
renfe-843c3336314f942bb7139a2c7da7625f98db46ac.tar.bz2
renfe-843c3336314f942bb7139a2c7da7625f98db46ac.zip
Initial commit
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix36
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;
+    };
+}