From df9ef966a252f2a541b916e085f1e31cb4b97d10 Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Wed, 18 Dec 2024 18:11:50 +0100 Subject: [PATCH] tried to turn on impermanence on mac --- flake.nix | 3 ++- nixos/mac-hardware-conf.nix | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index ca7ba14..9c1f553 100644 --- a/flake.nix +++ b/flake.nix @@ -97,7 +97,7 @@ hostname = "${username}-mac"; isLaptop = true; system = arm; - useImpermanence = false; + useImpermanence = true; }; inherit username; inherit first-nixos-install; @@ -117,6 +117,7 @@ modules = [ ./nixos/configuration.nix inputs.apple-silicon-support.nixosModules.default + inputs.impermanence.nixosModules.impermanence ./nixos/mac-hardware-conf.nix ./nixos/macos/configuration.nix ] ++ general-modules; diff --git a/nixos/mac-hardware-conf.nix b/nixos/mac-hardware-conf.nix index be279be..7d5d9ef 100644 --- a/nixos/mac-hardware-conf.nix +++ b/nixos/mac-hardware-conf.nix @@ -13,15 +13,27 @@ boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = + fileSystems."/" = { + device = "none"; + fsType = "tmpfs"; + options = [ "size = 3G" "mode = 755" ]; + }; + fileSystems."/persist" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; + neededForBoot = true; }; - + fileSystems."/nix" = { + device = "/persist/nix"; + options = [ "bind" ]; + depends = [ "/persist" ] + neededForBoot = true; + }; fileSystems."/boot" = { device = "/dev/disk/by-label/EFI\\x20-\\x20NIXOS"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; + neededForBoot = true; }; swapDevices = [ ];