From b51257e5e131ecec4dfdbd823512afb8eae183e2 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Fri, 22 May 2026 15:03:32 -0400 Subject: [PATCH] secrets and safety --- flake.lock | 146 +++++++++++++++++++++++++++++++++++-------- flake.nix | 5 ++ hosts/hl-minipc1.nix | 1 - secrets.nix | 4 ++ 4 files changed, 130 insertions(+), 26 deletions(-) create mode 100644 secrets.nix diff --git a/flake.lock b/flake.lock index e81643f..3f9e058 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1770165109, + "narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=", + "owner": "ryantm", + "repo": "agenix", + "rev": "b027ee29d959fda4b60b57566d64c98a202e0feb", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "aquamarine": { "inputs": { "hyprutils": [ @@ -101,13 +122,35 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "determinate": { "inputs": { "determinate-nixd-aarch64-darwin": "determinate-nixd-aarch64-darwin", "determinate-nixd-aarch64-linux": "determinate-nixd-aarch64-linux", "determinate-nixd-x86_64-linux": "determinate-nixd-x86_64-linux", "nix": "nix", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1776975946, @@ -375,6 +418,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -494,8 +558,8 @@ "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "hyprwire": "hyprwire", - "nixpkgs": "nixpkgs_3", - "systems": "systems" + "nixpkgs": "nixpkgs_4", + "systems": "systems_2" }, "locked": { "lastModified": 1777159923, @@ -636,7 +700,7 @@ "inputs": { "flake-parts": "flake-parts", "git-hooks-nix": "git-hooks-nix", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-23-11": "nixpkgs-23-11", "nixpkgs-regression": "nixpkgs-regression" }, @@ -727,16 +791,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1761597516, - "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", - "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", - "revCount": 811874, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.811874%2Brev-daf6dc47aa4b44791372d6139ab7b25269184d55/019a3494-3498-707e-9086-1fb81badc7fe/source.tar.gz" + "lastModified": 1754028485, + "narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "59e69648d345d6e8fef86158c555730fa12af9de", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2505" + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-23-11": { @@ -786,6 +852,20 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1761597516, + "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", + "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", + "revCount": 811874, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.811874%2Brev-daf6dc47aa4b44791372d6139ab7b25269184d55/019a3494-3498-707e-9086-1fb81badc7fe/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2505" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1776329215, "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=", @@ -799,7 +879,7 @@ "url": "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1772433332, "narHash": "sha256-izhTDFKsg6KeVBxJS9EblGeQ8y+O8eCa6RcW874vxEc=", @@ -815,7 +895,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1777077449, "narHash": "sha256-AIiMJiqvGrN4HyLEbKAoCSRRYn0rnlW5VbKNIMIYqm4=", @@ -856,7 +936,7 @@ "noctalia", "nixpkgs" ], - "systems": "systems_2", + "systems": "systems_3", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -922,20 +1002,21 @@ }, "root": { "inputs": { + "agenix": "agenix", "determinate": "determinate", "dms": "dms", "git-hooks": "git-hooks", - "home-manager": "home-manager", + "home-manager": "home-manager_2", "hyprlauncher": "hyprlauncher", "nix-darwin": "nix-darwin", "nix-flatpak": "nix-flatpak", "nix-index-database": "nix-index-database", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-unstable": "nixpkgs-unstable", "noctalia": "noctalia", "stylix": "stylix", - "systems": "systems_4" + "systems": "systems_5" } }, "stylix": { @@ -951,7 +1032,7 @@ "nixpkgs" ], "nur": "nur", - "systems": "systems_3", + "systems": "systems_4", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -975,16 +1056,16 @@ }, "systems": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -1004,6 +1085,21 @@ } }, "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1018,7 +1114,7 @@ "type": "github" } }, - "systems_4": { + "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/flake.nix b/flake.nix index 5edbec5..d5b8bc3 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,8 @@ }; # Hyprland hyprlauncher.url = "github:hyprwm/hyprlauncher"; + # Secrets management + agenix.url = "github:ryantm/agenix"; }; outputs = @@ -64,6 +66,7 @@ , noctalia , git-hooks , nix-index-database + , agenix , }: let @@ -85,6 +88,7 @@ systems nix-flatpak stylix + agenix ; specialArgs = { @@ -120,6 +124,7 @@ nixpkgs-fmt nixd nh + agenix.packages.${system}.default home-manager.packages.${system}.home-manager ]; shellHook = '' diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1.nix index a17dc88..f36973b 100644 --- a/hosts/hl-minipc1.nix +++ b/hosts/hl-minipc1.nix @@ -11,7 +11,6 @@ let stateDir = "/var/lib/sosnovsky/gitea"; sshPort = 2222; httpPort = 3000; - sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPXJ3NWIHsFMKhNp5FUSJcZU4eevhKyfcHR9dyCSbo19 ari@fwbook"; }; openPorts = [ ports.nixServe diff --git a/secrets.nix b/secrets.nix new file mode 100644 index 0000000..ec445a2 --- /dev/null +++ b/secrets.nix @@ -0,0 +1,4 @@ +let + ari = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKLp2hDlkPNyOoU/4evHPIyCdQQCsCOBqP59klwHWvH0 ariel@sosnovsky.ca"; +in +{ }