Skip to content

Commit

Permalink
🔒️ Manage GPG key using sops
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtaran committed May 4, 2024
1 parent eded0e7 commit 80dda8e
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .sops.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
keys:
- &user_mahtaran age1k9lqlzmpumn2x5ravmyrtnu44nhwzqanu8s0wv57amccvtlsud0qc2wenc
- &host_feanor age1m3fvful26zmrymxpv69ms2jj7cr4yksk65s2yg54sn5ehr9gp52s64tzcz
- &host_feanor age100vsh92w94np56zyf7umay3pv39593rjldy5mxvluslla0c9ufvq55cppt
creation_rules:
- path_regex: secret/user/mahtaran/[^/]+\.yaml$
key_groups:
Expand Down
130 changes: 63 additions & 67 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@

outputs = inputs @ {...}:
let
onInstallMedia = builtins.pathExists /home/nixos;
mkSystem = { entry, arch, extraModules, users, ... }:
inputs.nixpkgs.lib.nixosSystem {
system = arch;
specialArgs = {
inherit inputs;
inherit onInstallMedia;
};

modules = [
Expand All @@ -62,10 +64,14 @@
home-manager = {
extraSpecialArgs = {
inherit inputs;
inherit onInstallMedia;
};
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [inputs.nur.hmModules.nur];
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
inputs.nur.hmModules.nur
];

users = users;
};
Expand Down
12 changes: 7 additions & 5 deletions host/feanor/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
lib,
pkgs,
inputs,
onInstallMedia,
...
}:
let
onInstallMedia = builtins.pathExists /home/nixos;
in {
}: {
imports = [
./hardware.nix

Expand Down Expand Up @@ -138,6 +136,10 @@ in {
"Music"
"Pictures"
"Videos"
{
directory = ".config/sops/age";
mode = "u=rwx,g=,o=";
}
{
directory = ".gnupg";
mode = "u=rwx,g=,o=";
Expand Down Expand Up @@ -306,7 +308,7 @@ in {
};

# List services that you want to enable:

# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
Expand Down
Loading

0 comments on commit 80dda8e

Please sign in to comment.