Skip to content

Commit 4989469

Browse files
committed
format: prettier --write .
1 parent cbd3688 commit 4989469

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+967
-1192
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ you've come to the right place!
88
An unofficial and opinionated NixOS & Flakes :book: for beginners:
99
https://nixos-and-flakes.thiscute.world/
1010

11-
### Author-Maintained Versions:
12-
* **English Version**: https://nixos-and-flakes.thiscute.world/
13-
* **中文版**: https://nixos-and-flakes.thiscute.world/zh/
11+
### Author-Maintained Versions:
12+
13+
- **English Version**: https://nixos-and-flakes.thiscute.world/
14+
- **中文版**: https://nixos-and-flakes.thiscute.world/zh/
1415

1516
### Community-Maintained Versions:
16-
* **Versão em Português**: https://nixos-and-flakes.ieda.me/
17-
* **日本語版**: https://nixos-and-flakes-ja.hayao0819.com/
17+
18+
- **Versão em Português**: https://nixos-and-flakes.ieda.me/
19+
- **日本語版**: https://nixos-and-flakes-ja.hayao0819.com/
1820

1921
> If you're using macOS,
2022
> [ryan4yin/nix-darwin-kickstarter](https://github.com/ryan4yin/nix-darwin-kickstarter)
@@ -88,6 +90,7 @@ who already contributed to this project!
8890
Yin is licensed under [CC BY-SA 4.0](./LICENSE.md)
8991

9092
[^1]: [Flakes - NixOS Wiki](https://wiki.nixos.org/wiki/Flakes)
93+
9194
[^2]:
9295
[Flakes are such an obviously good thing](https://grahamc.com/blog/flakes-are-an-obviously-good-thing/)
9396

docs/.vitepress/config/index.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { defineConfig } from 'vitepress'
2-
import { shared } from './shared'
3-
import { en } from './en'
4-
import { zh } from './zh'
5-
1+
import { defineConfig } from "vitepress"
2+
import { shared } from "./shared"
3+
import { en } from "./en"
4+
import { zh } from "./zh"
65

76
export default defineConfig({
87
...shared,
@@ -12,13 +11,13 @@ export default defineConfig({
1211
"en/:rest*": ":rest*",
1312
},
1413
locales: {
15-
root: {
16-
label: 'English',
17-
...en
14+
root: {
15+
label: "English",
16+
...en,
1817
},
1918
zh: {
20-
label: '简体中文',
21-
...zh
19+
label: "简体中文",
20+
...zh,
2221
},
2322
pt: {
2423
label: "Português",
@@ -45,14 +44,13 @@ export default defineConfig({
4544
// },
4645
//
4746
// // Languages maintained by the original author
48-
// en: {
47+
// en: {
4948
// label: 'English',
5049
// link: "https://nixos-and-flakes.thiscute.world/",
5150
// },
5251
// zh: {
53-
// label: '简体中文',
52+
// label: '简体中文',
5453
// link: "https://nixos-and-flakes.thiscute.world/zh/",
5554
// },
5655
// },
5756
})
58-

docs/.vitepress/config/shared.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createRequire } from 'module'
1+
import { createRequire } from "module"
22
import { generateSitemap as sitemap } from "sitemap-ts"
33
import { PageData, defineConfig } from "vitepress"
44

@@ -43,14 +43,17 @@ export const shared = defineConfig({
4343
},
4444

4545
head: [
46-
["link", { rel: "icon", href: "/favicon-16x16.png", sizes: "16x16" }],
47-
["link", { rel: "icon", href: "/favicon-32x32.png", sizes: "32x32" }],
46+
["link", { rel: "icon", href: "/favicon-16x16.png", sizes: "16x16" }],
47+
["link", { rel: "icon", href: "/favicon-32x32.png", sizes: "32x32" }],
4848
// Google Search and Android Chrome
4949
["link", { rel: "icon", href: "/favicon-96x96.png", sizes: "96x96" }],
5050
["link", { rel: "icon", href: "/web-app-manifest-192x192.png", sizes: "192x192" }],
5151
["link", { rel: "icon", href: "/web-app-manifest-512x512.png", sizes: "512x512" }],
5252
// For Apple iPhone/iPad
53-
["link", { rel: "apple-touch-icon", href: "/apple-touch-icon.png", sizes: "180x180" }],
53+
[
54+
"link",
55+
{ rel: "apple-touch-icon", href: "/apple-touch-icon.png", sizes: "180x180" },
56+
],
5457

5558
// site.manifest
5659
["link", { rel: "manifest", href: "/site.webmanifest" }],

docs/en/best-practices/accelerating-dotfiles-debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ in
4040

4141
After modifying the configuration, run `sudo nixos-rebuild switch` (or
4242
`home-manager switch` if you are using Home Manager standalone) to apply the changes. From
43-
then on, any modifications you make to `~/nix-config/home/nvim` or `~/nix-config/home/doom` will be
44-
immediately observed by Neovim/Emacs.
43+
then on, any modifications you make to `~/nix-config/home/nvim` or
44+
`~/nix-config/home/doom` will be immediately observed by Neovim/Emacs.
4545

4646
This way, you can manage all your Dotfiles using a single nix-config repository, while
4747
frequently modified non-Nix configurations can take effect quickly, unaffected by Nix.

docs/en/best-practices/nix-path-and-flake-registry.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ then downloads the repository, locates the `flake.nix` within, and runs the corr
3838
3939
The roles of `NIX_PATH` and the Flake Registry have been explained earlier. In daily use,
4040
we typically want the `nixpkgs` used in commands like `nix repl '<nixpkgs>'`,
41-
`nix run nixpkgs#ponysay hello` to match the system's `nixpkgs`. This is done
42-
by default as of [NixOS 24.05][automatic flake registry]. Also, although
43-
`nix-channel` can coexist with the Flakes feature, in practice, Flakes can
44-
completely replace it, so we can also disable it.
41+
`nix run nixpkgs#ponysay hello` to match the system's `nixpkgs`. This is done by default
42+
as of [NixOS 24.05][automatic flake registry]. Also, although `nix-channel` can coexist
43+
with the Flakes feature, in practice, Flakes can completely replace it, so we can also
44+
disable it.
4545

4646
[automatic flake registry]: https://github.com/NixOS/nixpkgs/pull/254405
4747

docs/en/best-practices/run-downloaded-binaries-on-nixos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ add the following code to one of your Nix modules:
2727
(let base = pkgs.appimageTools.defaultFhsEnvArgs; in
2828
pkgs.buildFHSUserEnv (base // {
2929
name = "fhs";
30-
targetPkgs = pkgs:
30+
targetPkgs = pkgs:
3131
# pkgs.buildFHSUserEnv provides only a minimal FHS environment,
3232
# lacking many basic packages needed by most software.
3333
# Therefore, we need to add them manually.

docs/en/nix-store/add-binary-cache-servers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ In Nix, you can configure cache servers using the following options:
3737
the build process of a certain library, they must take on the corresponding security
3838
risks and decide whether to add the public key of that cache server to
3939
`trusted-public-keys`. To completely solve this trust issue, Nix has introduced the
40-
experimental feature [ca-derivations](https://wiki.nixos.org/wiki/Ca-derivations), which
41-
does not depend on `trusted-public-keys` for signature verification. Interested
42-
users can explore it further.
40+
experimental feature [ca-derivations](https://wiki.nixos.org/wiki/Ca-derivations),
41+
which does not depend on `trusted-public-keys` for signature verification.
42+
Interested users can explore it further.
4343

4444
You can configure the `substituters` and `trusted-public-keys` parameters in the following
4545
ways:

docs/en/nixos-with-flakes/downgrade-or-upgrade-packages.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ submodule. Here's an example of a Home Manager submodule:
104104

105105
## Pinning a package version with an overlay
106106

107-
The above approach is perfect for application packages, but sometimes you need to replace libraries used by those packages. This is where [Overlays](../nixpkgs/overlays.md) shine! Overlays can edit or replace any attribute of a package, but for now we'll just pin a package to a different nixpkgs version. The main disadvantage of editing a dependency with an overlay is that your Nix installation will recompile all installed packages that depend on it, but your situation may require it for specific bug fixes.
107+
The above approach is perfect for application packages, but sometimes you need to replace
108+
libraries used by those packages. This is where [Overlays](../nixpkgs/overlays.md) shine!
109+
Overlays can edit or replace any attribute of a package, but for now we'll just pin a
110+
package to a different nixpkgs version. The main disadvantage of editing a dependency with
111+
an overlay is that your Nix installation will recompile all installed packages that depend
112+
on it, but your situation may require it for specific bug fixes.
108113

109114
```nix
110115
# overlays/mesa.nix

docs/en/nixos-with-flakes/introduction-to-flakes.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,31 @@ them with the corresponding New CLI commands (except for `nix-collect-garbage`,
8585
is currently no alternative for this command):
8686

8787
1. `nix-channel`: `nix-channel` manages versions of inputs like nixpkgs through
88-
stable/unstable channels, similar to the package lists used by other package
89-
management tools such as apt/yum/pacman. This is what traditionally provides
90-
`<nixpkgs>` in the Nix language.
91-
1. In Flakes, the functionality of `nix-channel` is replaced by
92-
the Flake Registry (`nix registry`) for providing "some unspecified global
93-
version of nixpkgs" for interactive CLI usage (e.g. `nix run nixpkgs#hello`).
94-
When using a `flake.nix`, input versions are managed in the flake itself.
95-
2. Flakes use the `inputs` section in `flake.nix` to manage
96-
versions of nixpkgs and other inputs in each Flake instead of using
97-
global state.
88+
stable/unstable channels, similar to the package lists used by other package management
89+
tools such as apt/yum/pacman. This is what traditionally provides `<nixpkgs>` in the
90+
Nix language.
91+
1. In Flakes, the functionality of `nix-channel` is replaced by the Flake Registry
92+
(`nix registry`) for providing "some unspecified global version of nixpkgs" for
93+
interactive CLI usage (e.g. `nix run nixpkgs#hello`). When using a `flake.nix`,
94+
input versions are managed in the flake itself.
95+
2. Flakes use the `inputs` section in `flake.nix` to manage versions of nixpkgs and
96+
other inputs in each Flake instead of using global state.
9897
2. `nix-env`: `nix-env` is a core command-line tool for classic Nix used to manage
9998
software packages in the user environment.
99+
100100
1. It installs packages from the data sources added by `nix-channel`, causing the
101101
installed package's version to be influenced by the channel. Packages installed with
102102
`nix-env` are not automatically recorded in Nix's declarative configuration and are
103103
completely independent of its control, making them challenging to reproduce on other
104-
machines. Upgrading packages installed by `nix-env` is slow and may
105-
produce unexpected results because the attribute name where the package
106-
was found in nixpkgs is not saved.
104+
machines. Upgrading packages installed by `nix-env` is slow and may produce
105+
unexpected results because the attribute name where the package was found in nixpkgs
106+
is not saved.
107107

108108
Therefore, it is not recommended to use this command directly.
109+
109110
2. The corresponding command in the New CLI is `nix profile`. Personally, I don't
110111
recommend it for beginners.
112+
111113
3. `nix-shell`: `nix-shell` creates a temporary shell environment, which is useful for
112114
development and testing.
113115
1. New CLI: This tool is divided into three sub-commands: `nix develop`, `nix shell`,
@@ -126,6 +128,7 @@ is currently no alternative for this command):
126128
[Try to explain nix commands](https://qiita.com/Sumi-Sumi/items/6de9ee7aab10bc0dbead?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en).
127129

128130
[^1]: [Flakes - NixOS Wiki](https://wiki.nixos.org/wiki/Flakes)
131+
129132
[^2]:
130133
[Flakes are such an obviously good thing](https://grahamc.com/blog/flakes-are-an-obviously-good-thing/)
131134

docs/en/nixos-with-flakes/nixos-flake-configuration-explained.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,3 @@ source code, and study its implementation.
182182
https://github.com/NixOS/nixpkgs/blob/nixos-25.05/lib/modules.nix#L122-L184
183183
[nixpkgs/nixos-25.05/nixos/doc/manual/development/option-types.section.md#L268-L275]:
184184
https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/doc/manual/development/option-types.section.md?plain=1#L268-L275
185-
186-

0 commit comments

Comments
 (0)