Files
nixos-core/flake.nix
T
kiskaadee c78550abea feat(provenance): implement two-axis inspection engine and bounded upstream resolver
- Implement scripts/provenance.py evaluating local deployment checkout state independently from upstream software provenance.
- Add bounded git ls-remote provenance resolver with 10s timeout to prevent hanging on unresponsive remotes during --fetch.
- Add 10 unit tests in tests/unit/test_provenance.py covering clean/dirty detection, synced vs update-available states, timeout handling, and unreachable remotes.
- Include git in test-suite nativeBuildInputs in flake.nix for hermetic sandbox execution.
- Update todo.txt marking Tasks 3, 4, & 5 of Milestone P3 completed.
2026-10-14 13:41:17 -05:00

63 lines
1.4 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
]))
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
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/
'';
};
};
}