2022-07-15 13:11:54 +02:00
|
|
|
{ config
|
|
|
|
, lib
|
2022-09-03 11:31:21 +02:00
|
|
|
, inputs
|
2023-05-12 15:14:08 +02:00
|
|
|
, self
|
2022-07-15 13:11:54 +02:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
2023-05-07 13:59:01 +02:00
|
|
|
cfg = config.my.programs.nix;
|
2022-07-15 13:11:54 +02:00
|
|
|
in
|
|
|
|
{
|
2023-05-07 13:59:01 +02:00
|
|
|
options.my.programs.nix = {
|
2022-10-15 20:00:09 +02:00
|
|
|
gc = {
|
|
|
|
enable = mkEnableOption "nix-gc";
|
|
|
|
minimumFreedGB = mkOption {
|
|
|
|
default = 32;
|
|
|
|
type = types.int;
|
|
|
|
apply = number: toString (number * 1024 * 1024 * 1024);
|
|
|
|
};
|
2022-07-15 13:11:54 +02:00
|
|
|
};
|
2022-10-15 20:00:09 +02:00
|
|
|
optimise.enable = mkEnableOption "nix-optimise";
|
2022-07-15 13:11:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config.nix = {
|
2023-05-12 15:13:27 +02:00
|
|
|
extraOptions = "experimental-features = nix-command flakes";
|
|
|
|
|
2022-07-15 13:11:54 +02:00
|
|
|
gc = {
|
|
|
|
automatic = cfg.gc.enable;
|
2022-10-15 20:00:09 +02:00
|
|
|
options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d";
|
2022-07-15 13:11:54 +02:00
|
|
|
dates = "weekly";
|
|
|
|
};
|
|
|
|
|
|
|
|
optimise = {
|
|
|
|
automatic = cfg.optimise.enable;
|
|
|
|
dates = [ "weekly" ];
|
|
|
|
};
|
|
|
|
|
2022-09-03 11:31:21 +02:00
|
|
|
registry = {
|
|
|
|
master-upstream.to = {
|
|
|
|
type = "github";
|
|
|
|
owner = "nixos";
|
|
|
|
repo = "nixpkgs";
|
|
|
|
};
|
|
|
|
master.flake = inputs.master;
|
|
|
|
nixpkgs.flake = inputs.nixpkgs;
|
|
|
|
stable.flake = inputs.stable;
|
2023-05-12 15:14:08 +02:00
|
|
|
dotfiles.flake = self;
|
2022-09-03 11:31:21 +02:00
|
|
|
};
|
|
|
|
|
2022-07-15 13:11:54 +02:00
|
|
|
settings = {
|
|
|
|
substituters = [
|
|
|
|
"https://cache.nixos.org/"
|
|
|
|
"https://jupyterwith.cachix.org"
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
"https://pre-commit-hooks.cachix.org"
|
2022-11-25 10:24:29 +01:00
|
|
|
"https://hyprland.cachix.org"
|
2022-07-15 13:11:54 +02:00
|
|
|
];
|
|
|
|
trusted-public-keys = [
|
|
|
|
"jupyterwith.cachix.org-1:/kDy2B6YEhXGJuNguG1qyqIodMyO4w8KwWH4/vAc7CI="
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
|
|
|
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
|
2022-11-25 10:24:29 +01:00
|
|
|
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
2022-07-15 13:11:54 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
trusted-users = [ "root" "@wheel" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|