parent
467968eb4f
commit
42ca2912c7
31 changed files with 230 additions and 243 deletions
modules/docker
|
@ -1,10 +1,12 @@
|
|||
{config, ...}: let
|
||||
rwDataDir: {config, ...}: let
|
||||
inherit (config.sops) secrets;
|
||||
inherit (config.khepri) rwDataDir;
|
||||
|
||||
rwPath = rwDataDir + "/projectName";
|
||||
in {
|
||||
khepri.compositions."projectName" = {
|
||||
virtualisation.docker.compose."projectName" = {
|
||||
services = {};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./default.nix;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
khepri: {
|
||||
self: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
|
@ -6,11 +6,11 @@ khepri: {
|
|||
}: let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
|
||||
cfg = config.khepri;
|
||||
cfg = config.roles.docker;
|
||||
in {
|
||||
imports = [khepri.nixosModules.default];
|
||||
imports = [self.inputs.docker-compose.nixosModules.default];
|
||||
|
||||
options.khepri = {
|
||||
options.roles.docker = {
|
||||
enable = mkOption {
|
||||
default = cfg.compositions != {};
|
||||
type = types.bool;
|
||||
|
@ -19,14 +19,6 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
rwDataDir = mkOption {
|
||||
default = "/var/lib/docker";
|
||||
type = types.str;
|
||||
description = ''
|
||||
Directory to place persistent data in.
|
||||
'';
|
||||
};
|
||||
|
||||
storageDriver = mkOption {
|
||||
default = "btrfs"; # I use BTRFS on all my servers
|
||||
type = types.str;
|
||||
|
@ -41,12 +33,9 @@ in {
|
|||
|
||||
daemon.settings.dns = ["8.8.8.8" "1.1.1.1"];
|
||||
};
|
||||
|
||||
# khepri uses oci-containers under the hood and it must be set to docker to work
|
||||
oci-containers.backend = "docker";
|
||||
};
|
||||
|
||||
# Script for updating the images of all images of a compose.nix file
|
||||
# Script for updating the images of a compose.nix file
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage ./updateImage.nix {})
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue