-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Valentin Kharin <[email protected]>
- Loading branch information
1 parent
67edf00
commit 7bebddd
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
modules/microvm/virtualization/microvm/common/common-directory.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ lib, config, ... }: | ||
let | ||
cfg = config.ghaf.storagevm; | ||
common-mountPath = "/tmp/common"; | ||
in | ||
{ | ||
config = lib.mkIf cfg.enable { | ||
fileSystems.${common-mountPath}.neededForBoot = true; | ||
|
||
microvm.shares = [ | ||
{ | ||
tag = "common-directory-share"; | ||
proto = "virtiofs"; | ||
securityModel = "passthrough"; | ||
source = "/storagevm/common"; | ||
mountPoint = common-mountPath; | ||
} | ||
]; | ||
|
||
environment.persistence.${common-mountPath} = { | ||
hideMounts = true; | ||
|
||
directories = [ | ||
{ | ||
directory = "/home/${config.ghaf.users.accounts.user}/common"; | ||
inherit (config.ghaf.users.accounts) user; | ||
group = config.ghaf.users.accounts.user; | ||
mode = "u=rwx,g=,o="; | ||
} | ||
]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters