Haven't updated these readme's in a long time..

This commit is contained in:
Emmet
2025-10-01 19:54:25 -05:00
parent 44e854f32e
commit b44aeb9150
15 changed files with 212 additions and 290 deletions

View File

@@ -13,28 +13,10 @@ These are my dotfiles (configuration files) for my NixOS setup(s).
Here is my main setup:
[[desktop.png]]
** My Themes
** Themes
[[https://github.com/danth/stylix#readme][Stylix]] (and [[https://github.com/SenchoPens/base16.nix#readme][base16.nix]], of course) is amazing, allowing you to theme your entire system with base16-themes.
Using this I have [[./themes][59+ themes]] (I add more sometimes) I can switch between on-the-fly. Visit the [[./themes][themes directory]] for more info and screenshots!
** Install
I wrote some reinstall notes for myself [[./install.org][here (install.org)]].
TLDR: You should™ be able to install my dotfiles to a fresh NixOS system with the following experimental script:
#+begin_src sh :noeval
nix-shell -p git --command "nix run --experimental-features 'nix-command flakes' gitlab:librephoenix/nixos-config"
#+end_src
Disclaimer: Ultimately, I can't gaurantee this will work for anyone other than myself, so /use this at your own discretion/. Also my dotfiles are /highly/ opinionated, which you will discover immediately if you try them out.
Potential Errors: I've only tested it working on UEFI with the default EFI mount point of =/boot=. I've added experimental legacy (BIOS) boot support, but it does rely on a quick and dirty script to find the grub device. If you are testing it using some weird boot configuration for whatever reason, try modifying =bootMountPath= (UEFI) or =grubDevice= (legacy BIOS) in =flake.nix= before install, or else it will complain about not being able to install the bootloader.
Note: If you're installing this to a VM, Hyprland won't work unless 3D acceleration is enabled.
Security Disclaimer: If you install or copy my =homelab= or =worklab= profiles, /CHANGE THE PUBLIC SSH KEYS UNLESS YOU WANT ME TO BE ABLE TO SSH INTO YOUR SERVER. YOU CAN CHANGE OR REMOVE THE SSH KEY IN THE RELEVANT CONFIGURATION.NIX/:
- [[./profiles/homelab/configuration.nix][configuration.nix]] for homelab profile
- [[./profiles/worklab/configuration.nix][configuration.nix]] for worklab profile
Using this I have [[./modules/themes][a lot of themes]] (I add more sometimes) I can switch between on-the-fly. Visit the [[./modules/themes][themes directory]] for more info and screenshots!
** Modules
Separate Nix files can be imported as modules using an import block:
@@ -47,58 +29,58 @@ imports = [ ./import1.nix
This conveniently allows configurations to be (*cough cough) /modular/ (ba dum, tssss).
I have my modules separated into two groups:
- System-level - stored in the [[./system][system directory]]
- System-level modules are imported into configuration.nix, which is what is sourced into [[./flake.nix][my flake (flake.nix)]]
- User-level - stored in the [[./user][user directory]] (managed by home-manager)
- User-level modules are imported into home.nix, which is also sourced into [[./flake.nix][my flake (flake.nix)]]
I have my modules separated into three subdirectories:
- System-level - stored in the [[./modules/system][system directory]]
- User-level - stored in the [[./modules/user][user directory]]
More detailed information on these specific modules are in the [[./system][system directory]] and [[./user][user directory]] respectively.
** Install
I wrote some reinstall notes for myself [[./install.org][here (install.org)]].
Check them out if you'd like to try out my config in a VM or base your config on mine.
** Patches
In some cases, since I use =nixpgs-unstable=, I must patch nixpkgs. This can be done inside of a flake via:
#+BEGIN_SRC nix
nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [ ./example-patch.nix ];
};
nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [
./example-patch.nix
(builtins.fetchurl {
url = "https://asdf1234.patch";
sha256 = "sha256:qwerty123456...";
})
];
};
# configure pkgs
pkgs = import nixpkgs-patched { inherit system; };
# configure pkgs
pkgs = import nixpkgs-patched { inherit system; };
# configure lib
lib = nixpkgs.lib;
# configure lib
lib = nixpkgs.lib;
#+END_SRC
Patches can either be local or remote, so you can even import unmerged pull requests by using =fetchpatch= and the raw patch url, i.e: https://github.com/NixOS/nixpkgs/pull/example.patch.
I currently curate patches local to this repo in the [[./patches][patches]] directory.
** Profiles
I separate my configurations into [[./profiles][profiles]] (essentially system templates), i.e:
- [[./profiles/personal][Personal]] - What I would run on a personal laptop/desktop
- [[./profiles/work][Work]] - What I would run on a work laptop/desktop (if they let me bring my own OS :P)
- [[./profiles/homelab][Homelab]] - What I would run on a server or homelab
- [[./profiles/wsl][WSL]] - What I would run underneath Windows Subystem for Linux
My profile can be conveniently selected in [[./flake.nix][my flake.nix]] by setting the =profile= variable.
More detailed information on these profiles is in the [[./profiles][profiles directory]].
** Hosts
Configurations for all my machines are in [[./hosts][hosts]].
** Nix Wrapper Script
Some Nix commands are confusing, really long to type out, or require me to be in the directory with my dotfiles. To solve this, I wrote a [[./system/bin/phoenix.nix][wrapper script called phoenix]], which calls various scripts in the root of this directory.
Some Nix commands are confusing, really long to type out, or require me to be in the directory with my dotfiles. To solve this, I wrote a [[./modules/system/phoenix][wrapper script called phoenix]], which calls various scripts in the root of this directory.
TLDR:
- =phoenix sync= - Synchronize system and home-manager state with config files (essentially =nixos-rebuild switch= + =home-manager switch=)
- =phoenix sync system= - Only synchronize system state (essentially =nixos-rebuild switch=)
- =phoenix sync user= - Only synchronize home-manager state (essentially =home-manager switch=)
- =phoenix sync= - Synchronize system state with config
- =phoenix build= - Build all host configurations and push results to attic (requires attic config to be setup)
- =phoenix update= - Update all flake inputs without synchronizing system and home-manager states
- =phoenix upgrade= - Update flake.lock and synchronize system and home-manager states (=phoenix update= + =phoenix sync=)
- =phoenix update INPUT= - Update only the specified =INPUT= (see inputs in [[./flake.nix][flake.nix]])
- =phoenix refresh= - Call synchronization posthooks (mainly to refresh stylix and some dependent daemons)
- =phoenix pull= - Pull changes from upstream git and attempt to merge local changes (I use this to update systems other than my main system)
- =phoenix harden= - Ensure that all "system-level" files cannot be edited by an unprivileged user
- =phoenix soften= - Relax permissions so all dotfiles can be edited by a normal user (use temporarily for git or other operations)
- =phoenix lock= - Ensure that all "system-level" files cannot be edited by an unprivileged user
- =phoenix unlock= - Relax permissions so all dotfiles can be edited by a normal user (use temporarily for git or other operations)
- =phoenix gc= - Garbage collect the system and user nix stores
- =phoenix gc full= - Delete everything not currently in use
- =phoenix gc 15d= - Delete everything older than 15 days

View File

@@ -1,15 +1,11 @@
#+title: System Profiles
#+title: Machines
This directory contains various system profiles which can easily be set in [[../flake.nix][my flake.nix]] by setting the =profile= variable. Each profile directory contains a =configuration.nix= for system-level configuration and a =home.nix= for user-level configuration. Setting the =profile= variable in [[../flake.nix][my flake]] will automatically source the correct =configuration.nix= and =home.nix=.
This directory contains config for each of my machines.
Current profiles I have available are:
- [[./personal][Personal]] - What I would run on a personal laptop/desktop*
- [[./work][Work]] - What I would run on my work laptop/desktop*
- [[./homelab][Homelab]] - What I would run on a server or homelab*
- [[./worklab][Worklab]] - My homelab config with my work SSH keys preinstalled*
- [[./wsl][WSL]] - Windows Subsystem for Emacs (uses [[https://github.com/nix-community/NixOS-WSL][NixOS-WSL]])
- [[./nix-on-droid][Nix on Droid]] - So that I can run Emacs on my phone (uses [[https://github.com/nix-community/nix-on-droid][nix-on-droid]])
*My [[./personal][personal]] and [[./work][work]] profiles are actually functionally identical (the [[./work][work]] profile is actually imported into the [[./personal][personal]] profile)! The only difference between them is that my [[./personal][personal]] profile has a few extra things like gaming and social apps.
*My [[./homelab][homelab]] and [[./worklab][worklab]] profiles are similarly functionally identical (they both utilize the this [[./homelab/base.nix][base.nix]] file)! The only difference is that they have different preinstalled ssh keys.
In this directory you'll find:
- [[./snowfire][snowfire]] - My main machine (gaming laptop)
- [[./duskfall][duskfall]] - An old thinkpad I use occasionally
- [[./stardust][stardust]] - My wife's laptop
- [[./zenith][zenith]] - My work laptop
- [[./ori][ori]] - My homelab server host
- [[./TEMPLATE][TEMPLATE]] - Template files to use for a new host

View File

@@ -0,0 +1,3 @@
#+title: Just chillin'
This is my profile for a personal computer. It is functionally identical to my [[../work]] profile, but includes extra things like games and social apps!

View File

@@ -0,0 +1,61 @@
{ config, lib, pkgs, ... }:
{
config = {
systemSettings = {
# users
users = [ "USERNAME" ];
adminUsers = [ "USERNAME" ];
# hardware
cachy.enable = true;
bluetooth.enable = true;
powerprofiles.enable = true;
tlp.enable = false;
printing.enable = true;
# software
flatpak.enable = false;
gaming.enable = false;
virtualization = {
docker.enable = false;
virtualMachines.enable = false;
};
brave.enable = true;
# wm
hyprland.enable = true;
# dotfiles
dotfilesDir = "/etc/nixos";
# security
security = {
automount.enable = true;
blocklist.enable = true;
doas.enable = true;
firejail.enable = false; # TODO setup firejail profiles
firewall.enable = true;
gpg.enable = true;
openvpn.enable = true;
sshd.enable = false;
};
# style
stylix = {
enable = true;
theme = "orichalcum";
};
};
users.users.USERNAME.description = "NAME";
home-manager.users.USERNAME.userSettings = {
name = "NAME";
email = "EMAIL";
};
## EXTRA CONFIG GOES HERE
};
}

View File

@@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
imports = [
./configuration.nix
./hardware-configuration.nix
];
config = {
home-manager.users = builtins.listToAttrs
(map (user: { name = user; value =
({ imports = [ ./home.nix ../../modules/user ]; });}) config.systemSettings.users);
};
}

View File

@@ -0,0 +1,8 @@
## THIS FILE MUST BE GENERATED ON A PER MACHINE BASIS
## RUN
{ config, lib, pkgs, modulesPath, inputs, ... }:
{
}

47
hosts/TEMPLATE/home.nix Normal file
View File

@@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }:
{
config = {
userSettings = {
# setup
shell = {
enable = true;
apps.enable = true;
extraApps.enable = true;
};
xdg.enable = true;
# programs
browser = "brave";
editor = "emacs";
vscodium.enable = true;
yazi.enable = true;
git.enable = true;
engineering.enable = false;
art.enable = false;
flatpak.enable = false;
godot.enable = false;
keepass.enable = false;
media.enable = true;
music.enable = false;
office.enable = true;
recording.enable = false;
virtualization = {
virtualMachines.enable = false;
};
ai.enable = false;
# wm
hyprland.enable = true;
# style
stylix.enable = true;
# hardware
bluetooth.enable = true;
};
## EXTRA CONFIG GOES HERE
};
}

View File

@@ -1,3 +1,3 @@
#+title: Just chillin'
#+title: Thinkpad go brrr...
This is my profile for a personal computer. It is functionally identical to my [[../work]] profile, but includes extra things like games and social apps!
This is my config for an old Thinkpad. It's /really/ slow, but it's nice since it has a touch screen and pen with palm rejection! I don't use it that often, and I'm considering connecting it to the TV and trying Kodi out on it.

View File

@@ -1,3 +1,7 @@
#+title: Just chillin'
This is my profile for a personal computer. It is functionally identical to my [[../work]] profile, but includes extra things like games and social apps!
This is for my personal gaming laptop. Necessary and extra batteries included: office, engineering, development, media, recording, and gaming apps. Highly bloated system.
Specs:
- Asus ROG Strix G15 Advantage
- Upgraded to 64GB of RAM + 1TB SSD

View File

@@ -1,3 +1,3 @@
#+title: Just chillin'
#+title: For my wife
This is my profile for a personal computer. It is functionally identical to my [[../work]] profile, but includes extra things like games and social apps!
This is a config for my wife's computer. She likes Plasma and she mainly uses it for her art work and some light gaming.

View File

@@ -1,3 +1,3 @@
#+title: Just chillin'
#+title: Time to focus
This is my profile for a personal computer. It is functionally identical to my [[../work]] profile, but includes extra things like games and social apps!
This is config for my work computer. Essentially the same as [[../snowfire][snowfire]], just minus the gaming (and a few other things).

View File

@@ -3,102 +3,14 @@
These are just some simple install notes for myself (in-case I have to reinstall unexpectedly). You could also use these to try out my config in a VM.
** Automated Install Script (Experimental)
*** Install Directly From Git
I wrote a quick automated install script at [[./install.sh][install.sh]]. It essentially just runs [[Manual Install Procedure][the manual install steps]] and additionally hardens the security of the system-level (root configuration) files using [[./harden.sh][harden.sh]].
I'll eventually™ add the ability to supply arguments to this script as well.
The quickest way to install is running the install script directly from the remote git repo using =nix run=, which is essentially just one of the following:
#+BEGIN_SRC sh :noeval
# Install from gitlab
nix run gitlab:librephoenix/nixos-config
# Or install from github
nix run github:librephoenix/nixos-config
# Or install from codeberg
nix run git+https://codeberg.org/librephoenix/nixos-config
#+END_SRC
This will install the dotfiles to =~/.dotfiles=, but if you'd like to install to a custom directory, just supply it as a positional argument, i.e:
#+BEGIN_SRC sh :noeval
# Install from gitlab
nix run gitlab:librephoenix/nixos-config -- /your/custom/directory
#+END_SRC
The script will ask for sudo permissions at certain points, /but you should not run the script as root/.
If the above =nix run= command gives you an error, odds are you either don't have =git= installed, or you haven't enabled the experimental features in your Nix config (=nix-command= and =flakes=). To get the command to install properly, you can first enter a shell with =git= available using:
#+begin_src sh :noeval
nix-shell -p git
#+end_src
and then running:
#+BEGIN_SRC sh :noeval
nix run --experimental-features 'nix-command flakes' gitlab:librephoenix/nixos-config
#+END_SRC
And if you want a single copy-paste solution:
#+begin_src sh :noeval
nix-shell -p git --command "nix run --experimental-features 'nix-command flakes' gitlab:librephoenix/nixos-config"
#+end_src
This /should/ still work with a custom dotfiles directory too, i.e:
#+begin_src sh :noeval
nix-shell -p git --command "nix run --experimental-features 'nix-command flakes' gitlab:librephoenix/nixos-config -- /your/custom/directory"
#+end_src
At a certain point in the install script it will open =nano= (or whatever your $EDITOR is set to) and ask you to edit the =flake.nix=. You can edit as much or as little of the config variables as you like, and it will continue the install after you exit the editor.
Potential Errors: I've only tested it working on UEFI with the default EFI mount point of =/boot=. I've added experimental legacy (BIOS) boot support, but it does rely on a quick and dirty script to find the grub device. If you are testing it using some weird boot configuration for whatever reason, try modifying =bootMountPath= (UEFI) or =grubDevice= (legacy BIOS) in =flake.nix= before install, or else it will complain about not being able to install the bootloader.
Note: If you're installing this to a VM, Hyprland won't work unless 3D acceleration is enabled.
Disclaimer: If you install my =homelab= or =worklab= profiles /CHANGE THE PUBLIC SSH KEYS UNLESS YOU WANT ME TO BE ABLE TO SSH INTO YOUR SERVER. YOU CAN CHANGE OR REMOVE THE SSH KEY IN THE RELEVANT CONFIGURATION.NIX/:
- [[./profiles/homelab/configuration.nix][configuration.nix]] for homelab profile
- [[./profiles/worklab/configuration.nix][configuration.nix]] for worklab profile
*** Install From Local Git Clone
The dotfiles can be installed after cloning the repo into =~/.dotfiles= using:
#+BEGIN_SRC sh :noeval
git clone https://gitlab.com/librephoenix/nixos-config.git ~/.dotfiles
~/.dotfiles/install.sh
#+END_SRC
or with a custom directory:
#+BEGIN_SRC sh :noeval
git clone https://gitlab.com/librephoenix/nixos-config.git /your/custom/directory
/your/custom/directory/install.sh
#+END_SRC
If you install to a custom directory, make sure to edit the =userSettings.dotfilesDir= in the [[./flake.nix][flake.nix]], or else my [[./system/bin/phoenix.nix][phoenix wrapper script]] won't work.
At a certain point in the install script it will open =nano= (or whatever your =$EDITOR= is set to) and ask you to edit the =flake.nix=. You can edit as much or as little of the config variables as you like, and it will continue the install after you exit the editor.
Potential Errors: I mainly only test this on UEFI, but I've added experimental legacy (BIOS) boot support. Keep in mind, it does rely on a quick and dirty script to find the grub device. If you are testing it using some weird boot configuration for whatever reason, try modifying =bootMountPath= (UEFI) or =grubDevice= (legacy BIOS) in =flake.nix= before install, or else it will complain about not being able to install the bootloader.
Note: If you're installing this to a VM, Hyprland won't work unless 3D acceleration is enabled.
Disclaimer: If you install my =homelab= or =worklab= profiles /CHANGE THE PUBLIC SSH KEYS UNLESS YOU WANT ME TO BE ABLE TO SSH INTO YOUR SERVER. YOU CAN CHANGE OR REMOVE THE SSH KEY IN THE RELEVANT CONFIGURATION.NIX/:
- [[./profiles/homelab/configuration.nix][configuration.nix]] for homelab profile
- [[./profiles/worklab/configuration.nix][configuration.nix]] for worklab profile
*** Automatic Install Script Limitations
At this time, this only works on an existing NixOS install. It also only works if the dotfiles are cloned into =~/.dotfiles=. It also only works on UEFI, not on BIOS :(
Future upgrade plans:
- [ ] Be able to install directly from NixOS iso
- [ ] Be able to install just home-manager config to a non-NixOS Linux distro
- [ ] Be able to detect EFI mount point for systemd-boot?
- [X] +Be able to detect UEFI or BIOS and switch config as needed+
- [ ] ??? (open up an issue if you think there is anything else I should try to figure out)
** Manual Install Procedure
If you instead want to install this manually to see all the steps (kind of like an Arch install before the archinstall script existed), you can follow this following procedure:
Currently, the only supported install method is installing manually. This way yuo can see all the steps (kind of like an Arch install before the archinstall script existed), you can follow this following procedure:
*** Clone Repo and Modify Configuration
Start by cloning the repo:
Start by cloning the repo to =/etc/nixos=:
#+BEGIN_SRC sh :noeval
git clone https://gitlab.com/librephoenix/nixos-config.git ~/.dotfiles
sudo mv /etc/nixos /etc/nixos.bkp
git clone https://gitlab.com/librephoenix/nixos-config.git /etc/nixos
#+END_SRC
Any custom directory should also work:
@@ -106,50 +18,27 @@ Any custom directory should also work:
git clone https://gitlab.com/librephoenix/nixos-config.git /your/custom/directory
#+END_SRC
If you install to a custom directory, make sure to edit the =userSettings.dotfilesDir= in the beginning [[./flake.nix][flake.nix]], or else my [[./system/bin/phoenix.nix][phoenix wrapper script]] won't work.
If you install to a custom directory, make sure to edit =systemSettings.dotfilesDir= in the system configuration, or else the [[./system/bin/phoenix.nix][phoenix wrapper script]] won't work.
#+BEGIN_SRC nix :noeval
...
let
...
# ----- USER SETTINGS ----- #
dotfilesDir = "/your/custom/directory"; # username
...
# somewhere in system-level config:
{ config, lib, pkgs, ...}:
{
systemSettings.dotfilesDir = "/your/custom/directory";
}
#+END_SRC
To get the hardware configuration on a new system, either copy from =/etc/nixos/hardware-configuration.nix= or run:
To configure a new system, navigate to the [[./hosts][hosts]] directory and copy the [[./hosts/TEMPLATE][TEMPLATE]] directory. Name the copy whatever you want the new hostname to be (needs to match the hostname exactly).
Next, configure the resulting =configuration.nix= and =home.nix= with the available options. Make sure to change all references to =USERNAME=, =NAME= and =EMAIL= for your desired user(s).
Next, you must copy or generate the new system's hardware-config into your specific host's =hardware-configuration.nix=. To get the hardware configuration on a new system, either copy from =/etc/nixos.bkp/hardware-configuration.nix= or run:
#+BEGIN_SRC sh :noeval
sudo nixos-generate-config --show-hardware-config > ~/.dotfiles/system/hardware-configuration.nix
sudo nixos-generate-config --show-hardware-config > /etc/nixos/hosts/YOURHOSTNAMEHERE/hardware-configuration.nix
#+END_SRC
Also, if you have a differently named user account than my default (=emmet=), you /must/ update the following lines in the let binding near the top of the [[./flake.nix][flake.nix]]:
#+BEGIN_SRC nix :noeval
...
let
...
# ----- USER SETTINGS ----- #
username = "YOURUSERNAME"; # username
name = "YOURNAME"; # name/identifier
...
#+END_SRC
There are many more config options there that you may also want to change as well.
The build will fail if you are booting from BIOS instead of UEFI, unless change some of the system settings of the flake. Change =bootMode= to "bios" and set the =grubDevice= appropriately for your system (i.e. =/dev/vda= or =/dev/sda=).
#+begin_src nix :noeval
...
let
# ---- SYSTEM SETTINGS ---- #
...
bootMode = "bios"; # uefi or bios
grubDevice = "/dev/vda"; # device identifier for grub; find this by running lsblk
...
#+end_src
Note: If you're installing this to a VM, Hyprland won't work unless 3D acceleration is enabled.
Disclaimer: If you install my =homelab= or =worklab= profiles /CHANGE THE PUBLIC SSH KEYS UNLESS YOU WANT ME TO BE ABLE TO SSH INTO YOUR SERVER. YOU CAN CHANGE OR REMOVE THE SSH KEY IN THE RELEVANT CONFIGURATION.NIX/:
- [[./profiles/homelab/configuration.nix][configuration.nix]] for homelab profile
- [[./profiles/worklab/configuration.nix][configuration.nix]] for worklab profile
Disclaimer: If you copy my =ori= host config to setup a sever with NixOS, /MAKE SURE YOU CHANGE OR REMOVE THE PUBLIC SSH KEYS UNLESS YOU WANT ME TO BE ABLE TO SSH INTO YOUR SERVER. YOU CAN CHANGE OR REMOVE THE SSH KEY IN THE RELEVANT CONFIGURATION.NIX/ (see [[./hosts/ori/configuration.nix][configuration.nix]]).
*** Rebuild and Switch System Config
Once the variables are set, then switch into the system configuration by running:
@@ -161,42 +50,14 @@ or for your own custom directory:
sudo nixos-rebuild switch --flake /your/custom/directory#system
#+END_SRC
*** Intall and Switch Home Manager Config
Home manager can be installed and the configuration activated with:
Subsequent rebuilds can now use my =phoenix= wrapper script to rebuild:
#+BEGIN_SRC sh :noeval
nix run home-manager/master -- switch --flake ~/.dotfiles#user
#+END_SRC
or for your own custom directory:
#+BEGIN_SRC sh :noeval
nix run home-manager/master -- switch --flake /your/custom/directory#user
phoenix sync
#+END_SRC
** FAQ
*** =home-manager switch --flake .#user= Command Fails
If it fails with something to the effect of "could not download {some image file}" then that just means that one of my themes is having trouble downloading the background image. To conserve on space in the repo, my themes download the relevant wallpapers directly from their source, but that also means that if the link is broken, =home-manager switch= fails.
I have included a script in the [[./themes][themes directory]] named [[./themes/background-test.sh][background-test.sh]] which performs a rough test on every theme background url, reporting which are broken.
If you're having this error, navigate to the [[./flake.nix][flake.nix]] and select any theme with a good background wallpaper link. As long as it is able to download the new wallpaper, it should be able to build.
*** Do I have to put the configuration files in =~/.dotfiles=?
No. You can put them in literally any directory you want. I just prefer to use =~/.dotfiles= as a convention. If you change the directory, do keep in mind that the above scripts must be modified, replacing =~/.dotfiles= with whatever directory you want to install them to. Also, you may want to modify the =dotfilesDir= variable in =flake.nix=.
*** So I cloned these dotfiles into ~/.dotfiles, and now there are system-level files owned by my user account.. HOW IS THIS SECURE?!
If you're worried about someone modifying your system-level (root configuration) files as your unpriveleged user, see [[./harden.sh][harden.sh]].
*** I installed this to a VM and when I log in, it crashes and sends me back to the login manager (SDDM)?
Enable 3D acceleration for your virtual machine. Hyprland doesn't work without it.
*** It fails installing with some weird errors about grub or a bootloader?
It will 100% fail if you test it with a non-default boot configuration. It might even give this error otherwise! If this is the case, try modifying =bootMountPath= (UEFI) or =grubDevice= (legacy BIOS) in =flake.nix= before installing again.
*** The install seems to work, but when I login, I'm missing a lot of stuff (partial install)
This can happen if you run the autoinstall script on a system that already has a desktop environment, or if any other (non-Nix-store-symlink) config files are in the way of the config files generated by home-manager. In these cases, home-manager refuses to build anything, even if there's just one file in the way. If you try running =nix run home-manager/master -- switch --flake ~/.dotfiles#user=, it should throw an error at the end with something like:
#+begin_example
Existing file '/home/user/.gtkrc-2.0' is in the way of '/nix/store/6p3hzdbzhad8ra5j1qf4b2b3hs6as6sf-home-manager-files/.gtkrc-2.0'
Existing file '/home/user/.config/Trolltech.conf' is in the way of '/nix/store/6p3hzdbzhad8ra5j1qf4b2b3hs6as6sf-home-manager-files/.config/Trolltech.conf'
Existing file '/home/user/.config/user-dirs.conf' is in the way of '/nix/store/6p3hzdbzhad8ra5j1qf4b2b3hs6as6sf-home-manager-files/.config/user-dirs.conf'
...
#+end_example
The current solution to this is to delete or move the files mentioned so that home-manager can evaluate. Once the files are out of the way, just run =nix run home-manager/master -- switch --flake ~/.dotfiles#user= again and it should work!
*** You used to have an auto-install script! Where did it go?
My old [[https://www.youtube.com/watch?v=Dm11dcJ0vWY][auto-install script]] was kind of cool, but I found it wasn't really stable (even for me). I'll probably revisit this at some point (looking at you [[https://github.com/nix-community/nixos-anywhere][nixos-everywhere]] and [[https://github.com/nix-community/disko][disko]]).

View File

@@ -9,21 +9,4 @@ imports = [ import1.nix
];
#+END_SRC
My system-level Nix modules are organized into this directory:
- [[./hardware-configuration.nix][hardware-configuration]] - Default hardware config generated for my system
- [[./bin][bin]] - My own scripts
- [[./bin/phoenix.nix][phoenix]] - My nix command wrapper
- [[./app][app]] - Necessary system-level configuration to get various apps working
- [[./hardware][hardware]] - Hardware configurations I may need to use
- [[./security][security]] - System-level security stuff
- [[./style][style]] - Stylix setup (system-wide base16 theme generation)
- [[./wm][wm]] - Necessary system-level configuration to get various window managers, wayland compositors, and/or desktop environments working
** Variables imported from flake.nix
Variables can be imported from [[../flake.nix][flake.nix]] by setting the =specialArgs= block inside the flake (see [[../flake.nix][my flake]] for more details). This allows variables to merely be managed in one place ([[../flake.nix][flake.nix]]) rather than having to manage them in multiple locations.
I use this to pass a few attribute sets:
- =userSettings= - Settings for the normal user (see [[../flake.nix][flake.nix]] for more details)
- =systemSettings= - Settings for the system (see [[../flake.nix][flake.nix]] for more details)
- =inputs= - Flake inputs (see [[../flake.nix][flake.nix]] for more details)
- =pkgs-stable= - Allows me to include stable versions of packages along with (my default) unstable versions of packages
Modules in this directory are used are system-level (root) configurations.

View File

@@ -9,39 +9,4 @@ imports = [ import1.nix
];
#+END_SRC
My user-level Nix modules are organized into this directory:
- [[./app][app]] - Apps or collections of apps bundled with my configs
- [[./app/browser][browser]] - Used to set default browser
- [[./app/dmenu-scripts][dmenu-scripts]]
- [[./app/doom-emacs][doom-emacs]]
- [[./app/flatpak][flatpak]] - Installs flatpak as a utility (flatpaks must be installed manually)
- [[./app/games][games]] - Gaming setup
- [[./app/git][git]]
- [[./app/keepass][keepass]]
- [[./app/ranger][ranger]]
- [[./app/terminal][terminal]] - Configuration for terminal emulators
- [[./app/virtualization][virtualization]] - Virtualization and compatability layers
- [[./lang][lang]] - Various bundled programming languages
- I will probably get rid of this in favor of a shell.nix for every project, once I learn how that works
- [[./pkgs][pkgs]] - "Package builds" for packages not in the Nix repositories
- [[./pkgs/pokemon-colorscripts.nix][pokemon-colorscripts]]
- [[./pkgs/rogauracore.nix][rogauracore]] - not working yet
- [[./shell][shell]] - My default bash and zsh configs
- [[./shell/sh.nix][sh]] - bash and zsh configs
- [[./shell/cli-collection.nix][cli-collection]] - Curated useful CLI utilities
- [[./style][style]] - Stylix setup (system-wide base16 theme generation)
- [[./wm][wm]] - Window manager, compositor, wayland compositor, and/or desktop environment setups
- [[./wm/hyprland][hyprland]]
- [[./wm/xmonad][xmonad]]
- [[./wm/picom][picom]]
** Variables imported from flake.nix
Variables can be imported from [[../flake.nix][flake.nix]] by setting the =extraSpecialArgs= block inside the flake (see [[../flake.nix][my flake]] for more details). This allows variables to merely be managed in one place ([[../flake.nix][flake.nix]]) rather than having to manage them in multiple locations.
I use this to pass a few attribute sets:
- =userSettings= - Settings for the normal user (see [[../flake.nix][flake.nix]] for more details)
- =systemSettings= - Settings for the system (see [[../flake.nix][flake.nix]] for more details)
- =inputs= - Flake inputs (see [[../flake.nix][flake.nix]] for more details)
- =pkgs= - Set to unstable for client devices and stable for server devices
- =pkgs-stable= - Allows me to include stable versions of packages along with (my default) unstable versions of packages
- =pkgs-unstable= - Allows me to force unstable versions of packages on server devices
Modules in this directory are used are user-level configurations.

View File

@@ -1,14 +1,12 @@
#+title: I never thought I'd have to do this, but here we are
#+author: Emmet
Since I use =nixpkgs-unstable= (I am an Arch user by heart), there are some cases where certain packages will break or fail to build (usually due to my extremely customized, non-standard system).
Since I use =nixpkgs-unstable= (I am an Arch user (btw) at heart), there are some cases where certain packages will break or fail to build (usually due to my extremely customized, non-standard system).
With Nix, I /could/ just rollback everything and wait to update until an upstream patch fixes things, but if it's a quick fix, I'd rather just patch it in immediately so that everything else can stay up to date.
Patches end up in and out of this directory. Ideally, there shouldn't be any patches here!
** List of Patches
** List of Current Patches
Here is a list of patches in this directory, along with a more detailed description of why it's necessary:
| Patch | Reason |
|------------------------------+----------------------------------------------------------------------------------------------|
- n/a