-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
63 lines (57 loc) · 1.69 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
57
58
59
60
61
62
63
{
description = "Flake for development of the civ R package";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
# Install local version of civ
civ = pkgs.rPackages.buildRPackage {
name = "civ";
src = ./.;
# civ dependencies
propagatedBuildInputs = with pkgs.rPackages; [AER kcmeans];
};
# Fetch kcmeans package from GitHub (until it's on CRAN)
kcmeans = pkgs.rPackages.buildRPackage {
name = "kcmeans";
src = pkgs.fetchFromGitHub {
owner = "thomaswiemann";
repo = "kcmeans";
rev = "62958b74175e46f59d99b554746f56c77031c8e4";
sha256 = "iqEhb8NTcnF2IlqSBdHmBI43qOwuSgpfT44C6Ts92Nk=";
};
# kcmeans dependencies
propagatedBuildInputs = with pkgs.rPackages; [Ckmeans_1d_dp MASS Matrix];
};
# R packages
my-R-packages = with pkgs.rPackages; [
# this package
civ
# general develppment packages
devtools
pkgdown
testthat
covr
knitr
markdown
rmarkdown
# add other dependencies below
AER
kcmeans
# dependencies for vignettes only:
hdm
ranger
];
my-R = [pkgs.R my-R-packages];
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.bashInteractive ];
buildInputs = [
my-R
pkgs.rstudio
pkgs.quarto # needed for rstudio
];
};
});
}