Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/khaneliman/khanelinix

Nix configuration for my systems supporting macOS, NixOS, and WSL.
https://github.com/khaneliman/khanelinix

astronvim flake flakes hyprland neovim nixos nixos-config nixos-configuration nixos-dotfiles snowfall swayidle swaylock unstable waybar

Last synced: about 2 months ago
JSON representation

Nix configuration for my systems supporting macOS, NixOS, and WSL.

Awesome Lists containing this project

README

        


Logo


NixOS Config for Khaneliman





Nix Flakes Ready


Built With Snowfall

Welcome to khanelinix, a personal Nix configuration repository. This repository
contains my NixOS and Nixpkgs configurations, along with various tools and
customizations to enhance the Nix experience.

## Table of Contents

1. [Getting Started](#getting-started)
2. [Features](#features)
3. [Customization](#customization)
4. [Exported Packages](#exported-packages)
5. [Screenshots](#screenshots)
6. [Resources](#resources)

## Getting Started

Before diving in, ensure that you have Nix installed on your system. If not, you
can download and install it from the official
[Nix website](https://nixos.org/download.html) or from the
[Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer).
If running on macOS, you need to have Nix-Darwin installed, as well. You can follow the
installation instruction on [GitHub](https://github.com/LnL7/nix-darwin?tab=readme-ov-file#flakes).

### Clone this repository to your local machine

```bash
git clone https://github.com/khaneliman/khanelinix.git
cd khanelinix

# linux
sudo nixos-rebuild switch --flake .

# macos
darwin-rebuild switch --flake .

# with direnv
flake switch
```

## Features

Here's an overview of what my Nix configuration offers:

- **External Dependency Integrations**:
- [Nixvim](https://github.com/nix-community/nixvim) neovim configuration.
- Access the Nix User Repository (NUR) for additional packages and
enhancements.
- Incorporate Nixpkgs-Wayland to provide an up-to-date Wayland package
repository.

- **macOS Support**: Seamlessly configure and manage Nix on macOS using the
power of [Nix-darwin](https://github.com/LnL7/nix-darwin), also leveraging homebrew for GUI applications.

- **Home Manager**: Manage your dotfiles, home environment, and user-specific
configurations with [Home Manager](https://github.com/nix-community/home-manager).

- **DevShell Support**: The flake provides a development shell (`devShell`) to
support maintaining this flake. You can use the devShell for convenient
development and maintenance of your Nix environment.

- **CI with Cachix**: The configuration includes continuous integration (CI)
that pushes built artifacts to [Cachix](https://github.com/cachix/cachix). This ensures efficient builds and
reduces the need to build dependencies on your local machine.

- **Utilize sops-nix**: Secret management with [sops-nix](https://github.com/Mic92/sops-nix) for secure and encrypted
handling of sensitive information.

## Customization

My Nix configuration, based on the [SnowfallOrg lib](https://github.com/snowfallorg/lib) structure, provides a
flexible and organized approach to managing your Nix environment. Here's how it
works:

- **Custom Library**: An optional custom library in the `lib/` directory
contains a Nix function called with `inputs`, `snowfall-inputs`, and `lib`.
The function should return an attribute set to merge with `lib`.

- **Modular Directory Structure**: You can create any (nestable) directory
structure within `lib/`, `packages/`, `modules/`, `overlays/`, `systems/`, and
`homes/`. Each directory should contain a Nix function that returns an
attribute set to merge with the corresponding section.

- **Package Overlays**: The `packages/` directory includes an optional set of
packages to export. Each package is instantiated with `callPackage`, and the
files should contain functions that take an attribute set of packages and the
required `lib` to return a derivation.

- **Modules for Configuration**: In the `modules/` directory, you can define
NixOS modules for various platforms, such as `nixos`, `darwin`, and `home`.
This modular approach simplifies system configuration management.

- **Custom Overlays**: The `overlays/` directory is for optional custom
overlays. Each overlay file should contain a function that takes three
arguments: an attribute set of your flake's inputs and a `channels` attribute
containing all available channels, the final set of `pkgs`, and the previous
set of `pkgs`. This allows you to customize package sets effectively.

- **System Configurations**: The `systems/` directory organizes system
configurations based on architecture and format. You can create configurations
for different architectures and formats, such as `x86_64-linux`,
`aarch64-darwin`, and more.

- **Home Configurations**: Similar to system configurations, the `homes/`
directory organizes home configurations based on architecture and format. This
is especially useful if you want to manage home environments with Nix.

This structured approach to Nix configuration makes it easier to manage and
customize your Nix environment while maintaining flexibility and modularity.

# Exported packages

Run packages directly with:

```console
nix run github:khaneliman/khanelinix#packageName
```

Or install from the `packages` output. For example:

```nix
# flake.nix
{
inputs.khanelinix = {
url = "github:khaneliman/khanelinix";
inputs.nixpkgs.follows = "nixpkgs";
};
}

# configuration.nix
{pkgs, inputs, system, ...}: {
environment.systemPackages = [
inputs.khanelinix.packages."${system}".packageName
];
}
```

# Screenshots

## MacOS
image

## NixOS
![image](https://github.com/khaneliman/khanelinix/assets/1778670/34aebc9c-b053-4ccf-9540-6da5e93a77d5)

# Resources

Other configurations from where I learned and copied:

- [JakeHamilton/config](https://github.com/jakehamilton/config) *Main inspiration and started with
- [FelixKrats/dotfiles](https://github.com/FelixKratz/dotfiles) *Sketchybar design and implementation
- [Fufexan/dotfiles](https://github.com/fufexan/dotfiles)
- [NotAShelf/nyx](https://github.com/NotAShelf/nyx)