:space_invader: NixOS configuration
My current — and always evolving — NixOS configuration files, home-manager, neovim, etc.
NOTE: My new neovim configuration is now a separate flake: https://github.com/gvolpe/neovim-flake
The home.nix
file contains details about all the software I use, but here's a shout-out to the ones I use the most and that are customized to my needs.
Type | Program |
---|---|
Editor | NeoVim |
Launcher | Rofi |
Shell | Fish |
Status Bar | Polybar |
Terminal | Alacritty |
Window Manager | XMonad |
Type | Name |
---|---|
GTK Theme | Juno Ocean |
GTK Icon Theme | Beauty Line |
Terminal Font | JetBrainsMono |
Here is an overview of the directories' structure:
.
├── build
├── flake.nix
├── flake.lock
├── switch
├── home
├── imgs
├── lib
├── notes
├── outputs
└── system
build
: the build and installation script.flake.nix
: home and system configurations.switch
: helper script to switch home and system configurations.home
: all the user programs, services and dotfiles.imgs
: screenshots and other images.lib
: custom nix library functions and overlays used to instantiate pkgs.notes
: cheat-sheets, docs, etc.outputs
: the Home Manager and NixOS flake outputs.system
: the NixOS configuration, settings for different laptops and window managers.You can have a look at the available flake outputs before getting started.
$ nix flake show github:gvolpe/nix-config
github:gvolpe/nix-config/b7fb45d60b761fe39ee1ce78d2b1fd0f0c8db50e
├───homeConfigurations: unknown
├───nixosConfigurations
│ ├───dell-xps: NixOS configuration
│ ├───edp-tongfang-amd: NixOS configuration
│ ├───thinkpad: NixOS configuration
│ └───tongfang-amd: NixOS configuration
├───out: unknown
└───packages
└───x86_64-linux
├───bazecor: package 'bazecor-1.3.9-patched'
├───metals: package 'metals-1.2.2'
└───metals-updater: package 'metals-updater-script'
As well as all the declared flake inputs.
nix flake metadata github:gvolpe/nix-config
The edp-tongfang-amd
configuration also contains my Home Manager configuration using the NixOS module, so it can easily be tested with a single command.
nixos-rebuild switch --flake github:gvolpe/nix-config#edp-tongfang-amd
Or you can test it directly on a QEMU virtual machine, though it has its limitations in terms of graphics.
nixos-rebuild build-vm --flake github:gvolpe/nix-config#edp-tongfang-amd
./result/bin/run-tongfang-amd-vm
Having both NixOS and Home Manager configurations combined makes it easier to quickly install it on a new machine, but my preference is to have both separate, as my Home Manager configuration changes more often than that of the NixOS one, resulting in multiple generations at boot time.
Managing the different Home Manager generations in isolation makes this way easier for me.
The NixOS configuration can be installed by running the following command.
nixos-rebuild switch --flake github:gvolpe/nix-config#tongfang-amd
Beware that the hardware-configuration.nix
file is the result of the hardware scan of the specific machine and might not be suitable for yours.
A fresh install requires the creation of certain directories (see what the build
script does). However, if you omit those steps, the entire HM configuration can also be built as any other flake.
nix build github:gvolpe/nix-config#homeConfigurations.gvolpe-edp.activationPackage
result/activate
To set up a new machine from scratch, have a look at this document.