50 lines
1.1 KiB
Nix
Raw Normal View History

2025-01-01 14:10:08 -05:00
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
virtualisation.docker.enable = true;
2025-01-12 20:31:52 -05:00
# Use docker activation
virtualisation.docker.enableOnBoot = false;
# Rootless docker breaks access to ssh for buildkit.
# virtualisation.docker.rootless = {
# enable = true;
# setSocketVariable = true;
# };
# Give docker access to ssh for fetching repos with buildkit.
virtualisation.docker.extraPackages = [ pkgs.openssh ];
environment.systemPackages = with pkgs; [
docker-buildx
];
2025-01-01 14:10:08 -05:00
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
hideMounts = true;
directories = [
{
directory = "/var/lib/docker";
user = "root";
group = "root";
mode = "0740";
}
];
2025-01-12 20:31:52 -05:00
# users.talexander = {
# directories = [
# {
# directory = ".local/share/docker";
# user = "talexander";
# group = "talexander";
# mode = "0740";
# }
# ];
# };
2025-01-01 14:10:08 -05:00
};
2025-01-12 20:31:52 -05:00
# Needed for non-rootless docker
users.users.talexander.extraGroups = [ "docker" ];
2025-01-01 14:10:08 -05:00
}