fix: nix-darwin

This commit is contained in:
Ryan Yin
2023-12-12 11:28:24 +08:00
parent e3a17925f2
commit b92537e264
3 changed files with 25 additions and 9 deletions

View File

@@ -47,19 +47,19 @@ gc:
############################################################################
darwin-set-proxy:
echo "skip setting proxy, use global proxy instead"
# sudo python3 scripts/darwin_set_proxy.py
sudo python3 scripts/darwin_set_proxy.py
sleep 1
ha: darwin-set-proxy
nix build .#darwinConfigurations.harmonica.system
./result/sw/bin/darwin-rebuild switch --flake .
sleep 3
sleep 1
sudo chmod 644 /etc/agenix/alias-for-work.*
ha-debug: darwin-set-proxy
nix build .#darwinConfigurations.harmonica.system --show-trace --verbose
./result/sw/bin/darwin-rebuild switch --flake .#harmonica --show-trace --verbose
sleep 3
sleep 1
sudo chmod 644 /etc/agenix/alias-for-work.*
############################################################################

View File

@@ -41,6 +41,9 @@
# embedded development
minicom
# ai related
python311Packages.huggingface-hub # huggingface-cli
# misc
pkgs-unstable.devbox
glow # markdown previewer

View File

@@ -1,4 +1,5 @@
{
pkgs,
lib,
username,
...
@@ -29,11 +30,23 @@
};
# do garbage collection weekly to keep disk usage low
nix.gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 7d";
};
nix.gc =
{
automatic = lib.mkDefault true;
options = lib.mkDefault "--delete-older-than 7d";
}
// (
if pkgs.stdenv.isLinux
then {
dates = lib.mkDefault "weekly";
}
else {
# nix-darwin
interval = {
Hour = 24;
};
}
);
# Allow unfree packages
nixpkgs.config.allowUnfree = lib.mkDefault false;