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-03-27 11:56:04 +01:00
|
|
|
basecamp = {
|
2026-04-01 14:14:14 +02:00
|
|
|
url = "github:basecamp/basecamp-cli/v0.7.2";
|
2026-03-27 11:56:04 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-12 19:42:11 +01:00
|
|
|
# opencode needs newer bun from master
|
|
|
|
|
opencode = {
|
2026-04-13 17:35:08 +02:00
|
|
|
url = "github:anomalyco/opencode/v1.4.3";
|
2026-02-12 19:42:11 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs-master";
|
2025-10-04 15:53:48 +02:00
|
|
|
};
|
2026-02-18 17:54:20 +01:00
|
|
|
|
|
|
|
|
# openspec - spec-driven development for AI coding assistants
|
|
|
|
|
openspec = {
|
|
|
|
|
url = "github:Fission-AI/OpenSpec";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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;
|
2026-03-30 19:04:09 +02:00
|
|
|
opencode = import ./modules/home-manager/coding/opencode.nix;
|
2026-04-13 16:52:47 +02:00
|
|
|
agents = import ./modules/home-manager/coding/agents;
|
2026-02-13 06:54:31 +01:00
|
|
|
zellij-ps = import ./modules/home-manager/zellij-ps.nix;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Library functions - helper utilities for your configuration
|
2026-04-18 10:15:50 +00:00
|
|
|
lib = forAllSystems (system: import ./lib {lib = nixpkgs.lib;});
|
2026-02-13 06:54:31 +01:00
|
|
|
|
|
|
|
|
# Development shells for various programming environments
|
|
|
|
|
# Usage: nix develop .#<shell-name>
|
2026-02-17 20:16:11 +01:00
|
|
|
# Available shells: default, python, devops, opencode
|
2026-02-13 06:54:31 +01:00
|
|
|
devShells = forAllSystems (system: let
|
|
|
|
|
pkgs = pkgsFor system;
|
|
|
|
|
in
|
2026-02-17 20:16:11 +01:00
|
|
|
import ./shells {inherit pkgs inputs;});
|
2026-02-13 06:54:31 +01:00
|
|
|
|
|
|
|
|
# Formatter for 'nix fmt'
|
|
|
|
|
formatter = forAllSystems (system: (pkgsFor system).alejandra);
|
|
|
|
|
|
2026-02-14 07:15:06 +01:00
|
|
|
# Checks for 'nix flake check' - verifies all packages build
|
|
|
|
|
checks = forAllSystems (system: let
|
|
|
|
|
pkgs = pkgsFor system;
|
|
|
|
|
packages = import ./pkgs {inherit pkgs inputs;};
|
|
|
|
|
in
|
|
|
|
|
builtins.mapAttrs (name: pkg: pkgs.lib.hydraJob pkg) packages
|
|
|
|
|
// {
|
|
|
|
|
formatting = pkgs.runCommand "check-formatting" {} ''
|
|
|
|
|
${pkgs.alejandra}/bin/alejandra --check ${./.}
|
|
|
|
|
touch $out
|
|
|
|
|
'';
|
2026-04-18 10:15:50 +00:00
|
|
|
# Lib unit tests
|
|
|
|
|
lib-agents = import ./tests/lib/agents-test.nix;
|
|
|
|
|
lib-coding-rules = import ./tests/lib/coding-rules-test.nix;
|
2026-02-14 07:15:06 +01:00
|
|
|
});
|
|
|
|
|
|
2026-02-13 06:54:31 +01:00
|
|
|
# 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
|
|
|
}
|