24
hosts/common/system/configs/docker/default.nix
Normal file
24
hosts/common/system/configs/docker/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
enableOnBoot = false;
|
||||
storageDriver = "btrfs";
|
||||
|
||||
daemon.settings = {
|
||||
experimental = true;
|
||||
ipv6 = true;
|
||||
fixed-cidr-v6 = "fd00::/80";
|
||||
};
|
||||
|
||||
autoPrune = {
|
||||
enable = true;
|
||||
flags = [ "--all" ];
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
persistence."/persist".directories = [ "/var/lib/docker" ];
|
||||
systemPackages = with pkgs; [ docker-compose ];
|
||||
};
|
||||
}
|
35
hosts/common/user/configs/console/docker/default.nix
Normal file
35
hosts/common/user/configs/console/docker/default.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
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 ];
|
||||
}
|
@@ -5,6 +5,7 @@
|
||||
../common/system/configs/brightnessctl
|
||||
../common/system/configs/btop
|
||||
../common/system/configs/btrfs
|
||||
../common/system/configs/docker
|
||||
../common/system/configs/fastfetch
|
||||
../common/system/configs/getty
|
||||
../common/system/configs/git
|
||||
|
@@ -11,6 +11,7 @@ in
|
||||
(import ../common/user/configs/console/bluetooth { inherit username; })
|
||||
(import ../common/user/configs/console/brightnessctl { inherit username; })
|
||||
(import ../common/user/configs/console/btop { inherit username; })
|
||||
(import ../common/user/configs/console/docker { inherit username; })
|
||||
(import ../common/user/configs/console/ffmpeg { inherit username; })
|
||||
(import ../common/user/configs/console/git { inherit username; })
|
||||
(import ../common/user/configs/console/gpg-agent { inherit username; })
|
||||
|
Reference in New Issue
Block a user