Init the work config v2

Signed-off-by: Hadi <hadi@example.com>
This commit is contained in:
Hadi
2026-04-20 14:05:09 +02:00
parent 28cdcb6dad
commit 80aa828ee5
7 changed files with 225 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
# Those are my secrets, encrypted with sops
# You shouldn't import this file, unless you edit it
{
inputs,
pkgs,
config,
...
}: let
home = config.home.homeDirectory;
in {
imports = [inputs.sops-nix.homeManagerModules.sops];
sops = {
age.keyFile = "${home}/.config/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml;
secrets = {
ssh-config = {path = "${home}/.ssh/config";};
github-key = {path = "${home}/.ssh/github";};
gitlab-key = {path = "${home}/.ssh/gitlab";};
};
};
home.file.".config/nixos/.sops.yaml".text = ''
keys:
- &primary age12yvtj49pfh3fqzqflscm0ek4yzrjhr6cqhn7x89gdxnlykq0xudq5c7334
- &work age1c8pawdsxptfslgrz2c56s39mrtnjzc5mm3hfzgr2wdwu2v6vfsdsupjsq6
creation_rules:
- path_regex: hosts/laptop/secrets/secrets.yaml$
key_groups:
- age:
- *primary
- path_regex: hosts/server/secrets/secrets.yaml$
key_groups:
- age:
- *primary
- path_regex: hosts/work/secrets/secrets.yaml$
key_groups:
- age:
- *work
'';
systemd.user.services.mbsync.Unit.After = ["sops-nix.service"];
home.packages = with pkgs; [sops age];
wayland.windowManager.hyprland.settings.exec-once = ["systemctl --user start sops-nix"];
}