Skip to content

Commit

Permalink
Add NixOS installation option (closes #204)
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Mar 30, 2024
1 parent bafbe80 commit 7812ee9
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
24 changes: 24 additions & 0 deletions extension/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@
"message": "Gentoo-like Linux",
"description": "The Gentoo tab on the instructions page"
},
"instructionsPageTabNixOS": {
"message": "NixOS Linux",
"description": "The NixOS tab on the instructions page"
},
"instructionsPageTabMacOS": {
"message": "macOS",
"description": "The macOS tab on the instructions page"
Expand Down Expand Up @@ -580,6 +584,26 @@
"message": "Install the package using emerge:",
"description": "The step 3 of the Gentoo installation option"
},
"instructionsPageLinuxNixOSInstallStep1": {
"message": "Add the following Nix code to your NixOS Configuration, usually located in <kbd>/etc/nixos/configuration.nix</kbd>:",
"description": "The step 1 of the NixOS installation option"
},
"instructionsPageLinuxNixOSInstallStep1After": {
"message": "... to make sure the package is both in the Firefox's <kbd>nativeMessagingHosts</kbd> and in the <kbd>PATH</kbd>.",
"description": "The step 1 of the NixOS installation option"
},
"instructionsPageLinuxNixOSInstallStep2": {
"message": "Rebuild your system:",
"description": "The step 2 of the NixOS installation option"
},
"instructionsPageLinuxNixOSInstallStep3": {
"message": "After you have rebuilt the system, you should be automatically proceeded to the next step. If nothing changes after around 30 seconds, restart the browser.",
"description": "The step 3 of the NixOS installation option"
},
"instructionsPageLinuxNixOSInstallNotice": {
"message": "The package currently needs to be installed from nixos/nixpkgs unstable channel.",
"description": "The unstable channel notice for the NixOS installation option"
},
"instructionsPageMacOSInstallStep1": {
"message": "Make sure <a href=\"https://brew.sh/\" target=\"_blank\">Homebrew</a> is installed.",
"description": "The step 1 of the macOS installation option"
Expand Down
14 changes: 14 additions & 0 deletions extension/src/setup/instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<button class="nav-link" id="linux-rpm-install-tab" data-bs-toggle="tab" data-bs-target="#linux-rpm-install-pane" type="button" role="tab" aria-controls="linux-rpm-install-pane" aria-selected="false" data-i18n="instructionsPageTabRedHat"></button>
<button class="nav-link" id="linux-aur-install-tab" data-bs-toggle="tab" data-bs-target="#linux-aur-install-pane" type="button" role="tab" aria-controls="linux-aur-install-pane" aria-selected="false" data-i18n="instructionsPageTabArch"></button>
<button class="nav-link" id="linux-gentoo-install-tab" data-bs-toggle="tab" data-bs-target="#linux-gentoo-install-pane" type="button" role="tab" aria-controls="linux-gentoo-install-pane" aria-selected="false" data-i18n="instructionsPageTabGentoo"></button>
<button class="nav-link" id="linux-nixos-install-tab" data-bs-toggle="tab" data-bs-target="#linux-nixos-install-pane" type="button" role="tab" aria-controls="linux-nixos-install-pane" aria-selected="false" data-i18n="instructionsPageTabNixOS"></button>
<button class="nav-link" id="macos-install-tab" data-bs-toggle="tab" data-bs-target="#macos-install-pane" type="button" role="tab" aria-controls="macos-install-pane" aria-selected="false" data-i18n="instructionsPageTabMacOS"></button>
<button class="nav-link" id="bsd-install-tab" data-bs-toggle="tab" data-bs-target="#bsd-install-pane" type="button" role="tab" aria-controls="bsd-install-pane" aria-selected="false" data-i18n="instructionsPageTabBSD"></button>
<button class="nav-link" id="source-install-tab" data-bs-toggle="tab" data-bs-target="#source-install-pane" type="button" role="tab" aria-controls="source-install-pane" aria-selected="false" data-i18n="instructionsPageTabSourceCode"></button>
Expand Down Expand Up @@ -142,6 +143,19 @@
</ol>
</div>

<div class="tab-pane fade" id="linux-nixos-install-pane" role="tabpanel" aria-labelledby="linux-nixos-install-tab">
<ol>
<li>
<span data-i18n="instructionsPageLinuxNixOSInstallStep1"></span>
<code class="snippet">programs.firefox.nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];<br />environment.systemPackages = [ pkgs.firefoxpwa ];</code>
<span data-i18n="instructionsPageLinuxNixOSInstallStep1After"></span>
</li>
<li><span data-i18n="instructionsPageLinuxNixOSInstallStep2"></span> <kbd>sudo nixos-rebuild switch</kbd></li>
<li data-i18n="instructionsPageLinuxNixOSInstallStep3"></li>
</ol>
<p><strong><span data-i18n="commonNote"></span>:</strong> <span data-i18n="instructionsPageLinuxNixOSInstallNotice"></span></p>
</div>

<div class="tab-pane fade" id="source-install-pane" role="tabpanel" aria-labelledby="source-install-tab">
<ol>
<li data-i18n="instructionsPageSourceInstallStep1"></li>
Expand Down
11 changes: 11 additions & 0 deletions extension/src/setup/instructions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@ ol > li {
ul {
padding-left: 1rem;
}

.snippet {
display: block;
background-color: #343a40;
color: #fff;
border-radius: .25rem;
padding: .1875rem .375rem;
margin-top: .4rem;
margin-bottom: .4rem;
font-size: .875em;
}
3 changes: 3 additions & 0 deletions native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Read [the main README file](../README.md) for more details about the project.
* Debian-like Linux (pre-built DEB package)
* Red Hat-like Linux (pre-built RPM package)
* Arch-like Linux (source and binary AUR packages)
* Gentoo-like Linux (GURU ebuild)
* NixOS Linux (nixpkgs package)
* Other Linux (source installation only)
* macOS (bottled Homebrew formula)
* BSD (source installation only)
Expand Down Expand Up @@ -53,6 +55,7 @@ Thanks to [packagecloud.io](https://packagecloud.io/) for sponsoring this projec
* Arch User Repository: [`firefox-pwa`](https://aur.archlinux.org/packages/firefox-pwa/) (source)
* Arch User Repository: [`firefox-pwa-bin`](https://aur.archlinux.org/packages/firefox-pwa-bin/) (pre-built)
* Gentoo GURU: [`www-plugins/firefoxpwa`](https://gpo.zugaina.org/Overlays/guru/www-plugins/firefoxpwa)
* Nixpkgs Unstable: [`firefoxpwa`](https://search.nixos.org/packages?channel=unstable&show=firefoxpwa)

> [!NOTE]
> If you want to package PWAsForFirefox for your distribution or package manager, or have already packaged it, please let me know, so I can help with the packaging and list it in the installation instructions. If the packaging platform supports any auto-submission/uploading feature, please also let me know, as I might integrate it directly with GitHub Actions to make sure the packages are always up-to-date.
Expand Down
2 changes: 1 addition & 1 deletion native/packages/gentoo/firefoxpwa.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Gentoo Authors
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
Expand Down

0 comments on commit 7812ee9

Please sign in to comment.