This repository contains my personal NixOS and Home Manager configurations, managed using Nix Flakes.
The repository is organized as follows:
flake.nix
: The main entry point for the Nix Flake configuration.hosts/
: Contains configuration for specific machines (e.g.,alfred
).system_modules/
: Reusable Nix modules for various system components (e.g.,desktop manager
,shell
,window manager
).user_modules/
: Reusable Nix user modules (e.g.,browsers
,communication tools
,development tools
).users/
: User-specific configurationscreate_module.sh
: Script to create new modules.sync-system.sh
,sync-user.sh
,sync.sh
: Scripts for synchronizing and deploying configurations.secrets.yaml
: File for storing sensitive information managed bynix-sops
.
-
Install Homebrew Package Manager. More information can be found here.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install the Nix Package Manager on your system. More information can be found here.
sh <(curl -L https://nixos.org/nix/install)~
-
Create a nix config directory
mkdir -p ~/.config/nix
-
Allow experimental features to use flakes
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
-
Install Nix-Darwin:
nix run nix-darwin -- switch --flake .#<host>
-
Restart your shell.
- Ensure you have Nix with Flakes enabled installed on your system.
- Clone this repository:
git clone https://github.com/Manas73/nix-config.git
- Navigate to the repository directory:
cd nix-config
- Apply the configurations:
./sync-darwin.sh
To use this configuration:
-
Ensure you have Nix with Flakes enabled installed on your system.
-
Clone this repository:
git clone https://github.com/Manas73/nix-config.git
-
Navigate to the repository directory:
cd nix-config
-
Apply the configurations using one of the following sync scripts:
-
To apply both system and
home-manager
configurations:./sync.sh
-
To apply only the system configuration:
./sync-system.sh
-
To apply only the
home-manager
configuration:./sync-user.sh
Notes:
- The sync scripts use
sudo
where necessary, so you may be prompted for your password during execution. - The
sync.sh
script combines the functionality of bothsync-system.sh
andsync-user.sh
, allowing you to update your entire configuration in one go.
-
-
After running any of these scripts, your system will rebuild and apply the new configurations.
To customize this configuration for your own use:
- Modify the
hosts/
directory to match your machine(s). - Update user configurations in the
users/
directory. - Adjust modules in the
system_modules/
oruser_modules/
directory as needed. - Use the
create_module.sh
script to create new modules as required. - Utilize the sync scripts (
sync-system.sh
,sync-user.sh
,sync.sh
) to deploy your changes.