Skip to content

Commit

Permalink
style(treefmt-nix): Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
haruki7049 committed Oct 20, 2024
1 parent 001bbf6 commit d138ecd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
17 changes: 11 additions & 6 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ let
lib = super.lib;
fetchurl = super.fetchurl;
rpath = super.lib.makeLibraryPath [ super.pkgs.gcc-unwrapped ];
mkBinaryInstall = { pname ? "surrealdb", version, url, sha256 }:
mkBinaryInstall =
{
pname ? "surrealdb",
version,
url,
sha256,
}:
super.stdenv.mkDerivation rec {
inherit pname version;

Expand All @@ -26,19 +32,18 @@ let
'';

meta = with lib; {
description =
"A scalable, distributed, collaborative, document-graph database, for the realtime web";
description = "A scalable, distributed, collaborative, document-graph database, for the realtime web";
homepage = "https://surrealdb.com/";
mainProgram = "surreal";
license = licenses.bsl11;
};
};
in {
in
{
surrealdb = {
"1.4.2" = mkBinaryInstall {
version = "1.4.2";
url =
"https://github.com/surrealdb/surrealdb/releases/download/v1.4.2/surreal-v1.4.2.linux-arm64.tgz";
url = "https://github.com/surrealdb/surrealdb/releases/download/v1.4.2/surreal-v1.4.2.linux-arm64.tgz";
sha256 = "0xdaz8gy787rf3f3frk7czkdi1fyy5d24xip9lsnx7d88s02slw6";
};
};
Expand Down
7 changes: 5 additions & 2 deletions example/v1.4.2.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{ pkgs ? import <nixpkgs> { inherit overlays; }
, overlays ? [ (import ../default.nix) ], mkShell ? pkgs.mkShell }:
{
pkgs ? import <nixpkgs> { inherit overlays; },
overlays ? [ (import ../default.nix) ],
mkShell ? pkgs.mkShell,
}:

mkShell { packages = [ pkgs.surrealdb."1.4.2" ]; }
8 changes: 4 additions & 4 deletions flake.lock

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

24 changes: 13 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "An overlay for Godot";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
Expand All @@ -18,17 +18,19 @@
inputs.treefmt-nix.flakeModule
];

perSystem = { pkgs, ... }: {
treefmt = {
projectRootFile = "treefmt.nix";
programs.nixfmt.enable = true;
};
perSystem =
{ pkgs, ... }:
{
treefmt = {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
};

devShells.default = pkgs.mkShell {
packages = [
pkgs.nil
];
devShells.default = pkgs.mkShell {
packages = [
pkgs.nil
];
};
};
};
};
}

0 comments on commit d138ecd

Please sign in to comment.