-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: have a actually nix flake shell
Signed-off-by: Vincenzo Palazzo <[email protected]>
- Loading branch information
1 parent
5bbbed8
commit c431cda
Showing
2 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
''; | ||
}; | ||
}); | ||
} |