Skip to content

Commit

Permalink
duckdb in manual management (#318)
Browse files Browse the repository at this point in the history
This pull request introduces support for DuckDB in the Nix
configuration, including adding a new module for DuckDB and updating
relevant package lists.

### DuckDB Support:

* Added DuckDB module configuration in `modules/duckdb.nix`, including
platform-specific handling and fetch URL setup.
* Included `duckdb.nix` in the common modules list in
`modules/common.nix`.
* Removed `pkgs.duckdb` from the `home.packages` list in
`modules/misc.nix` to avoid redundancy.
  • Loading branch information
d-issy authored Oct 5, 2024
1 parent 3da37d7 commit 72b98d8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 7 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions modules/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
./aws.nix
./bat.nix
./bottom.nix
./duckdb.nix
./delta.nix
./difftastic.nix
./eza.nix
Expand Down
38 changes: 38 additions & 0 deletions modules/duckdb.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ config, pkgs, ... }:

let
version = "1.1.1";

platform =
if pkgs.stdenv.isDarwin then "osx-universal"
else if pkgs.stdenv.system == "x86_64-linux" then "linux-amd64"
else if pkgs.stdenv.system == "aarch64-linux" then "linux-aarch64"
else throw "Unsupported platform";

hashs = {
"linux-amd64" = "7f3f1a26e98b3f1fcc673ffb81d2daf43c07689ed60e88173d6a4fd307f118ae";
"linux-aarch64" = "9e1d2183453451050f6151bffb2425b78aa278f98acaca68a2671e36a9583be7";
"osx-universal" = "d6db79a6651ad6b0a35bb11fe9affdac9758ebef7b61b8e3f3f6a5a66fb4bf56";
};

duckdb = pkgs.stdenv.mkDerivation {
name = "duckdb";
src = pkgs.fetchurl {
url = "https://github.com/duckdb/duckdb/releases/download/v${version}/duckdb_cli-${platform}.zip";
sha256 = hashs.${platform};
};
buildInputs = [ pkgs.unzip ];

unpackPhase = ''
mkdir -p $out/bin
unzip $src -d $out/bin
'';

installPhase = ''
chmod +x $out/bin/duckdb
'';
};
in
{
home.packages = [ duckdb ];
}
1 change: 0 additions & 1 deletion modules/misc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
home.packages = [
pkgs.curl
pkgs.devbox
pkgs.duckdb
pkgs.glow
pkgs.gnumake
pkgs.grpcurl
Expand Down

0 comments on commit 72b98d8

Please sign in to comment.