mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-14 16:42:43 +02:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c44aa91e96 | |||
| 2868b72019 | |||
| 0bba489dbc | |||
| e22af008bf | |||
| 831c64407b | |||
| ab7136e58e | |||
| 9315055bac | |||
| 6c84c9e85b | |||
| ca6d584684 | |||
| d5822550b4 | |||
| 8d8cdab300 | |||
| 410b3c5312 | |||
| f0126c69d0 | |||
| 0fe12bef5a | |||
| 049390581e | |||
| 46398fc688 | |||
| c7b82b9e3e | |||
| c02459fabc | |||
| 30a6ad89ef | |||
| a5110c3aa7 | |||
| 0e5f1801cf | |||
| 6279ac663f | |||
| 92b92969b3 | |||
| ef1c02f3cf | |||
| b493cbae45 | |||
| 8462d34ade | |||
| be429dea2e | |||
| 691af4ae54 | |||
| 400725b36c | |||
| 2ed03e23e3 |
+15
-15
@@ -31,7 +31,7 @@ If rules conflict, follow the higher-priority source and state the conflict brie
|
||||
- Never write secret literals into tracked files.
|
||||
- Use environment variables, secret managers, or placeholders.
|
||||
- Redact sensitive output in logs and summaries.
|
||||
- For infra/IaC changes, prefer plan/eval/check before apply/switch.
|
||||
- For infra/IaC changes, prefer plan/eval/check before apply/deploy.
|
||||
|
||||
## 4) Scope Discipline
|
||||
|
||||
@@ -48,35 +48,35 @@ If rules conflict, follow the higher-priority source and state the conflict brie
|
||||
|
||||
## 6) Tooling Defaults
|
||||
|
||||
- Use Bash only for quick one-offs, Nushell for personal tooling, Python for everything else.
|
||||
- Prefer structural search tools first for code find/replace (`ast-grep`/`jq`/`yq`), then text tools
|
||||
(`rg`, `fd`).
|
||||
- Prefer project task runners (`just`, `make`, `task`, `npm scripts`, etc.) over ad-hoc commands
|
||||
when equivalent.
|
||||
- If a required command is not already available, use only `nix run`, `flake.nix`/`shell.nix` or
|
||||
`uv`/`pnpm` to provide it.
|
||||
- If that is still insufficient, stop and ask the user to prepare the environment instead of using
|
||||
any other installation method.
|
||||
- Prefer project task runners (`just`, `make`, `npm scripts`, etc.) over ad-hoc commands when
|
||||
equivalent.
|
||||
- Only use `nix run`, `flake.nix`/`shell.nix`, or `uv`/`pnpm` for missing commands & packages.
|
||||
Otherwise, ask the user—never use another installer.
|
||||
- Use `gh` CLI for GitHub operations, especially code/PR/issue search and inspection.
|
||||
|
||||
## 7) Environment Defaults
|
||||
|
||||
- Primary OS: NixOS.
|
||||
- Shell: default to `nushell`, `bash` also exists.
|
||||
- Primary OS: NixOS & macOS.
|
||||
- Shell: default to Nushell, Bash also exists.
|
||||
|
||||
## 8) Script Engineering Principles
|
||||
|
||||
Treat scripts as interruptible jobs that must be diagnosable and safe to rerun:
|
||||
|
||||
- Split workflows into explicit stages; allow running a selected stage via flags/arguments.
|
||||
- Make reruns idempotent; persist progress after each stage and support resume.
|
||||
- Cache external data with invalidation strategy to speed retries and improve reproducibility.
|
||||
- For HTTP flows, separate transport success from business success; support retry/backoff.
|
||||
- Provide independent verification commands/checks for key outputs (counts, samples, invariants).
|
||||
- Verbose logging of progress, decisions, and errors.
|
||||
- Stage workflows with selective execution via cli flags.
|
||||
- Idempotent reruns; persist progress and support resume.
|
||||
- Cache external data with invalidation.
|
||||
- Separate HTTP transport from business success; retry with backoff.
|
||||
- Verify key outputs independently.
|
||||
|
||||
## 9) Communication Defaults
|
||||
|
||||
- Respond in the language the user is currently using, prefer English & Chinese.
|
||||
- Code, commands, identifiers, and code comments: English.
|
||||
- Code, commands, identifiers, and code comments: Prefer English.
|
||||
- Be concise, concrete, and action-oriented.
|
||||
|
||||
## 10) Project Overlay
|
||||
|
||||
Generated
+36
-150
@@ -91,11 +91,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778446047,
|
||||
"narHash": "sha256-oQvcadh2BCkrog+SGrG6YffKJrveYpjj3TdQJWaKhaM=",
|
||||
"lastModified": 1782772816,
|
||||
"narHash": "sha256-s9BuFv0mRuZx9C1MF8qPHRdcAK14ONi0A5m6E2wqOoM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "bun2nix",
|
||||
"rev": "f2bc12af1a6369648aac41041ceeaa0b866599c6",
|
||||
"rev": "5a39d717029e94163ac223aee8d5c9946cafed1c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -127,11 +127,11 @@
|
||||
},
|
||||
"crane": {
|
||||
"locked": {
|
||||
"lastModified": 1765145449,
|
||||
"narHash": "sha256-aBVHGWWRzSpfL++LubA0CwOOQ64WNLegrYHwsVuVN7A=",
|
||||
"lastModified": 1781825982,
|
||||
"narHash": "sha256-SlXKwIRIhrOSAcTjCB3ftPLzJWZStQIPS7J1FlZPnKk=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "69f538cdce5955fcd47abfed4395dc6d5194c1c5",
|
||||
"rev": "469fd08d0bcf6926321fa973c6777fbc87785dd7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -186,15 +186,15 @@
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1761588595,
|
||||
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
||||
"owner": "edolstra",
|
||||
"lastModified": 1767039857,
|
||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -254,11 +254,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778716662,
|
||||
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
|
||||
"lastModified": 1782949081,
|
||||
"narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
|
||||
"rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -327,24 +327,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
@@ -531,16 +513,16 @@
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765382359,
|
||||
"narHash": "sha256-RJmgVDzjRI18BWVogG6wpsl1UCuV6ui8qr4DJ1LfWZ8=",
|
||||
"lastModified": 1782141370,
|
||||
"narHash": "sha256-hqijVSEETttmo8Okql9/LG0Ua34hdciKW1a5zzlj8mU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "lanzaboote",
|
||||
"rev": "e8c096ade12ec9130ff931b0f0e25d2f1bc63607",
|
||||
"rev": "7c9a54a7f87b4539ddbd8bda09a8a5f5f9361aa9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "v1.0.0",
|
||||
"ref": "v1.1.0",
|
||||
"repo": "lanzaboote",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -555,11 +537,11 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1781228339,
|
||||
"narHash": "sha256-gYIQvLpoGLH34tw3lZp11IrK82mkttLcw5sPErGe3+k=",
|
||||
"lastModified": 1783656972,
|
||||
"narHash": "sha256-M30foxi+2JXQ8KEIeWIKpB2uVpDYOw0XGI/gOaTb38I=",
|
||||
"owner": "numtide",
|
||||
"repo": "llm-agents.nix",
|
||||
"rev": "27d586e930f255a425ec2f9f238f078880333d09",
|
||||
"rev": "d17493b6a6d08cc1846a17175df67cd603c80c7d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -644,21 +626,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixlib": {
|
||||
"locked": {
|
||||
"lastModified": 1736643958,
|
||||
"narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-apple-silicon": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
@@ -680,27 +647,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-generators": {
|
||||
"inputs": {
|
||||
"nixlib": "nixlib",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1769813415,
|
||||
"narHash": "sha256-nnVmNNKBi1YiBNPhKclNYDORoHkuKipoz7EtVnXO50A=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "8946737ff703382fda7623b9fab071d037e897d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpak": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_3",
|
||||
@@ -725,11 +671,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1780930886,
|
||||
"narHash": "sha256-rppURzHviaQN131F+nLiLdGfcb0uCd9gGP0E5+iw9MI=",
|
||||
"lastModified": 1783279667,
|
||||
"narHash": "sha256-/NAkDSsve+GNM0Bt6tleJdCGfsTlK89nPjkVOzZMo0s=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8c3cede7ddc26bd659d2d383b5610efbd2c7a16e",
|
||||
"rev": "f205b5574fd0cb7da5b702a2da51507b7f4fdd1b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -788,11 +734,11 @@
|
||||
},
|
||||
"nixpkgs-master": {
|
||||
"locked": {
|
||||
"lastModified": 1781229721,
|
||||
"narHash": "sha256-ORvqDbb/LYxiJljGIejapjkc/kJbVote2N1WSb9W45I=",
|
||||
"lastModified": 1783657724,
|
||||
"narHash": "sha256-cw4ccmTWfdhNd6ATsgXgXsJEDhAY615qJCYgomchX60=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "173d0ad7a974f8543a9ab01d2271b2e290341b33",
|
||||
"rev": "a55048a53c27e59309d0c641d8acd72b5651920e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -836,11 +782,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1780030872,
|
||||
"narHash": "sha256-u6WU/yd/o8iYQrHX3RAwO1hYa3LkoSL+WNQD0rJfJZQ=",
|
||||
"lastModified": 1783224372,
|
||||
"narHash": "sha256-8i/87eeoqiGE4yOTjwSA3Eh/ziJRQEmd/unYU+K27sk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e9a7635a57597d9754eccebdfc7045e6c8600e6b",
|
||||
"rev": "d407951447dcd00442e97087bf374aad70c04cea",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -889,27 +835,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nuenv": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731006591,
|
||||
"narHash": "sha256-zCh7F0XKC5IEJKBTSNnUQ3SwJz3izPdxEU3C4udG8qI=",
|
||||
"owner": "DeterminateSystems",
|
||||
"repo": "nuenv",
|
||||
"rev": "45693a438df82b3a604f855c3372f4f7d9efb3eb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "DeterminateSystems",
|
||||
"repo": "nuenv",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nur-ryan4yin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -940,11 +865,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765016596,
|
||||
"narHash": "sha256-rhSqPNxDVow7OQKi4qS5H8Au0P4S3AYbawBSmJNUtBQ=",
|
||||
"lastModified": 1781733627,
|
||||
"narHash": "sha256-U3yTuGBnmXvXoQI3qkpfEDsn9RovQPAjN7ndRco+3u0=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "548fc44fca28a5e81c5d6b846e555e6b9c2a5a3c",
|
||||
"rev": "3bbec39bc90eadfa031e6f3b77272f3f60803e39",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1005,7 +930,6 @@
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nix-gaming": "nix-gaming",
|
||||
"nixos-apple-silicon": "nixos-apple-silicon",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixpak": "nixpak",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs-2505": "nixpkgs-2505",
|
||||
@@ -1015,7 +939,6 @@
|
||||
"nixpkgs-stable": "nixpkgs-stable",
|
||||
"nixvim": "nixvim",
|
||||
"nu_scripts": "nu_scripts",
|
||||
"nuenv": "nuenv",
|
||||
"nur-ryan4yin": "nur-ryan4yin",
|
||||
"pre-commit-hooks": "pre-commit-hooks",
|
||||
"preservation": "preservation",
|
||||
@@ -1030,33 +953,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765075567,
|
||||
"narHash": "sha256-KFDCdQcHJ0hE3Nt5Gm5enRIhmtEifAjpxgUQ3mzSJpA=",
|
||||
"lastModified": 1782012058,
|
||||
"narHash": "sha256-9mWUnReOUXfKjZuJAL/bAFH3LUyECTRtXgSNVjRw3UY=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "769156779b41e8787a46ca3d7d76443aaf68be6f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rust-overlay_2": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nuenv",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701397143,
|
||||
"narHash": "sha256-nYUJxZXwCWWVBYZXPgRxGDuQcZRhKTtD/Jp5Jl+9EWU=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "bb71557c93cad40f5921b2342d7fd69f9e6497ab",
|
||||
"rev": "8534567325bd8a8d2928e6afd81e0a87d19efd3c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1110,21 +1011,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_4": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
# substituers will be appended to the default substituters when fetching packages
|
||||
extra-substituters = [
|
||||
"https://cache.numtide.com"
|
||||
"https://catppuccin.cachix.org"
|
||||
# "https://nix-gaming.cachix.org"
|
||||
# "https://nixpkgs-wayland.cachix.org"
|
||||
# "https://install.determinate.systems"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
|
||||
"catppuccin.cachix.org-1:noG/4HkbhJb+lUAdKrph6LaozJvAeEEZj4N732IysmU="
|
||||
# "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||
# "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
||||
# "cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM="
|
||||
@@ -79,7 +81,7 @@
|
||||
};
|
||||
|
||||
lanzaboote = {
|
||||
url = "github:nix-community/lanzaboote/v1.0.0";
|
||||
url = "github:nix-community/lanzaboote/v1.1.0";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@@ -87,11 +89,6 @@
|
||||
url = "github:nix-community/preservation";
|
||||
};
|
||||
|
||||
# generate iso/qcow2/docker/... image from nixos configuration
|
||||
nixos-generators = {
|
||||
url = "github:nix-community/nixos-generators";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# secrets management
|
||||
agenix = {
|
||||
# lock with git commit at May 18, 2025
|
||||
@@ -112,11 +109,6 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nuenv = {
|
||||
url = "github:DeterminateSystems/nuenv";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
haumea = {
|
||||
url = "github:nix-community/haumea/v0.2.2";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -133,7 +125,6 @@
|
||||
};
|
||||
|
||||
nixos-apple-silicon = {
|
||||
# asahi-6.18.9
|
||||
url = "github:nix-community/nixos-apple-silicon";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
config,
|
||||
nixpkgs,
|
||||
nixvim,
|
||||
pkgs,
|
||||
...
|
||||
@@ -9,7 +8,7 @@
|
||||
|
||||
imports = [ nixvim.homeModules.nixvim ];
|
||||
|
||||
programs.nixvim.nixpkgs.source = nixpkgs;
|
||||
programs.nixvim.nixpkgs.useGlobalPackages = true;
|
||||
home.shellAliases = {
|
||||
|
||||
vi = "nvim";
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
catppuccin = {
|
||||
# The default `enable` value for all available programs.
|
||||
enable = true;
|
||||
cache.enable = true;
|
||||
# one of "latte", "frappe", "macchiato", "mocha"
|
||||
flavor = "mocha";
|
||||
# one of "blue", "flamingo", "green", "lavender", "maroon", "mauve", "peach", "pink", "red", "rosewater", "sapphire", "sky", "teal", "yellow"
|
||||
|
||||
@@ -19,14 +19,6 @@
|
||||
$env.ANTHROPIC_BASE_URL = $env.WORK_ANTHROPIC_BASE_URL
|
||||
$env.ANTHROPIC_AUTH_TOKEN = $env.WORK_ANTHROPIC_AUTH_TOKEN
|
||||
|
||||
# using claude-code with glm llm
|
||||
# https://docs.bigmodel.cn/cn/coding-plan/tool/claude
|
||||
# $env.ANTHROPIC_BASE_URL = "https://open.bigmodel.cn/api/anthropic"
|
||||
# $env.ANTHROPIC_AUTH_TOKEN = $env.ZAI_API_KEY
|
||||
# $env.ANTHROPIC_DEFAULT_OPUS_MODEL = "glm-5.1"
|
||||
# $env.ANTHROPIC_DEFAULT_SONNET_MODEL = "glm-5-turbo"
|
||||
# $env.ANTHROPIC_DEFAULT_HAIKU_MODEL = "glm-4.5-air"
|
||||
|
||||
# Directories in this constant are searched by the
|
||||
# `use` and `source` commands.
|
||||
const NU_LIB_DIRS = $NU_LIB_DIRS ++ ['${nu_scripts}']
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
{
|
||||
lib,
|
||||
mylib,
|
||||
myvars,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.homeDirectory = "/Users/${myvars.username}";
|
||||
|
||||
# home-manager's darwin module only forwards the system-level nix.package
|
||||
# when `nix.enable` is on, so provide a low-priority fallback here.
|
||||
nix.package = lib.mkDefault pkgs.nix;
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
../base/core
|
||||
../base/tui
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-stable,
|
||||
pkgs-master,
|
||||
blender-bin,
|
||||
...
|
||||
}:
|
||||
@@ -14,6 +15,8 @@
|
||||
inkscape # vector graphics
|
||||
krita # digital painting
|
||||
musescore # music notation
|
||||
pkgs-master.orca-slicer # 3d printer slicer app
|
||||
pkgs-master.bambu-studio # bambu 3d printer slicer app
|
||||
# reaper # audio production
|
||||
# sonic-pi # music programming
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
# screen locker
|
||||
programs.swaylock.enable = true;
|
||||
catppuccin.swaylock.enable = false;
|
||||
|
||||
# Logout Menu
|
||||
programs.wlogout.enable = true;
|
||||
|
||||
@@ -300,6 +300,14 @@ in
|
||||
".local/share/io.github.clash-verge-rev.clash-verge-rev"
|
||||
".local/share/clash-verge"
|
||||
|
||||
# Orca Slicer - 3D Printer Slicer
|
||||
".local/share/orca-slicer"
|
||||
".config/OrcaSlicer"
|
||||
|
||||
# Bambu Studio - 3D Printer Slicer
|
||||
".local/share/bambu-studio"
|
||||
".config/BambuStudio"
|
||||
|
||||
# Audio
|
||||
".config/pulse"
|
||||
".local/state/wireplumber"
|
||||
|
||||
+1
-4
@@ -10,15 +10,12 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (inputs) nixpkgs home-manager nixos-generators;
|
||||
inherit (inputs) nixpkgs home-manager;
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
modules =
|
||||
nixos-modules
|
||||
++ [
|
||||
nixos-generators.nixosModules.all-formats
|
||||
]
|
||||
++ (lib.optionals ((lib.lists.length home-modules) > 0) [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
|
||||
@@ -29,12 +29,14 @@
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
||||
|
||||
"https://nix-community.cachix.org"
|
||||
"https://catppuccin.cachix.org"
|
||||
# my own cache server, currently not used.
|
||||
# "https://ryan4yin.cachix.org"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"catppuccin.cachix.org-1:noG/4HkbhJb+lUAdKrph6LaozJvAeEEZj4N732IysmU="
|
||||
"ryan4yin.cachix.org-1:Gbk27ZU5AYpGS9i3ssoLlwdvMIh0NxG0w8it/cv9kbU="
|
||||
];
|
||||
builders-use-substitutes = true;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
{ nuenv, ... }@args:
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
nuenv.overlays.default
|
||||
]
|
||||
++ (import ../../overlays args);
|
||||
args: {
|
||||
nixpkgs.overlays = import ../../overlays args;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,6 @@ in
|
||||
# otherwise Apple Store will refuse to install them.
|
||||
# For details, see https://github.com/mas-cli/mas
|
||||
masApps = {
|
||||
Keynote = 409183694;
|
||||
Slack = 803453959;
|
||||
WireGuard = 1451685025;
|
||||
# Xcode = 497799835;
|
||||
@@ -177,6 +176,8 @@ in
|
||||
# Misc
|
||||
"iina" # video player
|
||||
"stats" # beautiful system status monitor in menu bar
|
||||
"orcaslicer" # 3d printer slicer app
|
||||
"bambu-studio" # bambu 3d printer slicer app
|
||||
|
||||
# "reaper" # audio editor
|
||||
# "tencent-lemon" # macOS cleaner
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{ lib, ... }:
|
||||
{
|
||||
# auto upgrade nix to the unstable version
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/package-management/nix/default.nix#L284
|
||||
@@ -23,7 +19,28 @@
|
||||
|
||||
# Manual optimise storage: nix-store --optimise
|
||||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.settings = {
|
||||
auto-optimise-store = true;
|
||||
|
||||
# Reference: https://github.com/NixOS/nixpkgs/pull/478109
|
||||
# NixOS tests using systemd-nspawn containers require the Nix daemon to be
|
||||
# configured with the following settings:
|
||||
auto-allocate-uids = true;
|
||||
extra-system-features = [ "uid-range" ];
|
||||
experimental-features = [
|
||||
"auto-allocate-uids"
|
||||
"cgroups"
|
||||
];
|
||||
# Use extra-sandbox-paths instead of sandbox-paths here. The plain
|
||||
# sandbox-paths setting replaces Nix's compiled sandbox defaults, including
|
||||
# the sandbox shell that provides /bin/sh for builders with legacy shebangs.
|
||||
# extra-sandbox-paths keeps those defaults and only adds the paths we need.
|
||||
# After deploying, verify the effective daemon config with:
|
||||
# nix config show | grep sandbox-paths
|
||||
extra-sandbox-paths = [
|
||||
"/dev/net"
|
||||
];
|
||||
};
|
||||
|
||||
nix.channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead.
|
||||
}
|
||||
|
||||
@@ -55,19 +55,11 @@
|
||||
# It supports a richer feature set than the standard linux console VT,
|
||||
# including full unicode support, and when the video card supports drm should be much faster.
|
||||
enable = true;
|
||||
fonts = with pkgs; [
|
||||
{
|
||||
name = "Maple Mono NF CN";
|
||||
package = maple-mono.NF-CN-unhinted;
|
||||
}
|
||||
{
|
||||
name = "JetBrainsMono Nerd Font";
|
||||
package = nerd-fonts.jetbrains-mono;
|
||||
}
|
||||
];
|
||||
extraOptions = "--term xterm-256color";
|
||||
extraConfig = "font-size=14";
|
||||
# Whether to use 3D hardware acceleration to render the console.
|
||||
hwRender = true;
|
||||
config = {
|
||||
font-name = "Maple Mono NF CN";
|
||||
font-size = 14;
|
||||
hwaccel = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
preservation.url = "github:nix-community/preservation";
|
||||
disko.url = "github:nix-community/disko/v1.11.0";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
nuenv.url = "github:DeterminateSystems/nuenv";
|
||||
|
||||
nixos-apple-silicon = {
|
||||
# 2025-10-07 asahi-6.16.8-1
|
||||
|
||||
@@ -56,6 +56,6 @@ in
|
||||
|
||||
# generate iso image for hosts with desktop environment
|
||||
packages = {
|
||||
"${name}-niri" = inputs.self.nixosConfigurations."${name}-niri".config.formats.iso;
|
||||
"${name}-niri" = inputs.self.nixosConfigurations."${name}-niri".config.system.build.images.iso;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
lib,
|
||||
outputs,
|
||||
}:
|
||||
lib.genAttrs (builtins.attrNames outputs.nixosConfigurations) (_: {
|
||||
autoAllocateUids = true;
|
||||
hasUidRange = true;
|
||||
hasAutoAllocateUidsFeature = true;
|
||||
hasCgroupsFeature = true;
|
||||
hasNoExplicitSandboxPaths = true;
|
||||
hasDevNetExtraSandboxPath = true;
|
||||
})
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
outputs,
|
||||
}:
|
||||
lib.genAttrs (builtins.attrNames outputs.nixosConfigurations) (
|
||||
name:
|
||||
let
|
||||
settings = outputs.nixosConfigurations.${name}.config.nix.settings;
|
||||
effectiveSystemFeatures =
|
||||
(settings.system-features or [ ]) ++ (settings.extra-system-features or [ ]);
|
||||
in
|
||||
{
|
||||
autoAllocateUids = settings.auto-allocate-uids or false;
|
||||
hasUidRange = builtins.elem "uid-range" effectiveSystemFeatures;
|
||||
hasAutoAllocateUidsFeature = builtins.elem "auto-allocate-uids" (
|
||||
settings.experimental-features or [ ]
|
||||
);
|
||||
hasCgroupsFeature = builtins.elem "cgroups" (settings.experimental-features or [ ]);
|
||||
hasNoExplicitSandboxPaths = !(settings ? sandbox-paths);
|
||||
hasDevNetExtraSandboxPath = builtins.elem "/dev/net" (settings.extra-sandbox-paths or [ ]);
|
||||
}
|
||||
)
|
||||
+1
-1
@@ -142,7 +142,7 @@ in
|
||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||
src = mylib.relativeToRoot ".";
|
||||
hooks = {
|
||||
nixfmt-rfc-style = {
|
||||
nixfmt = {
|
||||
enable = true;
|
||||
settings.width = 100;
|
||||
};
|
||||
|
||||
@@ -56,6 +56,6 @@ in
|
||||
|
||||
# generate iso image for hosts with desktop environment
|
||||
packages = {
|
||||
"${name}-niri" = inputs.self.nixosConfigurations."${name}-niri".config.formats.iso;
|
||||
"${name}-niri" = inputs.self.nixosConfigurations."${name}-niri".config.system.build.images.iso;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -47,5 +47,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -44,5 +44,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
|
||||
# nixos tests
|
||||
packages."${name}-nixos-tests" = import ../nixos-tests/idols-ruby.nix systemArgs;
|
||||
|
||||
@@ -40,5 +40,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.kubevirt;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.kubevirt;
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.iso;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.iso;
|
||||
}
|
||||
|
||||
@@ -42,5 +42,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.iso;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.iso;
|
||||
}
|
||||
|
||||
@@ -42,5 +42,5 @@ in
|
||||
|
||||
colmena.${name} = mylib.colmenaSystem (systemArgs // { inherit tags ssh-user; });
|
||||
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.formats.iso;
|
||||
packages.${name} = inputs.self.nixosConfigurations.${name}.config.system.build.images.iso;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
lib,
|
||||
outputs,
|
||||
}:
|
||||
lib.genAttrs (builtins.attrNames outputs.nixosConfigurations) (_: {
|
||||
autoAllocateUids = true;
|
||||
hasUidRange = true;
|
||||
hasAutoAllocateUidsFeature = true;
|
||||
hasCgroupsFeature = true;
|
||||
hasNoExplicitSandboxPaths = true;
|
||||
hasDevNetExtraSandboxPath = true;
|
||||
})
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
outputs,
|
||||
}:
|
||||
lib.genAttrs (builtins.attrNames outputs.nixosConfigurations) (
|
||||
name:
|
||||
let
|
||||
settings = outputs.nixosConfigurations.${name}.config.nix.settings;
|
||||
effectiveSystemFeatures =
|
||||
(settings.system-features or [ ]) ++ (settings.extra-system-features or [ ]);
|
||||
in
|
||||
{
|
||||
autoAllocateUids = settings.auto-allocate-uids or false;
|
||||
hasUidRange = builtins.elem "uid-range" effectiveSystemFeatures;
|
||||
hasAutoAllocateUidsFeature = builtins.elem "auto-allocate-uids" (
|
||||
settings.experimental-features or [ ]
|
||||
);
|
||||
hasCgroupsFeature = builtins.elem "cgroups" (settings.experimental-features or [ ]);
|
||||
hasNoExplicitSandboxPaths = !(settings ? sandbox-paths);
|
||||
hasDevNetExtraSandboxPath = builtins.elem "/dev/net" (settings.extra-sandbox-paths or [ ]);
|
||||
}
|
||||
)
|
||||
@@ -12,12 +12,12 @@ export def nixos-switch [
|
||||
print (repeat-str "=" 50)
|
||||
if "debug" == $mode {
|
||||
# show details via nix-output-monitor
|
||||
nom build $".#nixosConfigurations.($name).config.system.build.toplevel" --show-trace --verbose
|
||||
nixos-rebuild switch --sudo --flake $".#($name)" --show-trace --verbose
|
||||
nom build $".#nixosConfigurations.($name).config.system.build.toplevel" --accept-flake-config --show-trace --verbose
|
||||
nixos-rebuild switch --sudo --flake $".#($name)" --accept-flake-config --show-trace --verbose
|
||||
} else if "boot" == $mode {
|
||||
nixos-rebuild boot --sudo --flake $".#($name)"
|
||||
nixos-rebuild boot --sudo --flake $".#($name)" --accept-flake-config
|
||||
} else {
|
||||
nixos-rebuild switch --sudo --flake $".#($name)"
|
||||
nixos-rebuild switch --sudo --flake $".#($name)" --accept-flake-config
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,4 +86,3 @@ export def upload-vm [
|
||||
let remote = $"root@192.168.5.178:/data/caddy/fileserver/vms/kubevirt-($name).qcow2"
|
||||
rsync -avz --progress --copy-links --checksum result/nixos-image-*.qcow2 $remote
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -8,9 +8,11 @@ rec {
|
||||
proxyGateway6 = "fe80::8";
|
||||
nameservers = [
|
||||
# IPv4
|
||||
"119.29.29.29" # DNSPod
|
||||
"119.29.29.29" # DNSPod https://www.dnspod.cn/Products/publicdns
|
||||
"223.5.5.5" # AliDNS
|
||||
"1.1.1.1" # Cloudflare https://one.one.one.one/dns/
|
||||
# IPv6
|
||||
"2402:4e00::" # DNSPod
|
||||
"2400:3200::1" # Alidns
|
||||
"2606:4700:4700::1111" # Cloudflare
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user