2025-10-04 15:53:48 +02:00
|
|
|
{
|
2026-02-13 06:54:31 +01:00
|
|
|
description = "m3ta's personal Nix repository - Custom packages, overlays, and modules";
|
2025-10-04 15:53:48 +02:00
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2026-02-12 19:42:11 +01:00
|
|
|
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
|
2025-10-04 15:53:48 +02:00
|
|
|
|
2026-02-12 19:42:11 +01:00
|
|
|
# opencode needs newer bun from master
|
|
|
|
|
opencode = {
|
2026-02-13 06:54:31 +01:00
|
|
|
url = "github:anomalyco/opencode/v1.1.65";
|
2026-02-12 19:42:11 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs-master";
|
2025-10-04 15:53:48 +02:00
|
|
|
};
|
|
|
|
|
};
|
2026-02-12 19:42:11 +01:00
|
|
|
|
2026-02-13 06:54:31 +01:00
|
|
|
outputs = {
|
|
|
|
|
self,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
...
|
|
|
|
|
} @ inputs: let
|
|
|
|
|
# Supported systems
|
|
|
|
|
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
|
2026-02-12 19:42:11 +01:00
|
|
|
|
2026-02-13 06:54:31 +01:00
|
|
|
# Helper function to generate an attrset for each of the systems
|
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
2026-02-12 19:42:11 +01:00
|
|
|
|
2026-02-13 06:54:31 +01:00
|
|
|
# Helper to create pkgs for a given system
|
|
|
|
|
pkgsFor = system:
|
|
|
|
|
import nixpkgs {
|
|
|
|
|
inherit system;
|
|
|
|
|
config.allowUnfree = true;
|
2026-02-12 19:42:11 +01:00
|
|
|
};
|
2026-02-13 06:54:31 +01:00
|
|
|
in {
|
|
|
|
|
# Custom packages - accessible via 'nix build .#package-name'
|
|
|
|
|
packages = forAllSystems (system: let
|
|
|
|
|
pkgs = pkgsFor system;
|
|
|
|
|
in
|
|
|
|
|
import ./pkgs {inherit pkgs inputs;});
|
2026-02-12 19:42:11 +01:00
|
|
|
|
2026-02-13 06:54:31 +01:00
|
|
|
# Overlays - can be imported in your system configuration
|
|
|
|
|
overlays = {
|
|
|
|
|
# Default overlay: adds all custom packages
|
|
|
|
|
default = final: prev:
|
|
|
|
|
import ./pkgs {
|
|
|
|
|
pkgs = final;
|
|
|
|
|
inputs = inputs;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Individual overlays for more granular control
|
|
|
|
|
additions = final: prev:
|
|
|
|
|
import ./pkgs {
|
|
|
|
|
pkgs = final;
|
|
|
|
|
inputs = inputs;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
mem0 = ./modules/nixos/mem0.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, python, devops
|
|
|
|
|
devShells = forAllSystems (system: let
|
|
|
|
|
pkgs = pkgsFor system;
|
|
|
|
|
in
|
|
|
|
|
import ./shells {inherit pkgs;});
|
|
|
|
|
|
|
|
|
|
# Formatter for 'nix fmt'
|
|
|
|
|
formatter = forAllSystems (system: (pkgsFor system).alejandra);
|
|
|
|
|
|
|
|
|
|
# Templates for creating new packages/modules
|
|
|
|
|
templates = {
|
|
|
|
|
package = {
|
|
|
|
|
path = ./templates/package;
|
|
|
|
|
description = "Template for a new package";
|
2026-02-12 19:42:11 +01:00
|
|
|
};
|
2026-02-13 06:54:31 +01:00
|
|
|
nixos-module = {
|
|
|
|
|
path = ./templates/nixos-module;
|
|
|
|
|
description = "Template for a new NixOS module";
|
2026-02-12 19:42:11 +01:00
|
|
|
};
|
2026-02-13 06:54:31 +01:00
|
|
|
home-manager-module = {
|
|
|
|
|
path = ./templates/home-manager-module;
|
|
|
|
|
description = "Template for a new Home Manager module";
|
2026-02-12 19:42:11 +01:00
|
|
|
};
|
|
|
|
|
};
|
2026-02-13 06:54:31 +01:00
|
|
|
};
|
2025-10-04 15:53:48 +02:00
|
|
|
}
|