Reformat source using typstyle
This commit is contained in:
parent
01a3daa5d7
commit
62e7b07351
2 changed files with 88 additions and 30 deletions
|
|
@ -3538,8 +3538,8 @@ endobj
|
||||||
/Subject (https://forgejo.mit.edu/SIPB/nixos-cheatsheet)
|
/Subject (https://forgejo.mit.edu/SIPB/nixos-cheatsheet)
|
||||||
/Author (SIPB)
|
/Author (SIPB)
|
||||||
/Creator (Typst 0.14.2)
|
/Creator (Typst 0.14.2)
|
||||||
/ModDate (D:20251218170105-06'00)
|
/ModDate (D:20251218185526-06'00)
|
||||||
/CreationDate (D:20251218170105-06'00)
|
/CreationDate (D:20251218185526-06'00)
|
||||||
>>
|
>>
|
||||||
endobj
|
endobj
|
||||||
|
|
||||||
|
|
@ -3550,7 +3550,7 @@ endobj
|
||||||
/Subtype /XML
|
/Subtype /XML
|
||||||
>>
|
>>
|
||||||
stream
|
stream
|
||||||
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="xmp-writer"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" ><dc:title><rdf:Alt><rdf:li xml:lang="x-default">NixOS Cheatsheet</rdf:li></rdf:Alt></dc:title><dc:description><rdf:Alt><rdf:li xml:lang="x-default">https://forgejo.mit.edu/SIPB/nixos-cheatsheet</rdf:li></rdf:Alt></dc:description><dc:creator><rdf:Seq><rdf:li>SIPB</rdf:li></rdf:Seq></dc:creator><xmp:CreatorTool>Typst 0.14.2</xmp:CreatorTool><dc:language><rdf:Bag><rdf:li>en</rdf:li></rdf:Bag></dc:language><xmp:ModifyDate>2025-12-18T17:01:05-06:00</xmp:ModifyDate><xmp:CreateDate>2025-12-18T17:01:05-06:00</xmp:CreateDate><xmpTPg:NPages>1</xmpTPg:NPages><dc:format>application/pdf</dc:format><xmpMM:InstanceID>WiClfpAcbnklFdgdltz+DQ==</xmpMM:InstanceID><xmpMM:DocumentID>yTeYg1yex33MLTVF66AFMw==</xmpMM:DocumentID><xmpMM:RenditionClass>proof</xmpMM:RenditionClass><pdf:PDFVersion>1.7</pdf:PDFVersion></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="r"?>
|
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="xmp-writer"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" ><dc:title><rdf:Alt><rdf:li xml:lang="x-default">NixOS Cheatsheet</rdf:li></rdf:Alt></dc:title><dc:description><rdf:Alt><rdf:li xml:lang="x-default">https://forgejo.mit.edu/SIPB/nixos-cheatsheet</rdf:li></rdf:Alt></dc:description><dc:creator><rdf:Seq><rdf:li>SIPB</rdf:li></rdf:Seq></dc:creator><xmp:CreatorTool>Typst 0.14.2</xmp:CreatorTool><dc:language><rdf:Bag><rdf:li>en</rdf:li></rdf:Bag></dc:language><xmp:ModifyDate>2025-12-18T18:55:26-06:00</xmp:ModifyDate><xmp:CreateDate>2025-12-18T18:55:26-06:00</xmp:CreateDate><xmpTPg:NPages>1</xmpTPg:NPages><dc:format>application/pdf</dc:format><xmpMM:InstanceID>10nE75G6+Cc6iFzHr6IWtg==</xmpMM:InstanceID><xmpMM:DocumentID>yTeYg1yex33MLTVF66AFMw==</xmpMM:DocumentID><xmpMM:RenditionClass>proof</xmpMM:RenditionClass><pdf:PDFVersion>1.7</pdf:PDFVersion></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="r"?>
|
||||||
endstream
|
endstream
|
||||||
endobj
|
endobj
|
||||||
|
|
||||||
|
|
@ -3834,7 +3834,7 @@ trailer
|
||||||
/Size 256
|
/Size 256
|
||||||
/Root 255 0 R
|
/Root 255 0 R
|
||||||
/Info 253 0 R
|
/Info 253 0 R
|
||||||
/ID [(yTeYg1yex33MLTVF66AFMw==) (WiClfpAcbnklFdgdltz+DQ==)]
|
/ID [(yTeYg1yex33MLTVF66AFMw==) (10nE75G6+Cc6iFzHr6IWtg==)]
|
||||||
>>
|
>>
|
||||||
startxref
|
startxref
|
||||||
83908
|
83908
|
||||||
|
|
|
||||||
108
cheatsheet.typ
108
cheatsheet.typ
|
|
@ -19,42 +19,100 @@
|
||||||
|
|
||||||
Revision #datetime.today().display(), made by #context document.author.first() #box(image("sipb.svg", height: 15pt))
|
Revision #datetime.today().display(), made by #context document.author.first() #box(image("sipb.svg", height: 15pt))
|
||||||
|
|
||||||
#context document.description]
|
#context document.description],
|
||||||
)
|
)
|
||||||
|
|
||||||
#table(
|
#table(
|
||||||
stroke: (x: none, y: 0.5pt),
|
stroke: (x: none, y: 0.5pt),
|
||||||
columns: (35%, auto),
|
columns: (35%, auto),
|
||||||
table.header(table.cell(fill: silver, align: center, [Task]), table.cell(fill: silver, align: center, [Command])),
|
table.header(
|
||||||
table.header(level: 2, repeat: false, table.cell(fill: aqua)[*Running software*], table.cell(fill: aqua)[]),
|
table.cell(fill: silver, align: center, [Task]),
|
||||||
[Search for software], [```bash nix search nixpkgs hello``` #footnote[This evaluates nixpkgs so the first run may be slow, but further runs used cached results]],
|
table.cell(fill: silver, align: center, [Command]),
|
||||||
[Run program], [```bash nix run nixpkgs#hello``` #footnote[Pass `--` before any arguments to the program]],
|
),
|
||||||
[Run program from other nixpkgs branch], ```bash nix run nixpkgs/nixos-25.11#hello```,
|
table.header(
|
||||||
[Run program from another flake], ```bash nix run nix run github:user/nixpkgs/branch#hello```,
|
level: 2,
|
||||||
[Find nixpkgs revision for a specific version of a program], [See https://lazamar.co.uk/nix-versions/],
|
repeat: false,
|
||||||
|
table.cell(fill: aqua)[*Running software*], table.cell(fill: aqua)[],
|
||||||
|
),
|
||||||
|
[Search for software],
|
||||||
|
[```bash nix search nixpkgs hello``` #footnote[This evaluates nixpkgs so the first run may be slow, but further runs used cached results]],
|
||||||
|
|
||||||
|
[Run program],
|
||||||
|
[```bash nix run nixpkgs#hello``` #footnote[Pass `--` before any arguments to the program]],
|
||||||
|
|
||||||
|
[Run program from other nixpkgs branch],
|
||||||
|
```bash nix run nixpkgs/nixos-25.11#hello```,
|
||||||
|
|
||||||
|
[Run program from another flake],
|
||||||
|
```bash nix run nix run github:user/nixpkgs/branch#hello```,
|
||||||
|
|
||||||
|
[Find nixpkgs revision for a specific version of a program],
|
||||||
|
[See https://lazamar.co.uk/nix-versions/],
|
||||||
|
|
||||||
[Get shell with program], ```bash nix shell nixpkgs#hello```,
|
[Get shell with program], ```bash nix shell nixpkgs#hello```,
|
||||||
[Run AppImage], ```bash appimage-run hello.AppImage```,
|
[Run AppImage], ```bash appimage-run hello.AppImage```,
|
||||||
table.header(level: 2, repeat: false, table.cell(fill: lime)[*Building the system*], table.cell(fill: lime)[]),
|
table.header(
|
||||||
|
level: 2,
|
||||||
|
repeat: false,
|
||||||
|
table.cell(fill: lime)[*Building the system*], table.cell(fill: lime)[],
|
||||||
|
),
|
||||||
[Update flake inputs], ```bash nix flake update```,
|
[Update flake inputs], ```bash nix flake update```,
|
||||||
[Build and deploy to this machine], ```bash nixos-rebuild switch --sudo```,
|
[Build and deploy to this machine], ```bash nixos-rebuild switch --sudo```,
|
||||||
[Build on remote machine and deploy to current machine], [```bash sudo nixos-rebuild switch --build-host user@remote --use-substitutes``` #footnote[This needs root on the current machine to add untrusted paths to the Nix store]],
|
[Build on remote machine and deploy to current machine],
|
||||||
[Build on current machine and deploy to remote machine], [```bash nixos-rebuild switch --flake .#remote-machine-hostname --target-host root@remote``` #footnote[This needs root on the remote machine for the same reason]],
|
[```bash sudo nixos-rebuild switch --build-host user@remote --use-substitutes``` #footnote[This needs root on the current machine to add untrusted paths to the Nix store]],
|
||||||
[Build and run VM from config], [```bash nixos-rebuild build-vm && result/bin/run-$hostname-vm -m 4G -smp 4 -device virtio-vga-gl -display sdl,gl=on``` #footnote[You may need to change all occurrences of the QEMU version in the run script if the config uses a different nixpkgs revision than the host]],
|
|
||||||
[Build ISO from config], [Add `"/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"` as a module, then run ```bash nix build .#nixosConfigurations.$hostname.config.system.build.isoImage```],
|
[Build on current machine and deploy to remote machine],
|
||||||
table.header(level: 2, repeat: false, table.cell(fill: yellow)[*System generations*], table.cell(fill: yellow)[]),
|
[```bash nixos-rebuild switch --flake .#remote-machine-hostname --target-host root@remote``` #footnote[This needs root on the remote machine for the same reason]],
|
||||||
|
|
||||||
|
[Build and run VM from config],
|
||||||
|
[```bash nixos-rebuild build-vm && result/bin/run-$hostname-vm -m 4G -smp 4 -device virtio-vga-gl -display sdl,gl=on``` #footnote[You may need to change all occurrences of the QEMU version in the run script if the config uses a different nixpkgs revision than the host]],
|
||||||
|
|
||||||
|
[Build ISO from config],
|
||||||
|
[Add `"/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"` as a module, then run ```bash nix build .#nixosConfigurations.$hostname.config.system.build.isoImage```],
|
||||||
|
|
||||||
|
table.header(
|
||||||
|
level: 2,
|
||||||
|
repeat: false,
|
||||||
|
table.cell(fill: yellow)[*System generations*], table.cell(fill: yellow)[],
|
||||||
|
),
|
||||||
[List system generations], ```bash nixos-rebuild list-generations```,
|
[List system generations], ```bash nixos-rebuild list-generations```,
|
||||||
[Get changes between system generations], ```bash nix profile diff-closures --profile /nix/var/nix/profiles/system```,
|
[Get changes between system generations],
|
||||||
|
```bash nix profile diff-closures --profile /nix/var/nix/profiles/system```,
|
||||||
|
|
||||||
[Roll back one generation], ```bash nixos-rebuild switch --sudo --rollback```,
|
[Roll back one generation], ```bash nixos-rebuild switch --sudo --rollback```,
|
||||||
[Switch to generation], ```bash sudo nix-env --switch-generation 12345 -p /nix/var/nix/profiles/system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch```,
|
[Switch to generation],
|
||||||
table.header(level: 2, repeat: false, table.cell(fill: orange)[*Store operations*], table.cell(fill: orange)[]),
|
```bash sudo nix-env --switch-generation 12345 -p /nix/var/nix/profiles/system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch```,
|
||||||
[Get size of system], ```bash nix path-info -Sh /nix/var/nix/profiles/system```,
|
|
||||||
[Get size of Nix store], ```bash sqlite3 /nix/var/nix/db/db.sqlite 'SELECT SUM(narSize) FROM ValidPaths'```,
|
table.header(
|
||||||
[Get largest packages], ```bash sqlite3 /nix/var/nix/db/db.sqlite 'SELECT * FROM ValidPaths ORDER BY narSize DESC LIMIT 20'```,
|
level: 2,
|
||||||
|
repeat: false,
|
||||||
|
table.cell(fill: orange)[*Store operations*], table.cell(fill: orange)[],
|
||||||
|
),
|
||||||
|
[Get size of system],
|
||||||
|
```bash nix path-info -Sh /nix/var/nix/profiles/system```,
|
||||||
|
|
||||||
|
[Get size of Nix store],
|
||||||
|
```bash sqlite3 /nix/var/nix/db/db.sqlite 'SELECT SUM(narSize) FROM ValidPaths'```,
|
||||||
|
|
||||||
|
[Get largest packages],
|
||||||
|
```bash sqlite3 /nix/var/nix/db/db.sqlite 'SELECT * FROM ValidPaths ORDER BY narSize DESC LIMIT 20'```,
|
||||||
|
|
||||||
[Clean Nix store], ```bash sudo nix-collect-garbage && nix store optimise```,
|
[Clean Nix store], ```bash sudo nix-collect-garbage && nix store optimise```,
|
||||||
[Delete generations older than 7 days], ```bash sudo nix-collect-garbage --delete-older-than 7d```,
|
[Delete generations older than 7 days],
|
||||||
[Check what depends on path], ```bash nix-store --query --referrers /nix/store/aaaaaa```,
|
```bash sudo nix-collect-garbage --delete-older-than 7d```,
|
||||||
table.header(level: 2, repeat: false, table.cell(fill: fuchsia)[*Nix development*], table.cell(fill: fuchsia)[]),
|
|
||||||
|
[Check what depends on path],
|
||||||
|
```bash nix-store --query --referrers /nix/store/aaaaaa```,
|
||||||
|
|
||||||
|
table.header(
|
||||||
|
level: 2,
|
||||||
|
repeat: false,
|
||||||
|
table.cell(fill: fuchsia)[*Nix development*], table.cell(fill: fuchsia)[],
|
||||||
|
),
|
||||||
[Run Nix file], ```bash nix eval -f main.nix```,
|
[Run Nix file], ```bash nix eval -f main.nix```,
|
||||||
[Inspect system config in REPL], ```bash nix repl .#nixosConfigurations.$hostname```,
|
[Inspect system config in REPL],
|
||||||
[Format flake], [Add `formatter.${system} = pkgs.nixfmt-tree;` to your flake outputs, then run ```bash nix fmt```],
|
```bash nix repl .#nixosConfigurations.$hostname```,
|
||||||
|
|
||||||
|
[Format flake],
|
||||||
|
[Add `formatter.${system} = pkgs.nixfmt-tree;` to your flake outputs, then run ```bash nix fmt```],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue