tvl-depot/users/tazjin/nixos/modules/persistence.nix
Vincent Ambo 6dd8c0e40e fix(tazjin/nixos): only persist /etc/machine-id if its unset via nix
otherwise the files end up clashing with each other, causing annoying
errors on activation

Change-Id: Iaa4df8c50aa183f4a12749c66ee1b7a746d785da
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5949
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2022-07-14 15:28:32 +00:00

26 lines
591 B
Nix

# Configuration for persistent (non-home) data.
{ config, depot, pkgs, lib, ... }:
{
imports = [
(depot.third_party.sources.impermanence + "/nixos.nix")
];
environment.persistence."/persist" = {
directories = [
"/etc/NetworkManager/system-connections"
"/etc/mullvad-vpn"
"/var/cache/mullvad-vpn"
"/var/lib/bluetooth"
"/var/lib/systemd/coredump"
"/var/lib/tailscale"
"/var/log"
];
files = lib.optional (builtins.isNull config.networking.hostId) [
"/etc/machine-id"
];
};
programs.fuse.userAllowOther = true;
}