No description
Find a file
2024-05-03 15:58:29 -04:00
.github/workflows Update build.yml 2024-04-12 11:56:11 -04:00
core 417 current 2024-04-18 20:06:07 24.05.20240418.2948912 6.8.6-zen1 nvidiaProduction nvidiaStable nvidiaVulkanBeta 2024-04-18 20:06:08 -04:00
env 467 current 2024-04-24 11:16:41 24.05.20240423.0a0027c 6.8.6-zen1 * 2024-04-24 11:16:44 -04:00
hosts add autoindex 2024-05-03 15:58:29 -04:00
modules add pluto host 2024-05-03 13:33:06 -04:00
.envrc 358 current 2024-04-16 14:38:00 24.05.20240416.c04952a 6.8.4-zen1 * 2024-04-16 14:38:07 -04:00
.gitignore 55 current 2024-02-29 23:05:52 24.05.20240228.9099616 6.6.18 * 2024-02-29 23:15:48 -05:00
flake.lock add pluto host 2024-05-03 13:33:06 -04:00
flake.nix add pluto host 2024-05-03 13:33:06 -04:00
README.md clean up 2024-04-27 23:29:12 -04:00

zack's nixos dotfiles

image

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.nix for useful aliases, like "r" to rebuild your system!