about summary refs log tree commit diff
path: root/users/tazjin/nixos/modules/persistence.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-07-14T15·25+0300
committerclbot <clbot@tvl.fyi>2022-07-14T15·28+0000
commit6dd8c0e40ea2d733892ee7ffd4f6a20afef6825e (patch)
tree24952eb89bba6fe1e3a0a78a816a4b8f77002228 /users/tazjin/nixos/modules/persistence.nix
parent9b86f8f20892192e529cabd52f43cf52ee83ff8a (diff)
fix(tazjin/nixos): only persist /etc/machine-id if its unset via nix r/4301
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
Diffstat (limited to 'users/tazjin/nixos/modules/persistence.nix')
-rw-r--r--users/tazjin/nixos/modules/persistence.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/users/tazjin/nixos/modules/persistence.nix b/users/tazjin/nixos/modules/persistence.nix
index 5ed3683740b2..b864d13a8d70 100644
--- a/users/tazjin/nixos/modules/persistence.nix
+++ b/users/tazjin/nixos/modules/persistence.nix
@@ -1,5 +1,5 @@
 # Configuration for persistent (non-home) data.
-{ depot, pkgs, lib, ... }:
+{ config, depot, pkgs, lib, ... }:
 
 {
   imports = [
@@ -17,7 +17,7 @@
       "/var/log"
     ];
 
-    files = [
+    files = lib.optional (builtins.isNull config.networking.hostId) [
       "/etc/machine-id"
     ];
   };