mirror of
https://github.com/Alexandre1a/NixOSDots.git
synced 2026-03-10 00:09:46 +01:00
Changed the location of secrets.nix and adapted it
This commit is contained in:
parent
1f9a3f6869
commit
4818ff82af
@ -5,9 +5,11 @@
|
||||
imports = [
|
||||
inputs.spicetify-nix.homeManagerModules.spicetify
|
||||
../../modules/home-manager/spicetify.nix
|
||||
../../modules/home-manager/secrets.nix
|
||||
../../modules/common/zed.nix
|
||||
];
|
||||
|
||||
|
||||
programs = {
|
||||
# Git config
|
||||
git = {
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
imports =
|
||||
[
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
../../modules/nixos/secrets.nix # Sops
|
||||
../../modules/nixos/wireless.nix # For the wifi
|
||||
../../modules/nixos/locale.nix # For localisation options
|
||||
|
||||
@ -377,15 +377,16 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Secrets management with Sops-nix
|
||||
sops.secrets = lib.mkIf (cfg.githubToken != null || cfg.braveSearchApiKey != null) {
|
||||
"zed/github_token" = lib.mkIf (cfg.githubToken != null) {
|
||||
sopsFile = ../../secrets/secrets.yaml;
|
||||
owner = config.home.username or "alex";
|
||||
};
|
||||
"zed/brave_api_key" = lib.mkIf (cfg.braveSearchApiKey != null) {
|
||||
sopsFile = ../../secrets/secrets.yaml;
|
||||
owner = config.home.username or "alex";
|
||||
|
||||
sops = lib.mkIf (cfg.githubToken != null || cfg.braveSearchApiKey != null) {
|
||||
secrets = {
|
||||
"zed/github_token" = lib.mkIf (cfg.githubToken != null) {
|
||||
sopsFile = ../../secrets/secrets.yaml;
|
||||
};
|
||||
|
||||
"zed/brave_api_key" = lib.mkIf (cfg.braveSearchApiKey != null) {
|
||||
sopsFile = ../../secrets/secrets.yaml;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
sops = {
|
||||
defaultSopsFile = ../../secrets/secrets.yaml;
|
||||
defaultSopsFormat = "yaml";
|
||||
|
||||
age.keyFile = "/home/alex/.config/sops/age/keys.txt";
|
||||
age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user