diff --git a/spotlight_courses/HS24_NixOS/main.pdf b/spotlight_courses/HS24_NixOS/main.pdf index 2d726e4cf2ee927fc98f72f122c13e776d515144..4579bae7a29f46ea11d854bfb37ad2fbdbe5fc6e 100644 Binary files a/spotlight_courses/HS24_NixOS/main.pdf and b/spotlight_courses/HS24_NixOS/main.pdf differ diff --git a/spotlight_courses/HS24_NixOS/main.typ b/spotlight_courses/HS24_NixOS/main.typ index a1ed1e0b1f930e2f574ba4776b37b05ab4d278ff..212f9e692dbd9812fadb48d4a19364959c15d55f 100644 --- a/spotlight_courses/HS24_NixOS/main.typ +++ b/spotlight_courses/HS24_NixOS/main.typ @@ -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