flake: add devShells
exposed via nix registry :D can be used in nix-direnv like `use flake shells#cs.osu`
This commit is contained in:
parent
8c75ba2a2d
commit
76b6f7cfb8
11 changed files with 283 additions and 0 deletions
37
flake.lock
generated
37
flake.lock
generated
|
|
@ -193,6 +193,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_4": {
|
||||
"locked": {
|
||||
"lastModified": 1623875721,
|
||||
"narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
|
@ -499,6 +514,7 @@
|
|||
"pure": "pure",
|
||||
"radialstatus": "radialstatus",
|
||||
"rolecolor-everywhere": "rolecolor-everywhere",
|
||||
"rust-overlay": "rust-overlay",
|
||||
"spotify-adblock": "spotify-adblock",
|
||||
"theme-toggler": "theme-toggler",
|
||||
"tokyonight": "tokyonight",
|
||||
|
|
@ -512,6 +528,27 @@
|
|||
"zsh-history-substring-search": "zsh-history-substring-search"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1637115307,
|
||||
"narHash": "sha256-G+RKZeE1yLrnq+ExHF+HnSJsT+QJWebGhssgZHz3B00=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "8a2e5fa870df3d34667d28fb3383d19516d182e4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"spotify-adblock": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@
|
|||
tree-sitter-glimmer = { url = "github:alexlafroscia/tree-sitter-glimmer"; flake = false; };
|
||||
tree-sitter-jsonc = { url = "gitlab:WhyNotHugo/tree-sitter-jsonc"; flake = false; };
|
||||
|
||||
# shells
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# powercord plugins/themes
|
||||
better-status-indicators = { url = "github:griefmodz/better-status-indicators"; flake = false; };
|
||||
channel-typing = { url = "github:powercord-community/channel-typing"; flake = false; };
|
||||
|
|
@ -81,6 +85,7 @@
|
|||
nixosConfigurations."blossom" = mkSystem "blossom" "x86_64-linux" true;
|
||||
nixosConfigurations."fondue" = mkSystem "fondue" "x86_64-linux" false;
|
||||
|
||||
devShells.x86_64-linux = pkgs.callPackage ./shells { inherit inputs; };
|
||||
packages.x86_64-linux = pkgs.me;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
};
|
||||
nix.registry.config.flake = inputs.self;
|
||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||
nix.registry.shells.flake = inputs.self;
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
|
|
|
|||
14
shells/cs/default.nix
Normal file
14
shells/cs/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
callPackage,
|
||||
lib,
|
||||
mkShell,
|
||||
dotnetCorePackages
|
||||
}:
|
||||
mkShell {
|
||||
nativeBuildInputs = [ (with dotnetCorePackages; combinePackages [ sdk_6_0 runtime_6_0 ]) ];
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT = 1;
|
||||
|
||||
passthru = {
|
||||
osu = callPackage ./osu.nix {};
|
||||
};
|
||||
}
|
||||
80
shells/cs/osu.nix
Normal file
80
shells/cs/osu.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
# Flake for development on https://github.com/ppy/osu
|
||||
{
|
||||
lib,
|
||||
mkShell,
|
||||
writeScript,
|
||||
stdenv,
|
||||
stdenvNoCC,
|
||||
|
||||
dotnetCorePackages,
|
||||
|
||||
alsa-lib,
|
||||
ffmpeg_4,
|
||||
icu,
|
||||
lltng-ust,
|
||||
numactl,
|
||||
openssl,
|
||||
SDL2
|
||||
}:
|
||||
let
|
||||
baseBuild = "-f net5.0 -v minimal /property:Version=$OSU_VERSION osu.Desktop -- $@";
|
||||
|
||||
deps = [
|
||||
alsa-lib ffmpeg_4 icu lttng-ust numactl openssl SDL2
|
||||
];
|
||||
|
||||
fixSdl = writeScript "osu-fixsdl" ''
|
||||
ln -sft osu.Desktop/bin/Debug/net5.0/linux-x64/ ${SDL2}/lib/libSDL2${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
ln -sft osu.Desktop/bin/Release/net5.0/linux-x64/ ${SDL2}/lib/libSDL2${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
'';
|
||||
buildScript = writeScript "osu-build" ''
|
||||
rm -f osu.Desktop/bin/Debug/net5.0/linux-x64/libSDL2.so
|
||||
dotnet build -c Debug -r linux-x64 ${baseBuild} && ${fixSdl}
|
||||
'';
|
||||
buildReleaseScript = writeScript "osu-build-rel" ''
|
||||
rm -f osu.Desktop/bin/Release/net5.0/linux-x64/libSDL2.so
|
||||
dotnet build -c Release -r linux-x64 ${baseBuild} && ${fixSdl}
|
||||
'';
|
||||
publishScript = writeScript "osu-publish" ''
|
||||
rm -f osu.Desktop/bin/Release/net5.0/linux-x64/libSDL2.so
|
||||
dotnet publish -c Release -r linux-x64 --self-contained false ${baseBuild} && ${fixSdl}
|
||||
'';
|
||||
publishWinScript = writeScript "osu-publish-win" ''
|
||||
dotnet publish -c Release -r win-x64 --self-contained false -o build-win ${baseBuild}
|
||||
'';
|
||||
runScript = writeScript "osu-run" ''
|
||||
${buildScript} && dotnet run --no-build -c Debug -f net5.0 -r linux-x64 -p osu.Desktop -v minimal -- $@
|
||||
'';
|
||||
runReleaseScript = writeScript "osu-run-rel" ''
|
||||
${buildReleaseScript} && dotnet run --no-build -c Release -f net5.0 -r linux-x64 -p osu.Desktop -v minimal -- $@
|
||||
'';
|
||||
|
||||
scripts = stdenvNoCC.mkDerivation {
|
||||
pname = "osu-scripts";
|
||||
version = "1.0.0";
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp ${fixSdl} $out/osu-fixsdl
|
||||
cp ${buildScript} $out/osu-build
|
||||
cp ${buildReleaseScript} $out/osu-build-rel
|
||||
cp ${publishScript} $out/osu-publish
|
||||
cp ${publishWinScript} $out/osu-publish-win
|
||||
cp ${runScript} $out/osu-run
|
||||
cp ${runReleaseScript} $out/osu-run-rel
|
||||
'';
|
||||
};
|
||||
in mkShell {
|
||||
nativeBuildInputs = [
|
||||
icu
|
||||
|
||||
(with dotnetCorePackages; combinePackages [ sdk_5_0 runtime_5_0 ])
|
||||
];
|
||||
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT = 1;
|
||||
DRI_PRIME = 1;
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath deps;
|
||||
shellHook = ''
|
||||
export PATH="${scripts}:$PATH"
|
||||
'';
|
||||
}
|
||||
7
shells/default.nix
Normal file
7
shells/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ callPackage, inputs }: {
|
||||
cs = callPackage ./cs {};
|
||||
flutter = callPackage ./flutter {};
|
||||
js = callPackage ./js {};
|
||||
php = callPackage ./php {};
|
||||
rust = callPackage ./rust { inherit inputs; };
|
||||
}
|
||||
53
shells/flutter/default.nix
Normal file
53
shells/flutter/default.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
lib,
|
||||
mkShell,
|
||||
|
||||
flutter,
|
||||
clang,
|
||||
cmake,
|
||||
ninja,
|
||||
pkg-config,
|
||||
|
||||
atk,
|
||||
cairo,
|
||||
gdk-pixbuf,
|
||||
glib,
|
||||
gtk3,
|
||||
harfbuzz,
|
||||
libGL,
|
||||
pango,
|
||||
wayland,
|
||||
xorg,
|
||||
}:
|
||||
let
|
||||
makeIncludePath = lib.makeSearchPathOutput "include" "include";
|
||||
|
||||
includePath = makeIncludePath [
|
||||
xorg.xorgproto
|
||||
xorg.libX11.dev
|
||||
];
|
||||
in mkShell {
|
||||
nativeBuildInputs = [
|
||||
flutter
|
||||
clang
|
||||
cmake
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
C_INCLUDE_PATH = includePath;
|
||||
CPLUS_INCLUDE_PATH = includePath;
|
||||
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath "/lib" [
|
||||
atk
|
||||
cairo
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gtk3
|
||||
harfbuzz
|
||||
libGL
|
||||
pango
|
||||
wayland
|
||||
xorg.libX11
|
||||
];
|
||||
}
|
||||
19
shells/js/default.nix
Normal file
19
shells/js/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
mkShell,
|
||||
|
||||
nodejs-16_x,
|
||||
nodePackages,
|
||||
watchman
|
||||
}:
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
nodejs-16_x
|
||||
watchman
|
||||
|
||||
nodePackages.pnpm
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export PATH="$(readlink -f ./node_modules/.bin):$PATH"
|
||||
'';
|
||||
}
|
||||
16
shells/php/default.nix
Normal file
16
shells/php/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
callPackage,
|
||||
mkShell,
|
||||
php80,
|
||||
php80Packages,
|
||||
}:
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
php80
|
||||
php80Packages.composer
|
||||
];
|
||||
|
||||
passthru = {
|
||||
osu-web = callPackage ./osu-web.nix {};
|
||||
};
|
||||
}
|
||||
26
shells/php/osu-web.nix
Normal file
26
shells/php/osu-web.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Flake for development on https://github.com/ppy/osu-web
|
||||
{
|
||||
mkShell,
|
||||
nodejs-14_x,
|
||||
nodePackages,
|
||||
php80,
|
||||
php80Packages,
|
||||
python3
|
||||
}:
|
||||
let
|
||||
phpPkg = php80.withExtensions ({ enabled, all }:
|
||||
enabled ++ [ all.intl all.redis ]
|
||||
);
|
||||
in mkShell {
|
||||
buildInputs = [
|
||||
nodejs-14_x
|
||||
nodePackages.yarn
|
||||
phpPkg
|
||||
php80Packages.composer
|
||||
python3
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export PATH="$(readlink -f ./node_modules/.bin):$PATH"
|
||||
'';
|
||||
}
|
||||
25
shells/rust/default.nix
Normal file
25
shells/rust/default.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
inputs,
|
||||
mkShell,
|
||||
|
||||
pkg-config
|
||||
}:
|
||||
let
|
||||
overlays = [ (import inputs.rust-overlay) ];
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system overlays;
|
||||
};
|
||||
|
||||
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;
|
||||
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
inherit (toolchain) cargo rustc;
|
||||
};
|
||||
in mkShell {
|
||||
nativeBuildInputs = [
|
||||
toolchain
|
||||
pkg-config
|
||||
];
|
||||
|
||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue