literate-config

Literate config. See <a href="../readme.org">readme.org</a> for a better-formatted version
Log | Files | Refs

commit 7f8b301a4453f9fffa249ea0d22485cd6b882bd1
parent b9ab457baa047ba236d2deafa690c3b303db16b0
Author: Crazazy <crazazy@tilde.cafe>
Date:   Tue, 10 May 2022 09:27:21 +0200

remove the repeating of things in source code blocks

Diffstat:
Mnixos.org | 38+++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/nixos.org b/nixos.org @@ -21,15 +21,19 @@ stuff } #+end_src * Configuration +:PROPERTIES: +:header-args: :tangle no :noweb-ref nixos-config +:END: + ** Hardware Normal nixos installation comes with a hardware-configuration file. we are not going to add the contents of that file here ourself, but instead add it as an external module. This is the only place where we'll do this - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix ./hardware-configuration.nix #+end_src ** personal stuff First, some personal stuff, so that I can tel people my computer is mine - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { options.mainUser = with lib; mkOption { type = types.str; @@ -39,7 +43,7 @@ stuff #+end_src and then the actual info: - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { mainUser = "erik"; networking.hostName = "RACEMONSTER"; @@ -48,7 +52,7 @@ stuff #+end_src ** Main user config This sets up a (secret) default password for the main user and also sets some default groups - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { users.mutableUsers = false; # Define a user account. Don't forget to set a password with ‘passwd’. @@ -62,7 +66,7 @@ stuff #+end_src ** Init system nixos is started with systemd-boot, since we don't run any other distros - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -70,7 +74,7 @@ stuff #+end_src ** nixpkgs setup not much info here right now. emacs itself now refers to emacsng - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { nix.package = pkgs.nixFlakes; nixpkgs.config.allowUnfree = true; @@ -85,7 +89,7 @@ stuff *** cachix Cachix and other substitute servers allow you to not have to compile things as much as you are supposed to We will create a small module for cachix before we put in the rest declaratively - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { options.nix.cacheAttrs = with lib; mkOption { type = with types; attrsOf str; @@ -99,7 +103,7 @@ stuff } #+end_src With the config in hand, we can now quickly and easily declare our substitute servers - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { nix.cacheAttrs = { "https://crazazy.cachix.org" = "crazazy.cachix.org-1:3KaIHK26pkvd5palJH5A4Re1Hn2+GDV+aXYnftMYAm4="; @@ -117,7 +121,7 @@ stuff *** The config This part is quite advanced. It makes entries for filesystems and then makes a systemd service to re-assign generated temporary directories to the owner of the home folder - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { options = with lib; { homeBinds = mkOption { @@ -148,7 +152,7 @@ stuff #+end_src *** The binds These are the binds themselves, they change frequently - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { homeBinds = [ ".config/keybase" @@ -165,7 +169,7 @@ stuff I don't acutally literally live in the terminal. So we have to implement some xorg and other stuff *** Basics Enable printing, sound and a good keyboard, along with x11 itself - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { # Enable CUPS to print documents. services.printing.enable = true; @@ -185,7 +189,7 @@ stuff #+end_src *** XFCE I have decided to be lazy and not install a fancy window manager or whatever into the system. Thats headache - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { services.xserver.displayManager.lightdm.enable = true; services.xserver.desktopManager.xfce.enable = true; @@ -193,7 +197,7 @@ stuff #+end_src ** Networking Some default network settings for my laptop - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { networking.networkmanager.enable = true; # Enables wireless support via NetworkManager } @@ -202,7 +206,7 @@ stuff *** Core packages These are the normal packages that I use for core maintenance. I use a special hardened version of firefox that takes in some addons as well [[https://github.com/nix-community/nur-combined/blob/master/repos/ijohanne/pkgs/firefox-hardened/default.nix][Hardened firefox source]] - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { environment.systemPackages = let myFirefox = with pkgs; wrapFirefox firefox-esr-unwrapped { @@ -262,7 +266,7 @@ stuff #+end_src *** Steam I like to play videogames sometimes, however steam also requires a little more special attention - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { imports = [ nurModules.repos.crazazy.modules.private.steam-config @@ -277,7 +281,7 @@ stuff #+end_src *** Emacs Emacs needs to be integrated into the rest of the system. We are going to do that via a emacs daemon - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { services.emacs = { package = import ./emacs.nix; @@ -290,7 +294,7 @@ stuff #+end_src *** QEMU & frens I also sometimes run qemu vms. The qemu's manager will be libvirtd, but not sure if I will even use that - #+begin_src nix :noweb-ref nixos-config :tangle no + #+begin_src nix { virtualisation.libvirtd.enable = true; }