Skip to content

benvonh/.flake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.flake

My NixOS and Home Manager configuration flake.

Dependency

If not using NixOS, install nix here.

Direct Install (Home Manager only)

⚠️ To remove the Home Manager configuration, you will have to delete all symlinks manually.

  1. Enter the custom shell of this repository.
nix develop --extra-experimental-features 'nix-command flakes' github:benvonh/.flake
  1. 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

Local Install (Home Manager + NixOS)

  1. 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
  1. 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`
  1. 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

Issues

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

Thanks to...