aboutsummaryrefslogtreecommitdiff
path: root/infra/modules
diff options
context:
space:
mode:
authorvkcku <[email protected]>2026-06-01 16:42:07 +0530
committervkcku <[email protected]>2026-06-01 16:42:07 +0530
commit7fe980fd3650731992644e303523bbe84b3e37b6 (patch)
treeb060616c6238ac4175f51ded276f91c5349cc5d8 /infra/modules
parentinfra(indra): initial configuration (diff)
infra: configure nix-settings as part of base module
monorepo-revid: e8e6521c0182038cc29b403fbd62c49f26354a7f
Diffstat (limited to 'infra/modules')
-rw-r--r--infra/modules/base/nix-settings.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/infra/modules/base/nix-settings.nix b/infra/modules/base/nix-settings.nix
new file mode 100644
index 0000000..9f80663
--- /dev/null
+++ b/infra/modules/base/nix-settings.nix
@@ -0,0 +1,40 @@
+{ inputs, ... }:
+{
+ flake.modules.nixos.base =
+ { config, ... }:
+ {
+ nix = {
+ gc = {
+ automatic = true;
+ dates = "weekly";
+ options = "--delete-older-than 5d --log-format internal-json";
+ persistent = true;
+ };
+
+ optimise = {
+ automatic = true;
+ dates = "weekly";
+ persistent = true;
+ };
+
+ settings = {
+ auto-optimise-store = true;
+ experimental-features = [
+ "nix-command"
+ "flakes"
+ ];
+ allowed-users = [ ];
+ trusted-users = [ "@wheel" ];
+ };
+ };
+
+ system =
+ let
+ self = inputs.self;
+ in
+ {
+ configurationRevision = self.rev or self.dirtyRev or "unknown";
+ nixos.label = "${config.system.nixos.release}-${self.shortRev or self.dirtyShortRev or "unknown"}";
+ };
+ };
+}