-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
84 lines (77 loc) · 2 KB
/
flake.nix
File metadata and controls
84 lines (77 loc) · 2 KB
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
82
83
84
{
description = "Development Shell For this repository";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
qmk-git = {
url = "github:qmk/qmk_firmware/0.28.2";
flake = false;
};
};
outputs =
{
nixpkgs,
qmk-git,
... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
# TODO: i want to compile my keyboard using nix as a build system
devShells."${system}".default = pkgs.mkShell {
packages = with pkgs; [
keymapviz
qmk
];
shellHook = ''
echo 'Welcome to my keyboard development.'
keymapviz -k crkbd keymap.c
'';
};
packages."${system}".default = pkgs.stdenv.mkDerivation {
name = "corne";
# src = ./.;
srcs = [
( ./. )
( pkgs.fetchFromGitHub {
name = "qmk_firmware";
owner = "qmk";
repo = "qmk_firmware";
tag = "0.28.2";
hash = "sha256-mNySUNgB2rmY+TwSRIFAWj+W77dM27dkiGy0eznawkw=";
} )
];
sourceRoot = ".";
buildPhase = ''
pwd
ls -lah
# cp -r ${qmk-git} ./qmk_firmware
${pkgs.lib.getExe pkgs.tree} . | head -n 20
ls -lah ./qmk_firmware
mkdir -p testttt
# mkdir -p ./qmk_firmware/testttt
# mkdir -p ./qmk_firmware/keyboards/testttt
# cp -r ${./.} ./qmk_firmware/keyboards/crkbd/keymaps/osbm-config
# ${pkgs.lib.getExe pkgs.tree} . | head -n 20
mkdir -p $out
'';
buildInputs = [
pkgs.qmk
];
# buildPhase = ''
# qmk setup
# '';
};
};
}