nixos-config/modules/nix-common/default.nix

34 lines
662 B
Nix
Raw Normal View History

2021-11-16 00:22:18 +01:00
{ lib, pkgs, config, ... }:
with lib;
let cfg = config.eboskma.nix-common;
in
{
options.eboskma.nix-common = {
enable = mkEnableOption "activate nix-common";
disable-cache = mkEnableOption "no not use binary cache";
};
config = mkIf cfg.enable {
nixpkgs = {
config.allowUnfree = true;
};
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes ca-references
'';
autoOptimiseStore = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than=30d";
};
allowedUsers = [ "root" ];
};
};
}