feat: job context
This commit is contained in:
@@ -7,6 +7,10 @@
|
|||||||
./secrets.nix
|
./secrets.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
context = {
|
||||||
|
job = false;
|
||||||
|
};
|
||||||
|
|
||||||
# GnuPG keyring
|
# GnuPG keyring
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
++ [
|
++ [
|
||||||
./hosts/battleship/configuration.nix
|
./hosts/battleship/configuration.nix
|
||||||
inputs.stylix.nixosModules.stylix
|
inputs.stylix.nixosModules.stylix
|
||||||
|
./modules/nixos/context.nix
|
||||||
./home/guz/configuration.nix
|
./home/guz/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -111,6 +112,7 @@
|
|||||||
++ [
|
++ [
|
||||||
./hosts/figther/configuration.nix
|
./hosts/figther/configuration.nix
|
||||||
inputs.stylix.nixosModules.stylix
|
inputs.stylix.nixosModules.stylix
|
||||||
|
./modules/nixos/context.nix
|
||||||
./home/guz-lite/configuration.nix
|
./home/guz-lite/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
self,
|
self,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
osConfig,
|
osConfig,
|
||||||
...
|
...
|
||||||
@@ -12,10 +13,10 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
devkit.enable = true;
|
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}
|
source ${osConfig.sops.secrets."guz/git-envs".path}
|
||||||
"$@"
|
"$@"
|
||||||
'';
|
'');
|
||||||
|
|
||||||
# The *state version* indicates which default
|
# The *state version* indicates which default
|
||||||
# settings are in effect and will therefore help avoid breaking
|
# 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