Add options for enabling docker-compose services
This commit is contained in:
parent
c8b1a8eee1
commit
00cbecf839
4 changed files with 60 additions and 1 deletions
|
@ -30,7 +30,6 @@ let
|
|||
["aliae" "aliae"]
|
||||
["brave" "Brave Browser"]
|
||||
["discord" "Discord"]
|
||||
["docker" "docker"]
|
||||
["firefox" "Firefox Web Browser"]
|
||||
["openssh" "OpenSSH"]
|
||||
["osu!lazer" "osu!lazer"]
|
||||
|
@ -51,6 +50,7 @@ let
|
|||
["logo-ls" "logo-ls"]
|
||||
["lutris" "Lutris"]
|
||||
["minegrub-theme" "Minegrub Theme"]
|
||||
["nginx" "nginx"]
|
||||
["nodejs-n" "n"]
|
||||
["nuke-usb" "nuke-usb"]
|
||||
["nvidia-dkms" "Nvidia Drivers"]
|
||||
|
@ -83,6 +83,7 @@ let
|
|||
];
|
||||
in {
|
||||
imports = [
|
||||
./programs/docker.nix
|
||||
./programs/git.nix
|
||||
./programs/nextcloud.nix
|
||||
./programs/oh-my-posh.nix
|
||||
|
|
41
lib/modules/programs/docker.nix
Normal file
41
lib/modules/programs/docker.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
|
||||
commonOptions = {
|
||||
enable = mkEnableOption "docker";
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
valhalla = {
|
||||
programs.docker = commonOptions;
|
||||
|
||||
users = mkOption {
|
||||
type = types.attrsOf (types.submodule (
|
||||
{ ... }: {
|
||||
options = {
|
||||
programs.docker = commonOptions;
|
||||
};
|
||||
}));
|
||||
};
|
||||
|
||||
linux = {
|
||||
programs = {
|
||||
docker = {
|
||||
services = {
|
||||
anki-sync.enable = mkEnableOption "Anki Sync server";
|
||||
drone.enable = mkEnableOption "drone server";
|
||||
forgejo.enable = mkEnableOption "Forgejo server";
|
||||
minecraft.enable = mkEnableOption "Minecraft server";
|
||||
nextcloud.enable = mkEnableOption "Nextcloud server";
|
||||
teamspeak.enable = mkEnableOption "TeamSpeak server";
|
||||
trackmania.enable = mkEnableOption "TrackMania server";
|
||||
vaultwarden.enable = mkEnableOption "Vaultwarden server";
|
||||
woodpecker.enable = mkEnableOption "Woodpecker CI server";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -10,6 +10,8 @@ begin
|
|||
docker-compose \
|
||||
docker-buildx \
|
||||
docker-scan
|
||||
|
||||
installSWBase $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -12,5 +12,20 @@ begin
|
|||
sudo usermod -aG docker "$_flag_user"
|
||||
end
|
||||
|
||||
function installSWDependencies -V dir -V args
|
||||
source "$dir/../../../lib/settings.fish"
|
||||
set -la argv $args
|
||||
echo "args: $argv"
|
||||
argparse -i "name=" "user=" -- $argv
|
||||
set -l services (getProgramConfig --name "$_flag_name" --user "$_flag_user" --json | jq '.services')
|
||||
|
||||
for service in (echo "$services" | jq '. | keys[]' --raw-output0 | string split0)
|
||||
|
||||
if echo "$services" | SERVICE=$service jq --exit-status ".[env.SERVICE].enable" >/dev/null
|
||||
fish "$dir/services/$service/main.fish" $argv
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue