feat: moved ollama, tailscale, and sync into folders following the new storage pattern
This commit is contained in:
parent
b67be1472a
commit
d283f88160
11 changed files with 215 additions and 117 deletions
36
modules/nixos-modules/tailscale/storage.nix
Normal file
36
modules/nixos-modules/tailscale/storage.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
tailscale_data_directory = "/var/lib/tailscale";
|
||||
in {
|
||||
options = {
|
||||
services.tailscale.impermanence.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.services.tailscale.enable && config.storage.impermanence.enable;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.tailscale.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.storage.zfs.enable (lib.mkMerge [
|
||||
{
|
||||
# Tailscale needs persistent storage for keys and configuration
|
||||
}
|
||||
(lib.mkIf (!config.services.tailscale.impermanence.enable) {
|
||||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.tailscale.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
directories."${tailscale_data_directory}" = {
|
||||
enable = true;
|
||||
owner.name = "root";
|
||||
group.name = "root";
|
||||
};
|
||||
};
|
||||
})
|
||||
]))
|
||||
]
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue