mirror of
https://github.com/nmasur/dotfiles
synced 2026-05-17 15:06:27 +00:00
fix nodePackages references in prometheus-actual-exporter
This commit is contained in:
@@ -2,7 +2,12 @@
|
|||||||
"permissions": {
|
"permissions": {
|
||||||
"allow": [
|
"allow": [
|
||||||
"WebFetch(domain:github.com)",
|
"WebFetch(domain:github.com)",
|
||||||
"WebFetch(domain:raw.githubusercontent.com)"
|
"WebFetch(domain:raw.githubusercontent.com)",
|
||||||
|
"Bash(gh run *)",
|
||||||
|
"Bash(jj status *)",
|
||||||
|
"Bash(jj new *)",
|
||||||
|
"Bash(jj describe *)",
|
||||||
|
"Bash(nix flake *)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ let
|
|||||||
# [ package1.drv package2.drv ]
|
# [ package1.drv package2.drv ]
|
||||||
(builtins.map (name: prev.callPackage name { }))
|
(builtins.map (name: prev.callPackage name { }))
|
||||||
|
|
||||||
|
# Filter out packages that return null (e.g. platform-specific packages)
|
||||||
|
(builtins.filter (v: v != null))
|
||||||
|
|
||||||
# Convert the list to an attrset
|
# Convert the list to an attrset
|
||||||
# { package1 = package1.drv, package2 = package2.drv }
|
# { package1 = package1.drv, package2 = package2.drv }
|
||||||
listToAttrsByPnameOrName
|
listToAttrsByPnameOrName
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Fix: Volnoti error: 'volnoti' has been removed due to lack of maintenance upstream.
|
# Fix: Volnoti error: 'volnoti' has been removed due to lack of maintenance upstream.
|
||||||
|
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
if !pkgs.stdenv.isLinux then
|
||||||
|
null
|
||||||
|
else
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
pname = "volnoti";
|
pname = "volnoti";
|
||||||
version = "2013-09-23";
|
version = "2013-09-23";
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
nodejs_20,
|
nodejs_20,
|
||||||
buildNpmPackage,
|
buildNpmPackage,
|
||||||
nodePackages,
|
typescript,
|
||||||
|
node-gyp,
|
||||||
python3,
|
python3,
|
||||||
gcc,
|
gcc,
|
||||||
gnumake,
|
gnumake,
|
||||||
@@ -30,9 +31,9 @@ buildNpmPackage (finalAttrs: rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
nodejs_20
|
nodejs_20
|
||||||
nodePackages.typescript
|
typescript
|
||||||
python3
|
python3
|
||||||
nodePackages.node-gyp
|
node-gyp
|
||||||
gcc
|
gcc
|
||||||
gnumake
|
gnumake
|
||||||
];
|
];
|
||||||
@@ -53,8 +54,8 @@ buildNpmPackage (finalAttrs: rec {
|
|||||||
# export npm_config_build_from_source=true
|
# export npm_config_build_from_source=true
|
||||||
# export npm_config_unsafe_perm=true
|
# export npm_config_unsafe_perm=true
|
||||||
# export BINARY_SITE=none
|
# export BINARY_SITE=none
|
||||||
# export PATH=${nodePackages.node-gyp}/bin:$PATH
|
# export PATH=${node-gyp}/bin:$PATH
|
||||||
# export npm_config_node_gyp=${nodePackages.node-gyp}/bin/node-gyp
|
# export npm_config_node_gyp=${node-gyp}/bin/node-gyp
|
||||||
|
|
||||||
# npm rebuild better-sqlite3 --build-from-source --verbose
|
# npm rebuild better-sqlite3 --build-from-source --verbose
|
||||||
|
|
||||||
@@ -74,8 +75,8 @@ buildNpmPackage (finalAttrs: rec {
|
|||||||
export npm_config_build_from_source=true
|
export npm_config_build_from_source=true
|
||||||
export npm_config_unsafe_perm=true
|
export npm_config_unsafe_perm=true
|
||||||
export BINARY_SITE=none
|
export BINARY_SITE=none
|
||||||
export PATH=${nodePackages.node-gyp}/bin:$PATH
|
export PATH=${node-gyp}/bin:$PATH
|
||||||
export npm_config_node_gyp=${nodePackages.node-gyp}/bin/node-gyp
|
export npm_config_node_gyp=${node-gyp}/bin/node-gyp
|
||||||
|
|
||||||
sed -i '/"install"/d' node_modules/better-sqlite3/package.json
|
sed -i '/"install"/d' node_modules/better-sqlite3/package.json
|
||||||
rm -f node_modules/better-sqlite3/build/Release/better_sqlite3.node || true
|
rm -f node_modules/better-sqlite3/build/Release/better_sqlite3.node || true
|
||||||
|
|||||||
@@ -1,39 +1,42 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
|
stdenv,
|
||||||
buildDotnetModule,
|
buildDotnetModule,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
dotnetCorePackages,
|
dotnetCorePackages,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildDotnetModule rec {
|
if !stdenv.isLinux then
|
||||||
pname = "slsk-batchdl";
|
null
|
||||||
version = "2.4.7";
|
else
|
||||||
|
buildDotnetModule rec {
|
||||||
|
pname = "slsk-batchdl";
|
||||||
|
version = "2.4.7";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "fiso64";
|
owner = "fiso64";
|
||||||
repo = "slsk-batchdl";
|
repo = "slsk-batchdl";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-P7V7YJUA1bkfp13Glb1Q+NJ7iTya/xgO1TM88z1Nddc=";
|
sha256 = "sha256-P7V7YJUA1bkfp13Glb1Q+NJ7iTya/xgO1TM88z1Nddc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
projectFile = "slsk-batchdl/slsk-batchdl.csproj";
|
projectFile = "slsk-batchdl/slsk-batchdl.csproj";
|
||||||
nugetDeps = ./nuget-deps.nix;
|
nugetDeps = ./nuget-deps.nix;
|
||||||
|
|
||||||
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
||||||
dotnet-runtime = dotnetCorePackages.runtime_8_0;
|
dotnet-runtime = dotnetCorePackages.runtime_8_0;
|
||||||
|
|
||||||
# Patch the project file to use .NET 8
|
postPatch = ''
|
||||||
postPatch = ''
|
substituteInPlace slsk-batchdl/slsk-batchdl.csproj \
|
||||||
substituteInPlace slsk-batchdl/slsk-batchdl.csproj \
|
--replace-fail "net6.0" "net8.0"
|
||||||
--replace-fail "net6.0" "net8.0"
|
'';
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A batch downloader for Soulseek";
|
description = "A batch downloader for Soulseek";
|
||||||
homepage = "https://github.com/fiso64/slsk-batchdl";
|
homepage = "https://github.com/fiso64/slsk-batchdl";
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
mainProgram = "slsk-batchdl";
|
mainProgram = "slsk-batchdl";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +1,47 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
# Inspired by https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix
|
# Inspired by https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix
|
||||||
# This script will partition and format drives; use at your own risk!
|
# This script will partition and format drives; use at your own risk!
|
||||||
|
|
||||||
pkgs.writeShellScriptBin "installer" ''
|
if !pkgs.stdenv.isLinux then
|
||||||
set -e
|
null
|
||||||
|
else
|
||||||
|
pkgs.writeShellScriptBin "installer" ''
|
||||||
|
set -e
|
||||||
|
|
||||||
DISK=$1
|
DISK=$1
|
||||||
FLAKE=$2
|
FLAKE=$2
|
||||||
PARTITION_PREFIX=""
|
PARTITION_PREFIX=""
|
||||||
|
|
||||||
if [ -z "$DISK" ] || [ -z "$FLAKE" ]; then
|
if [ -z "$DISK" ] || [ -z "$FLAKE" ]; then
|
||||||
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
||||||
--foreground "#fb4934" \
|
--foreground "#fb4934" \
|
||||||
"Missing required parameter." \
|
"Missing required parameter." \
|
||||||
"Usage: installer -- <disk> <host>" \
|
"Usage: installer -- <disk> <host>" \
|
||||||
"Example: installer -- nvme0n1 tempest" \
|
"Example: installer -- nvme0n1 tempest" \
|
||||||
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest"
|
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest"
|
||||||
echo "(exiting)"
|
echo "(exiting)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$DISK" in nvme*)
|
case "$DISK" in nvme*)
|
||||||
PARTITION_PREFIX="p"
|
PARTITION_PREFIX="p"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
${pkgs.gum}/bin/gum confirm \
|
${pkgs.gum}/bin/gum confirm \
|
||||||
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
||||||
--default=false
|
--default=false
|
||||||
|
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mklabel gpt
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- mklabel gpt
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart primary 512MiB 100%
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart primary 512MiB 100%
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart ESP fat32 1MiB 512MiB
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart ESP fat32 1MiB 512MiB
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- set 3 esp on
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- set 3 esp on
|
||||||
mkfs.ext4 -L nixos /dev/''${DISK}''${PARTITION_PREFIX}1
|
mkfs.ext4 -L nixos /dev/''${DISK}''${PARTITION_PREFIX}1
|
||||||
mkfs.fat -F 32 -n boot /dev/''${DISK}''${PARTITION_PREFIX}2
|
mkfs.fat -F 32 -n boot /dev/''${DISK}''${PARTITION_PREFIX}2
|
||||||
|
|
||||||
mount /dev/disk/by-label/nixos /mnt
|
mount /dev/disk/by-label/nixos /mnt
|
||||||
mkdir --parents /mnt/boot
|
mkdir --parents /mnt/boot
|
||||||
mount /dev/disk/by-label/boot /mnt/boot
|
mount /dev/disk/by-label/boot /mnt/boot
|
||||||
|
|
||||||
${pkgs.nixos-install-tools}/bin/nixos-install --flake github:nmasur/dotfiles#''${FLAKE}
|
${pkgs.nixos-install-tools}/bin/nixos-install --flake github:nmasur/dotfiles#''${FLAKE}
|
||||||
''
|
''
|
||||||
|
|||||||
Reference in New Issue
Block a user