2024-04-06 01:24:47 -05:00
|
|
|
{ lib, config, pkgs, nixpkgs, self, ... }:
|
2024-03-24 17:23:35 -05:00
|
|
|
{
|
2024-03-25 00:47:43 -05:00
|
|
|
## Below is to align shell/system to flake's nixpkgs
|
|
|
|
## ref: https://nixos-and-flakes.thiscute.world/best-practices/nix-path-and-flake-registry
|
|
|
|
|
|
|
|
# Make `nix repl '<nixpkgs>'` use the same nixpkgs as the one used by this flake.
|
|
|
|
environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}";
|
2024-03-26 05:11:59 -05:00
|
|
|
nix = {
|
|
|
|
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
|
|
|
|
registry.nixpkgs.flake = nixpkgs;
|
|
|
|
channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead.
|
|
|
|
|
|
|
|
# but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake.
|
|
|
|
# https://github.com/NixOS/nix/issues/9574
|
|
|
|
settings.nix-path = lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs";
|
2024-03-25 00:47:43 -05:00
|
|
|
|
2024-03-26 05:11:59 -05:00
|
|
|
###
|
2024-03-24 17:23:35 -05:00
|
|
|
|
2024-03-26 05:11:59 -05:00
|
|
|
settings = {
|
|
|
|
# Enable flakes
|
|
|
|
experimental-features = [
|
|
|
|
"nix-command"
|
|
|
|
"flakes"
|
|
|
|
];
|
2024-03-24 17:23:35 -05:00
|
|
|
|
2024-03-26 05:11:59 -05:00
|
|
|
# Substitutions
|
2024-03-29 20:57:31 -05:00
|
|
|
substituters = [
|
2024-05-19 06:39:08 -05:00
|
|
|
"https://hsndev.cachix.org"
|
2024-03-26 05:11:59 -05:00
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
"https://numtide.cachix.org"
|
|
|
|
];
|
2024-03-24 17:23:35 -05:00
|
|
|
|
2024-03-26 05:11:59 -05:00
|
|
|
trusted-public-keys = [
|
2024-05-19 06:39:08 -05:00
|
|
|
"hsndev.cachix.org-1:vN1/XGBZtMLnTFYDmTLDrullgZHSUYY3Kqt+Yg/C+tE="
|
2024-03-26 05:11:59 -05:00
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
|
|
|
|
];
|
2024-03-24 17:23:35 -05:00
|
|
|
|
2024-03-26 05:11:59 -05:00
|
|
|
# Fallback quickly if substituters are not available.
|
2024-03-29 20:57:31 -05:00
|
|
|
connect-timeout = 25;
|
2024-03-26 05:11:59 -05:00
|
|
|
# Avoid copying unnecessary stuff over SSH
|
|
|
|
builders-use-substitutes = true;
|
2024-05-21 13:54:51 -05:00
|
|
|
trusted-users = [ "root" "@wheel" "gitea-runner" ];
|
2024-03-26 05:11:59 -05:00
|
|
|
warn-dirty = false;
|
|
|
|
# The default at 10 is rarely enough.
|
|
|
|
log-lines = lib.mkDefault 25;
|
|
|
|
};
|
2024-03-24 20:01:03 -05:00
|
|
|
};
|
2024-03-24 17:23:35 -05:00
|
|
|
}
|