mirror of
https://github.com/dwinkler1/np.git
synced 2026-02-19 22:40:57 -05:00
Moved to flake templates
This commit is contained in:
parent
0451e5cba4
commit
d1c00ee15c
5 changed files with 80 additions and 68 deletions
4
templates/r/Justfile
Normal file
4
templates/r/Justfile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
rverurl := 'https://raw.githubusercontent.com/ropensci/rix/refs/heads/main/inst/extdata/available_df.csv'
|
||||
update-r-version:
|
||||
RVER=$( wget -qO- {{rverurl}} | tail -n 2 | head -n 1 | cut -d',' -f4 | tr -d '"' ) &&\
|
||||
sed -i "s|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\.tar\.gz\";|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/$RVER.tar.gz\";|" flake.nix
|
||||
90
templates/r/flake.lock
generated
Normal file
90
templates/r/flake.lock
generated
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nCats": {
|
||||
"inputs": {
|
||||
"nixCats": "nixCats",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"plugins-r": "plugins-r",
|
||||
"rixpkgs": "rixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747269608,
|
||||
"narHash": "sha256-p6zniXPFJV5ImScTWStHWXcPYox7J7USFr/90u0x118=",
|
||||
"owner": "dwinkler1",
|
||||
"repo": "nixCatsConfig",
|
||||
"rev": "3c720b7789839fcac8bccf999a795cbd73c1bca2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "dwinkler1",
|
||||
"repo": "nixCatsConfig",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixCats": {
|
||||
"locked": {
|
||||
"lastModified": 1745981575,
|
||||
"narHash": "sha256-Q9PevfxZeO47fBd5ptGA4f+xJ8iC8jF/hsEVhRIOofo=",
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nixCats-nvim",
|
||||
"rev": "4cdecb9f07973fc0fe2d069d153bc9344db36791",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nixCats-nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1746525332,
|
||||
"narHash": "sha256-hnr+j3EeNt0An/+2N+7p7/UAfR3jWTaHSwHdr7K86aU=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-05.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-05.tar.gz"
|
||||
}
|
||||
},
|
||||
"plugins-r": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1746657805,
|
||||
"narHash": "sha256-X5ZfbrG7FtGJpnMJ2b7FMY/OM9rIIliFSqnbtudZCZg=",
|
||||
"owner": "R-nvim",
|
||||
"repo": "R.nvim",
|
||||
"rev": "f30c3b2be9ca1a3c277c5e66f5612774cc3fbcf4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "R-nvim",
|
||||
"repo": "R.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1746476429,
|
||||
"narHash": "sha256-KHNAOy8ILpIlz5rtwxURpcVOqbWRMoT/rXRgpy1pyG8=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nCats": "nCats",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
72
templates/r/flake.nix
Normal file
72
templates/r/flake.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
description = "Project Template";
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
url = "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-05.tar.gz";
|
||||
};
|
||||
nCats.url = "github:dwinkler1/nixCatsConfig";
|
||||
nCats.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
nCats,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
forSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
|
||||
in
|
||||
{
|
||||
packages = forSystems (
|
||||
system:
|
||||
let
|
||||
|
||||
inherit (nCats) utils;
|
||||
finalPackage = nCats.packages.${system}.default.override (prev: {
|
||||
categoryDefinitions = utils.mergeCatDefs prev.categoryDefinitions (
|
||||
{
|
||||
pkgs,
|
||||
settings,
|
||||
categories,
|
||||
name,
|
||||
extra,
|
||||
mkPlugin,
|
||||
...
|
||||
}@packageDef:
|
||||
let
|
||||
rpkgs = import ./rpkgs.nix pkgs;
|
||||
in
|
||||
{
|
||||
lspsAndRuntimeDeps.rdev = with pkgs; [
|
||||
(rWrapper.override {
|
||||
packages = rpkgs;
|
||||
})
|
||||
just
|
||||
wget
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
packageDefinitions = prev.packageDefinitions // {
|
||||
nixCats = utils.mergeCatDefs prev.packageDefinitions.nixCats (
|
||||
{ ... }:
|
||||
{
|
||||
settings = {
|
||||
suffix-path = false;
|
||||
suffix-LD = false;
|
||||
};
|
||||
categories = {
|
||||
rdev = true;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
});
|
||||
in
|
||||
# and
|
||||
utils.mkAllWithDefault finalPackage
|
||||
|
||||
);
|
||||
};
|
||||
}
|
||||
22
templates/r/rpkgs.nix
Normal file
22
templates/r/rpkgs.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
pkgs: with pkgs.rPackages; [
|
||||
languageserver
|
||||
fixest
|
||||
dplyr
|
||||
ggplot2
|
||||
(buildRPackage {
|
||||
name = "nvimcom";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "R-nvim";
|
||||
repo = "R.nvim";
|
||||
rev = "f30c3b2be9ca1a3c277c5e66f5612774cc3fbcf4";
|
||||
sha256 = "sha256-X5ZfbrG7FtGJpnMJ2b7FMY/OM9rIIliFSqnbtudZCZg=";
|
||||
};
|
||||
sourceRoot = "source/nvimcom";
|
||||
buildInputs = with pkgs; [
|
||||
R
|
||||
gcc
|
||||
gnumake
|
||||
];
|
||||
propagatedBuildInputs = [ ];
|
||||
})
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue