From a9a2a9e3452ee7052c8c11b9efeca63b9a5f36d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20Gir=C3=A3o?= <git@rafael.ovh>
Date: Thu, 23 Nov 2023 12:37:02 +0000
Subject: [PATCH] test: use gitlab caching

---
 .gitignore     | 3 +++
 .gitlab-ci.yml | 4 ++++
 README.md      | 3 +++
 flake.nix      | 3 ++-
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index aaa329d..2dfe37e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,3 +105,6 @@ tags
 
 # End of https://www.toptal.com/developers/gitignore/api/git,osx,vim,linux,visualstudiocode
 
+.direnv
+.envrc
+.pre-commit-config.yaml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index aa7acef..07e1ab0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,10 @@ before_script:
 pages:
   script:
   - nix develop --extra-experimental-features "nix-command flakes" .#ci -c "./src/entrypoint.sh"
+  cache:
+    - key:
+      paths:
+        - /nix/store
   artifacts:
     paths:
       # The folder that contains the files to be exposed at the Page URL
diff --git a/README.md b/README.md
index 0addf37..8636480 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,6 @@
 Original source: https://gitlab.com/malware-filter/phishing-filter
 
 Mirror: https://repo.dsi.tecnico.ulisboa.pt/rafaelsgirao/phishing-filter
+
+Uses Gitlab CI caching:
+https://docs.gitlab.com/ee/ci/caching/
diff --git a/flake.nix b/flake.nix
index e8b9ad9..8524f39 100644
--- a/flake.nix
+++ b/flake.nix
@@ -35,7 +35,7 @@
         # ...
       ];
       # perSystem = { config, self', inputs', pkgs, system, ... }: {
-      perSystem = { pkgs, ... }: {
+      perSystem = { config, pkgs, ... }: {
         # Per-system attributes can be defined here. The self' and inputs'
         # module parameters provide easy access to attributes of the same
         # system.
@@ -58,6 +58,7 @@
 
           #  shellHook (default: ""). Bash statements that are executed by nix-shell.
           shellHook = ''
+            ${config.pre-commit.installationScript}
             export DEBUG=1
           '';
 
-- 
GitLab