summaryrefslogtreecommitdiff
path: root/modules/nix/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nix/default.nix')
-rw-r--r--modules/nix/default.nix89
1 files changed, 89 insertions, 0 deletions
diff --git a/modules/nix/default.nix b/modules/nix/default.nix
new file mode 100644
index 0000000..7461ea2
--- /dev/null
+++ b/modules/nix/default.nix
@@ -0,0 +1,89 @@
+{ config, ... }:
+{
+ imports = [
+ ./nh.nix
+ ];
+
+ nixpkgs.config = {
+ cudaSupport = true;
+ allowUnfree = true;
+ };
+
+ programs.nix-index-database.comma.enable = true;
+
+ nix = {
+ settings = {
+ auto-optimise-store = true;
+ http-connections = 0;
+ warn-dirty = false;
+ log-lines = 50;
+ sandbox = true;
+ sandbox-fallback = false;
+ extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
+ keep-going = true;
+ accept-flake-config = false;
+ stalled-download-timeout = 20;
+
+ system-features = [
+ "nixos-test"
+ "kvm"
+ "recursive-nix"
+ "big-parallel"
+ ];
+
+ trusted-users = [
+ "root"
+ "@wheel"
+ "nix-builder"
+ ];
+
+ allowed-users = [
+ "root"
+ "@wheel"
+ "nix-builder"
+ ];
+
+ substituters = [
+ "https://cache.nixos.org/"
+ "https://nix-community.cachix.org"
+ "https://hyprland.cachix.org"
+ "https://nyx.chaotic.cx/"
+ "https://nixpkgs-wayland.cachix.org"
+ "https://cuda-maintainers.cachix.org"
+ "https://nixpkgs-unfree.cachix.org"
+ ];
+
+ trusted-public-keys = [
+ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
+ "nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
+ "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
+ "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
+ "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs="
+ ];
+
+ experimental-features = [
+ "nix-command"
+ "flakes"
+ "recursive-nix"
+ "ca-derivations"
+ "auto-allocate-uids"
+ "cgroups"
+ "repl-flake"
+ "no-url-literals"
+ "dynamic-derivations"
+ ];
+ };
+
+ gc = {
+ automatic = true;
+ dates = "03:00";
+ options = "--delete-older-than 3d";
+ };
+
+ optimise = {
+ automatic = true;
+ dates = [ "04:00" ];
+ };
+ };
+}