Migrate packages

This commit is contained in:
Julian Mutter 2025-04-22 21:14:51 +02:00
parent 642398da4b
commit d0942d018b
16 changed files with 127 additions and 253 deletions

View File

@ -1,37 +0,0 @@
{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs, stdenv, ... }:
pkgs.writeShellApplication {
name = "edit-config";
runtimeInputs = with pkgs; [ fd fzf ];
text = ''
if [[ $# == 0 ]]; then
QUERY=""
else
QUERY="$1"
fi
FILE=$(fd -H -t f . ~/.dotfiles | fzf --query "$QUERY")
if [[ "$FILE" != "" ]]; then
$EDITOR "$FILE"
else
exit 1
fi
read -rp 'Run "home-manager switch"? [Yn]: ' yn
case $yn in
Y | y | Yes | yes | "" ) home-manager switch;;
* ) echo "Not switching home-manager configuration";;
esac
'';
}

View File

@ -1,31 +0,0 @@
{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
stdenv,
...
}:
pkgs.writeShellApplication {
name = "open-messaging";
runtimeInputs = with pkgs; [
nheko
telegram-desktop
thunderbird
];
text = ''
thunderbird &
sleep 0.1
nheko &
sleep 0.1
telegram-desktop &
'';
}

View File

@ -1,89 +0,0 @@
{
pkgs,
stdenv,
lib,
fetchFromGitHub,
unzip,
...
}:
let
data = stdenv.mkDerivation (finalAttrs: {
pname = "path-of-building-data";
version = "dev-version";
src = fetchFromGitHub {
owner = "PathOfBuildingCommunity";
repo = "PathOfBuilding";
rev = "80dfb6f56bb41cad19f9904b3baacc15b8ecf0f7";
hash = "sha256-apZYU0PrB3wehzJPNNH3aFKLMA/fK5vo+dtgbho6EiM=";
};
nativeBuildInputs = [ unzip ];
buildCommand = ''
# I have absolutely no idea how this file is generated
# and I don't think I want to know. The Flatpak also does this.
unzip -j -d $out $src/runtime-win32.zip lua/sha1.lua
# Install the actual data
cp -r $src/src $src/runtime/lua/*.lua $src/manifest.xml $out
# Pretend this is an official build so we don't get the ugly "dev mode" warning
substituteInPlace $out/manifest.xml --replace '<Version' '<Version platform="nixos"'
touch $out/installed.cfg
# Completely stub out the update check
chmod +w $out/src/UpdateCheck.lua
echo 'return "none"' > $out/src/UpdateCheck.lua
'';
});
in
stdenv.mkDerivation {
pname = "path-of-building";
version = "${data.version}-unstable-2023-04-09";
src = fetchFromGitHub {
owner = "ernstp";
repo = "pobfrontend";
rev = "9faa19aa362f975737169824c1578d5011487c18";
hash = "sha256-zhw2PZ6ZNMgZ2hG+a6AcYBkeg7kbBHNc2eSt4if17Wk=";
};
nativeBuildInputs = with pkgs; [
meson
ninja
pkg-config
kdePackages.qttools
kdePackages.wrapQtAppsHook
];
buildInputs = with pkgs; [
kdePackages.qtbase
luajit
luajit.pkgs.lua-curl
];
installPhase = ''
runHook preInstall
install -Dm555 pobfrontend $out/bin/pobfrontend
runHook postInstall
'';
preFixup = ''
qtWrapperArgs+=(
--set LUA_PATH "$LUA_PATH"
--set LUA_CPATH "$LUA_CPATH"
--chdir "${data}"
)
'';
passthru.data = data;
meta = {
description = "Offline build planner for Path of Exile";
homepage = "https://pathofbuilding.community/";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.k900 ];
mainProgram = "pobfrontend";
broken = stdenv.isDarwin; # doesn't find uic6 for some reason
};
}

View File

@ -1,27 +0,0 @@
{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
stdenv,
...
}:
pkgs.writeShellApplication {
name = "xwacomcalibrate";
runtimeInputs = with pkgs; [
xf86_input_wacom
xorg.xwininfo
xorg.xrandr
xdotool
bc
];
text = ./xwacomcalibrate.sh;
}

View File

@ -1,21 +1,13 @@
{ {
# Snowfall Lib provides a customized `lib` instance with access to your flake's library conda,
# as well as the libraries available from your flake's inputs. yq,
lib, writeShellApplication,
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
stdenv,
...
}: }:
pkgs.writeShellApplication { writeShellApplication {
name = "conda-direnv"; name = "conda-direnv";
runtimeInputs = with pkgs; [ runtimeInputs = [
conda conda
yq yq
]; ];
@ -26,7 +18,7 @@ pkgs.writeShellApplication {
exit 1 exit 1
fi fi
ENV_NAME=$(${pkgs.yq}/bin/yq ".name" environment.yml -r) ENV_NAME=$(${yq}/bin/yq ".name" environment.yml -r)
if [ "$ENV_NAME" == "" ] || [ "$ENV_NAME" == "null" ]; then if [ "$ENV_NAME" == "" ] || [ "$ENV_NAME" == "null" ]; then
echo "Property \"name\" not in environment.yml or empty! Exiting..." echo "Property \"name\" not in environment.yml or empty! Exiting..."
exit 1 exit 1
@ -39,7 +31,7 @@ pkgs.writeShellApplication {
conda activate $ENV_NAME conda activate $ENV_NAME
} }
exec ${pkgs.conda}/bin/conda-shell exec ${conda}/bin/conda-shell
conda activate $ENV_NAME || condanew conda activate $ENV_NAME || condanew
echo "Environment active! To update it, run:" echo "Environment active! To update it, run:"

16
pkgs/default.nix Normal file
View File

@ -0,0 +1,16 @@
{
pkgs ? import <nixpkgs> { },
...
}:
{
conda-direnv = pkgs.callPackage ./conda-direnv { };
deploy-to-pianopi = pkgs.callPackage ./deploy-to-pianopi { };
edit-config = pkgs.callPackage ./edit-config { };
hyprshot-gui = pkgs.callPackage ./hyprshot-gui { };
install = pkgs.callPackage ./install { };
lntocp = pkgs.callPackage ./lntocp { };
open-messaging = pkgs.callPackage ./open-messaging { };
pulseaudio-popup = pkgs.callPackage ./pulseaudio-popup { };
sos = pkgs.callPackage ./sos { };
xwacomcalibrate = pkgs.callPackage ./xwacomcalibrate { };
}

View File

@ -1,18 +1,12 @@
{ {
# Snowfall Lib provides a customized `lib` instance with access to your flake's library rsync,
# as well as the libraries available from your flake's inputs. writeShellApplication,
lib, }:
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers writeShellApplication {
# programmatically or you may add the named attributes as arguments here.
pkgs, stdenv, ... }:
pkgs.writeShellApplication {
name = "deploy-to-pianopi"; name = "deploy-to-pianopi";
runtimeInputs = with pkgs; [ rsync ]; runtimeInputs = [ rsync ];
text = '' text = ''
set -e set -e

View File

@ -0,0 +1,34 @@
{
writeShellApplication,
fd,
fzf,
}:
writeShellApplication {
name = "edit-config";
runtimeInputs = [
fd
fzf
];
text = ''
if [[ $# == 0 ]]; then
QUERY=""
else
QUERY="$1"
fi
FILE=$(fd -H -t f . ~/.dotfiles | fzf --query "$QUERY")
if [[ "$FILE" != "" ]]; then
$EDITOR "$FILE"
else
exit 1
fi
read -rp 'Run "home-manager switch"? [Yn]: ' yn
case $yn in
Y | y | Yes | yes | "" ) home-manager switch;;
* ) echo "Not switching home-manager configuration";;
esac
'';
}

View File

@ -2,8 +2,10 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
pkgs, makeWrapper,
... bash,
hyprshot,
zenity,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -17,9 +19,9 @@ stdenv.mkDerivation rec {
sha256 = "sha256-XUy6+mFbNL+3zDfS4tWva4DiJeLnRM9S8ECRayTcPfI="; sha256 = "sha256-XUy6+mFbNL+3zDfS4tWva4DiJeLnRM9S8ECRayTcPfI=";
}; };
nativeBuildInputs = with pkgs; [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = with pkgs; [ buildInputs = [
bash bash
hyprshot hyprshot
zenity zenity

View File

@ -1,21 +1,11 @@
{ {
# Snowfall Lib provides a customized `lib` instance with access to your flake's library writeShellApplication,
# as well as the libraries available from your flake's inputs.
lib,
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
stdenv,
...
}: }:
pkgs.writeShellApplication { writeShellApplication {
name = "lntocp"; name = "lntocp";
runtimeInputs = with pkgs; [ ]; runtimeInputs = [ ];
text = '' text = ''
#!/bin/bash #!/bin/bash

View File

@ -0,0 +1,24 @@
{
writeShellApplication,
nheko,
telegram-desktop,
thunderbird,
}:
writeShellApplication {
name = "open-messaging";
runtimeInputs = [
nheko
telegram-desktop
thunderbird
];
text = ''
thunderbird &
sleep 0.1
nheko &
sleep 0.1
telegram-desktop &
'';
}

View File

@ -1,21 +1,14 @@
{ {
# Snowfall Lib provides a customized `lib` instance with access to your flake's library writeShellApplication,
# as well as the libraries available from your flake's inputs. pavucontrol,
lib, jgmenu,
# You also have access to your flake's inputs. pulseaudio,
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
stdenv,
...
}: }:
pkgs.writeShellApplication { writeShellApplication {
name = "pulseaudio-popup"; name = "pulseaudio-popup";
runtimeInputs = with pkgs; [ runtimeInputs = [
pavucontrol pavucontrol
jgmenu jgmenu
pulseaudio pulseaudio

View File

@ -1,21 +1,13 @@
{ {
# Snowfall Lib provides a customized `lib` instance with access to your flake's library writeShellApplication,
# as well as the libraries available from your flake's inputs. nix-output-monitor,
lib, jq,
# You also have access to your flake's inputs.
inputs,
# All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers
# programmatically or you may add the named attributes as arguments here.
pkgs,
stdenv,
...
}: }:
pkgs.writeShellApplication { writeShellApplication {
name = "sos"; name = "sos";
runtimeInputs = with pkgs; [ runtimeInputs = [
nix-output-monitor nix-output-monitor
jq jq
]; ];

View File

@ -0,0 +1,21 @@
{
writeShellApplication,
xf86_input_wacom,
xorg,
xdotool,
bc,
}:
writeShellApplication {
name = "xwacomcalibrate";
runtimeInputs = [
xf86_input_wacom
xorg.xwininfo
xorg.xrandr
xdotool
bc
];
text = ./xwacomcalibrate.sh;
}