try cdi
This commit is contained in:
parent
7001c58d39
commit
7a4fe282de
4 changed files with 42 additions and 21 deletions
|
|
@ -44,6 +44,7 @@
|
||||||
casks = [
|
casks = [
|
||||||
"steam"
|
"steam"
|
||||||
"discord"
|
"discord"
|
||||||
|
"discord@canary"
|
||||||
"Sikarugir-App/sikarugir/sikarugir"
|
"Sikarugir-App/sikarugir/sikarugir"
|
||||||
"zen"
|
"zen"
|
||||||
"python"
|
"python"
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,25 @@ in
|
||||||
|
|
||||||
boot.kernelModules = [ "fuse" ];
|
boot.kernelModules = [ "fuse" ];
|
||||||
programs.fuse.userAllowOther = true;
|
programs.fuse.userAllowOther = true;
|
||||||
|
environment.etc."cdi/fuse.json".text = builtins.toJSON {
|
||||||
|
cdiVersion = "1.1.0";
|
||||||
|
kind = "cdi.nyxerinys.dev/fuse";
|
||||||
|
devices = [
|
||||||
|
{
|
||||||
|
name = "rw";
|
||||||
|
containerEdits = {
|
||||||
|
deviceNodes = [
|
||||||
|
{
|
||||||
|
path = "/dev/fuse";
|
||||||
|
type = "c";
|
||||||
|
fileMode = 438;
|
||||||
|
permissions = "rw";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
6443 # k3s, api server
|
6443 # k3s, api server
|
||||||
|
|
|
||||||
|
|
@ -26,29 +26,30 @@
|
||||||
containerPort = 2222;
|
containerPort = 2222;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
volumeMounts = [
|
# volumeMounts = [
|
||||||
{
|
# {
|
||||||
name = "fuse-device";
|
# name = "fuse-device";
|
||||||
mountPath = "/dev/fuse";
|
# mountPath = "/dev/fuse";
|
||||||
}
|
# }
|
||||||
];
|
# ];
|
||||||
|
resources.requests."cdi.k8s.io/cdi.nyxerinys.dev_fuse" = "1";
|
||||||
securityContext = {
|
securityContext = {
|
||||||
capabilities.add = ["SYS_ADMIN"];
|
capabilities.add = ["SYS_ADMIN"];
|
||||||
privileged = false;
|
# privileged = false;
|
||||||
runAsUser = 0;
|
# runAsUser = 0;
|
||||||
runAsGroup = 0;
|
# runAsGroup = 0;
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
volumes = [
|
|
||||||
{
|
|
||||||
name = "fuse-device";
|
|
||||||
hostPath = {
|
|
||||||
path = "/dev/fuse";
|
|
||||||
type = "CharDevice";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
# volumes = [
|
||||||
|
# {
|
||||||
|
# name = "fuse-device";
|
||||||
|
# hostPath = {
|
||||||
|
# path = "/dev/fuse";
|
||||||
|
# type = "CharDevice";
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ let
|
||||||
KbdInteractiveAuthentication no
|
KbdInteractiveAuthentication no
|
||||||
PubkeyAuthentication no
|
PubkeyAuthentication no
|
||||||
|
|
||||||
PermitRootLogin yes
|
PermitRootLogin no
|
||||||
AllowUsers root
|
AllowUsers dev
|
||||||
|
|
||||||
AllowTcpForwarding yes
|
AllowTcpForwarding yes
|
||||||
X11Forwarding no
|
X11Forwarding no
|
||||||
|
|
@ -81,7 +81,7 @@ pkgs.dockerTools.buildLayeredImage {
|
||||||
mkdir -p ./var/empty
|
mkdir -p ./var/empty
|
||||||
chmod 755 ./var/empty
|
chmod 755 ./var/empty
|
||||||
|
|
||||||
mkdir -p ./home/dev/.ssh
|
mkdir -p ./home/dev/
|
||||||
chown -R 1000:1000 ./home/dev
|
chown -R 1000:1000 ./home/dev
|
||||||
|
|
||||||
mkdir -p ./containers
|
mkdir -p ./containers
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue