nixos-configs/nixosModules/base/common-nix/default.nix
matt1432 c43560ff95
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: get rid of vars and move common to modules
2024-11-22 23:15:13 -05:00

31 lines
653 B
Nix

self: {
config,
lib,
...
}: let
inherit (lib) hasAttr mkIf optionalString;
inherit (self.inputs) nixpkgs;
inherit (config.sops.secrets) access-token;
cfg = config.roles.base;
in {
config = mkIf cfg.enable {
# Minimize dowloads of indirect nixpkgs flakes
nix = {
registry.nixpkgs.flake = nixpkgs;
nixPath = ["nixpkgs=${nixpkgs}"];
extraOptions =
optionalString (hasAttr "sops" config)
"!include ${access-token.path}";
};
# Global hm settings
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
};
# For accurate stack trace
_file = ./default.nix;
}