Skip to content

Commit

Permalink
maid + docker with gcs
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Jul 1, 2024
1 parent 3e14452 commit 8cbe613
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 269 deletions.
4 changes: 3 additions & 1 deletion modules/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
# List your module files here
ssh = import ./ssh.nix;
zsh = import ./zsh.nix;
users = import ./users;
maid = import ./maid.nix;
boot = import ./boot.nix;
data = import ./data.nix;
users = import ./users;
docker = import ./docker.nix;
network = import ./network.nix;
nixpkgs = import ./nixpkgs.nix;
}
23 changes: 23 additions & 0 deletions modules/nixos/docker.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
config,
lib,
pkgs,
inputs,
...
}: {
config = {
virtualisation = {
docker = {
enable = true;
enableOnBoot = true;
autoPrune = {
enable = true;
dates = "daily";
};
};
oci-containers = {
backend = "docker";
};
};
};
}
27 changes: 27 additions & 0 deletions modules/nixos/maid.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
inputs,
...
}: {
config = {
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};

system.autoUpgrade = {
enable = true;
flake = inputs.self.outPath;
flags = [
"--update-input"
"nixpkgs"
"-L" # print build logs
];
dates = "23:59";
randomizedDelaySec = "10min";
};
};
}
113 changes: 52 additions & 61 deletions modules/server/container/kolyma-1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,65 @@
config,
lib,
pkgs,
outputs,
...
}: {
# Enabling docker
config = {
virtualisation = {
docker = {
enable = true;
enableOnBoot = true;
autoPrune.enable = true;
};
oci-containers = {
backend = "docker";
};
};
imports = [
outputs.nixosModules.docker
];

virtualisation.oci-containers.containers = {
# _ __ __ _ __
# | | / /__ / /_ _____(_) /____
# | | /| / / _ \/ __ \/ ___/ / __/ _ \
# | |/ |/ / __/ /_/ (__ ) / /_/ __/
# |__/|__/\___/_.___/____/_/\__/\___/
website = {
image = "ghcr.io/kolyma-labs/gate:master";
ports = ["8440:80"];
};
virtualisation.oci-containers.containers = {
# _ __ __ _ __
# | | / /__ / /_ _____(_) /____
# | | /| / / _ \/ __ \/ ___/ / __/ _ \
# | |/ |/ / __/ /_/ (__ ) / /_/ __/
# |__/|__/\___/_.___/____/_/\__/\___/
website = {
image = "ghcr.io/kolyma-labs/gate:master";
ports = ["8440:80"];
};

# __ ___ ______
# / |/ /___ __ ______ ______________ _/ __/ /_
# / /|_/ / __ \/ / / / __ \/ ___/ ___/ __ `/ /_/ __/
# / / / / /_/ / /_/ / / / / /__/ / / /_/ / __/ /_
# /_/ /_/\____/\__, /_/ /_/\___/_/ \__,_/_/ \__/
# /____/
minecraft = {
image = "itzg/minecraft-server:latest";
volumes = [
"/srv/minecraft:/data"
];
ports = [
"25565:25565"
"25656:25656"
];
environment = {
TYPE = "PAPER";
EULA = "TRUE";
MEMORY = "12G";
};
# __ ___ ______
# / |/ /___ __ ______ ______________ _/ __/ /_
# / /|_/ / __ \/ / / / __ \/ ___/ ___/ __ `/ /_/ __/
# / / / / /_/ / /_/ / / / / /__/ / / /_/ / __/ /_
# /_/ /_/\____/\__, /_/ /_/\___/_/ \__,_/_/ \__/
# /____/
minecraft = {
image = "itzg/minecraft-server:latest";
volumes = [
"/srv/minecraft:/data"
];
ports = [
"25565:25565"
"25656:25656"
];
environment = {
TYPE = "PAPER";
EULA = "TRUE";
MEMORY = "12G";
};
};

# _______ __ ____
# / ____(_) /_ / __ \__ ______ ____ ___ _____
# / / __/ / __/ / /_/ / / / / __ \/ __ \/ _ \/ ___/
# / /_/ / / /_ / _, _/ /_/ / / / / / / / __/ /
# \____/_/\__/ /_/ |_|\__,_/_/ /_/_/ /_/\___/_/
runner-1 = {
image = "gitlab/gitlab-runner:latest";
volumes = [
"/srv/git/runner-1:/etc/gitlab-runner"
"/var/run/docker.sock:/var/run/docker.sock"
];
};
# _______ __ ____
# / ____(_) /_ / __ \__ ______ ____ ___ _____
# / / __/ / __/ / /_/ / / / / __ \/ __ \/ _ \/ ___/
# / /_/ / / /_ / _, _/ /_/ / / / / / / / __/ /
# \____/_/\__/ /_/ |_|\__,_/_/ /_/_/ /_/\___/_/
runner-1 = {
image = "gitlab/gitlab-runner:latest";
volumes = [
"/srv/git/runner-1:/etc/gitlab-runner"
"/var/run/docker.sock:/var/run/docker.sock"
];
};

runner-2 = {
image = "gitlab/gitlab-runner:latest";
volumes = [
"/srv/git/runner-2:/etc/gitlab-runner"
"/var/run/docker.sock:/var/run/docker.sock"
];
};
runner-2 = {
image = "gitlab/gitlab-runner:latest";
volumes = [
"/srv/git/runner-2:/etc/gitlab-runner"
"/var/run/docker.sock:/var/run/docker.sock"
];
};
};
}
Loading

0 comments on commit 8cbe613

Please sign in to comment.