-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
44 lines (41 loc) · 1.05 KB
/
flake.nix
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
{
description = "Parametric version of the 3d printed cat ears often seen at CCC events.";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
name = "parametric-cat-ears";
packages.default = pkgs.stdenv.mkDerivation {
name = "cat-ears";
src = ./.;
nativeBuildInputs = [ pkgs.openscad ];
buildPhase = ''
openscad -o cat-ears.stl ./cat-ears.scad
'';
installPhase = ''
mkdir -p $out
cp cat-ears.stl $out/
'';
};
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.openscad
pkgs.llvmPackages_12.clang-tools # For formatting the scad file
];
};
formatter = pkgs.nixfmt-rfc-style;
}
);
}