nix-config icon indicating copy to clipboard operation
nix-config copied to clipboard

:space_invader: NixOS configuration

nix-config

CI Home CI System

My current — and always evolving — NixOS configuration files, home-manager, neovim, etc.

scala-dev-env

desktop

amd

themes

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
│  ├── installation.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, installation shell 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/60b91aea6461cfb8fb1efdc9fb88f8c5ba815810
├───devShell
│   └───x86_64-linux: development environment 'installation-shell'
├───homeConfigurations: unknown
└───nixosConfigurations
    ├───dell-xps: NixOS configuration
    └───tongfang-amd: NixOS configuration

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