Files
nixos-core/flake.nix
T
kiskaadee 68c149d9af feat(core): codify platform genericism invariant and add pydantic dependency
- Add Architectural Invariant 8 (Platform Genericism & Domain Decoupling) to AGENTS.md
- Add pydantic to flake.nix, pyproject.toml, and scripts/test
- Update docs/plans/p4-readiness-plan.md for Pydantic v2 pipeline and genericism
- Synchronize todo.txt with completed security gate and prioritized P4 tasks
2026-10-15 02:08:30 -05:00

65 lines
1.5 KiB
Nix

{
description = "Homelab Core — Turnkey Declarative NixOS Appliance for roadtotech.me";
inputs = {
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, sops-nix, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
nixosConfigurations.server = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
./nixos/configuration.nix
sops-nix.nixosModules.sops
];
};
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
(python3.withPackages (ps: with ps; [
pyyaml
types-pyyaml
pytest
pydantic
]))
pyright
ruff
];
shellHook = ''
git config core.hooksPath .githooks 2>/dev/null || true
'';
};
checks.${system} = {
test-suite = pkgs.runCommand "core-tests" {
nativeBuildInputs = with pkgs; [
git
python3
python3Packages.pytest
python3Packages.pyyaml
python3Packages.pydantic
ruff
];
} ''
mkdir -p $out
cp -r ${self} source
chmod -R u+w source
cd source
HOME=/tmp ruff check --no-cache .
HOME=/tmp pytest -o cache_dir=/tmp/.pytest_cache tests/
'';
};
};
}