Skip to content

Commit

Permalink
meta: have a actually nix flake shell
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Nov 11, 2024
1 parent b05b54d commit d0ec048
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
61 changes: 61 additions & 0 deletions flake.lock

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

47 changes: 47 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
description = "BTCPay nix flake";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
dotnet-combined = (with pkgs.dotnetCorePackages;
combinePackages [ sdk_8_0 sdk_7_0 ]).overrideAttrs
(finalAttrs: previousAttrs: {
# This is needed to install workload in $HOME
# https://discourse.nixos.org/t/dotnet-maui-workload/20370/2

postBuild = (previousAttrs.postBuild or "") + ''
for i in $out/sdk/*
do
i=$(basename $i)
length=$(printf "%s" "$i" | wc -c)
substring=$(printf "%s" "$i" | cut -c 1-$(expr $length - 2))
i="$substring""00"
mkdir -p $out/metadata/workloads/''${i/-*}
touch $out/metadata/workloads/''${i/-*}/userlocal
done
'';
});
in rec {
packages = { dotnet = pkgs.dotnet-sdk; };

default = packages.dotnet;

DOTNET_ROOT = "${dotnet-combined}";

devShell = pkgs.mkShell {
buildInputs = with pkgs; [ dotnet-combined docker docker-compose ];

mkShellHook = ''
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
'';
};
});
}

0 comments on commit d0ec048

Please sign in to comment.