aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-26 02:06:11 +0900
committerOphestra <cat@gensokyo.uk>2025-03-26 02:06:11 +0900
commit371dd5b938e70fa077d1452456fdd203b7a61cb9 (patch)
treef880594d068324988a468459b0ede9128e151d15
parent4836d570aed76ad607b964e55264e8397627fbf3 (diff)
nix: create current-system symlink
This is copied at runtime because it appears to be impossible to obtain this path in nix. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--nixos.nix24
-rw-r--r--test/sandbox/case/mapuid.nix5
-rw-r--r--test/sandbox/case/preset.nix5
-rw-r--r--test/sandbox/case/tty.nix5
4 files changed, 21 insertions, 18 deletions
diff --git a/nixos.nix b/nixos.nix
index 7186cd70..8cb58721 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -128,7 +128,6 @@ in
(mustBind "/bin")
(mustBind "/usr/bin")
(mustBind "/nix/store")
- (mustBind "/run/current-system")
(bind "/sys/block")
(bind "/sys/bus")
(bind "/sys/class")
@@ -151,20 +150,27 @@ in
auto_etc = true;
cover = [ "/var/run/nscd" ];
- symlink = optionals (isGraphical && config.hardware.graphics.enable) (
+ symlink =
[
[
- config.systemd.tmpfiles.settings.graphics-driver."/run/opengl-driver"."L+".argument
- "/run/opengl-driver"
+ "*/run/current-system"
+ "/run/current-system"
]
]
- ++ optionals (app.multiarch && config.hardware.graphics.enable32Bit) [
+ ++ optionals (isGraphical && config.hardware.graphics.enable) (
[
- config.systemd.tmpfiles.settings.graphics-driver."/run/opengl-driver-32"."L+".argument
- /run/opengl-driver-32
+ [
+ config.systemd.tmpfiles.settings.graphics-driver."/run/opengl-driver"."L+".argument
+ "/run/opengl-driver"
+ ]
]
- ]
- );
+ ++ optionals (app.multiarch && config.hardware.graphics.enable32Bit) [
+ [
+ config.systemd.tmpfiles.settings.graphics-driver."/run/opengl-driver-32"."L+".argument
+ /run/opengl-driver-32
+ ]
+ ]
+ );
};
inherit enablements;
diff --git a/test/sandbox/case/mapuid.nix b/test/sandbox/case/mapuid.nix
index 30969a41..f29f1929 100644
--- a/test/sandbox/case/mapuid.nix
+++ b/test/sandbox/case/mapuid.nix
@@ -111,8 +111,8 @@
} null;
nix = fs "800001c0" { store = fs "801001fd" null null; } null;
proc = fs "8000016d" null null;
- run = fs "800001c0" {
- current-system = fs "8000016d" null null;
+ run = fs "800001ed" {
+ current-system = fs "80001ff" null null;
opengl-driver = fs "80001ff" null null;
user = fs "800001ed" {
"1000" = fs "800001ed" {
@@ -195,7 +195,6 @@
(ent "/bin" "/bin" "ro,nosuid,nodev,relatime" "ext4" "/dev/disk/by-label/nixos" "rw")
(ent "/usr/bin" "/usr/bin" "ro,nosuid,nodev,relatime" "ext4" "/dev/disk/by-label/nixos" "rw")
(ent "/" "/nix/store" "ro,nosuid,nodev,relatime" "overlay" "overlay" "rw,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/upper,workdir=/mnt-root/nix/.rw-store/work,uuid=on")
- (ent ignore "/run/current-system" "ro,nosuid,nodev,relatime" "overlay" "overlay" "rw,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/upper,workdir=/mnt-root/nix/.rw-store/work,uuid=on")
(ent "/block" "/sys/block" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
(ent "/bus" "/sys/bus" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
(ent "/class" "/sys/class" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
diff --git a/test/sandbox/case/preset.nix b/test/sandbox/case/preset.nix
index 5366fd48..3f9134fe 100644
--- a/test/sandbox/case/preset.nix
+++ b/test/sandbox/case/preset.nix
@@ -111,8 +111,8 @@
} null;
nix = fs "800001c0" { store = fs "801001fd" null null; } null;
proc = fs "8000016d" null null;
- run = fs "800001c0" {
- current-system = fs "8000016d" null null;
+ run = fs "800001ed" {
+ current-system = fs "80001ff" null null;
opengl-driver = fs "80001ff" null null;
user = fs "800001ed" {
"65534" = fs "800001ed" {
@@ -195,7 +195,6 @@
(ent "/bin" "/bin" "ro,nosuid,nodev,relatime" "ext4" "/dev/disk/by-label/nixos" "rw")
(ent "/usr/bin" "/usr/bin" "ro,nosuid,nodev,relatime" "ext4" "/dev/disk/by-label/nixos" "rw")
(ent "/" "/nix/store" "ro,nosuid,nodev,relatime" "overlay" "overlay" "rw,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/upper,workdir=/mnt-root/nix/.rw-store/work,uuid=on")
- (ent ignore "/run/current-system" "ro,nosuid,nodev,relatime" "overlay" "overlay" "rw,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/upper,workdir=/mnt-root/nix/.rw-store/work,uuid=on")
(ent "/block" "/sys/block" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
(ent "/bus" "/sys/bus" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
(ent "/class" "/sys/class" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
diff --git a/test/sandbox/case/tty.nix b/test/sandbox/case/tty.nix
index 65bdc199..7e6b5519 100644
--- a/test/sandbox/case/tty.nix
+++ b/test/sandbox/case/tty.nix
@@ -112,8 +112,8 @@
} null;
nix = fs "800001c0" { store = fs "801001fd" null null; } null;
proc = fs "8000016d" null null;
- run = fs "800001c0" {
- current-system = fs "8000016d" null null;
+ run = fs "800001ed" {
+ current-system = fs "80001ff" null null;
opengl-driver = fs "80001ff" null null;
user = fs "800001ed" {
"65534" = fs "800001ed" {
@@ -197,7 +197,6 @@
(ent "/bin" "/bin" "ro,nosuid,nodev,relatime" "ext4" "/dev/disk/by-label/nixos" "rw")
(ent "/usr/bin" "/usr/bin" "ro,nosuid,nodev,relatime" "ext4" "/dev/disk/by-label/nixos" "rw")
(ent "/" "/nix/store" "ro,nosuid,nodev,relatime" "overlay" "overlay" "rw,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/upper,workdir=/mnt-root/nix/.rw-store/work,uuid=on")
- (ent ignore "/run/current-system" "ro,nosuid,nodev,relatime" "overlay" "overlay" "rw,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/upper,workdir=/mnt-root/nix/.rw-store/work,uuid=on")
(ent "/block" "/sys/block" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
(ent "/bus" "/sys/bus" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")
(ent "/class" "/sys/class" "ro,nosuid,nodev,noexec,relatime" "sysfs" "sysfs" "rw")