Skip to content

Commit 9f1e575

Browse files
authored
Merge pull request #36 from mattpolzin/modernize
update indexed dependency and modernize nix stuff a bit
2 parents e4faae7 + 5a55cd2 commit 9f1e575

File tree

7 files changed

+1086
-136
lines changed

7 files changed

+1086
-136
lines changed

.github/workflows/nix.yml

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ jobs:
1111
- name: Checkout
1212
uses: actions/checkout@v3
1313
- uses: cachix/install-nix-action@v18
14+
with:
15+
extra_nix_config: |
16+
extra-trusted-public-keys = gh-nix-idris2-packages.cachix.org-1:iOqSB5DrESFT+3A1iNzErgB68IDG8BrHLbLkhztOXfo=
17+
extra-substituters = https://gh-nix-idris2-packages.cachix.org
18+
nix_path: nixpkgs=channel:nixos-unstable
1419
- name: Update example flake file
1520
env:
1621
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ IDRIS2 ?= idris2
33
# system libncurses version:
44
NCURSES_VERSION ?=
55
# indexed Idris package:
6-
INDEXED_VERSION = 0.0.9
6+
INDEXED_VERSION = 0.0.10
77
# install in the local depends directory by default:
88
INDEXED_INSTALL_LOCATION ?= ./depends
99

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{ buildIdris, ncurses-idris }:
2+
(buildIdris {
3+
ipkgName = "control_curses_ticker";
4+
version = "0.0.1";
5+
src = ./.;
6+
idrisLibraries = [ ncurses-idris ];
7+
}).executable

examples/control_curses_ticker/flake.nix

+3-38
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,15 @@
33

44
inputs = {
55
flake-utils.url = "github:numtide/flake-utils";
6-
idris2 = {
7-
url = "github:idris-lang/idris2/main";
8-
inputs.nixpkgs.follows = "nixpkgs";
9-
};
10-
ncurses-idris = {
11-
url = "github:mattpolzin/ncurses-idris/main";
12-
inputs.nixpkgs.follows = "nixpkgs";
13-
inputs.idris2.follows = "idris2";
14-
};
6+
ncurses-idris.url = "github:mattpolzin/ncurses-idris/main";
157
};
168

17-
outputs = { self, nixpkgs, flake-utils, idris2, ncurses-idris }:
9+
outputs = { nixpkgs, flake-utils, ncurses-idris, ... }:
1810
flake-utils.lib.eachDefaultSystem (system:
1911
let pkgs = nixpkgs.legacyPackages.${system};
20-
inherit (pkgs) stdenv;
21-
idris2' = idris2.defaultPackage.${system};
2212
ncurses-idris' = ncurses-idris.packages.${system}.default;
23-
inherit (builtins) concatStringsSep;
2413
in rec {
25-
packages.control-curses-ticker = stdenv.mkDerivation rec {
26-
name = "control-curses-ticker";
27-
version = "0.0.1";
28-
src = ./.;
29-
idrisPackages = [ ncurses-idris' ] ++ ncurses-idris'.idrisPackages;
30-
buildInputs = [
31-
idris2'
32-
] ++ idrisPackages;
33-
34-
IDRIS2="${idris2'}/bin/idris2";
35-
IDRIS2_PACKAGE_PATH = concatStringsSep ":" (map (p: "${p}/idris2-${idris2'.version}") idrisPackages);
36-
37-
buildPhase = ''
38-
make clean
39-
make app
40-
'';
41-
42-
installPhase = ''
43-
rm ./build/exec/control_curses_ticker_app/compileChez
44-
rm ./build/exec/control_curses_ticker_app/control_curses_ticker.ss
45-
mkdir -p $out/bin/control_curses_ticker_app
46-
install ./build/exec/control_curses_ticker_app/* $out/bin/control_curses_ticker_app/
47-
install ./build/exec/control_curses_ticker $out/bin/
48-
'';
49-
};
14+
packages.control-curses-ticker = import ./. { inherit (pkgs) buildIdris; ncurses-idris = ncurses-idris'; };
5015
packages.default = packages.control-curses-ticker;
5116
apps.control-curses-ticker = flake-utils.lib.mkApp { drv = packages.control-curses-ticker; };
5217
apps.default = apps.control-curses-ticker;

0 commit comments

Comments
 (0)