Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update indexed dependency and modernize nix stuff a bit #36

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
with:
extra_nix_config: |
extra-trusted-public-keys = gh-nix-idris2-packages.cachix.org-1:iOqSB5DrESFT+3A1iNzErgB68IDG8BrHLbLkhztOXfo=
extra-substituters = https://gh-nix-idris2-packages.cachix.org
nix_path: nixpkgs=channel:nixos-unstable
- name: Update example flake file
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ IDRIS2 ?= idris2
# system libncurses version:
NCURSES_VERSION ?=
# indexed Idris package:
INDEXED_VERSION = 0.0.9
INDEXED_VERSION = 0.0.10
# install in the local depends directory by default:
INDEXED_INSTALL_LOCATION ?= ./depends

Expand Down
7 changes: 7 additions & 0 deletions examples/control_curses_ticker/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ buildIdris, ncurses-idris }:
(buildIdris {
ipkgName = "control_curses_ticker";
version = "0.0.1";
src = ./.;
idrisLibraries = [ ncurses-idris ];
}).executable
41 changes: 3 additions & 38 deletions examples/control_curses_ticker/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,15 @@

inputs = {
flake-utils.url = "github:numtide/flake-utils";
idris2 = {
url = "github:idris-lang/idris2/main";
inputs.nixpkgs.follows = "nixpkgs";
};
ncurses-idris = {
url = "github:mattpolzin/ncurses-idris/main";
inputs.nixpkgs.follows = "nixpkgs";
inputs.idris2.follows = "idris2";
};
ncurses-idris.url = "github:mattpolzin/ncurses-idris/main";
};

outputs = { self, nixpkgs, flake-utils, idris2, ncurses-idris }:
outputs = { nixpkgs, flake-utils, ncurses-idris, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) stdenv;
idris2' = idris2.defaultPackage.${system};
ncurses-idris' = ncurses-idris.packages.${system}.default;
inherit (builtins) concatStringsSep;
in rec {
packages.control-curses-ticker = stdenv.mkDerivation rec {
name = "control-curses-ticker";
version = "0.0.1";
src = ./.;
idrisPackages = [ ncurses-idris' ] ++ ncurses-idris'.idrisPackages;
buildInputs = [
idris2'
] ++ idrisPackages;

IDRIS2="${idris2'}/bin/idris2";
IDRIS2_PACKAGE_PATH = concatStringsSep ":" (map (p: "${p}/idris2-${idris2'.version}") idrisPackages);

buildPhase = ''
make clean
make app
'';

installPhase = ''
rm ./build/exec/control_curses_ticker_app/compileChez
rm ./build/exec/control_curses_ticker_app/control_curses_ticker.ss
mkdir -p $out/bin/control_curses_ticker_app
install ./build/exec/control_curses_ticker_app/* $out/bin/control_curses_ticker_app/
install ./build/exec/control_curses_ticker $out/bin/
'';
};
packages.control-curses-ticker = import ./. { inherit (pkgs) buildIdris; ncurses-idris = ncurses-idris'; };
packages.default = packages.control-curses-ticker;
apps.control-curses-ticker = flake-utils.lib.mkApp { drv = packages.control-curses-ticker; };
apps.default = apps.control-curses-ticker;
Expand Down
Loading
Loading