From af9d4521e2dde0dcafacd6d4304e61b26f0ddafd Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 10 Sep 2024 08:12:16 +0800 Subject: [PATCH] lib/nixos: add filesystem-related functions --- lib/env-specific/nixos.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/env-specific/nixos.nix b/lib/env-specific/nixos.nix index 1425efa8..979e43fd 100644 --- a/lib/env-specific/nixos.nix +++ b/lib/env-specific/nixos.nix @@ -54,4 +54,16 @@ start' = start + 1; in { from = start'; to = start' + range; }; + + /* + A specific function that checks if specific filesystem setups are set. + */ + isFilesystemSet = config: setupName: + config.suites.filesystem.setups.${setupName}.enable or false; + + /* + Get the path from the state variable. + */ + getFilesystem = config: setupName: + config.state.paths.${setupName}; }