lto server

This commit is contained in:
mjallen18
2025-12-11 21:19:40 -06:00
parent 3364ae8fda
commit 2e4b629805
4 changed files with 197 additions and 191 deletions

View File

@@ -1,29 +1,34 @@
{
config,
lib,
namespace,
...
}:
let
cfg = config.mjallen.sops;
cfg = config.${namespace}.sops;
in
{
imports = [ ./options.nix ];
config = lib.mkIf cfg.enable {
# sops = {
# age.keyFile = "/home/${user}/.config/sops/age/keys.txt";
# defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
# validateSopsFiles = false;
# secrets = {
# "ssh-keys-public/desktop-nixos" = {
# path = "/home/${user}/.ssh/id_ed25519.pub";
# mode = "0644";
# };
# "ssh-keys-private/desktop-nixos" = {
# path = "/home/${user}/.ssh/id_ed25519";
# mode = "0600";
# };
# };
# };
sops = {
age.keyFile = "/home/${config.${namespace}.user.name}/.config/sops/age/keys.txt";
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
validateSopsFiles = false;
secrets = {
"github-token" = { };
};
templates = {
".env".content = ''
GITHUB_TOKEN = "${config.sops.placeholder.github-token}"
'';
};
};
programs.zsh.initExtra = ''
if [ -f ${config.sops.templates.".env".path} ]; then
export $(grep -v '^#' ${config.sops.templates.".env".path} | xargs)
fi
'';
};
}

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
{ lib, namespace, ... }:
with lib;
{
options.mjallen.sops = {
options.${namespace}.sops = {
enable = mkEnableOption "enable sops";
defaultSopsFile = mkOption {