From a63a944cc6bb30720a920879e0241998a26f0af7 Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Mon, 15 Jan 2024 15:48:05 -0600 Subject: [PATCH] Massive Improvement to README and testing stuff --- README.md | 52 ++++++++++++++++++++++---- flake.nix | 1 + workstation/configuration.nix | 1 - workstation/hardware-configuration.nix | 2 +- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c156474..1e63ecb 100644 --- a/README.md +++ b/README.md @@ -34,20 +34,58 @@ With NixOS, it's possible to have multiple versions of the same software install NixOS has an active community that contributes to its growth, sharing configurations, and offering support. Its customizable nature allows users to tailor their systems to their needs. +## Why Choose My Configuration? + +I have gone through a lot of effort of making my configuration something that is simple to understand while remaining feature complete. My configuration is written as a NixOS Flake so you will need to be using NixOS. I will have a guide to replicating what I use down below. + +## Explaining My Flake + +My Flake controls where we are getting things from, allows me to define variables for you to set your information for configurations, as well as lets us choose which configuration we want. + +When you choose which configuration you want it just sources the configuration.nix and hardware-configuration.nix from the corresponding workstation, laptop, etc folders from the git repo. The hardware-configuration.nix is automatically generated with all the things you need and the configuration.nix mainly just has services, Steam, and other system level stuff. + +### How The Config Files Work + +I am using home manager and as of now all configurations use the same home.nix configuration file. That is where all of the main configuration for stuff is. + +All of the configuration files that we need in the home filesystem for our programs are stored in the folder config. You might have noticed something quite different about all of them... They are in a .nix format. These files are imported by home.nix. + +### This Makes Theming Incredible + +Having the configuration files as a .nix file that I have creating the home files allows me to have variables passed into them. This allows me to use Nix Colors, **a phenomenal tool in NixOS**, to define a base16 colorscheme and let the user change it in the flake and have all the programs change upon rebuild. *Do note that some programs like SwayNotificationCenter may require a relaunch to show changes.* + +Themes you have available for you to set in the flake.nix are available [here](https://github.com/tinted-theming/base16-schemes). Just take off the .yaml part of any of those names and use that as your theme variable. + +Another cool thing I can do is have that theme the user set in the flake.nix used to generate a GTK theme as well! So when you change that one variable all you system programs will change upon a rebuild. I have included some fun scripts as well so definitely have some fun playing around with what you can do with my setup. + # Steps To Reproduce My System +- Enable flakes in your default configuration.nix by adding this: -- Clone this repo -- Change username and hostname in flake.nix -- Replace your hardware-configuration.nix with the one inside the workstation or laptop folders -- Enable flakes in your default configuration.nix -- Rebuild your system -- Then go into repo folder and run this command: +``` +# Enable Flakes and the new command-line tool +nix.settings.experimental-features = [ "nix-command" "flakes" ]; +``` + +This file should be located at /etc/nixos/configuration.nix + +- Ensure you have Git listed in your pkgs in the configuration.nix. +- Rebuild your system. +- Clone this repo. +- Then go into repo folder (stay in this folder) +- Change username, hostname, theme, and any other variables you may want under user information in flake.nix +- Replace your hardware-configuration.nix with the one inside the workstation or laptop folders like so: + +``` +nixos-generate-config --show-hardware-config > workstation/hardware-configuration.nix +``` + +- Run this command: ``` sudo nixos-rebuild switch --flake .#workstation ``` -Replace #workstation with #laptop to switch to my Intel Whitebook laptop's configuration. +Replace #workstation with #laptop to switch to my Intel Whitebook laptop's configuration. *My laptop's configuration is well behind my workstation as I do not use it as often. For what you see in videos look at using the workstation one.* Hope you enjoy! diff --git a/flake.nix b/flake.nix index 9748a13..68d415a 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ outputs = inputs@{ nixpkgs, home-manager, ... }: let + # User Variables system = "x86_64-linux"; hostname = "hyprnix"; username = "zaney"; diff --git a/workstation/configuration.nix b/workstation/configuration.nix index 8518675..daf7044 100644 --- a/workstation/configuration.nix +++ b/workstation/configuration.nix @@ -138,7 +138,6 @@ ]; NIXPKGS_ALLOW_UNFREE = "1"; SCRIPTDIR = "\${HOME}/.local/share/scriptdeps"; - STARSHIP_CONFIG = "\${HOME}/.config/starship/starship.toml"; XDG_CURRENT_DESKTOP = "Hyprland"; XDG_SESSION_TYPE = "wayland"; XDG_SESSION_DESKTOP = "Hyprland"; diff --git a/workstation/hardware-configuration.nix b/workstation/hardware-configuration.nix index e87c57d..0561015 100644 --- a/workstation/hardware-configuration.nix +++ b/workstation/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ];