[direnv] Create module

This commit is contained in:
Tibo De Peuter 2023-11-14 22:32:04 +01:00
parent 125803927c
commit 7dda8086d4
5 changed files with 26 additions and 46 deletions

View file

@ -19,6 +19,7 @@
};
programs = {
direnv.enable = true;
home-manager.enable = true;
sops.enable = true;
ssh.enable = true;
@ -69,14 +70,6 @@
time.timeZone = "Europe/Brussels";
nix = {
# Keep derivations so shells don't break (direnv)
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
};
i18n.defaultLocale = "en_GB.UTF-8";
console = {
# font = "Lat2-Terminus16";

View file

@ -19,6 +19,7 @@
};
programs = {
direnv.enable = true;
home-manager.enable = true;
sops.enable = true;
ssh.enable = true;
@ -101,14 +102,6 @@
networkmanager.enable = true;
};
nix = {
# Keep derivations so shells don't break (direnv)
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
};
i18n.defaultLocale = "en_GB.UTF-8";
console = {
# font = "Lat2-Terminus16";

View file

@ -1,29 +0,0 @@
{ inputs, lib, config, pkgs, ... }:
{
nix = {
# Allow Nix Flakes
# Keep derivations so shells don't break (direnv)
# If the disk has less than 100MiB, free up to 2GiB by garbage-collecting.
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
min-free = ${toString (100 * 1024 * 1024)}
max-free = ${toString (2048 * 1024 * 1024)}
'';
# Scheduled garbage-collect
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
package = pkgs.nixFlakes;
};
i18n.defaultLocale = "en_GB.UTF-8";
console = {
# font = "Lat2-Terminus16";
useXkbConfig = true; # use xkbOptions in tty.
};
}

View file

@ -1,8 +1,9 @@
{
imports = [
./direnv
./home-manager
./sops
./ssh
./spotify-adblock
./ssh
];
}

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
let
cfg = sisyphus.programs.direnv;
in {
options.sisyphus.programs.direnv.enable = lib.mkEnableOption "direnv";
config = lib.mkIf cfg.enable {
programs.direnv = {
enable = true;
nix-direnv.enable = true; # Use nix-specific direnv.
persistDerivations = true; # Sets the extraOptions listed below.
};
# This is also done by setting programs.direnv.persistDerivations.
# Keep derivations so shells don't break.
nix.extraOption = ''
keep-outputs = true
keep-derivations = true
'';
};
};