summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2026-05-26 13:01:44 -0400
committerFreya Murphy <freya@freyacat.org>2026-05-26 13:01:44 -0400
commitdb1096e7b1a9417fefe9039d808b213ec3302448 (patch)
treedc6a171f33877dddef047e07edd25790f73dd429 /system
parentadd amd anti lag (diff)
downloaddotfiles-nix-db1096e7b1a9417fefe9039d808b213ec3302448.tar.gz
dotfiles-nix-db1096e7b1a9417fefe9039d808b213ec3302448.tar.bz2
dotfiles-nix-db1096e7b1a9417fefe9039d808b213ec3302448.zip
refactor sops/vpn into modules
Diffstat (limited to 'system')
-rw-r--r--system/default.nix2
-rw-r--r--system/sops.nix27
-rw-r--r--system/vpn.nix38
3 files changed, 67 insertions, 0 deletions
diff --git a/system/default.nix b/system/default.nix
index 39d41bc..fd2e1cc 100644
--- a/system/default.nix
+++ b/system/default.nix
@@ -23,9 +23,11 @@ in {
./fingerprint.nix
./networking.nix
./nvidia.nix
+ ./sops.nix
./sshd.nix
./tpm.nix
./unfree.nix
+ ./vpn.nix
];
# allow flakes
diff --git a/system/sops.nix b/system/sops.nix
new file mode 100644
index 0000000..17f6f13
--- /dev/null
+++ b/system/sops.nix
@@ -0,0 +1,27 @@
+{
+ config,
+ pkgs,
+ lib,
+ inputs,
+ hostDir,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.sops;
+in {
+ imports = [
+ inputs.sops-nix.nixosModules.sops
+ ];
+
+ config = mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ sops
+ ];
+
+ sops = {
+ defaultSopsFile = hostDir + "/secrets.yaml";
+ gnupg.home = config.homePath + "/.local/share/gnupg";
+ gnupg.sshKeyPaths = [];
+ };
+ };
+}
diff --git a/system/vpn.nix b/system/vpn.nix
new file mode 100644
index 0000000..c336f32
--- /dev/null
+++ b/system/vpn.nix
@@ -0,0 +1,38 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.vpn;
+in {
+ config = mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ wireguard-tools
+ ];
+
+ networking.wg-quick.interfaces = {
+ freyanet = {
+ address = [cfg.ip];
+ dns = ["10.2.0.1"];
+ privateKeyFile = config.sops.secrets.freyanetWg.path;
+ autostart = false;
+
+ peers = [
+ {
+ publicKey = "x0ykwakpYCvI/pG+nR83lNUyeOE9m54thnX3bvZ+FUk=";
+ allowedIPs = ["10.0.0.0/8"];
+ endpoint = "freya.cat:3000";
+ persistentKeepalive = 25;
+ }
+ ];
+ };
+ };
+
+ sops = {
+ enable = true;
+ secrets.freyanetWg = {};
+ };
+ };
+}