feat: add sops
We've previously used SOPS for our secrets management and liked it. We
did, however, find the configuration was a bit annoying to do. In aid of
this, we've made a SOPS module that we find a little easier to make the
sort of configurations we want without creating so much mess.
We haven't set up scalpel/equivalent yet - we intend to avoid it if at
all possible. It isn't necessarily out-of-scope but it isn't included in
our current SOPS plans.
Change-Id: I35b9c7e94c12a4f1360833026efe06803d59626e
Reviewed-on: https://git.clicks.codes/c/Infra/NixFiles/+/725
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Samuel Shuert <coded@clicks.codes>
diff --git a/lib/strings/default.nix b/lib/strings/default.nix
new file mode 100644
index 0000000..dccb09f
--- /dev/null
+++ b/lib/strings/default.nix
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2024 Clicks Codes
+#
+# SPDX-License-Identifier: GPL-3.0-only
+
+{ lib, inputs, ... }:
+{
+ strings = {
+ getCommonPrefix =
+ a: b:
+ let
+ prefixLength = lib.strings.commonPrefixLength a b;
+ in
+ builtins.substring 0 prefixLength a;
+ };
+}