feat(stdlib): disable apt package recommendations by default

This commit is contained in:
Julien Dessaux 2024-03-02 00:21:27 +01:00
parent 9d68556f0e
commit 154af6f819
Signed by: adyxax
GPG key ID: F92E51B86E07177E
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,3 @@
APT::Install-Recommends "false";
APT::AutoRemove::RecommendsImportant "false";
APT::AutoRemove::SuggestsImportant "false";

View file

@ -19,6 +19,9 @@ func init() {
packages_list()
}
//go:embed apt-norecommends
var apt_norecommends []byte
//go:embed sources.list
var sources_list []byte
@ -28,6 +31,7 @@ func Promise() {
gonf.AppendVariable("debian-extra-sources", "# Extra sources")
apt_update := gonf.Command("apt-get", "update", "-qq")
gonf.File("/etc/apt/sources.list").Permissions(rootRO).Template(sources_list).Promise().IfRepaired(apt_update)
gonf.File("/etc/apt/apt.conf.d/99_norecommends").Permissions(rootRO).Template(apt_norecommends).Promise()
gonf.SetPackagesConfiguration(packages_install, packages_list, apt_update)
gonf.Service("opensmtpd").State("enabled", "started").Promise()
systemd.Promise()