Coder Social home page Coder Social logo

totoroot / dotfiles Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 2.0 54.33 MB

Dotfiles for my NixOS and nix-darwin systems

License: MIT License

Shell 12.32% Awk 0.14% Scheme 10.36% Lua 0.42% Python 4.03% JavaScript 0.15% Common Lisp 0.41% HTML 0.52% CSS 1.28% Nix 41.14% SCSS 26.77% Nushell 2.44% Ruby 0.03%
nix nixos dotfiles nix-darwin nix-flake nixos-configuration nixos-dotfiles hacktoberfest

dotfiles's Introduction

NixOS/Nix system and user configuration for my private machines

Get it on Codeberg

NixOS 24.05

Commit activity Latest commit

Hey, you. You're finally awake. You were trying to configure your OS declaratively, right? Walked right into that NixOS ambush, same as us, and those dotfiles over there.

Note that this repository is a fork of Henrik Lissner's dotfiles which I have modified and updated over the years to better suit my needs.

In case you need help getting started with NixOS and want to use these dotfiles as a starting point, feel free to raise issues asking for help or send me an Email to my Git commit address which you can find on my profile.

Screenshots 4K Display

Full Desktop Floating Desktop


Shell: zsh + zgenom
DM: lightdm + lightdm-mini-greeter
WM: bspwm + polybar
Editor: micro (and occasionally nvim)
Terminal: kitty
Launcher: rofi
Browser: firefox
GTK Theme: Ant Dracula

If you've never before installed NixOS, make sure to read through the official installation guide. This quick start guide is based on the installation instructions in the official NixOS manual so you might want to skim over them as well before getting started.

Also, if you run into any issues, especially when trying to follow the installation instructions and you get stuck, please open an issue either on Codeberg or on GitHub.

Quick start

Using the minimal installer image

  1. Yoink the minimal ISO image of NixOS from the official download page.

  2. Verify integrity of the ISO image and flash to boot medium.

  3. Boot into the installer.

  4. Create the mount directories with mkdir -p /mnt/boot.

  5. Do your partitions and mount your root to /mnt. I recommend first doing sudo su for ease of use. Be careful with those labels though.

  6. Check whether everything is mounted correctly by running lsblk. Check disk labels by running blkid.

  7. Install git with nix-env -iA nixos.git.

  8. Make sure you've got a working, stable network connection as it will be needed for installing/rebuilding the system's configuration.

Using the graphical installer image

  1. Install NixOS following the official instructions for graphical installation according to your needs (encryption, partioning etc.). Since most of my hosts use KDE Plasma as a desktop environment at the moment, it makes sense to use the KDE Plasma image, so that the first rebuild will not take as long. For most platforms, this should work without any issues with the default configuration. You should not have to configure much before installing NixOS.

  2. Reboot your system and boot into your system's first generation.

  3. Open a terminal. If you used the KDE Plasma image, launch Konsole.

Continuing with the install/rebuild

  1. Clone the dotfiles to any directory in your home directory. I prefer putting it alongside other dotfiles in ~/.config/. git clone https://codeberg.org/totoroot/dotfiles ~/.config/dotfiles

  2. Look through available configurations in the hosts directory. Every host subdirectory includes a little README, that should help you figure out, which host configuration you could base your configuration on. For a desktop PC look at purple, for a server look at violet, for a notebook look at grape.

  3. Once you found a configuration you like, copy its directory and think of a good name for your new host. Then run cp -r ~/.config/dotfiles/hosts/grape ~/.config/dotfiles/hosts/<new-host>.

  4. Overwrite the hardware configuration file in the copied directory with a new one. Run sudo nixos-generate-config --show-hardware-config > ~/.config/dotfiles/hosts/<new-host>/hardware-configuration.nix

  5. In case you want to make adjustments to the configuration, do it now.

  6. Check whether the partitioning scheme in ~/.config/dotfiles/hosts/<new-host>/hardware-configuration.nix is correct.

  7. Add nixpkgs channel and install flakes nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs && nix-channel --update && nix-env -iA nixpkgs.nixFlakes.

  8. In case you have already installed with the graphical installer and rebooted, rebuild your system with the following command. nixos-rebuild boot --flake /mnt/etc/nixos#<new-host> --impure

  9. In case you haven't yet installed, run the installer with the following command: nixos-install --root /mnt --flake /mnt/etc/nixos#<new-host> --impure

  10. Reboot!

Management

Since Nix tooling can be confusing, I'm occasionally using hlissner's wrapper hey.

For example to rebuild your system using the flake, run hey re instead of nixos-rebuild switch --flake /mnt/etc/nixos#<host> --impure.

And I say, bin/hey. What's going on?

Usage: hey [global-options] [command] [sub-options]

Available Commands:
  check                  Run 'nix flake check' on your dotfiles
  gc                     Garbage collect & optimize nix store
  generations            Explore, manage, diff across generations
  help [SUBCOMMAND]      Show usage information for this script or a subcommand
  rebuild                Rebuild the current system's flake
  repl                   Open a nix-repl with nixpkgs and dotfiles preloaded
  rollback               Roll back to last generation
  search                 Search nixpkgs for a package
  show                   [ARGS...]
  ssh HOST [COMMAND]     Run a bin/hey command on a remote NixOS system
  swap PATH [PATH...]    Recursively swap nix-store symlinks with copies (or back).
  test                   Quickly rebuild, for quick iteration
  theme THEME_NAME       Quickly swap to another theme module
  update [INPUT...]      Update specific flakes or all of them
  upgrade                Update all flakes and rebuild system

Options:
    -d, --dryrun                     Don't change anything; preform dry run
    -D, --debug                      Show trace on nix errors
    -f, --flake URI                  Change target flake to URI
    -h, --help                       Display this help, or help for a specific command
    -i, -A, -q, -e, -p               Forward to nix-env

Some information to get you started configuring the install to your needs

Mimeapps can be set in modules/xdg.nix.

Frequently asked questions

dotfiles's People

Contributors

hlissner avatar totoroot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.