5.4 KiB
5.4 KiB
m3ta-nixpkgs
My personal Nix repository containing custom packages, overlays, NixOS modules, and Home Manager modules.
Features
- 🎁 Custom Packages: Collection of personal Nix packages
- 🔄 Overlays: Package modifications and enhancements
- ⚙️ NixOS Modules: System-level configuration modules
- 🏠 Home Manager Modules: User-level configuration modules
- ❄️ Flakes Only: Modern Nix flakes support (no channels)
Repository Structure
m3ta-nixpkgs/
├── flake.nix # Main flake configuration
├── pkgs/ # Custom packages
│ ├── default.nix # Package registry
│ ├── code2prompt/
│ ├── hyprpaper-random/
│ ├── launch-webapp/
│ ├── msty-studio/
│ ├── pomodoro-timer/
│ ├── tuxedo-backlight/
│ └── zellij-ps/
├── overlays/ # Overlays
│ ├── default.nix
│ └── mods/ # Package modifications
│ ├── default.nix
│ └── n8n.nix
├── modules/
│ ├── nixos/ # NixOS modules
│ │ └── default.nix
│ └── home-manager/ # Home Manager modules
│ ├── default.nix
│ └── zellij-ps.nix
└── templates/ # Templates for new packages/modules
Usage
Adding to Your Flake
Add this repository to your flake inputs:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
m3ta-nixpkgs.url = "git+https://code.m3ta.dev/m3tam3re/nixpkgs";
};
}
Using Packages in NixOS Configuration
Method 1: Using the Overlay
{
nixpkgs.overlays = [
inputs.m3ta-nixpkgs.overlays.default
];
environment.systemPackages = with pkgs; [
code2prompt
hyprpaper-random
msty-studio
# ... any other custom packages
];
}
Method 2: Direct Package Reference
{
environment.systemPackages = [
inputs.m3ta-nixpkgs.packages.${system}.code2prompt
inputs.m3ta-nixpkgs.packages.${system}.hyprpaper-random
];
}
Using in Home Manager
With Overlay
{
nixpkgs.overlays = [
inputs.m3ta-nixpkgs.overlays.default
];
home.packages = with pkgs; [
zellij-ps
pomodoro-timer
];
}
With Home Manager Modules
{
imports = [
inputs.m3ta-nixpkgs.homeManagerModules.default
# Or specific modules:
# inputs.m3ta-nixpkgs.homeManagerModules.zellij-ps
];
# Module-specific configuration here
}
Using NixOS Modules
{
imports = [
inputs.m3ta-nixpkgs.nixosModules.default
];
# Your custom module options will be available here
}
Building Packages Directly
# Build a specific package
nix build git+https://code.m3ta.dev/m3tam3re/nixpkgs#code2prompt
# Run a package without installing
nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#zellij-ps
# Install to your profile
nix profile install git+https://code.m3ta.dev/m3tam3re/nixpkgs#msty-studio
# List all available packages
nix flake show git+https://code.m3ta.dev/m3tam3re/nixpkgs
Development
Setting Up Development Environment
# Clone the repository
git clone https://code.m3ta.dev/m3tam3re/nixpkgs
cd m3ta-nixpkgs
# Enter development shell
nix develop
# Check flake validity
nix flake check
# Format code
nix fmt
Adding a New Package
- Create a new directory under
pkgs/
:
mkdir pkgs/my-package
- Create
pkgs/my-package/default.nix
:
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "my-package";
version = "1.0.0";
src = fetchFromGitHub {
owner = "owner";
repo = "repo";
rev = "v${version}";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
meta = with lib; {
description = "Description of my package";
homepage = "https://github.com/owner/repo";
license = licenses.mit;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
}
- Add to
pkgs/default.nix
:
{
# ... existing packages ...
my-package = pkgs.callPackage ./my-package {};
}
Adding a New NixOS Module
- Create
modules/nixos/my-module.nix
- Add import to
modules/nixos/default.nix
- Update
flake.nix
to expose it:
nixosModules = {
default = ./modules/nixos;
my-module = ./modules/nixos/my-module.nix;
};
Adding a New Home Manager Module
- Create
modules/home-manager/my-module.nix
- Add to
modules/home-manager/default.nix
- Update
flake.nix
to expose it:
homeManagerModules = {
default = import ./modules/home-manager;
my-module = import ./modules/home-manager/my-module.nix;
};
Available Packages
Package | Description |
---|---|
code2prompt |
Convert code to prompts |
hyprpaper-random |
Random wallpaper setter for Hyprpaper |
launch-webapp |
Launch web applications |
msty-studio |
Msty Studio application |
pomodoro-timer |
Pomodoro timer utility |
tuxedo-backlight |
Backlight control for Tuxedo laptops |
zellij-ps |
Process viewer for Zellij |
License
Individual packages may have their own licenses. Check each package's meta.license
attribute.