From e4d3d8a9499271d6a6c9d5c8b2744c4610788b02 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 14 Jun 2021 16:41:28 +0200 Subject: [PATCH] modules: system: add boot And enable mounting `/tmp` as tmpfs by default. --- modules/system/boot.nix | 21 +++++++++++++++++++++ modules/system/default.nix | 1 + 2 files changed, 22 insertions(+) create mode 100644 modules/system/boot.nix diff --git a/modules/system/boot.nix b/modules/system/boot.nix new file mode 100644 index 0000000..0fed267 --- /dev/null +++ b/modules/system/boot.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: +let + cfg = config.my.system.boot; +in +{ + options.my.system.boot = with lib; { + tmp = { + clean = mkEnableOption "clean `/tmp` on boot."; + + tmpfs = my.mkDisableOption "mount `/tmp` as a tmpfs on boot."; + }; + }; + + config = { + boot = { + cleanTmpDir = cfg.tmp.clean; + + tmpOnTmpfs = cfg.tmp.tmpfs; + }; + }; +} diff --git a/modules/system/default.nix b/modules/system/default.nix index 48a0770..a9b251b 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -3,6 +3,7 @@ { imports = [ + ./boot.nix ./documentation.nix ./language.nix ./media.nix