Container: add containers/policy.json
This commit is contained in:
parent
3211d3e2be
commit
1332534734
1 changed files with 31 additions and 4 deletions
35
flake.nix
35
flake.nix
|
@ -60,7 +60,29 @@
|
||||||
with pkgs;
|
with pkgs;
|
||||||
(imagePackages pkgs)
|
(imagePackages pkgs)
|
||||||
++ [
|
++ [
|
||||||
(pkgs.writeTextFile {
|
|
||||||
|
(writeTextFile {
|
||||||
|
name = "containerPolicy";
|
||||||
|
destination = "/etc/containers/policy.json";
|
||||||
|
text = ''
|
||||||
|
{
|
||||||
|
"default": [
|
||||||
|
{
|
||||||
|
"type": "insecureAcceptAnything"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transports":
|
||||||
|
{
|
||||||
|
"docker-daemon":
|
||||||
|
{
|
||||||
|
"": [{"type":"insecureAcceptAnything"}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
||||||
|
(writeTextFile {
|
||||||
name = "passwd";
|
name = "passwd";
|
||||||
destination = "/etc/passwd";
|
destination = "/etc/passwd";
|
||||||
text = builtins.concatStringsSep "\n" [
|
text = builtins.concatStringsSep "\n" [
|
||||||
|
@ -100,7 +122,8 @@
|
||||||
"nobody:x:65534:65534:Unprivileged account (don't use!):/var/empty:/run/current-system/sw/bin/nologin"
|
"nobody:x:65534:65534:Unprivileged account (don't use!):/var/empty:/run/current-system/sw/bin/nologin"
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
(pkgs.writeTextFile {
|
|
||||||
|
(writeTextFile {
|
||||||
name = "group";
|
name = "group";
|
||||||
destination = "/etc/group";
|
destination = "/etc/group";
|
||||||
text = builtins.concatStringsSep "\n" [
|
text = builtins.concatStringsSep "\n" [
|
||||||
|
@ -127,7 +150,8 @@
|
||||||
"nogroup:x:65534:"
|
"nogroup:x:65534:"
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
(pkgs.writeTextFile {
|
|
||||||
|
(writeTextFile {
|
||||||
name = "nsswitch.conf";
|
name = "nsswitch.conf";
|
||||||
destination = "/etc/nsswitch.conf";
|
destination = "/etc/nsswitch.conf";
|
||||||
text = builtins.concatStringsSep "\n" [
|
text = builtins.concatStringsSep "\n" [
|
||||||
|
@ -142,7 +166,8 @@
|
||||||
"rpc: files"
|
"rpc: files"
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
(pkgs.writeTextFile {
|
|
||||||
|
(writeTextFile {
|
||||||
name = "nix.conf";
|
name = "nix.conf";
|
||||||
destination = "/etc/nix/nix.conf";
|
destination = "/etc/nix/nix.conf";
|
||||||
text = builtins.concatStringsSep "\n" [
|
text = builtins.concatStringsSep "\n" [
|
||||||
|
@ -153,6 +178,7 @@
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
extraCommands = builtins.concatStringsSep "\n" [
|
extraCommands = builtins.concatStringsSep "\n" [
|
||||||
# /usr/bin/env
|
# /usr/bin/env
|
||||||
"mkdir usr"
|
"mkdir usr"
|
||||||
|
@ -162,6 +188,7 @@
|
||||||
# root needs a home
|
# root needs a home
|
||||||
"mkdir -vp root"
|
"mkdir -vp root"
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
Cmd = [ "/bin/bash" ];
|
Cmd = [ "/bin/bash" ];
|
||||||
Env = [
|
Env = [
|
||||||
|
|
Loading…
Add table
Reference in a new issue