feat(ops/modules): Provide some modules to all nixoses
For modules that are gated behind a mkEnableOption, it's reasonable to just provide them to all Depot-built nixos systems without requiring people to explicitly import them. This defines a special module called `default-imports.nix` which imports these modules (currently just tvl-cache.nix and automatic-gc.nix, as I'm being rather conservative adding things here to avoid breaking anyone's system), then provides that module as one of the `modules` passed at the top-level nixos/eval-config invocation. Change-Id: I3be299ab10ae4c451ef11c514edb3c89318a2278 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4345 Tested-by: BuildkiteCI Autosubmit: grfn <grfn@gws.fyi> Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
01f4212ca1
commit
d85c6a1b56
4 changed files with 18 additions and 5 deletions
|
@ -7,7 +7,6 @@ let
|
|||
in {
|
||||
imports = [
|
||||
"${depot.path}/ops/modules/atward.nix"
|
||||
"${depot.path}/ops/modules/automatic-gc.nix"
|
||||
"${depot.path}/ops/modules/clbot.nix"
|
||||
"${depot.path}/ops/modules/gerrit-queue.nix"
|
||||
"${depot.path}/ops/modules/git-serving.nix"
|
||||
|
|
13
ops/modules/default-imports.nix
Normal file
13
ops/modules/default-imports.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ depot, ... }:
|
||||
|
||||
# Default set of modules that are imported in all Depot nixos systems
|
||||
#
|
||||
# All modules here should be properly gated behind a `lib.mkEnableOption` with a
|
||||
# `lib.mkIf` for the config.
|
||||
|
||||
{
|
||||
imports = [
|
||||
./automatic-gc.nix
|
||||
./tvl-cache.nix
|
||||
];
|
||||
}
|
7
third_party/default.nix
vendored
7
third_party/default.nix
vendored
|
@ -12,7 +12,7 @@
|
|||
# other folders below //third_party, other than the ones mentioned
|
||||
# above.
|
||||
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, depot, ... }:
|
||||
|
||||
{
|
||||
# Expose a partially applied NixOS, expecting an attribute set with
|
||||
|
@ -33,7 +33,10 @@
|
|||
let
|
||||
eval = import "${pkgs.path}/nixos/lib/eval-config.nix" {
|
||||
inherit specialArgs system;
|
||||
modules = [ configuration ];
|
||||
modules = [
|
||||
configuration
|
||||
(import "${depot.path + "/ops/modules/default-imports.nix"}")
|
||||
];
|
||||
};
|
||||
|
||||
# This is for `nixos-rebuild build-vm'.
|
||||
|
|
|
@ -18,8 +18,6 @@ config: let
|
|||
in lib.fix(self: {
|
||||
imports = [
|
||||
"${depot.third_party.impermanence}/nixos.nix"
|
||||
"${depot.path + "/ops/modules/automatic-gc.nix"}"
|
||||
"${depot.path + "/ops/modules/tvl-cache.nix"}"
|
||||
"${pkgs.home-manager.src}/nixos"
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue