My NixOS and Home Manager configuration flake.
If not using NixOS, install nix
here.
- Enter the custom shell of this repository.
nix develop --extra-experimental-features 'nix-command flakes' github:benvonh/.flake
- Switch to a Home Manager configuration.
🛑 This will fail if existing configs block Home Manager. Back up each of them as seen in the output.
# Replace `ben` with an exiting user config.
home-manager switch --flake github:benvonh/.flake#ben
- Clone this repository and enter the custom shell.
❗ Aliases exist with ~/.flake
. Change these aliases if using a different path.
# `nix-shell -p git` if needed
git clone https://github.com/benvonh/.flake ~/.flake
cd ~/.flake
nix-shell
- Create a custom configuration for both NixOS and Home Manager.
# `nix-shell -p vim` if needed
NixOS:
vim flake.nix
# ...
# nixosConfigurations = {
# ...
# <your-hostname> = nixpkgs.lib.nixosSystem {
# specialArgs = { inherit inputs outputs; };
# modules = [ ./nixos/<your-hostname> ];
# };
# };
cp -r nixos/zeph nixos/$HOST
cp /etc/nixos/hardware-configuration.nix nixos/$HOST/hardware.nix
vim nixos/$HOST/default.nix
# EDIT
# Also see `modules/nixos`
Home Manager:
vim flake.nix
# ...
# homeConfigurations = {
# ...
# <your-username> = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux;
# extraSpecialArgs = { inherit inputs outputs; };
# modules = [ ./home/<your-username> ];
# };
# };
cp -r home/ben home/$USER
vim home/$USER/default.nix
# EDIT
# Also see `modules/home`
- Switch to the NixOS and Home Manager configuration.
# Add `#<user or host>` to specify which config.
sudo nixos-rebuild switch --flake ~/.flake
home-manager switch --flake ~/.flake
# You can also use my aliases to switch configurations.
nrs
hms
From experience, grub
had many problems installing onto my system while replacing systemd
.
You can use the following to help debug your problem.
# Add ` -- <arguments>` to pass arguments.
nix run nixpkgs#efibootmgr
- Misterio77 for his nix-starter-configs template
- Vimjoyer for his awesome YouTube content on Nix