sops-nix
sops-nix copied to clipboard
Placeholder dont seem to work with nix-darwin
Hi, this config
let
packageSet = import ./packages.nix { inherit pkgs; };
opencode-package = pkgs.callPackage ../custom/opencode { };
in
{
sops.defaultSopsFile = ../secrets/secrets.yaml;
sops.age.keyFile = "/Users/victor/.config/sops/age/keys.txt";
# needed to stop warnings about sshkeys missing, the above path is the corerct source
sops.gnupg.sshKeyPaths = [ ];
sops.age.sshKeyPaths = [ ];
sops.secrets.github_token = {
owner = "victor";
};
sops.secrets.tavily_api_key = {
owner = "victor";
};
environment.systemPackages = [
pkgs.lazygit
pkgs.neovim
pkgs.nushell
pkgs.nufmt
pkgs.tmux
pkgs.nixfmt-rfc-style
pkgs.jujutsu
pkgs.git
pkgs.direnv
opencode-package
] ++ packageSet.allPackages;
nix.settings = {
experimental-features = "nix-command flakes";
extra-platforms = "x86_64-darwin aarch64-darwin";
extra-access-tokens = [
"github.com=${config.sops.placeholder.github_token}"
];
};
programs.fish.enable = true;
users.users."victor".shell = pkgs.fish;
users.knownUsers = [ "victor" ];
users.users.victor.uid = 501;
system.configurationRevision = config.selfRev or config.selfDirtyRev or null;
system.stateVersion = 6;
system.primaryUser = "victor";
nixpkgs.hostPlatform = "aarch64-darwin";
environment.etc."nix-darwin".source = "/Users/victor/.config/nix-darwin";
environment.variables.TAVILY_API_KEY = config.sops.placeholder.tavily_api_key;
programs.direnv.enable = true;
}
gives me this error, is this not the appropiate way to use place holders?
error: attribute 'tavily_api_key' missing
at /nix/store/jdsi3bp9hzgxzhkgrfvspp2hihab4azn-source/nix-darwin/modules/configuration.nix:50:42:
49| environment.etc."nix-darwin".source = "/Users/victor/.config/nix-darwin";
50| environment.variables.TAVILY_API_KEY = config.sops.placeholder.tavily_api_key;
| ^
51| programs.direnv.enable = true;
and also this error
error: attribute 'github_token' missing
at /nix/store/wqnvh666b4dxjp36qfdhidl4yvajvbbb-source/nix-darwin/modules/configuration.nix:37:21:
36| extra-access-tokens = [
37| "github.com=${config.sops.placeholder.github_token}"
| ^
38| ];