mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-02-16 17:50:52 +01:00
system: Add option to avoid cleaning /tmp on boot
This increases boot times quite a bit so I'd rather use tmpfs as /tmp where possible. Note that this defaults to cleaning /tmp anyway since I'd rather clean /tmp than not do so at all. For future reference, the message that gets shown is the following: "A start job is running for Create Volatile Files and Directories"
This commit is contained in:
parent
59f557a3e5
commit
01acf8197d
@ -1,10 +1,10 @@
|
|||||||
{ nix-config, pkgs, lib, config, ... }:
|
{ nix-config, pkgs, lib, config, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption;
|
inherit (lib) mkOption mkEnableOption mkIf;
|
||||||
inherit (lib.types) str listOf;
|
inherit (lib.types) str listOf;
|
||||||
inherit (pkgs.nixVersions) nix_2_19;
|
inherit (pkgs.nixVersions) nix_2_19;
|
||||||
inherit (cfg) username;
|
inherit (cfg) username iHaveLotsOfRam;
|
||||||
inherit (builtins) attrValues;
|
inherit (builtins) attrValues;
|
||||||
|
|
||||||
cfg = config.modules.system;
|
cfg = config.modules.system;
|
||||||
@ -39,11 +39,15 @@ in
|
|||||||
type = str;
|
type = str;
|
||||||
default = "22.11";
|
default = "22.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
boot = {
|
boot = {
|
||||||
tmp.cleanOnBoot = true;
|
tmp = if iHaveLotsOfRam
|
||||||
|
then { useTmpfs = true; }
|
||||||
|
else { cleanOnBoot = true; };
|
||||||
|
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot = {
|
systemd-boot = {
|
||||||
|
Loading…
Reference in New Issue
Block a user