From 9fe637af17c8e284796d1bf065493fa2128f167f Mon Sep 17 00:00:00 2001 From: janabhumi Date: Wed, 31 Aug 2022 13:23:54 +0300 Subject: [PATCH] home: install direnv --- .envrc | 1 + .gitignore | 2 ++ home/home.nix | 5 +++++ system/configuration.nix | 7 +++++++ system/machine/home/default.nix | 2 +- 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.gitignore b/.gitignore index e410d2a..0bbcc4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +.direnv/ + /wallpapers/*.jpg diff --git a/home/home.nix b/home/home.nix index 64fe90b..708bd3d 100644 --- a/home/home.nix +++ b/home/home.nix @@ -93,6 +93,11 @@ in zoxide.enable = true; }; + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + accounts = { email = { accounts = secrets.emailAccounts; diff --git a/system/configuration.nix b/system/configuration.nix index 78b4a3a..6a938cd 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -120,6 +120,13 @@ in options = "--delete-older-than 7d"; }; + # To protect nix-shell against garbage collection + # Source: https://github.com/nix-community/nix-direnv#installation + extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + settings = { auto-optimise-store = true; diff --git a/system/machine/home/default.nix b/system/machine/home/default.nix index 8b2e4b6..519b264 100644 --- a/system/machine/home/default.nix +++ b/system/machine/home/default.nix @@ -35,7 +35,7 @@ in services.xserver = { # All monitors in the right order - # See: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/xserver.nix#L83 + # Source: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/xserver.nix#L83 xrandrHeads = [ { output = "HDMI-A-0";