nix-config
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
Programs
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 |
If you're interested in using taffybar
or xmobar
, browse the commit history and you will find the configuration files I used. Here's a screenshot showcasing the former.
Themes
Type | Name |
---|---|
GTK Theme | Juno Ocean |
GTK Icon Theme | Beauty Line |
Terminal Font | JetBrainsMono |
Structure
Here is an overview of the folders' structure:
.
โโโ build
โโโ flake.nix
โโโ flake.lock
โโโ home
โ โโโ config.nix
โ โโโ home.nix
โ โโโ modules
โ โโโ overlays
โ โโโ programs
โ โโโ scripts
โ โโโ secrets
โ โโโ services
โ โโโ themes
โโโ imgs
โโโ notes
โโโ outputs
โ โโโ home-conf.nix
โ โโโ nixos-conf.nix
โโโ system
โโโ cachix
โโโ cachix.nix
โโโ configuration.nix
โโโ fonts
โโโ machine
โโโ misc
โโโ wm
build
: the build and installation script.flake.nix
: home and system configurations.home
: all the user programs, services and dotfiles.imgs
: screenshots and other images.notes
: cheat-sheets, docs, etc.outputs
: the Home Manager and NixOS flake outputs.system
: the NixOS configuration, settings for different laptops and window managers.
Install
You can have a look at the available flake outputs before getting started.
$ nix flake show github:gvolpe/nix-config
github:gvolpe/nix-config/0161ea3bd15e0cd06696f27bd60c588991305b20
โโโโhomeConfigurations: unknown
โโโโnixosConfigurations
โโโโdell-xps: NixOS configuration
โโโโtongfang-amd: NixOS configuration
As well as all the declared flake inputs.
$ nix flake metadata github:gvolpe/nix-config
NixOS
The full home configuration is not yet fully automated but 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.
Home Manager
A fresh install requires the creation of certain directories so this has not been automated yet (see build
script file). 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-hdmi.activationPackage
$ result/activate
Full configuration via script
On a fresh NixOS installation, run the following commands.
$ nix flake clone github:gvolpe/nix-config --dest /choose/a/path
$ nix run nixpkgs#git-crypt unlock
$ ./build fresh-install # requires sudo
Note that
git-crypt unlock
requires your GPG Keys to be correctly set up.
The build
script is only suitable for a fresh install customized to my personal use but you can build the flakes directly. E.g.
$ nix build .#nixosConfigurations.tongfang-amd.config.system.build.toplevel
sudo result/bin/switch-to-configuration switch
Or for Home Manager.
$ nix build .#homeConfigurations.gvolpe-hdmi.activationPackage
$ result/activate