Add flake
This commit is contained in:
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1746663147,
|
||||
"narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
64
flake.nix
Normal file
64
flake.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
description = "R development shell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
quarto = pkgs.quarto.overrideAttrs (oldAttrs: rec {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share
|
||||
|
||||
mv bin/* $out/bin
|
||||
mv share/* $out/share
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
in
|
||||
{
|
||||
devShells.x86_64-linux.default = pkgs.mkShell rec {
|
||||
name = "R_environment";
|
||||
buildInputs = with pkgs; [
|
||||
# Technical dependencies:
|
||||
R
|
||||
python312Packages.radian
|
||||
quarto
|
||||
rPackages.languageserver
|
||||
rPackages.lintr
|
||||
rPackages.styler
|
||||
rPackages.httpgd
|
||||
rPackages.crayon
|
||||
rPackages.cli
|
||||
|
||||
# Actual R packages needed for the project:
|
||||
rPackages.quarto
|
||||
rPackages.tidyverse
|
||||
rPackages.data_table
|
||||
rPackages.anytime
|
||||
rPackages.dbx
|
||||
rPackages.RMySQL
|
||||
rPackages.gamlss
|
||||
rPackages.forecast
|
||||
rPackages.tictoc
|
||||
|
||||
];
|
||||
|
||||
# Creating a symlink to the radian binary in the .bin directory is certainly not ideal. There is an isue on that: "https://github.com/REditorSupport/vscode-R/issues/1347"
|
||||
# But it is the best way to make it work for now I guess.
|
||||
shellHook = ''
|
||||
mkdir -p .bin
|
||||
ln -sf ${pkgs.python312Packages.radian}/bin/radian .bin/
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user