-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sysbox: init at 0.6.2 #273241
base: master
Are you sure you want to change the base?
sysbox: init at 0.6.2 #273241
Changes from all commits
633a0e5
9ea3c05
2cddc3a
84bf710
ea0591b
932b968
c92dbde
e5bdd4b
5af174e
9878ab3
1f40464
8239b41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9143,6 +9143,12 @@ | |
githubId = 1792886; | ||
name = "Julien Malka"; | ||
}; | ||
juliosueiras = { | ||
email = "[email protected]"; | ||
github = "juliosueiras"; | ||
githubId = 3680302; | ||
name = "Julio Tain Sueiras"; | ||
}; | ||
juliusrickert = { | ||
email = "[email protected]"; | ||
github = "juliusrickert"; | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,73 @@ | ||||||||||
{ config, lib, pkgs, ... }: | ||||||||||
|
||||||||||
with lib; | ||||||||||
|
||||||||||
let | ||||||||||
cfg = config.virtualisation.sysbox; | ||||||||||
in | ||||||||||
|
||||||||||
{ | ||||||||||
###### interface | ||||||||||
|
||||||||||
options.virtualisation.sysbox = { | ||||||||||
enable = | ||||||||||
mkOption { | ||||||||||
type = types.bool; | ||||||||||
default = false; | ||||||||||
description = | ||||||||||
lib.mdDoc '' | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||
This option enables sysbox | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to be a little bit more precise what this does =).
Suggested change
|
||||||||||
''; | ||||||||||
}; | ||||||||||
|
||||||||||
package = mkPackageOption pkgs "sysbox" { }; | ||||||||||
}; | ||||||||||
|
||||||||||
###### implementation | ||||||||||
|
||||||||||
config = mkIf cfg.enable { | ||||||||||
systemd.services.sysbox-mgr = { | ||||||||||
description = "Sysbox Manager Service"; | ||||||||||
wantedBy = [ "multi-user.target" ]; | ||||||||||
|
||||||||||
path = [ pkgs.rsync pkgs.kmod pkgs.iptables ]; | ||||||||||
script = "${cfg.package}/bin/sysbox-mgr"; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would |
||||||||||
|
||||||||||
preStart = '' | ||||||||||
mkdir /sbin || true | ||||||||||
cp ${pkgs.iptables}/bin/* /sbin || true | ||||||||||
''; | ||||||||||
|
||||||||||
serviceConfig = { | ||||||||||
User = "root"; | ||||||||||
Group = "root"; | ||||||||||
}; | ||||||||||
}; | ||||||||||
|
||||||||||
systemd.services.sysbox-fs = { | ||||||||||
description = "Sysbox FileSystem Service"; | ||||||||||
wantedBy = [ "multi-user.target" ]; | ||||||||||
|
||||||||||
path = [ pkgs.rsync pkgs.kmod pkgs.fuse pkgs.iptables ]; | ||||||||||
script = "${cfg.package}/bin/sysbox-fs"; | ||||||||||
|
||||||||||
serviceConfig = { | ||||||||||
User = "root"; | ||||||||||
Group = "root"; | ||||||||||
}; | ||||||||||
}; | ||||||||||
|
||||||||||
virtualisation.docker.extraOptions = ''--add-runtime=sysbox=${cfg.package}/bin/sysbox-runc''; | ||||||||||
|
||||||||||
security.unprivilegedUsernsClone = true; | ||||||||||
|
||||||||||
assertions = [ | ||||||||||
{ assertion = !virtualisation.docker.enable; | ||||||||||
message = "Sysbox require docker to be functional"; | ||||||||||
} | ||||||||||
{ assertion = virtualisation.podman.enable; | ||||||||||
message = "Sysbox require docker to be functional"; | ||||||||||
} | ||||||||||
]; | ||||||||||
}; | ||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ stdenv | ||
, lib | ||
, fetchurl | ||
, dpkg | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "sysbox"; | ||
version = "0.6.2"; | ||
|
||
src = fetchurl { | ||
url = "https://downloads.nestybox.com/sysbox/releases/v0.6.2/sysbox-ce_${version}-0.linux_amd64.deb"; | ||
sha256 = "/Sh/LztaBytiw3j54e7uqizK0iu0jLOB0w2MhVxRtAE="; | ||
}; | ||
|
||
nativeBuildInputs = [ dpkg ]; | ||
|
||
unpackPhase = '' | ||
dpkg-deb -R $src . | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp -rf usr/bin/* $out/bin/ | ||
''; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/nestybox/sysbox"; | ||
description = "An open-source, next-generation 'runc' that empowers rootless containers to run workloads such as Systemd, Docker, Kubernetes, just like VMs."; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ juliosueiras ]; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -908,6 +908,8 @@ with pkgs; | |
|
||
docker-slim = callPackage ../applications/virtualization/docker-slim { }; | ||
|
||
sysbox = callPackage ../applications/virtualization/sysbox { }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this needed? |
||
|
||
doc2go = callPackage ../development/tools/doc2go { }; | ||
|
||
docker-sync = callPackage ../tools/misc/docker-sync { }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to address #208242 for this module, uses of
with
such as this should be avoided.consider
inherits
where you find yourself usinglib.foo
excessively.