feat(modules): move nix settings to a seperate module

This commit is contained in:
xinyangli 2024-07-17 15:52:30 +08:00
parent e5bd395fd8
commit e36875131b
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
8 changed files with 66 additions and 57 deletions

View file

@ -9,6 +9,10 @@
../sops.nix
];
commonSettings = {
nix.enableMirrors = true;
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
@ -229,23 +233,6 @@
system.stateVersion = "22.05";
# Use mirror for binary cache
nix.settings.substituters = [
"https://mirrors.bfsu.edu.cn/nix-channels/store"
"https://mirrors.ustc.edu.cn/nix-channels/store"
];
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
nix.optimise.automatic = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
trusted-users = [ "xin" "root" ];
};
nix.extraOptions = ''
!include "${config.sops.secrets.github_public_token.path}"
'';

View file

@ -79,10 +79,6 @@ in
wheelNeedsPassword = false;
};
nix.settings = {
trusted-users = [ "root" ];
};
services.sing-box = let
singTls = {
enabled = true;

View file

@ -46,21 +46,6 @@
git
];
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = "https://cache.garnix.io";
trusted-public-keys = "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=";
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
nix.optimise.automatic = true;
nix.settings.auto-optimise-store = true;
system.stateVersion = "22.11";
networking = {

View file

@ -4,6 +4,9 @@
imports = [
./hass.nix
];
commonSettings.nix.enableMirrors = true;
nixpkgs.overlays = [
# Workaround https://github.com/NixOS/nixpkgs/issues/126755#issuecomment-869149243
(final: super: {
@ -18,13 +21,6 @@
raspberrypi-eeprom
];
# Use mirror for binary cache
nix.settings.substituters = [
"https://mirrors.bfsu.edu.cn/nix-channels/store"
"https://mirrors.ustc.edu.cn/nix-channels/store"
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "24.05";
networking = {
@ -51,10 +47,6 @@
wheelNeedsPassword = false;
};
nix.settings = {
trusted-users = [ "@wheel" ];
};
# fileSystems."/".fsType = lib.mkForce "btrfs";
boot.supportedFilesystems.zfs = lib.mkForce false;