mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:59:23 +08:00
整理 docker 和 waydroid
This commit is contained in:
@@ -147,6 +147,7 @@
|
||||
./modules/packages
|
||||
./modules/boot
|
||||
./modules/system
|
||||
./modules/virtualization
|
||||
(inputs: { config.nixos =
|
||||
{
|
||||
fileSystems =
|
||||
@@ -217,6 +218,11 @@
|
||||
hostname = "chn-PC";
|
||||
march = "alderlake";
|
||||
};
|
||||
virtualization =
|
||||
{
|
||||
waydroid.enable = true;
|
||||
docker.enable = true;
|
||||
};
|
||||
};}
|
||||
)
|
||||
|
||||
@@ -240,10 +246,8 @@
|
||||
./modules/packages/hpc.nix
|
||||
[ ./modules/users/root.nix {} ]
|
||||
[ ./modules/users/chn.nix {} ]
|
||||
./modules/virtualisation/docker.nix
|
||||
./modules/virtualisation/kvm_guest.nix
|
||||
./modules/virtualisation/kvm_host.nix
|
||||
./modules/virtualisation/waydroid.nix
|
||||
./modules/home/root.nix
|
||||
./modules/home/chn.nix
|
||||
]
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
config.virtualisation.docker =
|
||||
{
|
||||
enable = true;
|
||||
rootless = { enable = true; setSocketVariable = true; };
|
||||
enableNvidia = true;
|
||||
storageDriver = "overlay2";
|
||||
};
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# sudo waydroid shell wm set-fix-to-user-rotation enabled
|
||||
{ config.virtualisation = { waydroid.enable = true; }; }
|
||||
25
modules/virtualization/default.nix
Normal file
25
modules/virtualization/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.virtualization = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
waydroid.enable = mkOption { default = false; type = types.bool; };
|
||||
docker.enable = mkOption { default = false; type = types.bool; };
|
||||
};
|
||||
config = let inherit (inputs.lib) mkMerge mkIf; in mkMerge
|
||||
[
|
||||
# waydroid
|
||||
(mkIf inputs.config.nixos.virtualization.waydroid.enable { virtualisation = { waydroid.enable = true; }; })
|
||||
# docker
|
||||
(
|
||||
mkIf inputs.config.nixos.virtualization.docker.enable { virtualisation.docker =
|
||||
{
|
||||
enable = true;
|
||||
rootless = { enable = true; setSocketVariable = true; };
|
||||
enableNvidia = true;
|
||||
storageDriver = "overlay2";
|
||||
}; }
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
# sudo waydroid shell wm set-fix-to-user-rotation enabled
|
||||
Reference in New Issue
Block a user