{ description = "skm: pin and update agent skills from git repos"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; outputs = { self, nixpkgs }: let systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); in { homeModules.default = import ./nix/module.nix self; packages = forAllSystems (pkgs: { skm = pkgs.buildGoModule { pname = "skm"; version = "0.1.0"; # Only the Go sources: path: inputs copy untracked dirs like .devenv too. src = pkgs.lib.fileset.toSource { root = ./.; fileset = pkgs.lib.fileset.unions [ ./go.mod ./go.sum ./cmd ./internal ]; }; # Update after changing go.mod: set to lib.fakeHash, build, copy the "got" hash. vendorHash = "sha256-rTR/1l7HFUL8Eh2LA1JdkrfBxnJdwwyKp094QL2KMzg="; # Tests that need nix skip themselves: it isn't on PATH in the sandbox. nativeCheckInputs = [ pkgs.git ]; nativeBuildInputs = [ pkgs.makeWrapper ]; # nix itself comes from the system, so it matches the daemon. postInstall = '' wrapProgram $out/bin/skm --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.diffutils ]} ''; meta.mainProgram = "skm"; }; default = self.packages.${pkgs.stdenv.hostPlatform.system}.skm; }); devShells = forAllSystems (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ go gopls git ]; }; }); checks = forAllSystems (pkgs: { skm = self.packages.${pkgs.stdenv.hostPlatform.system}.skm; }); }; }