Compare commits
6 Commits
678ba70af9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
0ecb3a5094
|
|||
|
f0ab1a403f
|
|||
|
d5082ae62c
|
|||
|
f5f60e7af5
|
|||
|
3a94fff521
|
|||
|
a39124bffc
|
@@ -1,2 +1,98 @@
|
||||
# obx-pkgs
|
||||
# Oceanbox Nixpkgs
|
||||
|
||||
`obx-pkgs` is the shared Oceanbox Nix overlay. It collects packages that we use
|
||||
across projects but that are either not in nixpkgs, are stuck on an outdated
|
||||
version, or need internal patches. Each project that consumes the overlay gets
|
||||
the same versions, the same fixes, and a single place to update them.
|
||||
|
||||
## Usage
|
||||
|
||||
### As an overlay on nixpkgs (recommended)
|
||||
|
||||
With `npins`:
|
||||
|
||||
```nix
|
||||
{
|
||||
sources ? import ./npins,
|
||||
pkgs ? import sources.nixpkgs {
|
||||
overlays = [ (import "${sources.obx-pkgs}/overlay.nix") ];
|
||||
},
|
||||
}:
|
||||
# pkgs.arcosparse, pkgs.openzl, pkgs.sphinx-shibuya-theme, ... are now available
|
||||
```
|
||||
|
||||
With `flakes`:
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs.obx-pkgs.url = "git+https://git.oceanbox.io/oceanbox/obx-pkgs";
|
||||
|
||||
outputs = { nixpkgs, obx-pkgs, ... }: {
|
||||
legacyPackages.x86_64-linux = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [ obx-pkgs.overlays.default ];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### As a standalone package set
|
||||
|
||||
```nix
|
||||
let
|
||||
obx = import sources.obx-pkgs { };
|
||||
in
|
||||
[ obx.copernicusmarine obx.sz3 ]
|
||||
```
|
||||
|
||||
Useful when you want one of our packages without modifying the rest
|
||||
of nixpkgs.
|
||||
|
||||
## Adding a package
|
||||
|
||||
```text
|
||||
by-name/
|
||||
<package-name>/
|
||||
default.nix
|
||||
```
|
||||
|
||||
`default.nix` is a regular `callPackage` function, the same shape you would
|
||||
write for nixpkgs:
|
||||
|
||||
```nix
|
||||
{ stdenv, fetchFromGitHub, ... }:
|
||||
stdenv.mkDerivation { ... }
|
||||
```
|
||||
|
||||
Cross-references between our own packages work via the standard argument syntax
|
||||
name the dependency in the argument list (e.g. `arcosparse`) and the overlay's
|
||||
`self.callPackage` injects it.
|
||||
|
||||
Once the directory exists it is picked up automatically
|
||||
|
||||
## Development
|
||||
|
||||
```text
|
||||
nix-shell
|
||||
```
|
||||
|
||||
drops you into a shell with `npins`, `nix-init`, `nix-update`, and a
|
||||
pre-configured `treefmt`.
|
||||
|
||||
Format the tree:
|
||||
|
||||
```text
|
||||
treefmt
|
||||
```
|
||||
|
||||
Update a pin:
|
||||
|
||||
```text
|
||||
npins update nixpkgs
|
||||
```
|
||||
|
||||
Bump a package version:
|
||||
|
||||
```text
|
||||
nix-update -f . <package-name>
|
||||
```
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{ buildDotnetGlobalTool }:
|
||||
buildDotnetGlobalTool {
|
||||
pname = "fable";
|
||||
version = "4.24.0";
|
||||
nugetHash = "sha256-ERewWqfEyyZKpHFFALpMGJT0fDWywBYY5buU/wTZZTg=";
|
||||
meta.mainProgram = "fable";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ buildDotnetGlobalTool }:
|
||||
buildDotnetGlobalTool {
|
||||
pname = "fable";
|
||||
version = "4.29.0";
|
||||
nugetHash = "sha256-Eed1bb9heteWOWmv6NnXPzXbf3t218K/eHufwgtRuzI=";
|
||||
meta.mainProgram = "fable";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ buildDotnetGlobalTool }:
|
||||
buildDotnetGlobalTool {
|
||||
pname = "fsharp-analyzers";
|
||||
version = "0.35.0";
|
||||
nugetHash = "sha256-GxQR3Fq28cb+akNbzRTav9nhMtayN/0g2d1G6Ml+ck4=";
|
||||
meta.mainProgram = "fsharp-analyzers";
|
||||
}
|
||||
@@ -24,14 +24,13 @@ stdenv.mkDerivation {
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
zstd
|
||||
gsl
|
||||
]
|
||||
++ lib.optionals stdenv.cc.isClang [
|
||||
llvmPackages.openmp
|
||||
];
|
||||
buildInputs = [
|
||||
zstd
|
||||
gsl
|
||||
]
|
||||
++ lib.optionals stdenv.cc.isClang [
|
||||
llvmPackages.openmp
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
|
||||
@@ -5,6 +5,19 @@
|
||||
"name": "nixos-unstable",
|
||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre1004030.64c08a7ca051/nixexprs.tar.xz",
|
||||
"hash": "sha256-NpH8iEQ5JHv/BtUuzTEXUMDxPLetCDzIv4OxL8H7Kps="
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix"
|
||||
},
|
||||
"branch": "main",
|
||||
"submodules": false,
|
||||
"revision": "db947814a175b7ca6ded66e21383d938df01c227",
|
||||
"url": "https://github.com/numtide/treefmt-nix/archive/db947814a175b7ca6ded66e21383d938df01c227.tar.gz",
|
||||
"hash": "sha256-eynAfOmbmxJnkp7YewvCEbShNnnYJ9gLLqkzsYtBPeM="
|
||||
}
|
||||
},
|
||||
"version": 7
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
sources ? import ./npins,
|
||||
pkgs ? import sources.nixpkgs { },
|
||||
}:
|
||||
|
||||
let
|
||||
treefmt = pkgs.callPackage ./tools/treefmt.nix { inherit sources; };
|
||||
in
|
||||
pkgs.mkShellNoCC {
|
||||
packages = [
|
||||
pkgs.npins
|
||||
pkgs.nix-init
|
||||
pkgs.nixfmt-rfc-style
|
||||
pkgs.nix-update
|
||||
treefmt
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{ pkgs, sources, ... }:
|
||||
let
|
||||
treefmt-nix = import sources.treefmt-nix;
|
||||
in
|
||||
treefmt-nix.mkWrapper pkgs {
|
||||
projectRootFile = ".git/config";
|
||||
programs = {
|
||||
nixfmt.enable = true;
|
||||
deadnix.enable = true;
|
||||
statix = {
|
||||
enable = true;
|
||||
disabled-lints = [
|
||||
"manual_inherit_from"
|
||||
"repeated_keys"
|
||||
];
|
||||
};
|
||||
shellcheck.enable = true;
|
||||
};
|
||||
settings.global.excludes = [
|
||||
"npins/default.nix"
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user