fix: put empty string if doesn't have secrets
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-09 13:28:14 -05:00
parent 77643378cc
commit 2330fe3104

View file

@ -4,14 +4,17 @@
nixpkgs, nixpkgs,
... ...
}: }:
with lib; { with lib; let
inherit (config.sops.secrets) access-token;
in {
# Minimize dowloads of indirect nixpkgs flakes # Minimize dowloads of indirect nixpkgs flakes
nix = { nix = {
registry.nixpkgs.flake = nixpkgs; registry.nixpkgs.flake = nixpkgs;
nixPath = ["nixpkgs=${nixpkgs}"]; nixPath = ["nixpkgs=${nixpkgs}"];
extraOptions = optionalAttrs (hasAttr "sops" config) '' extraOptions =
!include ${config.sops.secrets.access-token.path} if (hasAttr "sops" config)
''; then "!include ${access-token.path}"
else "";
}; };
# Global hm settings # Global hm settings