feat: job context
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
./secrets.nix
|
||||
];
|
||||
|
||||
context = {
|
||||
job = false;
|
||||
};
|
||||
|
||||
# GnuPG keyring
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
|
||||
@@ -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
|
||||
];
|
||||
};
|
||||
|
||||
@@ -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
17
modules/nixos/context.nix
Normal 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 = {};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user