111 lines
2.9 KiB
Nix
111 lines
2.9 KiB
Nix
{
|
|
description = "m3ta's personal Nix repository - Custom packages, overlays, and modules";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
# Optional: Add stable channel if needed
|
|
# nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
...
|
|
} @ inputs: let
|
|
# Supported systems
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
|
|
# Helper function to generate an attrset for each system
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
|
|
# Helper to create pkgs for a given system
|
|
pkgsFor = system:
|
|
import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
in {
|
|
# Custom packages - accessible via 'nix build .#package-name'
|
|
packages = forAllSystems (
|
|
system: let
|
|
pkgs = pkgsFor system;
|
|
in
|
|
import ./pkgs {inherit pkgs;}
|
|
);
|
|
|
|
# Overlays - can be imported in your system configuration
|
|
overlays = {
|
|
# Default overlay: adds all custom packages
|
|
default = final: prev:
|
|
import ./pkgs {pkgs = final;};
|
|
|
|
# Individual overlays for more granular control
|
|
additions = final: prev:
|
|
import ./pkgs {pkgs = final;};
|
|
|
|
modifications = final: prev:
|
|
import ./overlays/mods {inherit prev;};
|
|
};
|
|
|
|
# NixOS modules - for system-level configuration
|
|
nixosModules = {
|
|
default = ./modules/nixos;
|
|
# Individual modules for selective imports
|
|
ports = ./modules/nixos/ports.nix;
|
|
};
|
|
|
|
# Home Manager modules - for user-level configuration
|
|
homeManagerModules = {
|
|
default = import ./modules/home-manager;
|
|
ports = import ./modules/home-manager/ports.nix;
|
|
zellij-ps = import ./modules/home-manager/zellij-ps.nix;
|
|
};
|
|
|
|
# Library functions - helper utilities for your configuration
|
|
lib = forAllSystems (
|
|
system: let
|
|
pkgs = pkgsFor system;
|
|
in
|
|
import ./lib {lib = pkgs.lib;}
|
|
);
|
|
|
|
# Development shells for various programming environments
|
|
# Usage: nix develop .#<shell-name>
|
|
# Available shells: default, rust, python, nodejs, go, cpp, web, devops, data-science
|
|
devShells = forAllSystems (
|
|
system: let
|
|
pkgs = pkgsFor system;
|
|
in
|
|
import ./shells {inherit pkgs;}
|
|
);
|
|
|
|
# Formatter for 'nix fmt'
|
|
formatter = forAllSystems (
|
|
system:
|
|
(pkgsFor system).nixpkgs-fmt
|
|
);
|
|
|
|
# Templates for creating new packages/modules
|
|
templates = {
|
|
package = {
|
|
path = ./templates/package;
|
|
description = "Template for a new package";
|
|
};
|
|
nixos-module = {
|
|
path = ./templates/nixos-module;
|
|
description = "Template for a new NixOS module";
|
|
};
|
|
home-manager-module = {
|
|
path = ./templates/home-manager-module;
|
|
description = "Template for a new Home Manager module";
|
|
};
|
|
};
|
|
};
|
|
}
|