Skip to content
Snippets Groups Projects
Unverified Commit b1503ff3 authored by Valentin's avatar Valentin
Browse files

NixOS: add nvf

parent f6935ee3
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -13,6 +13,7 @@
),
)
#show: codly-init.with()
// #show link: underline
#codly(
stroke: 2pt + black,
......@@ -48,6 +49,7 @@
- configuring *`NixOS`*
- *toolbox* of commands / websites
- some *interesting projects* for NixOS
== Nix, Nixpkgs, and NixOS
#align(center)[
#image("img/nix-holy-trinity.png", height: 1fr)
......@@ -330,7 +332,6 @@ in
```
// https://fzakaria.com/2024/07/05/learn-nix-the-fun-way.html
= NixOS
== What is NixOS?
......@@ -342,6 +343,13 @@ in
$==>$ gigantic collection of nix code
= Nixpkgs
== A look at nixpkgs
- Giant mono-repo with build recipies (derivations) for 100 000+ programs
- *nixpkgs* lib
- *NixOS* itself too!
== `nixpkgs/pkgs/by-name/ty/typst/package.nix`
#columns(2,
......@@ -384,9 +392,6 @@ rustPlatform.buildRustPackage rec {
```)]
)
== nixpkgs - `cache.nixos.org`
- We do not want build every package ourselves...
......@@ -440,9 +445,11 @@ lrwxrwxrwx 1 cr users 57 Oct 30 18:35 result -> /nix/store/hysmspp11fxnkgjsp032
- Easy to test our package, just run `./result/bin/what-is-my-ip`
== What's the _flake.lock_ doing there?
```
❯ cat flake.lock
#columns(2,
[
#text(
size: 15pt,
[```json
{
"nodes": {
"nixpkgs": {
......@@ -470,7 +477,8 @@ lrwxrwxrwx 1 cr users 57 Oct 30 18:35 result -> /nix/store/hysmspp11fxnkgjsp032
"root": "root",
"version": 7
}
```
```])])
== So, what's great about flakes exactly?
- Keep track of all inputs, lock them
- version-control your dependencies
......@@ -580,12 +588,6 @@ Remember derivations?
nh os rebuild --update
```
= Home Manager
== Manage your user with nix!
......@@ -707,7 +709,53 @@ true-color = true
]
)
= Nix wrappers
== nvf
Configure everything in nix, even programs like neovim!
#text(size: 10pt,
[#columns(2, [
```nix
config.vim = {
viAlias = true;
vimAlias = true;
spellcheck.enable = true;
lsp.formatOnSave = true;
debugger = {
nvim-dap = {
enable = true;
ui.enable = true;
};
};
languages = {
enableLSP = true;
enableFormat = true;
zig.enable = false;
nix.enable = true;
rust = {
enable = true;
crates.enable = true;
};
};
autopairs.enable = true;
treesitter.context.enable = true;
autocomplete = {
enable = true;
type = "nvim-cmp";
};
filetree = {
nvimTree = {
enable = true;
};
};
git = {
enable = true;
gitsigns.enable = true;
};
```
#link("https://github.com/NotAShelf/nvf")
])
])
= Toolbox
== CLI
......@@ -724,14 +772,14 @@ true-color = true
#image("img/nix-repl.png", width: 100%)
]
=== nix-shell
== Websites
- #link("https://noogle.dev") - NixOS function search
- #link("https://search.nixos.org") - NixOS package search
- #link("https://home-manager-options.extranix.com")
- #link("https://wiki.nixos.org") - NixOS Wiki
- *_Tip:_* don't use #link("https://nixos.wiki") (outdated)
= packaging
......@@ -742,12 +790,6 @@ true-color = true
- why? identity of derivation: hash
= stylix
== Styling
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment