dotfiles/README.org
2023-03-28 09:33:54 -05:00

273 lines
11 KiB
Org Mode
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#+TITLE: Readme
#+AUTHOR: Chris Cochrun
mailto:chris@tfcconnection.org
* Welcome
This repository contains all of my dotfiles to the many programs I like to use on Linux. This is primarily built with NixOS and Emacs. This is done through literate programming. So basically this README file has all the source code for the entire system. (or at least it will once I get it all finished)
As is common in org-mode literate programming, I'm using a feature of org-mode to bring in config that exists elsewhere called org-babel tangle and noweb. The syntax =<<something>>= brings in the named blocks that are above. Meaning that through this single document I can consolidate configuration. This may not work for you, but I prefer it.
You will see the blocks to be brought into the bracket syntax by a named section like #+NAME: ...
This creates files that have everything in them, making them bigger and maybe filled with more things, but makes this document much easier to read and easier for me to handle things. Again, if this doesn't work for you, sorry it's just the way that I like to do it.
* NixOS
The biggest part of this is through NixOS. NixOS is a declarative way of building an OS for Linux and allows an immutable and reproducible system. I really like that last part. I enjoy my config to be the same no matter how many machines I place it on. I'd also one day like this to be modular so that I'll have some switches that can turn on and off certain features.
Let's start with the core of this, the flake.
** Syl
Syl is my laptop and has some configuration unique to that. In particular, it's a Framework Laptop. Honestly a great piece of tech. Love it.
Notice how I am including all of my software here. It may be a big file, but having all of it in one place means I can easily grok through it and remove something.
*** Hardware
Now in the =hardware-configuration.nix= file, I didn't change much because I wanted to keep it roughly the same in case things do get overwritten, but this is another nice feature of literate programming, should things change in the /etc folder, I'll have this readme as a backup of what it was before the changes.
#+begin_src nix :tangle system/syl/hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "acpi_call" ];
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
boot.loader.efi.efiSysMountPoint = "/boot/efi";
zramSwap.enable = true;
fileSystems."/" =
{ device = "/dev/disk/by-uuid/db28ba7c-a15d-4c81-8373-99f2f171cac5";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/BA76-3723";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp170s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true;
}
#+end_src
** Kaladin
Kaladin is my desktop machine. A powerhouse for the most part with a recent i7 and 64gb of memory and an Nvidia 1080. Basically I use this for video editing, animation, and some other things. Here is it's configuration.
*** hardware
And here is it's hardware config.
#+begin_src nix :tangle system/kaladin/hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ config.boot.kernelPackages.nvidiaPackages.latest ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@home" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@nix" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/var/log" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@log" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/run/media/chris/Storage" =
{ device = "/dev/disk/by-uuid/4c7d4273-7b72-4aa8-8e1c-e281543d06cb";
fsType = "btrfs";
options = [ "noatime" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/run/media/chris/backup" =
{ device = "/dev/disk/by-uuid/4286b9ef-e8ed-49a0-9eec-91b8ee05b2cb";
fsType = "btrfs";
options = [ "noatime" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/35A0-C1F1";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
#+end_src
Kaladin is still not fullly setup, so I'll be working on that more and more as time goes.
** Dalinar
Dalinar is my home server. It's built with an old laptop at the moment, but the way everything is orchestrated is to protect from screw ups.
*** Containers
Here are Dalinar's containers
First off, I'm not entirely sure how this works, but this is my best guess.
#+begin_src nix
jellyfin = {
config = { config, pkgs, ... }:
{
# ...
};
};
#+end_src
*** Hardware Configuration
Dalinar's hardware
#+begin_src nix :tangle system/dalinar/hardware-configuration.nix
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/103a24d5-ffb5-4f7c-ab68-48e0b766b3ac";
fsType = "btrfs";
options = [ "subvol=@" "noatime" "nodiratime" "compress=zstd" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/55C5-7725";
fsType = "vfat";
};
fileSystems."/storage" =
{ device = "/dev/disk/by-uuid/f1804953-14e5-42db-a974-1e18f16d884c";
fsType = "btrfs";
options = [ "noatime" "nodiratime" "compress=zstd" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
#+end_src
** Kohlin
Kohlin is another home server. It's built with an old laptop at the moment, but the way everything is orchestrated is to protect from screw ups.
*** Containers
*** Hardware Configuration
Kohlin's hardware
#+begin_src nix :tangle system/kohlin/hardware-configuration.nix
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/3dc76272-54d9-445e-846f-591cd407b085";
fsType = "ext4";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/DDA5-32A1";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b25464c5-2268-4963-80cb-6dc51dcba91b"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
#+end_src
** Home
I also use home-manager for managing dotfiles. This means that everything is contained in this folder and then tangled out to their respective places when rebuilding the system.
* Thanks!
* EXTRA
Possible efibootmgr command to make efistub work on desktop
#+begin_src sh
efibootmgr --disk /dev/nvme0n1 --part 1 --create --label "Arch Linux" --loader /boot/vmlinuz-linux-zen --unicode 'root=PARTUUID=d920ee9c-3b42-4c83-9c4c-a33406421ed1 rootflags=subvol=@ rw noatime nodiratime compress=zstd:3 ssd space_cache initrd=\initramfs-linux-zen.img' --verbose
#+end_src