feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }'

This commit is contained in:
Ryan Yin
2025-07-30 12:17:24 +08:00
parent d10b30b06b
commit 13bb77108c
219 changed files with 2103 additions and 1728 deletions
+14 -13
View File
@@ -53,12 +53,12 @@ let
# HTTPS_PROXY = "http://127.0.0.1:7890";
};
homebrew_env_script =
lib.attrsets.foldlAttrs
(acc: name: value: acc + "\nexport ${name}=${value}")
""
(homebrew_mirror_env // local_proxy_env);
in {
homebrew_env_script = lib.attrsets.foldlAttrs (
acc: name: value:
acc + "\nexport ${name}=${value}"
) "" (homebrew_mirror_env // local_proxy_env);
in
{
# Install packages from nix's official package repository.
#
# The packages installed here are available to all users, and are reproducible across machines, and are rollbackable.
@@ -75,13 +75,14 @@ in {
# darwin only apps
utm # virtual machine
];
environment.variables =
{
# Fix https://github.com/LnL7/nix-darwin/wiki/Terminfo-issues
TERMINFO_DIRS = map (path: path + "/share/terminfo") config.environment.profiles ++ ["/usr/share/terminfo"];
}
# Set variables for you to manually install homebrew packages.
// homebrew_mirror_env;
environment.variables = {
# Fix https://github.com/LnL7/nix-darwin/wiki/Terminfo-issues
TERMINFO_DIRS = map (path: path + "/share/terminfo") config.environment.profiles ++ [
"/usr/share/terminfo"
];
}
# Set variables for you to manually install homebrew packages.
// homebrew_mirror_env;
# Set environment variables for nix-darwin before run `brew bundle`.
system.activationScripts.homebrew.text = lib.mkBefore ''
+11 -10
View File
@@ -1,4 +1,4 @@
{lib, ...}:
{ lib, ... }:
# ===================================================================
# Remove packages that are not well supported for the Darwin platform
# ===================================================================
@@ -19,15 +19,16 @@ let
"ncdu"
"racket-minimal"
];
in {
in
{
nixpkgs.overlays = [
(_: super: let
removeUnwantedPackages = pname:
lib.warn "the ${pname} has been removed on the darwin platform"
super.emptyDirectory;
in
lib.genAttrs
brokenPackages
removeUnwantedPackages)
(
_: super:
let
removeUnwantedPackages =
pname: lib.warn "the ${pname} has been removed on the darwin platform" super.emptyDirectory;
in
lib.genAttrs brokenPackages removeUnwantedPackages
)
];
}
+5 -6
View File
@@ -1,7 +1,6 @@
{mylib, ...}: {
imports =
(mylib.scanPaths ./.)
++ [
../base
];
{ mylib, ... }:
{
imports = (mylib.scanPaths ./.) ++ [
../base
];
}
+2 -1
View File
@@ -1,4 +1,5 @@
{config, ...}: {
{ config, ... }:
{
###################################################################################
#
# Core configuration for nix-darwin
+4 -2
View File
@@ -2,9 +2,11 @@
config,
myvars,
...
}: let
}:
let
homeDir = config.users.users."${myvars.username}".home;
in {
in
{
# https://github.com/LnL7/nix-darwin/blob/master/modules/programs/gnupg.nix
# try `pkill gpg-agent` if you have issues(such as `no pinentry`)
programs.gnupg.agent = {
+2 -1
View File
@@ -1,4 +1,5 @@
{myvars, ...}: {
{ myvars, ... }:
{
# Define a user account. Don't forget to set a password with passwd.
users.users."${myvars.username}" = {
home = "/Users/${myvars.username}";