summary refs log tree commit diff
path: root/profiles/nix.nix
diff options
context:
space:
mode:
Diffstat (limited to 'profiles/nix.nix')
-rw-r--r--profiles/nix.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/profiles/nix.nix b/profiles/nix.nix
new file mode 100644
index 0000000..769a06a
--- /dev/null
+++ b/profiles/nix.nix
@@ -0,0 +1,44 @@
+{
+  inputs,
+  pkgs,
+  ...
+}: {
+  nix = {
+    package = pkgs.nixUnstable;
+    registry.nixpkgs.flake = inputs.nixpkgs;
+    nixPath = [
+      "nixpkgs=flake:nixpkgs"
+    ];
+    gc.automatic = true;
+    optimise.automatic = true;
+    settings = {
+      experimental-features = [
+        "nix-command"
+        "flakes"
+        "cgroups"
+        "auto-allocate-uids"
+        "repl-flake"
+        "no-url-literals"
+      ];
+      use-cgroups = true;
+      auto-allocate-uids = true;
+      builders-use-substitutes = true;
+      auto-optimise-store = true;
+      warn-dirty = false;
+      trusted-users = [
+        "@wheel"
+      ];
+      substituters = [
+        "https://nix-community.cachix.org"
+      ];
+      trusted-public-keys = [
+        "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+      ];
+    };
+  };
+
+  nixpkgs.config.allowUnfree = true;
+
+  # save uid/guid
+  environment.persistence."/nix/persist".directories = ["/var/lib/nixos"];
+}