Make Docker toggleable
This commit is contained in:
parent
6728f32ffc
commit
37673680cd
1 changed files with 14 additions and 10 deletions
|
@ -1,20 +1,24 @@
|
|||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
flake.modules.nixos.pc = {
|
||||
virtualisation = {
|
||||
oci-containers.backend = "docker";
|
||||
flake.modules.nixos.pc = args: {
|
||||
options.docker.enable = lib.mkEnableOption "Enable Docker";
|
||||
|
||||
docker = {
|
||||
enable = true;
|
||||
config = lib.mkIf args.config.docker.enable {
|
||||
virtualisation = {
|
||||
oci-containers.backend = "docker";
|
||||
|
||||
autoPrune = {
|
||||
docker = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
|
||||
autoPrune = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${config.flake.meta.owner.username}.extraGroups = [ "docker" ];
|
||||
users.users.${config.flake.meta.owner.username}.extraGroups = [ "docker" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue