1
0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-11-22 17:01:57 +01:00

upgrade nixpkgs; remove glitch-soc

This commit is contained in:
Jill "oatmealine" Monoids 2023-01-20 00:52:46 +01:00
parent 881cef6bbe
commit 410e5c5762
10 changed files with 18 additions and 3381 deletions

@ -28,11 +28,11 @@
]
},
"locked": {
"lastModified": 1674061743,
"narHash": "sha256-4xz24XJlAqRRjN2+HFUeaJn7CPqpO8N/TQLNinLLv7c=",
"lastModified": 1674151952,
"narHash": "sha256-c0dwSGWi8LH2uBsv7ZJK11To1w8oFjTs+d2dtiusGug=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "c02cfe11649018c3e31c8c4a4d91233b1e62d487",
"rev": "fa7dedfa5e1171a76ff78a1260064e1b20ec93bb",
"type": "github"
},
"original": {
@ -147,11 +147,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1674054764,
"narHash": "sha256-00cRYxCYmZvncLyCsVYrhQsCzFnjkZi+23TC2FpQU/U=",
"lastModified": 1674143063,
"narHash": "sha256-CfP6ZYjxLeC1Q6W4f+RCd2sokIX8RnyTA8wYzYmx9XE=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "428063ff2304962387803fd59e5da8b9b82710cc",
"rev": "5112056fdbda989191310364444f328240bbf6f1",
"type": "github"
},
"original": {
@ -266,11 +266,11 @@
]
},
"locked": {
"lastModified": 1674006232,
"narHash": "sha256-RRfRRO3D/ezYzeGiu75moIDNm4ba2ZE3XSAIrbLuWVQ=",
"lastModified": 1674092998,
"narHash": "sha256-NYB/PjEJ9W9VDVWScVFqooK20gDsNyPhCqQIP1Nn+AU=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "a2396d8c4c65ed5b41e7198cbf66a9de10573ccb",
"rev": "a55757a572e115459bbad449d2fde514d11a76e1",
"type": "github"
},
"original": {
@ -312,11 +312,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1670064435,
"narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=",
"lastModified": 1673796341,
"narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c",
"rev": "6dccdc458512abce8d19f74195bb20fdb067df50",
"type": "github"
},
"original": {
@ -343,11 +343,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1670064435,
"narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=",
"lastModified": 1673796341,
"narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c",
"rev": "6dccdc458512abce8d19f74195bb20fdb067df50",
"type": "github"
},
"original": {

@ -33,7 +33,7 @@ in {
# aether??? is that... reference.../.??? aether https://www.curseforge.com/minecraft/mc-mods/aether mod Curseforge minecraft Forge Patreon Chat twitter code license Assets license All rights reserved categories Last Updated apr 17 2021 Game Version 1.12.2 aether
aether = {
conf = {
packages = with pkgs; [ bat duf broot nftables tmux bottom writefreely ];
packages = with pkgs; [ bat duf broot nftables tmux bottom writefreely helix ];
shell = pkgs.unstable.fish;
extraGroups = [ "wheel" "nix-users" "dotfiles" ];
initialHashedPassword = "!";
@ -54,7 +54,7 @@ in {
# oatmealine ?? is that a reference to jill oatmealine monoids from the beloved videogame franchise "oateamelin jill monoids???" .oat. zone??? from va11hall-a??? video game???? woman????? minecraft???????
oatmealine = {
conf = {
packages = with pkgs; [ bat tmux micro direnv nix-direnv ripgrep _.glitch-soc ];
packages = with pkgs; [ bat tmux micro direnv nix-direnv ripgrep ];
shell = pkgs.unstable.fish;
extraGroups = [ "wheel" "nix-users" "dotfiles" "yugoslavia" ];
initialHashedPassword = "!";

@ -29,11 +29,6 @@ in {
domain = "matrix.dark-firepit.cloud";
};
glitch-soc = {
enable = true;
domain = "feditest.oat.zone";
};
vaultwarden = {
enable = true;
domain = "vault.aether.gay";

@ -5,7 +5,7 @@ with lib;
config = {
environment.systemPackages = with pkgs; [
valgrind
nix-linter
# nix-linter
];
};
}

@ -1,131 +0,0 @@
{ lib, stdenv, nodejs-slim, mkYarnPackage, fetchFromGitHub, bundlerEnv, nixosTests, pkgs
, yarn, callPackage, imagemagick, ffmpeg, file, ruby_3_0, writeShellScript
, fetchYarnDeps, fixup_yarn_lock, fetchgit
# Allow building a fork or custom version of Mastodon:
, pname ? "glitch-soc"
, version ? import ./version.nix
, srcOverride ? fetchgit {
url = "https://git.oat.zone/dark-firepit/mastodon";
rev = "7cb3b3f2df99e7df6b3a94bb90e4b4bee632a103";
sha256 = "sha256-6Y+nDS/Gh/v6ixOa4utqNy+ETw7AdYDTAEFjpQrkunU=";
}
#/home/oatmealine/mastodon
, dependenciesDir ? ./. # Should contain gemset.nix, yarn.nix and package.json.
}:
stdenv.mkDerivation rec {
inherit pname version;
# Using overrideAttrs on src does not build the gems and modules with the overridden src.
# Putting the callPackage up in the arguments list also does not work.
src = if srcOverride != null then srcOverride else callPackage ./source.nix {};
mastodon-gems = bundlerEnv {
name = "${pname}-gems-${version}";
inherit version;
ruby = ruby_3_0;
gemdir = src;
gemset = dependenciesDir + "/gemset.nix";
# This fix (copied from https://github.com/NixOS/nixpkgs/pull/76765) replaces the gem
# symlinks with directories, resolving this error when running rake:
# /nix/store/451rhxkggw53h7253izpbq55nrhs7iv0-mastodon-gems-3.0.1/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/settings.rb:6:in `<module:Bundler>': uninitialized constant Bundler::Settings (NameError)
postBuild = ''
for gem in "$out"/lib/ruby/gems/*/gems/*; do
cp -a "$gem/" "$gem.new"
rm "$gem"
# needed on macOS, otherwise the mv yields permission denied
chmod +w "$gem.new"
mv "$gem.new" "$gem"
done
'';
};
mastodon-modules = stdenv.mkDerivation {
pname = "${pname}-modules";
inherit src version;
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
sha256 = "sha256-Y1KFts3/3BmLIOuXahe6hn+va1ObMkWRNGB0rudRRGs=";
};
nativeBuildInputs = [ fixup_yarn_lock nodejs-slim yarn mastodon-gems mastodon-gems.wrappedRuby ];
RAILS_ENV = "production";
NODE_ENV = "production";
buildPhase = ''
export HOME=$PWD
# This option is needed for openssl-3 compatibility
# Otherwise we encounter this upstream issue: https://github.com/mastodon/mastodon/issues/17924
export NODE_OPTIONS=--openssl-legacy-provider
fixup_yarn_lock ~/yarn.lock
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
patchShebangs ~/bin
patchShebangs ~/node_modules
# skip running yarn install
rm -rf ~/bin/yarn
OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder \
rails assets:precompile
yarn cache clean --offline
rm -rf ~/node_modules/.cache
'';
installPhase = ''
mkdir -p $out/public
cp -r node_modules $out/node_modules
cp -r public/assets $out/public
cp -r public/packs $out/public
'';
};
propagatedBuildInputs = [ imagemagick ffmpeg file mastodon-gems.wrappedRuby ];
buildInputs = [ mastodon-gems nodejs-slim ];
buildPhase = ''
ln -s ${mastodon-modules}/node_modules node_modules
ln -s ${mastodon-modules}/public/assets public/assets
ln -s ${mastodon-modules}/public/packs public/packs
patchShebangs bin/
for b in $(ls ${mastodon-gems}/bin/)
do
if [ ! -f bin/$b ]; then
ln -s ${mastodon-gems}/bin/$b bin/$b
fi
done
rm -rf log
ln -s /var/log/mastodon log
ln -s /tmp tmp
'';
installPhase = let
run-streaming = writeShellScript "run-streaming.sh" ''
# NixOS helper script to consistently use the same NodeJS version the package was built with.
${nodejs-slim}/bin/node ./streaming
'';
in ''
mkdir -p $out
cp -r * $out/
ln -s ${run-streaming} $out/run-streaming.sh
'';
passthru = {
tests.mastodon = nixosTests.mastodon;
updateScript = callPackage ./update.nix {};
};
meta = with lib; {
description = "Self-hosted, globally interconnected microblogging software based on ActivityPub";
homepage = "https://joinmastodon.org";
license = licenses.agpl3Plus;
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
maintainers = with maintainers; [ happy-river erictapen izorkin ];
};
}

File diff suppressed because it is too large Load Diff

@ -1,11 +0,0 @@
# This file was generated by pkgs.mastodon.updateScript.
{ fetchgit, applyPatches }: let
src = fetchgit {
url = "https://github.com/glitch-soc/mastodon.git";
rev = "3f15326a05a926e9f001800a48ac2addbd3aa833";
sha256 = "1m1agij9i2byiml02yq0h9w6f64jvy2y2ayjm880pg5xm638nqmk";
};
in applyPatches {
inherit src;
patches = [];
}

@ -1,98 +0,0 @@
#!/usr/bin/env bash
set -e
URL=https://github.com/mastodon/mastodon.git
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--url)
URL="$2"
shift # past argument
shift # past value
;;
--ver)
VERSION="$2"
shift # past argument
shift # past value
;;
--rev)
REVISION="$2"
shift # past argument
shift # past value
;;
--patches)
PATCHES="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1")
shift # past argument
;;
esac
done
if [[ -z "$VERSION" || -n "$POSITIONAL" ]]; then
echo "Usage: update.sh [--url URL] --ver VERSION [--rev REVISION] [--patches PATCHES]"
echo "URL may be any path acceptable to 'git clone' and VERSION the"
echo "semantic version number. If VERSION is not a revision acceptable to"
echo "'git checkout', you must provide one in REVISION. If URL is not"
echo "provided, it defaults to https://github.com/mastodon/mastodon.git."
echo "PATCHES, if provided, should be one or more Nix expressions"
echo "separated by spaces."
exit 1
fi
if [[ -z "$REVISION" ]]; then
REVISION="$VERSION"
fi
rm -f gemset.nix version.nix source.nix
TARGET_DIR="$PWD"
WORK_DIR=$(mktemp -d)
# Check that working directory was created.
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temporary directory"
exit 1
fi
# Delete the working directory on exit.
function cleanup {
# Report errors, if any, from nix-prefetch-git
grep "fatal" $WORK_DIR/nix-prefetch-git.out >/dev/stderr || true
rm -rf "$WORK_DIR"
}
trap cleanup EXIT
echo "Fetching source code $REVISION from $URL"
JSON=$(nix-prefetch-git --url "$URL" --rev "$REVISION" 2> $WORK_DIR/nix-prefetch-git.out)
SHA=$(echo $JSON | jq -r .sha256)
FETCHED_SOURCE_DIR=$(grep '^path is' $WORK_DIR/nix-prefetch-git.out | sed 's/^path is //')
echo "Creating version.nix"
echo \"$VERSION\" | sed 's/^"v/"/' > version.nix
cat > source.nix << EOF
# This file was generated by pkgs.mastodon.updateScript.
{ fetchgit, applyPatches }: let
src = fetchgit {
url = "$URL";
rev = "$REVISION";
sha256 = "$SHA";
};
in applyPatches {
inherit src;
patches = [$PATCHES];
}
EOF
SOURCE_DIR="$(nix-build --no-out-link -E '(import <nixpkgs> {}).callPackage ./source.nix {}')"
echo "Creating gemset.nix"
bundix --lockfile="$SOURCE_DIR/Gemfile.lock" --gemfile="$SOURCE_DIR/Gemfile"
echo "" >> $TARGET_DIR/gemset.nix # Create trailing newline to please EditorConfig checks

@ -1,4 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -p jq -p bundix -p nix-prefetch-git -i bash
./update-remote.sh --url https://github.com/glitch-soc/mastodon.git --rev 5db3a14388cf780364b213c63aaf97b6f444ca17 --ver v3.5.1

@ -1 +0,0 @@
"3f15326a05a926e9f001800a48ac2addbd3aa833"