blob: 66e350f9449a373c5faf6cc62a8a0a52522075cc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# vim: ft=nix :
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils/main";
nix-filter.url = "github:numtide/nix-filter/main";
cq = {
url = "github:vinszent/cq-flake/main";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
description = "clef: kicad shared data and utils";
outputs = { self, nixpkgs, flake-utils, ... } @ inputs: (flake-utils.lib.eachDefaultSystem (system: {
packages = let
pkgs = import nixpkgs {
inherit system;
overlays = with self.overlays; [
kicad
nix-filter
];
};
clef = pkgs.callPackage ./nix;
in {
inherit clef;
default = clef;
};
devShells.default = let
pkgs = import nixpkgs {
inherit system;
overlays = with self.overlays; [
kicad
];
};
in pkgs.mkShell {
name = "devshell";
version = self.rev or "dirty";
packages = with pkgs; [
kicad
kikit
];
};
}
)) // {
overlays = let
base = (import ./overlays.nix { inherit inputs; });
in base // {
# clef built against its own nixpkgs import with its required overlay
# deps (cadquery, kicad, occt).
#
# _This will cause another evaluation of nixpkgs_, which is generally
# undesirable. However, this provides for the most hassle-free way to
# use clef, as you don't need to include all of the overlay dependencies
# in your nixpkgs.
default = final: prev: {
clef = self.packages.${prev.system}.default;
};
# No overlay dependencies included -- clef will not work by default.
# You can replicate overlays.default with:
#
# import nixpkgs { overlays = with clef.overlays; [ freestanding kicad nix-filter ]; }
#
# Assuming you've pinned clef's nixpkgs to the same version as yours.
# This functionality is provided to give you an option
freestanding = final: prev: {
clef = prev.callPackage ./nix;
};
};
};
}
|