summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-27 18:55:17 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-27 18:55:17 +0000
commite9b27dc85bdf11039d2125e215cb77f731d1939b (patch)
tree64d7b1538e4f83af708f363941796aacfda73a8c
parentb5f99c9fa7add3a91062e8d35e606a98b1f8cb63 (diff)
downloadspectrum-e9b27dc85bdf11039d2125e215cb77f731d1939b.tar
spectrum-e9b27dc85bdf11039d2125e215cb77f731d1939b.tar.gz
spectrum-e9b27dc85bdf11039d2125e215cb77f731d1939b.tar.bz2
spectrum-e9b27dc85bdf11039d2125e215cb77f731d1939b.tar.lz
spectrum-e9b27dc85bdf11039d2125e215cb77f731d1939b.tar.xz
spectrum-e9b27dc85bdf11039d2125e215cb77f731d1939b.tar.zst
spectrum-e9b27dc85bdf11039d2125e215cb77f731d1939b.zip
Use lib.getExe where possible
Signed-off-by: Alyssa Ross <hi@alyssa.is>
-rw-r--r--release/checks/wayland/default.nix12
-rw-r--r--release/installer/configuration.nix3
-rw-r--r--vm/app/catgirl.nix4
-rw-r--r--vm/app/foot.nix6
-rw-r--r--vm/app/lynx.nix4
-rw-r--r--vm/app/mg.nix4
6 files changed, 16 insertions, 17 deletions
diff --git a/release/checks/wayland/default.nix b/release/checks/wayland/default.nix
index 65ff29b..713b924 100644
--- a/release/checks/wayland/default.nix
+++ b/release/checks/wayland/default.nix
@@ -9,7 +9,7 @@ let
   surface-notify = import ./surface-notify { inherit config; };
 in
 
-config.pkgs.nixosTest ({ pkgs, ... }: {
+config.pkgs.nixosTest ({ lib, pkgs, ... }: {
   name = "spectrum-wayland";
 
   nodes.machine = { ... }: {
@@ -18,14 +18,14 @@ config.pkgs.nixosTest ({ pkgs, ... }: {
     systemd.services.cloud-hypervisor = {
       after = [ "crosvm-gpu.service" "weston.service" ];
       requires = [ "crosvm-gpu.service" "weston.service" ];
-      serviceConfig.ExecStart = "${pkgs.cloud-hypervisor}/bin/cloud-hypervisor --memory shared=on --disk path=${appvm}/img/appvm/blk/root.img,readonly=on --disk path=${run}/blk/run.img,readonly=on --cmdline \"console=ttyS0 root=PARTLABEL=root\" --gpu socket=/run/crosvm-gpu.sock --serial tty --console null --kernel ${appvm}/img/appvm/vmlinux";
+      serviceConfig.ExecStart = "${lib.getExe pkgs.cloud-hypervisor} --memory shared=on --disk path=${appvm}/img/appvm/blk/root.img,readonly=on --disk path=${run}/blk/run.img,readonly=on --cmdline \"console=ttyS0 root=PARTLABEL=root\" --gpu socket=/run/crosvm-gpu.sock --serial tty --console null --kernel ${appvm}/img/appvm/vmlinux";
     };
 
     systemd.services.crosvm = {
       after = [ "crosvm-gpu.service" "weston.service" ];
       requires = [ "crosvm-gpu.service" "weston.service" ];
-      serviceConfig.ExecStart = "${pkgs.crosvm}/bin/crosvm run -s /run/crosvm --disk ${appvm}/img/appvm/blk/root.img --disk ${run}/blk/run.img -p \"console=ttyS0 root=PARTLABEL=root\" --vhost-user-gpu /run/crosvm-gpu.sock --serial type=stdout,hardware=virtio-console,stdin=true ${appvm}/img/appvm/vmlinux";
-      serviceConfig.ExecStop = "${pkgs.crosvm}/bin/crosvm stop /run/crosvm";
+      serviceConfig.ExecStart = "${lib.getExe pkgs.crosvm} run -s /run/crosvm --disk ${appvm}/img/appvm/blk/root.img --disk ${run}/blk/run.img -p \"console=ttyS0 root=PARTLABEL=root\" --vhost-user-gpu /run/crosvm-gpu.sock --serial type=stdout,hardware=virtio-console,stdin=true ${appvm}/img/appvm/vmlinux";
+      serviceConfig.ExecStop = "${lib.getExe pkgs.crosvm} stop /run/crosvm";
     };
 
     systemd.services.crosvm-gpu = {
@@ -38,7 +38,7 @@ config.pkgs.nixosTest ({ pkgs, ... }: {
             done
             systemd-notify --ready --no-block
         ) &
-        exec ${pkgs.crosvm}/bin/crosvm device gpu \
+        exec ${lib.getExe pkgs.crosvm} device gpu \
             --socket /run/crosvm-gpu.sock \
             --wayland-sock /run/wayland-1 \
             --params '{"context-types":"cross-domain"}'
@@ -58,7 +58,7 @@ config.pkgs.nixosTest ({ pkgs, ... }: {
       requires = [ "surface-notify-socket.service" ];
       environment.XDG_RUNTIME_DIR = "/run";
       environment.WAYLAND_DEBUG = "server";
-      serviceConfig.ExecStart = "${pkgs.westonLite}/bin/weston --modules ${surface-notify}/lib/weston/surface-notify.so,systemd-notify.so";
+      serviceConfig.ExecStart = "${lib.getExe pkgs.westonLite} --modules ${surface-notify}/lib/weston/surface-notify.so,systemd-notify.so";
       serviceConfig.TTYPath = "/dev/tty7";
       serviceConfig.Type = "notify";
     };
diff --git a/release/installer/configuration.nix b/release/installer/configuration.nix
index 8dd4a43..8db5148 100644
--- a/release/installer/configuration.nix
+++ b/release/installer/configuration.nix
@@ -31,8 +31,7 @@ in
   fileSystems."/" = { fsType = "tmpfs"; };
 
   services.cage.enable = true;
-  services.cage.program =
-    "${pkgs.callPackage ./app {}}/bin/gnome-image-installer";
+  services.cage.program = lib.getExe (pkgs.callPackage ./app {});
 
   # Force eos-installer to stop artificially constraining its size.
   systemd.services.cage-tty1.environment.GIS_SMALL_SCREEN = "1";
diff --git a/vm/app/catgirl.nix b/vm/app/catgirl.nix
index 755852b..e190456 100644
--- a/vm/app/catgirl.nix
+++ b/vm/app/catgirl.nix
@@ -6,13 +6,13 @@ import ../../lib/eval-config.nix ({ config, ... }:
 import ../make-vm.nix { inherit config; } {
   providers.net = [ "netvm" ];
   run = config.pkgs.pkgsStatic.callPackage (
-    { writeScript, catgirl }:
+    { lib, writeScript, catgirl }:
     writeScript "run-catgirl" ''
       #!/bin/execlineb -P
       if { /etc/mdev/wait network-online }
       foreground { printf "IRC nick (to join #spectrum): " }
       backtick -E nick { head -1 }
-      ${catgirl}/bin/catgirl -h irc.libera.chat -j "#spectrum" -n $nick
+      ${lib.getExe catgirl} -h irc.libera.chat -j "#spectrum" -n $nick
     ''
   ) { };
 })
diff --git a/vm/app/foot.nix b/vm/app/foot.nix
index b408022..62a287c 100644
--- a/vm/app/foot.nix
+++ b/vm/app/foot.nix
@@ -6,7 +6,7 @@ import ../../lib/eval-config.nix ({ config, ... }:
 import ../make-vm.nix { inherit config; } {
   wayland = true;
   run = config.pkgs.pkgsStatic.callPackage (
-    { writeScript }:
+    { lib, writeScript }:
     writeScript "run-foot" ''
       #!/bin/execlineb -P
       foreground { mkdir /run/user }
@@ -16,8 +16,8 @@ import ../make-vm.nix { inherit config; } {
       }
       if { /etc/mdev/wait card0 }
       export XDG_RUNTIME_DIR /run/user/0
-      ${config.pkgs.pkgsMusl.wayland-proxy-virtwl}/bin/wayland-proxy-virtwl --virtio-gpu --
-      ${config.pkgs.pkgsMusl.foot}/bin/foot
+      ${lib.getExe config.pkgs.pkgsMusl.wayland-proxy-virtwl} --virtio-gpu --
+      ${lib.getExe config.pkgs.pkgsMusl.foot}
     ''
   ) { };
 })
diff --git a/vm/app/lynx.nix b/vm/app/lynx.nix
index d4560f4..b2a6aa1 100644
--- a/vm/app/lynx.nix
+++ b/vm/app/lynx.nix
@@ -6,11 +6,11 @@ import ../../lib/eval-config.nix ({ config, ... }:
 import ../make-vm.nix { inherit config; } {
   providers.net = [ "netvm" ];
   run = config.pkgs.pkgsStatic.callPackage (
-    { writeScript, lynx }:
+    { lib, writeScript, lynx }:
     writeScript "run-lynx" ''
       #!/bin/execlineb -P
       if { /etc/mdev/wait network-online }
-      ${lynx}/bin/lynx https://spectrum-os.org
+      ${lib.getExe lynx} https://spectrum-os.org
     ''
   ) { };
 })
diff --git a/vm/app/mg.nix b/vm/app/mg.nix
index 11f9e21..97596f3 100644
--- a/vm/app/mg.nix
+++ b/vm/app/mg.nix
@@ -6,11 +6,11 @@
 import ../make-vm.nix { inherit config; } {
   sharedDirs.virtiofs0.path = "/ext";
   run = config.pkgs.pkgsStatic.callPackage (
-    { writeScript, mg }:
+    { lib, writeScript, mg }:
     writeScript "run-mg" ''
       #!/bin/execlineb -P
       if { /etc/mdev/wait virtiofs0 }
-      ${mg}/bin/mg /run/virtiofs/virtiofs0
+      ${lib.getExe mg} /run/virtiofs/virtiofs0
     ''
   ) { };
 }