- Drop x86_64-darwin; nixpkgs 26.11 no longer supports it. - Expose only packages available on each system (mem0 is Linux-only) and mark rofi-project-opener Linux-only. - mem0: use posthog without its test suite; nixpkgs marks it broken only because the tests fail with mcp >= 2. - devops shell: build fabric with invoke 3 so azure-cli evaluates; nixpkgs marks it broken over its invoke<3 pin and failing tests. - Update flake inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
153 lines
4.7 KiB
Nix
153 lines
4.7 KiB
Nix
{
|
|
description = "m3ta's personal Nix repository - Custom packages, overlays, and modules";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
|
|
|
|
basecamp = {
|
|
url = "github:basecamp/basecamp-cli/v0.9.0";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
opencode.url = "github:anomalyco/opencode/dev";
|
|
|
|
buzz = {
|
|
url = "github:mulatta/buzz.nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# Agent definitions and coding rules
|
|
agents = {
|
|
url = "git+https://code.m3ta.dev/m3tam3re/AGENTS";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
...
|
|
} @ inputs: let
|
|
# Supported systems
|
|
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"];
|
|
|
|
# Helper function to generate an attrset for each of the systems
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
|
|
# Only expose packages whose meta.platforms include the system
|
|
# (e.g. mem0 is Linux-only), so `nix flake check --all-systems` passes.
|
|
supportedOn = pkgs:
|
|
nixpkgs.lib.filterAttrs (_: nixpkgs.lib.meta.availableOn pkgs.stdenv.hostPlatform);
|
|
|
|
# Helper to create pkgs for a given system
|
|
pkgsFor = system:
|
|
import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
overlays = [fabricInvoke3];
|
|
};
|
|
|
|
# nixpkgs marks fabric broken: it pins invoke<3 and its tests fail with
|
|
# invoke 3, but the library imports and connects fine. Needed by
|
|
# azure-cli in the devops shell.
|
|
fabricInvoke3 = _: prev: {
|
|
pythonPackagesExtensions =
|
|
prev.pythonPackagesExtensions
|
|
++ [
|
|
(_: pyPrev: {
|
|
fabric = pyPrev.fabric.overridePythonAttrs (old: {
|
|
doCheck = false;
|
|
pythonRelaxDeps = ["invoke"];
|
|
meta = old.meta // {broken = false;};
|
|
});
|
|
})
|
|
];
|
|
};
|
|
in {
|
|
# Custom packages - accessible via 'nix build .#package-name'
|
|
packages = forAllSystems (system: let
|
|
pkgs = pkgsFor system;
|
|
in
|
|
supportedOn pkgs (import ./pkgs {inherit pkgs inputs;}));
|
|
|
|
# Overlays - can be imported in your system configuration
|
|
overlays = import ./overlays {inherit inputs;};
|
|
|
|
# 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;
|
|
opencode = import ./modules/home-manager/coding/opencode.nix;
|
|
agents = import ./modules/home-manager/coding/agents;
|
|
zellij-ps = import ./modules/home-manager/zellij-ps.nix;
|
|
};
|
|
|
|
# Library functions - helper utilities for your configuration
|
|
lib = forAllSystems (system: import ./lib {lib = nixpkgs.lib;});
|
|
|
|
# Development shells for various programming environments
|
|
# Usage: nix develop .#<shell-name>
|
|
# Available shells: default, python, devops, coding
|
|
devShells = forAllSystems (system: let
|
|
pkgs = pkgsFor system;
|
|
in
|
|
import ./shells {
|
|
inherit pkgs inputs;
|
|
agents = inputs.agents;
|
|
});
|
|
|
|
# Formatter for 'nix fmt'
|
|
formatter = forAllSystems (system: (pkgsFor system).alejandra);
|
|
|
|
# Checks for 'nix flake check' - verifies all packages build
|
|
checks = forAllSystems (system: let
|
|
pkgs = pkgsFor system;
|
|
packages = supportedOn pkgs (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
|
|
'';
|
|
n8n-overlay = import ./tests/n8n-overlay-test.nix {
|
|
inherit pkgs inputs self;
|
|
};
|
|
# Lib unit tests
|
|
lib-agents = import ./tests/lib/agents-test.nix {
|
|
inherit pkgs;
|
|
lib = pkgs.lib;
|
|
};
|
|
lib-coding-rules = import ./tests/lib/coding-rules-test.nix {
|
|
inherit pkgs;
|
|
lib = pkgs.lib;
|
|
};
|
|
});
|
|
|
|
# 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";
|
|
};
|
|
};
|
|
};
|
|
}
|