sane.persist.root-on-tmpfs -> sane.root-on-tmpfs
This commit is contained in:
parent
539ee010ab
commit
6acd363f55
|
@ -10,6 +10,7 @@
|
|||
./image.nix
|
||||
./persist
|
||||
./ports.nix
|
||||
./root-on-tmpfs.nix
|
||||
./services
|
||||
./sops.nix
|
||||
./ssh.nix
|
||||
|
|
|
@ -183,11 +183,6 @@ in
|
|||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
sane.persist.root-on-tmpfs = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = "define / fs root to be a tmpfs. make sure to mount some other device to /nix";
|
||||
};
|
||||
sane.persist.sys = mkOption {
|
||||
description = "directories (or files) to persist to disk, relative to the fs root /";
|
||||
default = {};
|
||||
|
@ -203,7 +198,6 @@ in
|
|||
};
|
||||
|
||||
imports = [
|
||||
./root-on-tmpfs.nix
|
||||
./stores
|
||||
];
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.sane.persist;
|
||||
in
|
||||
{
|
||||
fileSystems."/" = lib.mkIf (cfg.enable && cfg.root-on-tmpfs) {
|
||||
device = "none";
|
||||
fsType = "tmpfs";
|
||||
options = [
|
||||
"mode=755"
|
||||
"size=1G"
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options = with lib; {
|
||||
sane.root-on-tmpfs = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = "define / fs root to be a tmpfs. make sure to mount some other device to /nix";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sane.root-on-tmpfs {
|
||||
fileSystems."/" = {
|
||||
device = "none";
|
||||
fsType = "tmpfs";
|
||||
options = [
|
||||
"mode=755"
|
||||
"size=1G"
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue