{ 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 ''; settings = { auto-optimise-store = true; allowed-users = [ "root" ]; substituters = [ "https://nix-community.cachix.org" "https://marcus7070.cachix.org" ] ++ lib.optionals (! cfg.disable-cache) [ "http://loki.datarift.nl" ]; trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "marcus7070.cachix.org-1:JawxHSgnYsgNYJmNqZwvLjI4NcOwrcEZDToWlT3WwXw=" ] ++ lib.optionals (! cfg.disable-cache) [ "loki.datarift.nl:Mk+g9h52oCWtCi6b6KxRkntrD+HZVhwNT8muUQtgKoA=" ]; }; gc = { automatic = true; dates = "daily"; options = "--delete-older-than=30d"; }; }; }; }