diff --git a/flake.nix b/flake.nix index 49136f8..6cff12f 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ #================================Nix Packages collection & NixOS==============================# #-----------Official NixOS package source, using nixos's unstable branch by default-----------# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - #-------------------------Simplify Nix Flakes with the module system--------------------------# + #=========================Simplify Nix Flakes with the module system==========================# flake-parts.url = "github:hercules-ci/flake-parts"; #===================Declarative disk partitioning and formatting using nix====================# disko = { diff --git a/impermanence.nix b/impermanence.nix index 48ec1a3..f825f80 100644 --- a/impermanence.nix +++ b/impermanence.nix @@ -11,6 +11,15 @@ in pkgs.ncdu ]; + # issue: https://github.com/nix-community/impermanence/issues/229 + # Use symlink + systemd.tmpfiles.rules = [ + "L /etc/machine-id - - - - /persist/etc/machine-id" + ]; + # Or + # boot.initrd.systemd.suppressedUnits = [ "systemd-machine-id-commit.service" ]; + # systemd.suppressedSystemUnits = [ "systemd-machine-id-commit.service" ]; + # There are two ways to clear the root filesystem on every boot: ## 1. use tmpfs for / ## 2. (btrfs/zfs only)take a blank snapshot of the root filesystem and revert to it on every boot via: @@ -45,7 +54,7 @@ in # "/usr/share/icons" ]; files = [ - "/etc/machine-id" + #"/etc/machine-id" "/etc/create-ap.conf" ];