Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
{ pkgs ? import ./pkgs.nix }:
{
pkgs ? import ./pkgs.nix,
lib ? pkgs.lib
}:
let
manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
manifest = (lib.importTOML ./Cargo.toml).package;
in
pkgs.rustPlatform.buildRustPackage {
pname = manifest.name;
version = manifest.version;
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.cleanSource ./.;
src = lib.cleanSource ./.;

doCheck = true;
checkPhase = ''
runHook preCheck
cargoCheckHook
runHook postCheck
'';
}

meta = {
description = "Visualize your Nix flake.lock!";
homepage = "https://github.com/nikitawootten/flake-graph";
license = lib.licenses.mit;
maintainers = [ ];
mainProgram = manifest.name;
};
}
12 changes: 8 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

outputs = { self, nixpkgs }: let
outputs = { self, nixpkgs }: let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
# forEachSystem [ "x86_64-linux" ] (_: { example = true; }) -> { x86_64-linux.example = true }
forEachSystem = nixpkgs.lib.genAttrs systems;
in {
packages = forEachSystem (system: {
default = nixpkgs.legacyPackages.${system}.callPackage ./. { };
});
packages = forEachSystem (system:
let
flake-graph = nixpkgs.legacyPackages.${system}.callPackage ./. { };
in {
inherit flake-graph;
default = flake-graph;
});

checks = forEachSystem (system: {
# Build the default package, including tests
Expand Down
Loading