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

Fix CRAN submission erros, some chores #4

Merged
merged 6 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
chore(dev): re-configure Nix environment
- All important Nix expressions are now under `./nix/default.nix`.
- Switched from telos.nix to vanilla nixpkgs (branch `release-22.11`).
  • Loading branch information
vst committed Dec 6, 2022
commit be8b5e4321ab339bb95ecff76c73a4ca0a4a6819
54 changes: 46 additions & 8 deletions nix/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,57 @@
{ compiler ? "ghc90"
, ...
{ ...
}:

let
## Import sources:
sources = import ./sources.nix;

## Import telosnix:
telosnix = import sources.telosnix { };

## Import nixpkgs:
pkgs = import telosnix.pkgs-sources.unstable { };
pkgs = import sources.nixpkgs { };

## Define R package dependencies:
rDeps = with pkgs.rPackages; {
## Dependencies for our package:
pkg = [
mvtnorm
tseries
];

## Dependencies for development:
dev = [
devtools
roxygen2
spelling
testthat
];
};

## Setup R environment:
r = pkgs.rWrapper.override {
packages = rDeps.pkg ++ rDeps.dev;
};

## Setup development shell:
shell = pkgs.mkShell
{
buildInputs = [
## Fancy stuff:
pkgs.figlet
pkgs.lolcat

## TeX stuff:
pkgs.texlive.combined.scheme-full

## R:
r
];

shellHook = ''
figlet -w 999 "mgarchBEKK DEV SHELL" | lolcat -S 42
'';
};
in
{
sources = sources;
telosnix = telosnix;
pkgs = pkgs;
r = r;
shell = shell;
}
18 changes: 9 additions & 9 deletions nix/sources.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"telosnix": {
"branch": "v0.0.4",
"description": null,
"homepage": null,
"owner": "telostat",
"repo": "telos.nix",
"rev": "4d45ee0f57fb6979781b726cdf87eb68f4ef672d",
"sha256": "0my9pmbvyfpj3n747zmwhl6fk8mhnmirl18zmlpy29g1pcd891k2",
"nixpkgs": {
"branch": "release-22.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "52e3e80afff4b16ccb7c52e9f0f5220552f03d04",
"sha256": "0x0pc4qm0adsdbr8n20ghl7byq9n0bvj9fjiiqzp9839cippp9hn",
"type": "tarball",
"url": "https://github.com/telostat/telos.nix/archive/4d45ee0f57fb6979781b726cdf87eb68f4ef672d.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/52e3e80afff4b16ccb7c52e9f0f5220552f03d04.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
31 changes: 1 addition & 30 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,5 @@
let
## Import this codebase's Nix helper set:
nix = import ./nix { };

## Get packages:
pkgs = nix.pkgs;

## R environment:
r = pkgs.rWrapper.override {
packages = with pkgs.rPackages; [
devtools
mvtnorm
roxygen2
spelling
testthat
tseries
];
};
in
pkgs.mkShell {
buildInputs = [
## Fancy stuff:
pkgs.figlet
pkgs.lolcat

## Development:
pkgs.texlive.combined.scheme-full
r
];

shellHook = ''
figlet -w 999 "mgarchBEKK DEV SHELL" | lolcat -S 42
'';
}
nix.shell