diff options
author | Minijackson <minijackson@riseup.net> | 2019-10-05 15:28:22 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2019-10-06 19:52:49 +0200 |
commit | a718a6e3490bc4e43df2bb8afc351ef599d9d975 (patch) | |
tree | dcec0c489dcba08b64b7bdc72e4057986f524921 | |
parent | 25cf13479e5876dc526a23657f6d10e2630cd940 (diff) | |
download | nixos-embedded-slides-a718a6e3490bc4e43df2bb8afc351ef599d9d975.tar.gz nixos-embedded-slides-a718a6e3490bc4e43df2bb8afc351ef599d9d975.zip |
Better minted fix + how 2 define modules
-rw-r--r-- | slides.md | 281 |
1 files changed, 176 insertions, 105 deletions
@@ -52,6 +52,13 @@ Heads Up | |||
52 | yet. | 52 | yet. |
53 | - This is more a call to try, tinker, experiment, contribute to the project so | 53 | - This is more a call to try, tinker, experiment, contribute to the project so |
54 | it would be production ready | 54 | it would be production ready |
55 | - This also is a "bottom-up" talk, which means: | ||
56 | - More technical, but | ||
57 | - Should lead to better understanding | ||
58 | - How, and why it works | ||
59 | - Maybe apply some of these concepts in your daily work (using, Buildroot, | ||
60 | Yocto, etc.) | ||
61 | |||
55 | 62 | ||
56 | ::: | 63 | ::: |
57 | 64 | ||
@@ -204,7 +211,7 @@ of the "package function". | |||
204 | /nix/store/486r3d12gc042yric302jg14in7j3jwm-i3.conf | 211 | /nix/store/486r3d12gc042yric302jg14in7j3jwm-i3.conf |
205 | ``` | 212 | ``` |
206 | 213 | ||
207 | ## Nix---Language (Types) | 214 | ## Nix---Language (Types){.fragile} |
208 | 215 | ||
209 | ```{=latex} | 216 | ```{=latex} |
210 | \begin{minted}{nix} | 217 | \begin{minted}{nix} |
@@ -224,9 +231,6 @@ of the "package function". | |||
224 | \end{minted} | 231 | \end{minted} |
225 | ``` | 232 | ``` |
226 | 233 | ||
227 | ``` | ||
228 | ``` | ||
229 | |||
230 | ::: notes | 234 | ::: notes |
231 | 235 | ||
232 | - There's also the "derivation", which is his own type. | 236 | - There's also the "derivation", which is his own type. |
@@ -238,7 +242,7 @@ a function that returns a function ("currying"), or use named parameters. | |||
238 | 242 | ||
239 | ::: | 243 | ::: |
240 | 244 | ||
241 | ## Nix---Language (Control Flow) | 245 | ## Nix---Language (Control Flow){.fragile} |
242 | 246 | ||
243 | 247 | ||
244 | :::::: {.columns} | 248 | :::::: {.columns} |
@@ -272,9 +276,6 @@ Gives: | |||
272 | \end{minted} | 276 | \end{minted} |
273 | ``` | 277 | ``` |
274 | 278 | ||
275 | ``` | ||
276 | ``` | ||
277 | |||
278 | ::: | 279 | ::: |
279 | :::::: | 280 | :::::: |
280 | 281 | ||
@@ -293,7 +294,7 @@ Gives: | |||
293 | 294 | ||
294 | ::: | 295 | ::: |
295 | 296 | ||
296 | ## Nix---Language (Control Flow continued) | 297 | ## Nix---Language (Control Flow continued){.fragile} |
297 | 298 | ||
298 | 299 | ||
299 | :::::: {.columns} | 300 | :::::: {.columns} |
@@ -314,9 +315,6 @@ in | |||
314 | \end{minted} | 315 | \end{minted} |
315 | ``` | 316 | ``` |
316 | 317 | ||
317 | ``` | ||
318 | ``` | ||
319 | |||
320 | ::: | 318 | ::: |
321 | ::: {.column witdh="40%"} | 319 | ::: {.column witdh="40%"} |
322 | 320 | ||
@@ -332,9 +330,6 @@ Gives: | |||
332 | \end{minted} | 330 | \end{minted} |
333 | ``` | 331 | ``` |
334 | 332 | ||
335 | ``` | ||
336 | ``` | ||
337 | |||
338 | ::: | 333 | ::: |
339 | :::::: | 334 | :::::: |
340 | 335 | ||
@@ -345,7 +340,7 @@ Gives: | |||
345 | 340 | ||
346 | ::: | 341 | ::: |
347 | 342 | ||
348 | ## Puzzle | 343 | ## Puzzle{.fragile} |
349 | 344 | ||
350 | What does that do? | 345 | What does that do? |
351 | 346 | ||
@@ -359,9 +354,6 @@ rec { | |||
359 | \end{minted} | 354 | \end{minted} |
360 | ``` | 355 | ``` |
361 | 356 | ||
362 | ``` | ||
363 | ``` | ||
364 | |||
365 | ::: notes | 357 | ::: notes |
366 | 358 | ||
367 | - Because the language is lazy, the question we have to ask is "What do we want | 359 | - Because the language is lazy, the question we have to ask is "What do we want |
@@ -371,7 +363,7 @@ rec { | |||
371 | 363 | ||
372 | # How 2 perfect packaging with Nixpkgs | 364 | # How 2 perfect packaging with Nixpkgs |
373 | 365 | ||
374 | ## An example Nixpkgs derivation | 366 | ## An example Nixpkgs derivation{.fragile} |
375 | 367 | ||
376 | ```{=latex} | 368 | ```{=latex} |
377 | \begin{minted}{nix} | 369 | \begin{minted}{nix} |
@@ -390,9 +382,6 @@ stdenv.mkDerivation rec { | |||
390 | \end{minted} | 382 | \end{minted} |
391 | ``` | 383 | ``` |
392 | 384 | ||
393 | ``` | ||
394 | ``` | ||
395 | |||
396 | ::: notes | 385 | ::: notes |
397 | 386 | ||
398 | - `stdenv` (standard environment) is a collection of packages: contains | 387 | - `stdenv` (standard environment) is a collection of packages: contains |
@@ -430,7 +419,7 @@ stdenv.mkDerivation rec { | |||
430 | ``` | 419 | ``` |
431 | ``` | 420 | ``` |
432 | 421 | ||
433 | ## Other examples {.shrink} | 422 | ## Other examples{.fragile} |
434 | 423 | ||
435 | 424 | ||
436 | :::::: {.columns} | 425 | :::::: {.columns} |
@@ -454,9 +443,6 @@ stdenv.mkDerivation rec { | |||
454 | \end{minted} | 443 | \end{minted} |
455 | ``` | 444 | ``` |
456 | 445 | ||
457 | ``` | ||
458 | ``` | ||
459 | |||
460 | ::: | 446 | ::: |
461 | ::: {.column} | 447 | ::: {.column} |
462 | 448 | ||
@@ -474,9 +460,6 @@ derive2 { | |||
474 | \end{minted} | 460 | \end{minted} |
475 | ``` | 461 | ``` |
476 | 462 | ||
477 | ``` | ||
478 | ``` | ||
479 | |||
480 | ::: | 463 | ::: |
481 | :::::: | 464 | :::::: |
482 | 465 | ||
@@ -497,7 +480,7 @@ derive2 { | |||
497 | 480 | ||
498 | ::: | 481 | ::: |
499 | 482 | ||
500 | ## Examples with non dependencies parameters | 483 | ## Examples with non dependencies parameters{.fragile} |
501 | 484 | ||
502 | ```{=latex} | 485 | ```{=latex} |
503 | \begin{minted}{nix} | 486 | \begin{minted}{nix} |
@@ -518,9 +501,6 @@ stdenv.mkDerivation rec { | |||
518 | \end{minted} | 501 | \end{minted} |
519 | ``` | 502 | ``` |
520 | 503 | ||
521 | ``` | ||
522 | ``` | ||
523 | |||
524 | --- | 504 | --- |
525 | 505 | ||
526 | ```{=latex} | 506 | ```{=latex} |
@@ -653,7 +633,7 @@ echo 'Hello, World!' | |||
653 | 633 | ||
654 | ::: | 634 | ::: |
655 | 635 | ||
656 | ## Overlays | 636 | ## Overlays{.fragile} |
657 | 637 | ||
658 | ```{=latex} | 638 | ```{=latex} |
659 | \begin{minted}{nix} | 639 | \begin{minted}{nix} |
@@ -673,9 +653,6 @@ in | |||
673 | \end{minted} | 653 | \end{minted} |
674 | ``` | 654 | ``` |
675 | 655 | ||
676 | ``` | ||
677 | ``` | ||
678 | |||
679 | ::: notes | 656 | ::: notes |
680 | 657 | ||
681 | - Because the `callPackage` is from `self`, `myPackage` is able to use | 658 | - Because the `callPackage` is from `self`, `myPackage` is able to use |
@@ -688,7 +665,7 @@ in | |||
688 | 665 | ||
689 | ::: | 666 | ::: |
690 | 667 | ||
691 | ## Overriding parameters | 668 | ## Overriding parameters{.fragile} |
692 | 669 | ||
693 | ```{=latex} | 670 | ```{=latex} |
694 | \begin{minted}{nix} | 671 | \begin{minted}{nix} |
@@ -705,10 +682,7 @@ self: super: { | |||
705 | \end{minted} | 682 | \end{minted} |
706 | ``` | 683 | ``` |
707 | 684 | ||
708 | ``` | 685 | ## Overriding attributes{.fragile} |
709 | ``` | ||
710 | |||
711 | ## Overriding attributes | ||
712 | 686 | ||
713 | ```{=latex} | 687 | ```{=latex} |
714 | \begin{minted}{nix} | 688 | \begin{minted}{nix} |
@@ -725,9 +699,6 @@ self: super: { | |||
725 | \end{minted} | 699 | \end{minted} |
726 | ``` | 700 | ``` |
727 | 701 | ||
728 | ``` | ||
729 | ``` | ||
730 | |||
731 | ::: notes | 702 | ::: notes |
732 | 703 | ||
733 | - Useful for ie. adding patches without having to copy the definition. | 704 | - Useful for ie. adding patches without having to copy the definition. |
@@ -735,7 +706,7 @@ self: super: { | |||
735 | 706 | ||
736 | ::: | 707 | ::: |
737 | 708 | ||
738 | ## Using different versions of the same package---Generic | 709 | ## Using different versions of the same package---Generic{.fragile} |
739 | 710 | ||
740 | . . . | 711 | . . . |
741 | 712 | ||
@@ -755,9 +726,6 @@ exec -a "$0" "/nix/store/...-kodi-18.1/bin/.kodi-wrapped" \ | |||
755 | \end{minted} | 726 | \end{minted} |
756 | ``` | 727 | ``` |
757 | 728 | ||
758 | ``` | ||
759 | ``` | ||
760 | |||
761 | ::: notes | 729 | ::: notes |
762 | 730 | ||
763 | - This is actually called by another wrapper who tells Kodi where to find its | 731 | - This is actually called by another wrapper who tells Kodi where to find its |
@@ -768,10 +736,10 @@ exec -a "$0" "/nix/store/...-kodi-18.1/bin/.kodi-wrapped" \ | |||
768 | 736 | ||
769 | ::: | 737 | ::: |
770 | 738 | ||
771 | ## Using different versions of the same package---ELF | 739 | ## Using different versions of the same package---ELF{.fragile} |
772 | 740 | ||
773 | ```{=latex} | 741 | ```{=latex} |
774 | \begin{minted}{text} | 742 | \begin{minted}{console} |
775 | $ readelf -d coreutils | 743 | $ readelf -d coreutils |
776 | ... | 744 | ... |
777 | Bibliothèque partagée: [librt.so.1] | 745 | Bibliothèque partagée: [librt.so.1] |
@@ -788,10 +756,7 @@ Bibliothèque runpath:[ | |||
788 | \end{minted} | 756 | \end{minted} |
789 | ``` | 757 | ``` |
790 | 758 | ||
791 | ``` | 759 | ## Using different versions of the same package---Python{.fragile} |
792 | ``` | ||
793 | |||
794 | ## Using different versions of the same package---Python | ||
795 | 760 | ||
796 | ```{=latex} | 761 | ```{=latex} |
797 | \begin{minted}{python} | 762 | \begin{minted}{python} |
@@ -810,9 +775,6 @@ functools.reduce( | |||
810 | \end{minted} | 775 | \end{minted} |
811 | ``` | 776 | ``` |
812 | 777 | ||
813 | ``` | ||
814 | ``` | ||
815 | |||
816 | ::: notes | 778 | ::: notes |
817 | 779 | ||
818 | - Because these paths are in the closure of the app, they are guaranteed by Nix | 780 | - Because these paths are in the closure of the app, they are guaranteed by Nix |
@@ -828,7 +790,7 @@ functools.reduce( | |||
828 | - In the end, the Nix package manager creates files | 790 | - In the end, the Nix package manager creates files |
829 | - Let's use Nix to create *every* (non user data) file | 791 | - Let's use Nix to create *every* (non user data) file |
830 | 792 | ||
831 | ## Adding yourself to the environment---Symbolic links | 793 | ## Adding yourself to the environment---Symbolic links{.fragile} |
832 | 794 | ||
833 | ```{=latex} | 795 | ```{=latex} |
834 | \begin{minted}{console} | 796 | \begin{minted}{console} |
@@ -837,9 +799,6 @@ $ ls -l /etc/static/ssh/ssh_config | |||
837 | \end{minted} | 799 | \end{minted} |
838 | ``` | 800 | ``` |
839 | 801 | ||
840 | ``` | ||
841 | ``` | ||
842 | |||
843 | --- | 802 | --- |
844 | 803 | ||
845 | ```{=latex} | 804 | ```{=latex} |
@@ -873,7 +832,7 @@ Type=simple | |||
873 | 832 | ||
874 | ::: | 833 | ::: |
875 | 834 | ||
876 | ## Adding yourself to the environment---Environment variables | 835 | ## Adding yourself to the environment---Environment variables{.fragile} |
877 | 836 | ||
878 | ```{=latex} | 837 | ```{=latex} |
879 | \begin{minted}{console} | 838 | \begin{minted}{console} |
@@ -887,9 +846,6 @@ $ echo $PATH | |||
887 | \end{minted} | 846 | \end{minted} |
888 | ``` | 847 | ``` |
889 | 848 | ||
890 | ``` | ||
891 | ``` | ||
892 | |||
893 | ::: notes | 849 | ::: notes |
894 | 850 | ||
895 | - Inside these dirs are symbolic links | 851 | - Inside these dirs are symbolic links |
@@ -920,7 +876,7 @@ Networking | |||
920 | 876 | ||
921 | ::: | 877 | ::: |
922 | 878 | ||
923 | ## How we do it | 879 | ## How we do it{.fragile} |
924 | 880 | ||
925 | Introducing: the module system! | 881 | Introducing: the module system! |
926 | 882 | ||
@@ -935,9 +891,6 @@ Introducing: the module system! | |||
935 | \end{minted} | 891 | \end{minted} |
936 | ``` | 892 | ``` |
937 | 893 | ||
938 | ``` | ||
939 | ``` | ||
940 | |||
941 | ::: notes | 894 | ::: notes |
942 | 895 | ||
943 | - We talked about how it is possible for NixOS to do it, now we talk about how | 896 | - We talked about how it is possible for NixOS to do it, now we talk about how |
@@ -961,7 +914,7 @@ Introducing: the module system! | |||
961 | 914 | ||
962 | ::: | 915 | ::: |
963 | 916 | ||
964 | ## Being pedantic | 917 | ## Being pedantic{.fragile} |
965 | 918 | ||
966 | ```{=latex} | 919 | ```{=latex} |
967 | \begin{minted}{nix} | 920 | \begin{minted}{nix} |
@@ -974,10 +927,7 @@ Introducing: the module system! | |||
974 | \end{minted} | 927 | \end{minted} |
975 | ``` | 928 | ``` |
976 | 929 | ||
977 | ``` | 930 | ## Customizing the SSH server config{.fragile} |
978 | ``` | ||
979 | |||
980 | ## Customizing the SSH server config | ||
981 | 931 | ||
982 | ```{=latex} | 932 | ```{=latex} |
983 | \begin{minted}{nix} | 933 | \begin{minted}{nix} |
@@ -996,9 +946,6 @@ Introducing: the module system! | |||
996 | \end{minted} | 946 | \end{minted} |
997 | ``` | 947 | ``` |
998 | 948 | ||
999 | ``` | ||
1000 | ``` | ||
1001 | |||
1002 | ::: notes | 949 | ::: notes |
1003 | 950 | ||
1004 | - Compared to the previous example, this on only changes the final | 951 | - Compared to the previous example, this on only changes the final |
@@ -1071,7 +1018,7 @@ Introducing: the module system! | |||
1071 | 1018 | ||
1072 | ::: | 1019 | ::: |
1073 | 1020 | ||
1074 | ## Moaaar examples | 1021 | ## Moaaar examples{.fragile} |
1075 | 1022 | ||
1076 | ```{=latex} | 1023 | ```{=latex} |
1077 | \begin{minted}{nix} | 1024 | \begin{minted}{nix} |
@@ -1092,10 +1039,7 @@ Introducing: the module system! | |||
1092 | \end{minted} | 1039 | \end{minted} |
1093 | ``` | 1040 | ``` |
1094 | 1041 | ||
1095 | ``` | 1042 | ## Composition{.fragile} |
1096 | ``` | ||
1097 | |||
1098 | ## Composition | ||
1099 | 1043 | ||
1100 | ```{=latex} | 1044 | ```{=latex} |
1101 | \begin{minted}{nix} | 1045 | \begin{minted}{nix} |
@@ -1110,10 +1054,7 @@ Introducing: the module system! | |||
1110 | \end{minted} | 1054 | \end{minted} |
1111 | ``` | 1055 | ``` |
1112 | 1056 | ||
1113 | ``` | 1057 | ## "Overridability"---Provided{.fragile} |
1114 | ``` | ||
1115 | |||
1116 | ## "Overridability"---Provided | ||
1117 | 1058 | ||
1118 | ```{=latex} | 1059 | ```{=latex} |
1119 | \begin{minted}{nix} | 1060 | \begin{minted}{nix} |
@@ -1127,10 +1068,7 @@ Introducing: the module system! | |||
1127 | \end{minted} | 1068 | \end{minted} |
1128 | ``` | 1069 | ``` |
1129 | 1070 | ||
1130 | ``` | 1071 | ## "Overridability"---Forced{.fragile} |
1131 | ``` | ||
1132 | |||
1133 | ## "Overridability"---Forced | ||
1134 | 1072 | ||
1135 | ```{=latex} | 1073 | ```{=latex} |
1136 | \begin{minted}{nix} | 1074 | \begin{minted}{nix} |
@@ -1145,10 +1083,7 @@ Introducing: the module system! | |||
1145 | \end{minted} | 1083 | \end{minted} |
1146 | ``` | 1084 | ``` |
1147 | 1085 | ||
1148 | ``` | 1086 | ## "Overridability"---Commando mode{.fragile} |
1149 | ``` | ||
1150 | |||
1151 | ## "Overridability"---Commando mode | ||
1152 | 1087 | ||
1153 | ```{=latex} | 1088 | ```{=latex} |
1154 | \begin{minted}{nix} | 1089 | \begin{minted}{nix} |
@@ -1161,9 +1096,6 @@ Introducing: the module system! | |||
1161 | \end{minted} | 1096 | \end{minted} |
1162 | ``` | 1097 | ``` |
1163 | 1098 | ||
1164 | ``` | ||
1165 | ``` | ||
1166 | |||
1167 | Otherwise, you can just copy and edit the official module file. | 1099 | Otherwise, you can just copy and edit the official module file. |
1168 | 1100 | ||
1169 | ::: notes | 1101 | ::: notes |
@@ -1173,7 +1105,144 @@ Otherwise, you can just copy and edit the official module file. | |||
1173 | 1105 | ||
1174 | ::: | 1106 | ::: |
1175 | 1107 | ||
1176 | ## Assertions | 1108 | ## Defining our own modules{.fragile} |
1109 | |||
1110 | The true module structure: | ||
1111 | |||
1112 | ```{=latex} | ||
1113 | \begin{minted}{nix} | ||
1114 | { ... }: | ||
1115 | { | ||
1116 | imports = [ /* ... */ ]; | ||
1117 | options = { /* ... */ }; | ||
1118 | config = { /* ... */ }; | ||
1119 | } | ||
1120 | \end{minted} | ||
1121 | ``` | ||
1122 | |||
1123 | ## Defining our own modules---API{.fragile} | ||
1124 | |||
1125 | ```{=latex} | ||
1126 | \begin{minted}[lastline=10]{nix} | ||
1127 | { lib, pkgs, config, ... }: | ||
1128 | with lib; | ||
1129 | { | ||
1130 | options.services.myService = { | ||
1131 | enable = mkEnableOption "myService, awesomeness incarnated"; | ||
1132 | |||
1133 | port = mkOption { | ||
1134 | type = types.port; # = ints.u16 | ||
1135 | default = 1337 | ||
1136 | description = "The listen port for this service"; | ||
1137 | }; | ||
1138 | }; | ||
1139 | } | ||
1140 | \end{minted} | ||
1141 | ``` | ||
1142 | |||
1143 | ::: notes | ||
1144 | |||
1145 | - Whether to enable "myService, awesomeness incarnated" | ||
1146 | |||
1147 | |||
1148 | ::: | ||
1149 | |||
1150 | ## Defining our own modules---API{.fragile} | ||
1151 | |||
1152 | ```{=latex} | ||
1153 | \begin{minted}[firstline=4,lastline=16]{nix} | ||
1154 | { lib, pkgs, ... }: | ||
1155 | { | ||
1156 | options.services.myService = with lib; { | ||
1157 | package = mkOption { | ||
1158 | type = types.package; | ||
1159 | default = pkgs.myPackage; | ||
1160 | defaultText = "pkgs.myPackage"; | ||
1161 | description = "The package to use for this service"; | ||
1162 | }; | ||
1163 | |||
1164 | user = mkOption { | ||
1165 | type = with types; nullOr string; | ||
1166 | default = null; | ||
1167 | description = "The user this service will run as."; | ||
1168 | }; | ||
1169 | }; # options.services.myService | ||
1170 | }; | ||
1171 | \end{minted} | ||
1172 | ``` | ||
1173 | |||
1174 | ## Defining our own modules---Implementation{.fragile} | ||
1175 | |||
1176 | ```{=latex} | ||
1177 | \begin{minted}[firstline=3,lastline=10]{nix} | ||
1178 | { lib, pkgs, ... }: | ||
1179 | { | ||
1180 | config = let | ||
1181 | cfg = config.services.myService; | ||
1182 | in | ||
1183 | mkIf cfg.enable { | ||
1184 | systemd.services.myService = { | ||
1185 | description = "My awesome service"; | ||
1186 | wantedBy = [ "multi-user.target" ]; | ||
1187 | |||
1188 | }; | ||
1189 | }; | ||
1190 | } | ||
1191 | \end{minted} | ||
1192 | ``` | ||
1193 | |||
1194 | ## Defining our own modules---Implementation{.fragile} | ||
1195 | |||
1196 | ```{=latex} | ||
1197 | \begin{minted}[firstline=5,lastline=13]{nix} | ||
1198 | { lib, pkgs, ... }: | ||
1199 | { | ||
1200 | config = mkIf cfg.enable { | ||
1201 | systemd.services.myService = { | ||
1202 | serviceConfig = { | ||
1203 | ExecStart = | ||
1204 | "${cfg.package}/bin/myserviced --port ${toString cfg.port}" | ||
1205 | } // (if isNull cfg.user then { | ||
1206 | DynamicUser = true; | ||
1207 | } else { | ||
1208 | User = cfg.user; | ||
1209 | }); | ||
1210 | }; # systemd.services.myService | ||
1211 | }; | ||
1212 | } | ||
1213 | \end{minted} | ||
1214 | ``` | ||
1215 | |||
1216 | ## Defining our own modules---Implementation{.fragile} | ||
1217 | |||
1218 | ```{=latex} | ||
1219 | \begin{minted}[firstline=4,lastline=13]{nix} | ||
1220 | { lib, pkgs, ... }: | ||
1221 | { | ||
1222 | config = mkIf cfg.enable { | ||
1223 | users.users = mkIf (!isNull cfg.user) { | ||
1224 | "${cfg.user}".uid = 42; # < don't do that | ||
1225 | }; | ||
1226 | }; # config | ||
1227 | } # The end! | ||
1228 | \end{minted} | ||
1229 | ``` | ||
1230 | |||
1231 | ::: notes | ||
1232 | |||
1233 | - We can't go around assigning random UIDs because: | ||
1234 | - It's not deterministic | ||
1235 | - If done deterministically (ie. not randomly, but by assigning the first | ||
1236 | free UID), a UID can change between rebuilds, and can introduces file | ||
1237 | permission issues. | ||
1238 | - So we have a list of fixed UIDs, so that each service has their own UIDs, | ||
1239 | forever, for everyone | ||
1240 | - The list is quite big, which is why `DynamicUser`s are so important for NixOS | ||
1241 | |||
1242 | |||
1243 | ::: | ||
1244 | |||
1245 | ## Assertions{.fragile} | ||
1177 | 1246 | ||
1178 | ```{=latex} | 1247 | ```{=latex} |
1179 | \begin{minted}{text} | 1248 | \begin{minted}{text} |
@@ -1183,12 +1252,16 @@ Failed assertions: | |||
1183 | \end{minted} | 1252 | \end{minted} |
1184 | ``` | 1253 | ``` |
1185 | 1254 | ||
1186 | ``` | 1255 | ## More Assertions{.fragile} |
1256 | |||
1257 | ```{=late} | ||
1258 | \begin{minted}{nix} | ||
1259 | \end{minted} | ||
1187 | ``` | 1260 | ``` |
1188 | 1261 | ||
1189 | # The embedded world | 1262 | # The embedded world |
1190 | 1263 | ||
1191 | ## Proper project structure | 1264 | ## Proper project structure{.fragile} |
1192 | 1265 | ||
1193 | <https://github.com/illegalprime/nixos-on-arm> | 1266 | <https://github.com/illegalprime/nixos-on-arm> |
1194 | 1267 | ||
@@ -1212,13 +1285,11 @@ $ nix build -f default.nix \ | |||
1212 | \end{minted} | 1285 | \end{minted} |
1213 | ``` | 1286 | ``` |
1214 | 1287 | ||
1215 | ``` | ||
1216 | ``` | ||
1217 | |||
1218 | ## TODO | 1288 | ## TODO |
1219 | 1289 | ||
1220 | - [x] Use good Markdown / Beamer template | 1290 | - [x] Use good Markdown / Beamer template |
1221 | - [ ] Pinning repo version | 1291 | - [ ] Pinning repo version |
1292 | - [ ] `a.b.c` = `a = { b = { c = ...; }; };` | ||
1222 | - [x] How to use different versions | 1293 | - [x] How to use different versions |
1223 | - [ ] Modules can call other modules (and that's what they do **all** the time) | 1294 | - [ ] Modules can call other modules (and that's what they do **all** the time) |
1224 | - [ ] How to build an image | 1295 | - [ ] How to build an image |