mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 00:03:55 +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, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption;
|
||||
inherit (lib) mkOption mkEnableOption mkIf;
|
||||
inherit (lib.types) str listOf;
|
||||
inherit (pkgs.nixVersions) nix_2_19;
|
||||
inherit (cfg) username;
|
||||
inherit (cfg) username iHaveLotsOfRam;
|
||||
inherit (builtins) attrValues;
|
||||
|
||||
cfg = config.modules.system;
|
||||
@ -39,11 +39,15 @@ in
|
||||
type = str;
|
||||
default = "22.11";
|
||||
};
|
||||
|
||||
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
||||
};
|
||||
|
||||
config = {
|
||||
boot = {
|
||||
tmp.cleanOnBoot = true;
|
||||
tmp = if iHaveLotsOfRam
|
||||
then { useTmpfs = true; }
|
||||
else { cleanOnBoot = true; };
|
||||
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
|
Loading…
Reference in New Issue
Block a user