added firefox native

297ef48f8e8b… · Ryan Schanzenbacher ·

parent 9f69bb20dff2… view tree

Changed files

diff --git a/deploy.sh b/deploy.sh
index cc7038f..80bd40f 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -62,11 +62,31 @@ copy_and_prepare() {
echo "Installing non-guix signing keys for substitutes..."
curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub
guix archive --authorize < sign-key.pub
+}
+install_system() {
echo "Beginning install!"
guix time-machine -C ./channels.scm -- system -L ./modules --substitute-urls='https://substitutes.nonguix.org https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' init $install_hostname.scm /mnt
+}
+
+install_user_env() {
+ # System should be installed now, we can chroot in and configure the user profile now
+ # NOTE: This assumes the user "ryan" for things, so change the USER var if you change your username
+
+ # Mount the special block devices to prepare for chroot
+ mount --rbind /proc /mnt/proc
+ mount --rbind /sys /mnt/sys
+ mount --rbind /dev /mnt/dev
+
+ # chroot into system and run commands
+ USER=ryan
+ chroot /mnt <<EOT
+
+ EOT
}
gather_env
copy_and_prepare
+install_system
+install_user_env
diff --git a/home-config/home-configuration.scm b/home-config/home-configuration.scm
index 374f673..8dc46b9 100644
--- a/home-config/home-configuration.scm
+++ b/home-config/home-configuration.scm
@@ -17,7 +17,8 @@
(gnu home services gnupg)
(gnu home services)
(ryan-services pipewire)
- (ryan-packages freedesktop))
+ (ryan-packages freedesktop)
+ (ryan-packages mozilla))
(define my-neovim
(package
@@ -92,7 +93,7 @@
"git"
"node"
"git-lfs"))
- (list my-neovim wl-mirror)))
+ (list my-neovim wl-mirror firefox-wayland-new)))
;; Below is the list of Home services. To search for available
;; services, run 'guix home search KEYWORD' in a terminal.
diff --git a/modules/ryan-packages/mozilla.scm b/modules/ryan-packages/mozilla.scm
new file mode 100644
index 0000000..8959b07
--- /dev/null
+++ b/modules/ryan-packages/mozilla.scm
@@ -0,0 +1,62 @@
+(define-module (ryan-packages mozilla)
+ #:use-module (gnu)
+ #:use-module (guix download)
+ #:use-module (guix packages)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (gnu packages bash)
+ #:use-module (gnu packages linux)
+ #:use-module (nonguix build-system binary)
+ #:use-module (guix build-system trivial)
+ #:use-module (nongnu packages mozilla))
+
+(define firefox*
+ (package/inherit
+ firefox
+ (inputs
+ (modify-inputs
+ (package-inputs firefox)
+ (delete "pipewire")
+ (append pipewire)))))
+
+(define-public firefox-wayland-new
+ (package
+ (inherit firefox*)
+ (name "firefox-wayland-new")
+ (native-inputs '())
+ (inputs
+ `(("bash" ,bash-minimal)
+ ("pipewire" ,pipewire)
+ ("firefox" ,firefox*)))
+ (build-system trivial-build-system)
+ (arguments
+ '(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((bash (assoc-ref %build-inputs "bash"))
+ (firefox (assoc-ref %build-inputs "firefox"))
+ (pipewire (assoc-ref %build-inputs "pipewire"))
+ (out (assoc-ref %outputs "out"))
+ (exe (string-append out "/bin/firefox")))
+ (mkdir-p (dirname exe))
+
+ (call-with-output-file exe
+ (lambda (port)
+ ;; NOTE: added "export LD_LIBRARY_PATH=pipewire"
+ ;; maybe this can be done better with `wrap-programm'
+ (format port "#!~a \n
+export LD_LIBRARY_PATH=~a \n
+export MOZ_ENABLE_WAYLAND=1 \n
+exec ~a $@\n"
+ (string-append bash "/bin/bash")
+ (string-append pipewire "/lib")
+ (string-append firefox "/bin/firefox"))))
+ (chmod exe #o555)
+
+ ;; Provide the manual and .desktop file.
+ (copy-recursively (string-append firefox "/share")
+ (string-append out "/share"))
+ (substitute* (string-append
+ out "/share/applications/firefox.desktop")
+ ((firefox) out))
+ #t))))))