summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2024-03-02 00:21:27 +0100
committerJulien Dessaux2024-03-07 01:02:23 +0100
commit154af6f8192c5bbf0948d9997b4ee07e58a9c29e (patch)
tree831470ed8f214809e71374cc47a5a15710768062
parentfix(stdlib): fixed apt package promises (diff)
downloadgonf-154af6f8192c5bbf0948d9997b4ee07e58a9c29e.tar.gz
gonf-154af6f8192c5bbf0948d9997b4ee07e58a9c29e.tar.bz2
gonf-154af6f8192c5bbf0948d9997b4ee07e58a9c29e.zip
feat(stdlib): disable apt package recommendations by default
-rw-r--r--stdlib/os/debian/apt-norecommends3
-rw-r--r--stdlib/os/debian/apt.go4
2 files changed, 7 insertions, 0 deletions
diff --git a/stdlib/os/debian/apt-norecommends b/stdlib/os/debian/apt-norecommends
new file mode 100644
index 0000000..d868eb4
--- /dev/null
+++ b/stdlib/os/debian/apt-norecommends
@@ -0,0 +1,3 @@
+APT::Install-Recommends "false";
+APT::AutoRemove::RecommendsImportant "false";
+APT::AutoRemove::SuggestsImportant "false";
diff --git a/stdlib/os/debian/apt.go b/stdlib/os/debian/apt.go
index 848294b..77c3b21 100644
--- a/stdlib/os/debian/apt.go
+++ b/stdlib/os/debian/apt.go
@@ -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()