feat: job context

This commit is contained in:
Guz
2025-08-24 14:27:30 -03:00
parent 58b8ed6353
commit 588dddb07d
4 changed files with 26 additions and 2 deletions

View File

@@ -7,6 +7,10 @@
./secrets.nix
];
context = {
job = false;
};
# GnuPG keyring
programs.gnupg.agent = {
enable = true;

View File

@@ -94,6 +94,7 @@
++ [
./hosts/battleship/configuration.nix
inputs.stylix.nixosModules.stylix
./modules/nixos/context.nix
./home/guz/configuration.nix
];
};
@@ -111,6 +112,7 @@
++ [
./hosts/figther/configuration.nix
inputs.stylix.nixosModules.stylix
./modules/nixos/context.nix
./home/guz-lite/configuration.nix
];
};

View File

@@ -1,5 +1,6 @@
{
self,
lib,
pkgs,
osConfig,
...
@@ -12,10 +13,10 @@
];
devkit.enable = true;
devkit.git.wrapper = pkgs.writeShellScriptBin "git-envs" ''
devkit.git.wrapper = lib.mkIf (osConfig.context.job) (pkgs.writeShellScriptBin "git-envs" ''
source ${osConfig.sops.secrets."guz/git-envs".path}
"$@"
'';
'');
# The *state version* indicates which default
# settings are in effect and will therefore help avoid breaking

17
modules/nixos/context.nix Normal file
View File

@@ -0,0 +1,17 @@
{lib, ...}:
with lib; {
options.context = mkOption {
type = with types; let
primitive = oneOf [
bool
int
str
path
(attrsOf primitive)
(listOf primitive)
];
in
attrsOf primitive;
default = {};
};
}