From b3a722f52a0be3f6d8b4f3fa6ba7b8848cc3a34d Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Wed, 5 Jun 2024 09:58:16 +0200 Subject: Install system packages using profile-service-type --- tw/system.scm | 37 +++++++++++-------------------------- tw/system/btl.scm | 3 --- tw/system/cern.scm | 3 --- tw/system/frm.scm | 3 --- tw/system/lap.scm | 5 ++--- tw/system/lud.scm | 6 +++--- tw/system/vin.scm | 5 ----- 7 files changed, 16 insertions(+), 46 deletions(-) diff --git a/tw/system.scm b/tw/system.scm index 4526e2d4..7e7f8aa8 100644 --- a/tw/system.scm +++ b/tw/system.scm @@ -12,19 +12,11 @@ (use-package-modules acl admin android avahi backup certs cups curl disk docker file-systems gnome golang-crypto guile kerberos linux lsof man moreutils mtools pulseaudio python rsync - search shells tls version-control vpn wm xorg) + search shells tls vim version-control vpn wm xorg) (use-service-modules authentication avahi base cups dbus desktop docker kerberos linux mcron monitoring networking pm shepherd ssh vpn xorg) - -;; TODO: Use `profile-service-type' to install these! -(define-public %base-system-packages - (cons* acl acpi age btrfs-progs cpupower curl efibootmgr exfat-utils git - glibc-locales hddtemp htop lshw lsof man-db man-pages man-pages-posix - mlocate moreutils nss-mdns python restic rsync strace wireguard-tools - %base-packages)) - (define-public %british-keyboard (keyboard-layout "gb" #:options '("caps:swapescape" @@ -100,6 +92,11 @@ (define-public (server-base-services host-name) (cons* + (simple-service 'tw-base-packages profile-service-type + (list acl acpi age btrfs-progs cpupower curl efibootmgr exfat-utils git + glibc-locales hddtemp htop lshw lsof man-db man-pages man-pages-posix + mlocate moreutils nss-mdns python restic rsync strace vim wireguard-tools)) + (tw-openssh-service host-name) ;; Prometheus node exporter @@ -196,23 +193,6 @@ ACTION!=\"remove\", SUBSYSTEM==\"backlight\", GROUP=\"video\", MODE=\"0664\" ACTION!=\"remove\", SUBSYSTEM==\"leds\", GROUP=\"video\", MODE=\"0664\" ")) -;; TODO: Use `profile-service-type' to install these! -(define-public %enduser-system-packages - (cons* - cups docker mit-krb5 - pulseaudio - dosfstools mtools ntfs-3g - i3-wm ; install i3 here so gdm can see its xsession file - ;; We need to install gnome-keyring here so its PAM module is - ;; enabled properly (by its service; see below). - ;; nheko needs gnome-keyring to store secrets (kwallet doesn't do dbus). - gnome-keyring - ;; It's probably easiest to install geoclue system-wide, so it - ;; gets added to `%desktop-services' and redshift can access the - ;; location. - geoclue - %base-system-packages)) - (export enduser-system-services) (define* (enduser-system-services #:key @@ -237,6 +217,11 @@ ACTION!=\"remove\", SUBSYSTEM==\"leds\", GROUP=\"video\", MODE=\"0664\" (drivers xorg-drivers))) (cons* + (simple-service 'tw-enduser-packages profile-service-type + (list cups docker mit-krb5 pulseaudio dosfstools mtools ntfs-3g + ;; Install window manager here so gdm can see its xsession file. + i3-wm)) + (service docker-service-type) (service krb5-service-type diff --git a/tw/system/btl.scm b/tw/system/btl.scm index 2e3daca5..a7389de9 100644 --- a/tw/system/btl.scm +++ b/tw/system/btl.scm @@ -122,9 +122,6 @@ "/run/current-system/profile/sbin/reboot, " "/run/current-system/profile/sbin/shutdown\n"))) - ;; This is where we specify system-wide packages. - (packages %enduser-system-packages) - ;; Use the "desktop" services, which include the X11 ;; log-in service, networking with NetworkManager, and more. ;; See info '(guix)Services' for useful services. diff --git a/tw/system/cern.scm b/tw/system/cern.scm index c519bbe9..362ff9e0 100644 --- a/tw/system/cern.scm +++ b/tw/system/cern.scm @@ -110,9 +110,6 @@ "/run/current-system/profile/sbin/reboot, " "/run/current-system/profile/sbin/shutdown\n"))) - ;; This is where we specify system-wide packages. - (packages %enduser-system-packages) - ;; Use the "desktop" services, which include the X11 ;; log-in service, networking with NetworkManager, and more. ;; See info '(guix)Services' for useful services. diff --git a/tw/system/frm.scm b/tw/system/frm.scm index 76d8c492..c05b7180 100644 --- a/tw/system/frm.scm +++ b/tw/system/frm.scm @@ -122,9 +122,6 @@ "/run/current-system/profile/sbin/reboot, " "/run/current-system/profile/sbin/shutdown\n"))) - ;; This is where we specify system-wide packages. - (packages %enduser-system-packages) - ;; Use the "desktop" services, which include the X11 ;; log-in service, networking with NetworkManager, and more. ;; See info '(guix)Services' for useful services. diff --git a/tw/system/lap.scm b/tw/system/lap.scm index fd503dc9..0cf76d72 100644 --- a/tw/system/lap.scm +++ b/tw/system/lap.scm @@ -163,9 +163,8 @@ "/run/current-system/profile/sbin/shutdown\n"))) ;; This is where we specify system-wide packages. - (packages - ;; Proprietary NVIDIA driver. See its description for more required setup steps. - (cons* nongnu:nvidia-driver %enduser-system-packages)) + ;; Proprietary NVIDIA driver. See its description for more required setup steps. + (packages (list nongnu:nvidia-driver)) ;; Use the "desktop" services, which include the X11 ;; log-in service, networking with NetworkManager, and more. diff --git a/tw/system/lud.scm b/tw/system/lud.scm index fc9e85c6..44bd4293 100644 --- a/tw/system/lud.scm +++ b/tw/system/lud.scm @@ -54,12 +54,12 @@ ;; under their own account: use 'guix search KEYWORD' to search ;; for packages and 'guix install PACKAGE' to install a package. (packages - (cons* + (list ffmpeg tor ; for video downloader ;; For Nextcloud. PHP modules must be installed in system ;; profile, as that's referred to in Nextcloud's php.ini. - php php-apcu php-imagick openssl ; curl is in `%base-system-packages' - %base-system-packages)) + ;; curl is already installed by `server-base-services'. + php php-apcu php-imagick openssl)) ;; Below is the list of system services. To search for available ;; services, run 'guix system search KEYWORD' in a terminal. diff --git a/tw/system/vin.scm b/tw/system/vin.scm index 02a4bbcb..b7c30b18 100644 --- a/tw/system/vin.scm +++ b/tw/system/vin.scm @@ -49,11 +49,6 @@ ;; Choose UK English console keyboard layout. (keyboard-layout %british-keyboard) - ;; Packages installed system-wide. Users can also install packages - ;; under their own account: use 'guix search KEYWORD' to search - ;; for packages and 'guix install PACKAGE' to install a package. - (packages %base-system-packages) - ;; Below is the list of system services. To search for available ;; services, run 'guix system search KEYWORD' in a terminal. (services -- cgit v1.2.3