Put impermanence behind an option to make kopia work.
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./impermanence.nix # TODO: find a way to avoid needing this here
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.isContainer = true;
|
boot.isContainer = true;
|
||||||
|
custom.impermanence.enable = false;
|
||||||
custom.tailscale.enable = false;
|
custom.tailscale.enable = false;
|
||||||
networking.useDHCP = lib.mkForce false;
|
networking.useDHCP = lib.mkForce false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.custom.impermanence;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
options.custom.impermanence = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable impermanent root fs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
environment.persistence = {
|
environment.persistence = {
|
||||||
"/persist" = {
|
"/persist" = {
|
||||||
directories = [ "/var/lib/nixos" ];
|
directories = [ "/var/lib/nixos" ];
|
||||||
@@ -68,4 +80,5 @@
|
|||||||
btrfs subvolume create /mnt/root
|
btrfs subvolume create /mnt/root
|
||||||
umount /mnt
|
umount /mnt
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user