diff options
author | Ryan Schanzenbacher <ryan@rschanz.org> | 2023-09-14 19:57:05 -0400 |
---|---|---|
committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2023-09-14 19:57:05 -0400 |
commit | 297ef48f8e8bb5f50a16f9074b54bec6827eec6d (patch) | |
tree | 39e162489139b571093531fe4729e270f0017839 | |
parent | 9f69bb20dff2ee270d823e1d0688ab04c41435de (diff) |
added firefox native
-rwxr-xr-x | deploy.sh | 20 | ||||
-rw-r--r-- | home-config/home-configuration.scm | 5 | ||||
-rw-r--r-- | modules/ryan-packages/mozilla.scm | 62 |
3 files changed, 85 insertions, 2 deletions
@@ -62,11 +62,31 @@ copy_and_prepare() { | |||
62 | echo "Installing non-guix signing keys for substitutes..." | 62 | echo "Installing non-guix signing keys for substitutes..." |
63 | curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub | 63 | curl -o sign-key.pub https://substitutes.nonguix.org/signing-key.pub |
64 | guix archive --authorize < sign-key.pub | 64 | guix archive --authorize < sign-key.pub |
65 | } | ||
65 | 66 | ||
67 | install_system() { | ||
66 | echo "Beginning install!" | 68 | echo "Beginning install!" |
67 | 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 | 69 | 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 |
70 | } | ||
71 | |||
72 | install_user_env() { | ||
73 | # System should be installed now, we can chroot in and configure the user profile now | ||
74 | # NOTE: This assumes the user "ryan" for things, so change the USER var if you change your username | ||
75 | |||
76 | # Mount the special block devices to prepare for chroot | ||
77 | mount --rbind /proc /mnt/proc | ||
78 | mount --rbind /sys /mnt/sys | ||
79 | mount --rbind /dev /mnt/dev | ||
80 | |||
81 | # chroot into system and run commands | ||
82 | USER=ryan | ||
83 | chroot /mnt <<EOT | ||
84 | |||
85 | EOT | ||
68 | 86 | ||
69 | } | 87 | } |
70 | 88 | ||
71 | gather_env | 89 | gather_env |
72 | copy_and_prepare | 90 | copy_and_prepare |
91 | install_system | ||
92 | 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 @@ | |||
17 | (gnu home services gnupg) | 17 | (gnu home services gnupg) |
18 | (gnu home services) | 18 | (gnu home services) |
19 | (ryan-services pipewire) | 19 | (ryan-services pipewire) |
20 | (ryan-packages freedesktop)) | 20 | (ryan-packages freedesktop) |
21 | (ryan-packages mozilla)) | ||
21 | 22 | ||
22 | (define my-neovim | 23 | (define my-neovim |
23 | (package | 24 | (package |
@@ -92,7 +93,7 @@ | |||
92 | "git" | 93 | "git" |
93 | "node" | 94 | "node" |
94 | "git-lfs")) | 95 | "git-lfs")) |
95 | (list my-neovim wl-mirror))) | 96 | (list my-neovim wl-mirror firefox-wayland-new))) |
96 | 97 | ||
97 | ;; Below is the list of Home services. To search for available | 98 | ;; Below is the list of Home services. To search for available |
98 | ;; services, run 'guix home search KEYWORD' in a terminal. | 99 | ;; 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 @@ | |||
1 | (define-module (ryan-packages mozilla) | ||
2 | #:use-module (gnu) | ||
3 | #:use-module (guix download) | ||
4 | #:use-module (guix packages) | ||
5 | #:use-module ((guix licenses) #:prefix license:) | ||
6 | #:use-module (gnu packages bash) | ||
7 | #:use-module (gnu packages linux) | ||
8 | #:use-module (nonguix build-system binary) | ||
9 | #:use-module (guix build-system trivial) | ||
10 | #:use-module (nongnu packages mozilla)) | ||
11 | |||
12 | (define firefox* | ||
13 | (package/inherit | ||
14 | firefox | ||
15 | (inputs | ||
16 | (modify-inputs | ||
17 | (package-inputs firefox) | ||
18 | (delete "pipewire") | ||
19 | (append pipewire))))) | ||
20 | |||
21 | (define-public firefox-wayland-new | ||
22 | (package | ||
23 | (inherit firefox*) | ||
24 | (name "firefox-wayland-new") | ||
25 | (native-inputs '()) | ||
26 | (inputs | ||
27 | `(("bash" ,bash-minimal) | ||
28 | ("pipewire" ,pipewire) | ||
29 | ("firefox" ,firefox*))) | ||
30 | (build-system trivial-build-system) | ||
31 | (arguments | ||
32 | '(#:modules ((guix build utils)) | ||
33 | #:builder | ||
34 | (begin | ||
35 | (use-modules (guix build utils)) | ||
36 | (let* ((bash (assoc-ref %build-inputs "bash")) | ||
37 | (firefox (assoc-ref %build-inputs "firefox")) | ||
38 | (pipewire (assoc-ref %build-inputs "pipewire")) | ||
39 | (out (assoc-ref %outputs "out")) | ||
40 | (exe (string-append out "/bin/firefox"))) | ||
41 | (mkdir-p (dirname exe)) | ||
42 | |||
43 | (call-with-output-file exe | ||
44 | (lambda (port) | ||
45 | ;; NOTE: added "export LD_LIBRARY_PATH=pipewire" | ||
46 | ;; maybe this can be done better with `wrap-programm' | ||
47 | (format port "#!~a \n | ||
48 | export LD_LIBRARY_PATH=~a \n | ||
49 | export MOZ_ENABLE_WAYLAND=1 \n | ||
50 | exec ~a $@\n" | ||
51 | (string-append bash "/bin/bash") | ||
52 | (string-append pipewire "/lib") | ||
53 | (string-append firefox "/bin/firefox")))) | ||
54 | (chmod exe #o555) | ||
55 | |||
56 | ;; Provide the manual and .desktop file. | ||
57 | (copy-recursively (string-append firefox "/share") | ||
58 | (string-append out "/share")) | ||
59 | (substitute* (string-append | ||
60 | out "/share/applications/firefox.desktop") | ||
61 | ((firefox) out)) | ||
62 | #t)))))) | ||