feat: init basic scaffolding for docker migration

This commit is contained in:
notohh 2023-05-12 08:18:42 -04:00
parent 941a017882
commit 23278892c5
Signed by: notohh
GPG key ID: BD47506D475EE86D
8 changed files with 60 additions and 5 deletions

View file

@ -22,7 +22,6 @@
xkbVariant = ""; xkbVariant = "";
}; };
virtualisation.docker.enable = true;
users = { users = {
defaultUserShell = pkgs.nushell; defaultUserShell = pkgs.nushell;
users.oh = { users.oh = {
@ -33,7 +32,6 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
docker-compose
hugo hugo
wget wget
python3Full python3Full

View file

@ -6,6 +6,7 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules ../../modules
../../modules/services
]; ];
boot.loader = { boot.loader = {
@ -16,7 +17,6 @@
useOSProber = false; useOSProber = false;
}; };
}; };
networking = { networking = {
hostName = "sakura"; hostName = "sakura";
}; };
@ -26,7 +26,6 @@
xkbVariant = ""; xkbVariant = "";
}; };
virtualisation.docker.enable = true;
users = { users = {
defaultUserShell = pkgs.nushell; defaultUserShell = pkgs.nushell;
users.notoh = { users.notoh = {

View file

@ -26,7 +26,6 @@
xkbVariant = ""; xkbVariant = "";
}; };
virtualisation.docker.enable = true;
users = { users = {
defaultUserShell = pkgs.nushell; defaultUserShell = pkgs.nushell;
users.oh = { users.oh = {

View file

@ -5,5 +5,6 @@
./nix.nix ./nix.nix
./system.nix ./system.nix
./openssh.nix ./openssh.nix
./virtualisation.nix
]; ];
} }

View file

@ -0,0 +1,6 @@
{...}: {
imports = [
./traefik.nix
./homepage.nix
];
}

View file

@ -0,0 +1,7 @@
{pkgs, ...}: {
virtualisation.oci-containers.containers.homepage = {
ports = ["3000:3000"];
image = "ghcr.io/benphelps/homepage";
volumes = ["/home/notoh/docker/homepage:/app/config" "/var/run/docker.sock:/var/run/docker.sock:ro"];
};
}

View file

@ -0,0 +1,29 @@
{...}: {
networking.firewall.allowedTCPPorts = [80 443];
services.traefik = {
enable = true;
group = "docker";
dynamicConfigOptions = {
http = {
routers = {
homepage = {
rule = "Host(`dashboard.lab`)";
entryPoints = ["websecure"];
service = "homepage";
};
};
};
};
staticConfigOptions = {
global = {
checkNewVersion = false;
sendAnonymousUsage = false;
};
entryPoints = {
websecure.address = ":443";
web.address = ":80";
};
};
};
}

View file

@ -0,0 +1,16 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [docker-compose];
virtualisation.oci-containers.backend = "docker";
virtualisation.docker = {
enable = true;
enableOnBoot = true;
autoPrune = {
enable = true;
dates = "weekly";
};
listenOptions = [
"/run/docker.sock"
];
};
}