server-configs/shared/modules/state.nix
2024-08-08 14:16:04 +02:00

33 lines
543 B
Nix

{ config, lib, ... }:
with lib;
let
sources = import ./../sources/sources.nix;
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"
];
};
};
};
}