-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
48 lines (45 loc) · 1.41 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
45
46
47
48
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in {
defaultPackage = pkgs.mkShell {
packages = with pkgs; [
gnumake
qmk
(writeShellScriptBin "setupSrc" ''
#! /usr/bin/env bash
ROOTDIR=$(git rev-parse --show-toplevel)
QMK_SRC="$ROOTDIR/qmk_firmware"
CRKBD="$QMK_SRC/keyboards/crkbd/"
if [[ ! -d "$QMK_SRC" ]]
then
echo "adding QMK src as a git submodule"
git submodule add -f https://github.com/qmk/qmk_firmware
git submodule update --init --recursive --progress
fi
if [[ ! -d "$CRKBD/keymaps/customkm" ]]
then
echo "Creating keyboard src symbolic link"
mkdir "$CRKBD/keymaps/customkm"
ln -r -s crkbd/* $CRKBD/keymaps/customkm/
fi
'')
(writeShellScriptBin "compileKeyboard" ''
#! /usr/bin/env bash
cd qmk_firmware
qmk compile -kb crkbd -km customkm
'')
(writeShellScriptBin "flashKeyboard" ''
#! /usr/bin/env bash
cd qmk_firmware
qmk flash -kb crkbd -km customkm
'')
];
};
});
}