36 lines
886 B
Nix
36 lines
886 B
Nix
{
|
|
username ? throw "username argument is required",
|
|
}:
|
|
{
|
|
config,
|
|
inputs,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
virtualisation.docker.rootless = {
|
|
enable = true;
|
|
setSocketVariable = true;
|
|
enableOnBoot = false;
|
|
storageDriver = "btrfs";
|
|
|
|
daemon.settings = {
|
|
experimental = true;
|
|
ipv6 = true;
|
|
fixed-cidr-v6 = "fd00::/80";
|
|
};
|
|
|
|
autoPrune = {
|
|
enable = true;
|
|
flags = [ "--all" ];
|
|
};
|
|
};
|
|
|
|
# This is not set though home-manager because we need to hide the mount
|
|
# otherwise docker complains with the following error:
|
|
# dockerd-rootless: failed to start daemon: error initializing graphdriver: prerequisites for driver not satisfied (wrong filesystem?): btrfs
|
|
environment.persistence."/persist".users.${username}.directories = [ ".local/share/docker" ];
|
|
|
|
home-manager.users.${username}.home.packages = with pkgs; [ docker-compose ];
|
|
}
|