aboutsummaryrefslogtreecommitdiffhomepage
path: root/nixos.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-12 04:38:45 +0900
committerOphestra <cat@gensokyo.uk>2025-08-14 04:52:49 +0900
commit99ac96511bed17f48d908db3d00a1f48579ba011 (patch)
tree30d404efb7256c9f053f64192068637d6b846db4 /nixos.nix
parente99d7affb0c128fa82722f9b3d79c99b5e5918cd (diff)
hst/fs: interface filesystem config
This allows mount points to be represented by different underlying structs. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'nixos.nix')
-rw-r--r--nixos.nix44
1 files changed, 25 insertions, 19 deletions
diff --git a/nixos.nix b/nixos.nix
index a26b3658..90ce28b1 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -142,36 +142,42 @@ in
filesystem =
let
- bind = src: { inherit src; };
- mustBind = src: {
+ bind = src: {
+ type = "bind";
inherit src;
- require = true;
};
- devBind = src: {
+ optBind = src: {
+ type = "bind";
+ inherit src;
+ optional = true;
+ };
+ optDevBind = src: {
+ type = "bind";
inherit src;
dev = true;
+ optional = true;
};
in
[
- (mustBind "/bin")
- (mustBind "/usr/bin")
- (mustBind "/nix/store")
- (bind "/sys/block")
- (bind "/sys/bus")
- (bind "/sys/class")
- (bind "/sys/dev")
- (bind "/sys/devices")
+ (bind "/bin")
+ (bind "/usr/bin")
+ (bind "/nix/store")
+ (optBind "/sys/block")
+ (optBind "/sys/bus")
+ (optBind "/sys/class")
+ (optBind "/sys/dev")
+ (optBind "/sys/devices")
]
++ optionals app.nix [
- (mustBind "/nix/var")
+ (bind "/nix/var")
]
++ optionals isGraphical [
- (devBind "/dev/dri")
- (devBind "/dev/nvidiactl")
- (devBind "/dev/nvidia-modeset")
- (devBind "/dev/nvidia-uvm")
- (devBind "/dev/nvidia-uvm-tools")
- (devBind "/dev/nvidia0")
+ (optDevBind "/dev/dri")
+ (optDevBind "/dev/nvidiactl")
+ (optDevBind "/dev/nvidia-modeset")
+ (optDevBind "/dev/nvidia-uvm")
+ (optDevBind "/dev/nvidia-uvm-tools")
+ (optDevBind "/dev/nvidia0")
]
++ optionals app.useCommonPaths cfg.commonPaths
++ app.extraPaths;