forked from semickolon/fak-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
56 lines (53 loc) · 1.68 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
49
50
51
52
53
54
55
56
{
description = "fak";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
naersk.url = "github:nix-community/naersk";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
pkgs-unstable = import inputs.nixpkgs-unstable { inherit system; };
naersk = pkgs.callPackage inputs.naersk { };
wchisp = naersk.buildPackage rec {
pname = "wchisp";
version = "0.3-git";
src = pkgs.fetchFromGitHub {
owner = "ch32-rs";
repo = pname;
rev = "4b4787243ef9bc87cbbb0d95c7482b4f7c9838f1";
hash = "sha256-Ju2DBv3R4O48o8Fk/AFXOBIsvGMK9hJ8Ogxk47f7gcU=";
};
};
fak = pkgs.writeShellScriptBin "fak" ''
#!/usr/bin/env bash
DIR=$(pwd)
while [ ! -z "$DIR" ] && [ ! -f "$DIR/fak.py" ] && [ ! -f "$DIR/meson.build" ]; do
DIR="''${DIR%\/*}"
done
if [ -f "$DIR/fak.py" ]; then
python "$DIR/fak.py" $@
else
echo "Error: fak.py not found"
fi
'';
packages = with pkgs; [
fak
sdcc
pkgs-unstable.nickel
pkgs-unstable.nls
pkgs-unstable.topiary
meson
ninja
python311
];
in {
devShells = {
default = pkgs.mkShell { packages = packages ++ [ wchisp ]; };
container = pkgs.mkShell { inherit packages; };
};
});
}