diff options
Diffstat (limited to 'nixos.org')
-rw-r--r-- | nixos.org | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/nixos.org b/nixos.org index ac4ad81..c8f2a16 100644 --- a/nixos.org +++ b/nixos.org @@ -10,7 +10,7 @@ stuff The nixos config is going to consist of a bunch of "imports" which are just a bunch of configs in the imports part of the main configuration. Then we can put each part of said config on its own source block This does require a bit of a prefix, that lets us access packages, existing configuration and library functions - #+begin_src nix :tangle configuration.nix + #+begin_src nix :tangle configuration.nix :noweb yes { config, lib, pkgs, ... }: let sources = import ./nix/sources.nix; @@ -19,17 +19,20 @@ stuff in { imports = [ + <<nixos-config>> + ]; + } #+end_src * Configuration ** 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 :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config ./hardware-configuration.nix #+end_src ** personal stuff First, some personal stuff, so that I can tel people my computer is mine - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { options.mainUser = with lib; mkOption { type = types.str; @@ -39,7 +42,7 @@ stuff #+end_src and then the actual info: - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { mainUser = "erik"; networking.hostName = "RACEMONSTER"; @@ -48,7 +51,7 @@ stuff #+end_src ** Init system nixos is started with systemd-boot, since we don't run any other distros - #+begin_src nix + #+begin_src nix :noweb-ref nixos-config { boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -56,7 +59,7 @@ stuff #+end_src ** Networking Some default network settings for my laptop - #+begin_src nix + #+begin_src nix :noweb-ref nixos-config { networking.networkmanager.enable = true; # Enables wireless support via wpa_supplicant. networking.useDHCP = false; @@ -66,7 +69,7 @@ stuff #+end_src ** nixpkgs setup not much info here right now. emacs itself now refers to emacsng - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { nix.package = pkgs.nixFlakes; nixpkgs.config.allowUnfree = true; @@ -80,7 +83,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 :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { options.nix.cacheAttrs = with lib; mkOption { type = with types; attrsOf str; @@ -94,7 +97,7 @@ stuff } #+end_src With the config in hand, we can now quickly and easily declare our substitute servers - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { nix.cacheAttrs = { "https://crazazy.cachix.org" = "crazazy.cachix.org-1:3KaIHK26pkvd5palJH5A4Re1Hn2+GDV+aXYnftMYAm4="; @@ -112,7 +115,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 :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { options = with lib; { homebinds = mkoption { @@ -143,7 +146,7 @@ stuff #+end_src *** The binds These are the binds themselves, they change frequently - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { homeBinds = [ ".config/keybase" @@ -164,7 +167,7 @@ stuff ** packages *** Core packages These are the normal packages that I use for core maintenance - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config environment.systemPackages = with pkgs; [ gitFull curl @@ -175,7 +178,7 @@ stuff #+end_src *** Steam I like to play videogames sometimes, however steam also requires a little more special attention - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { imports = [ nurModules.repos.crazazy.private.steam-config @@ -187,7 +190,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 :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { services.emacs = { package = import ./emacsconfig.nix; @@ -199,7 +202,7 @@ stuff I also sometimes run qemu vms. The qemu's ** Main user config This sets up a (secret) default password for the main user and also sets some default groups - #+begin_src nix :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { users.mutableUsers = false; # Define a user account. Don't forget to set a password with ‘passwd’. @@ -208,13 +211,14 @@ stuff isNormalUser = true; extraGroups = [ "video" "wheel" "NetworkManager" ]; # Enable ‘sudo’ for the user. # shell = pkgs.nushell; - } + }; + } #+end_src ** Visual 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 :tangle configuration.nix + #+begin_src nix :noweb-ref nixos-config { # Enable CUPS to print documents. services.printing.enable = true; @@ -234,15 +238,9 @@ 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 :tangle configration.nix + #+begin_src nix :noweb-ref nixos-config { services.xserver.displayManager.lightdm.enable = true; services.xserver.desktopManager.xfce.enable = true; } #+end_src -* Postfix - We need to remember to close our main module that we started off with - #+begin_src nix :tangle configuration.nix - ]; - } - #+end_src |