server-configs/shared/modules/state.nix
2024-08-14 12:22:33 +02:00

33 lines
531 B
Nix

{ config, lib, ... }:
with lib;
let
sources = import ./../sources;
in {
options.mine.state.enable = mkOption {
type = types.bool;
default = false;
};
imports = [
(sources.impermanence + "/nixos.nix")
];
config = mkIf config.mine.state.enable {
environment.persistence = {
root = {
persistentStoragePath = "/state/root";
files = [
"/etc/machine-id"
];
directories = [
"/var/lib/nixos"
"/var/log"
];
};
};
};
}