From e4282877907dc303a8e54e95a3a74e341cf91250 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 30 Aug 2022 16:14:07 +0200 Subject: [PATCH] [skip-ci] Add firefox from ppa installation --- .../provs/desktop/infrastructure/Firefox.kt | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Firefox.kt diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Firefox.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Firefox.kt new file mode 100644 index 0000000..754bc55 --- /dev/null +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Firefox.kt @@ -0,0 +1,34 @@ +package org.domaindrivenarchitecture.provs.desktop.infrastructure + +import org.domaindrivenarchitecture.provs.framework.core.Prov +import org.domaindrivenarchitecture.provs.framework.core.writeToFile +import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.addTextToFile +import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall +import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstallFromPpa +import java.io.File + + +fun Prov.installFirefox( + +) = task { + + cmd("snap remove firefox", sudo = true) + aptInstall("software-properties-common") + cmd("sudo add-apt-repository -y ppa:mozillateam/ppa") + + addTextToFile( + "\nPackage: *\n" + + "Pin: release o=LP-PPA-mozillateam\n" + + "Pin-Priority: 1001\n", + File("/etc/apt/preferences.d/mozilla-firefox"), + sudo = true + ) + + addTextToFile( + """Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${'$'}{distro_codename}";""", + File("/etc/apt/preferences.d/mozilla-firefox"), + sudo = true + ) + + aptInstall("firefox") +} \ No newline at end of file