feat: init basic scaffolding for docker migration
This commit is contained in:
parent
941a017882
commit
23278892c5
8 changed files with 60 additions and 5 deletions
|
@ -22,7 +22,6 @@
|
|||
xkbVariant = "";
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
users = {
|
||||
defaultUserShell = pkgs.nushell;
|
||||
users.oh = {
|
||||
|
@ -33,7 +32,6 @@
|
|||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
docker-compose
|
||||
hugo
|
||||
wget
|
||||
python3Full
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules
|
||||
../../modules/services
|
||||
];
|
||||
|
||||
boot.loader = {
|
||||
|
@ -16,7 +17,6 @@
|
|||
useOSProber = false;
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "sakura";
|
||||
};
|
||||
|
@ -26,7 +26,6 @@
|
|||
xkbVariant = "";
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
users = {
|
||||
defaultUserShell = pkgs.nushell;
|
||||
users.notoh = {
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
xkbVariant = "";
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
users = {
|
||||
defaultUserShell = pkgs.nushell;
|
||||
users.oh = {
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
./nix.nix
|
||||
./system.nix
|
||||
./openssh.nix
|
||||
./virtualisation.nix
|
||||
];
|
||||
}
|
||||
|
|
6
modules/services/default.nix
Normal file
6
modules/services/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./traefik.nix
|
||||
./homepage.nix
|
||||
];
|
||||
}
|
7
modules/services/homepage.nix
Normal file
7
modules/services/homepage.nix
Normal 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"];
|
||||
};
|
||||
}
|
29
modules/services/traefik.nix
Normal file
29
modules/services/traefik.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
16
modules/virtualisation.nix
Normal file
16
modules/virtualisation.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue