| .github/workflows | ||
| core | ||
| env | ||
| hosts | ||
| modules | ||
| .envrc | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
zack's nixos dotfiles
my customized versions of other's dotfiles
major credits to sioodmy and luckasRanarison.
could not have done this without their work :)
How to Install
Prerequisetes
Grab the latest NixOS ISO from NixOS nixos.org. After that, make a new shell with git available:
nix shell nixpkgs#git
Now, configure your disk as seen here.
Note
Just follow the partitioning and mounting steps, the other steps to install will be listed below.
1. Cloning the repository
With git installed, clone the repository with
git clone https://github.com/zackartz/nixos-dots.git && cd nixos-dots
2. Configuring the System
Generate your hardware-configuration.nix file.
sudo nixos-generate-config --root /mnt
You will now have two files in /mnt/etc/nixos. We will need hardware-configuration.nix and part of configuration.nix.
[nixos@live:~/nixos-dots]$ ls /mnt/etc/nixos/
configuration.nix hardware-configuration.nix
Go ahead and make a new folder for your pc inside of the hosts directory.
cd hosts && mkdir vm # change "vm" to your preferred hostname -- it MUST match the hostname you plan on using for scripts to work properly.
Tip
You can use the "m" alias to create directories once you have booted into the installed system!
Now, copy the files over from /mnt/etc/nixos/.
cd vm && cp /mnt/etc/nixos/* . # remember to change "vm" to your hostname
mv configuration.nix config.old.nix # we will be writing our own configuration.nix
Now, make a new file: configuration.nix.
touch configuration.nix
Open up configuration.nix in your favorite editor and paste the following:
{
pkgs,
inputs,
...
}: {
imports = [
../common/default.nix
./hardware-configuration.nix
];
networking.hostName = "vm"; # Define your hostname.
programs.zsh.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.zack = {
isNormalUser = true;
description = "zack";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.zsh;
};
home-manager = {
extraSpecialArgs = {inherit inputs;};
users = {
"zack" = {
imports = [../../modules/home-manager/default.nix];
_module.args.theme = import ../../core/theme.nix;
home.username = "zack";
home.homeDirectory = "/home/zack";
};
};
};
}
Change the instances of zack to your desired username, and customize as you see fit!
We will need to copy some things over from configuration.nix, namely boot related options. I am doing this in a VM, so I see these boot related options. Find the boot.loader option, and copy it over from your old file into this new one.
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/vda"; # the device to change
Warning
DO NOT COPY THIS CODE, THIS IS JUST AN EXAMPLE OF WHAT TO LOOK FOR
Make sure the device targets the correct drive for your EFI to be installed on.
Finally, add the following to flake.nix (somewhere around line 100).
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
./hosts/vm/configuration.nix
inputs.home-manager.nixosModules.default
];
};
3. Installing the system
Now that you have the config ready to go, run the following command.
rm -rf .git # remove the github repository
sudo nixos-install --flake ~/nixos-dots#vm # again, remember to change vm to be your hostname
4. Post-Install configuration.
Set a password for your user:
sudo passwd zack # replace with your username
Copy the flake to your home folder
cp -r ~/nixos-dots /mnt/home/zack/nixos # replace "zack" with your username
Reboot the system and you're done! Enjoy the system!
Tip
Check
./modules/shell/zsh/aliases.nixfor useful aliases, like "r" to rebuild your system!