nixos-configs/apps/update/src/misc.ts
matt1432 cc9cb421c8
All checks were successful
Discord / discord commits (push) Has been skipped
chore: update flake.lock
Flake Inputs:
• Updated input 'discord-overlay':
    'github:matt1432/discord-nightly-overlay/798e83f' (2024-07-27)
  → 'github:matt1432/discord-nightly-overlay/4df152b' (2024-07-29)

• Updated input 'gpu-screen-recorder-src':
    'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=5e2a233' (2024-07-26)
  → 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=ddf3fa5' (2024-07-28)

• Updated input 'gtk-theme-src':
    'github:dracula/gtk/c9896cb' (2024-07-21)
  → 'github:dracula/gtk/100310f' (2024-07-29)

• Updated input 'headscale':
    'github:juanfont/headscale/4ad3f3c' (2024-07-22)
  → 'github:juanfont/headscale/06f0705' (2024-07-28)

• Updated input 'home-manager':
    'github:nix-community/home-manager/975b83c' (2024-07-27)
  → 'github:nix-community/home-manager/89670e2' (2024-07-29)

• Updated input 'hyprland':
    'git+https://github.com/hyprwm/Hyprland?ref=refs/heads/main&rev=729b47d46d0c749efbffe01ea863a124fad562b4&submodules=1' (2024-07-27)
  → 'git+https://github.com/hyprwm/Hyprland?ref=refs/heads/main&rev=e67322034037fef22079c8e480be38c1d04b5a4a&submodules=1' (2024-07-29)

• Updated input 'hyprland/aquamarine':
    'github:hyprwm/aquamarine/f95d1509370b7f40ef356ff69a332bd0356ab044?narHash=sha256-GFDSPWxOqEkNrbuSfyoQHGIaRhJNapn2Rv0EEmBGR9A%3D' (2024-07-26)
  → 'github:hyprwm/aquamarine/4918e57979bbdbd05aabb20f63e1cb5dc289bcbd?narHash=sha256-75Hcx5Zu0f%2BBeCkZxN1frkYacjbkwgCq%2Bz3doVgr4Hw%3D' (2024-07-27)

• Updated input 'hyprland/hyprutils':
    'github:hyprwm/hyprutils/962582a090bc233c4de9d9897f46794280288989?narHash=sha256-WAZ0X6yJW1hFG6otkHBfyJDKRpNP5stsRqdEuHrFRpk%3D' (2024-07-18)
  → 'github:hyprwm/hyprutils/5dcbbc1e3de40b2cecfd2007434d86e924468f1f?narHash=sha256-D3wIZlBNh7LuZ0NaoCpY/Pvu%2BxHxIVtSN%2BKkWZYvvVs%3D' (2024-07-27)

• Updated input 'hyprland/xdph':
    'github:hyprwm/xdg-desktop-portal-hyprland/5555f467f68ce7cdf1060991c24263073b95e9da?narHash=sha256-O17b38bQnmfxv7It3OnVYx7fp1seEdI7xxnw5vJFv30%3D' (2024-07-23)
  → 'github:hyprwm/xdg-desktop-portal-hyprland/0e2f3b9c85f7bab3983098a01366876d34daf383?narHash=sha256-Lj/g1UzrsTZUixtveQix6eB3pon2j23qv5/5pzTx0LQ%3D' (2024-07-28)
• Updated input 'hyprland/xdph/hyprland-protocols':
    'github:hyprwm/hyprland-protocols/1b61f0093afff20ab44d88ad707aed8bf2215290?narHash=sha256-HUklK5u86w2Yh9dOkk4FdsL8eehcOZ95jPhLixGDRQY%3D' (2024-06-18)
  → 'github:hyprwm/hyprland-protocols/5a11232266bf1a1f5952d5b179c3f4b2facaaa84?narHash=sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg%3D' (2024-07-18)

• Updated input 'hyprgrass':
    'github:horriblename/hyprgrass/736119f' (2024-06-14)
  → 'github:horriblename/hyprgrass/5c93341' (2024-07-28)

• Updated input 'nix-gaming':
    'github:fufexan/nix-gaming/dc966ed' (2024-07-27)
  → 'github:fufexan/nix-gaming/7a07614' (2024-07-29)

• Updated input 'nix-gaming/umu':
    'git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&ref=refs/heads/main&rev=abbdeed&submodules=1' (2024-07-20)
  → 'git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&ref=refs/heads/main&rev=7e00027&submodules=1' (2024-07-26)

• Updated input 'nix-index-db':
    'github:Mic92/nix-index-database/b6db9fd' (2024-07-21)
  → 'github:Mic92/nix-index-database/c0ca47e' (2024-07-28)

• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/9cf33b4' (2024-07-27)
  → 'github:nix-community/nixpkgs-wayland/6642ef6' (2024-07-28)

• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/e0ea775' (2024-07-21)
  → 'github:nix-community/lib-aggregate/4ce8efe' (2024-07-28)

• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/31a9902' (2024-07-21)
  → 'github:nix-community/nixpkgs.lib/d15f6f6' (2024-07-28)

Docker Images:
• rssbridge/rss-bridge latest:
   sha256:94480c924f35512e81ad846fd9968591c63d20221484b7774083055b990ab31f
 → sha256:5d8906da7276396e077e054eb7e646f4f02d639be60a0b3bded97ec751fc0700

• ghcr.io/linuxserver/calibre-web latest:
   sha256:604ae903f520bd5485bcbdb2f70ea460c90a559bca3d4ac3fc05b93da2737a0a
 → sha256:49660a8890e2e4356cbc4b8874ff5ad1ebc40f647fdb2419fc289700affebcf0

• ghcr.io/linuxserver/radarr latest:
   sha256:2a02b311cefb344cd0caf74a443b9d6318daf15bda5280a3bc732381db983dc3
 → sha256:9d6f0548fd805edb30108fdd06d0fc5a4436c9bd708b57bd4119d7aefa815fe4

• ghcr.io/fallenbagel/jellyseerr develop:
   sha256:4faf2f19c7a2be559354821e7da57477c236a22afb78e17a40dd40a75a120435
 → sha256:788f508bdb33812a77acc8281e1299ff95ddebd07aee40d452e4f0c74bb15dc9
2024-07-30 01:45:01 -04:00

74 lines
2.2 KiB
TypeScript

import { readdirSync, writeFileSync } from 'node:fs';
import { spawnSync } from 'node:child_process';
import { parseFetchurl } from './lib.ts';
/* Constants */
const FLAKE = process.env.FLAKE;
export const updateFlakeInputs = () => {
const output = spawnSync(
`nix flake update --flake ${FLAKE} |& grep -v "warning: updating lock file"`,
[],
{ shell: true },
).stdout
.toString()
// Add an extra blank line between inputs
.split('\n•')
.join('\n\n•')
// Shorten git revs to help readability
.split('\n')
.map((l) => l
.replace(/.{33}\?narHash=sha256[^']*/, '')
.replace(/&rev=(.{7})[^'&]*/, (_, backref) => `&rev=${backref}`))
.join('\n');
return output;
};
export const updateDocker = () => {
let updates = '';
const FILE = `${FLAKE}/devices/nos/modules/docker`;
readdirSync(FILE, { withFileTypes: true, recursive: true }).forEach((path) => {
if (path.name === 'compose.nix') {
console.log(`Updating ${path.parentPath.split('/').at(-1)} images`);
updates += spawnSync('updateImages', [path.parentPath], { shell: true })
.stdout.toString();
}
});
return updates;
};
const genVueText = (version: string, hash: string, url: string) =>
`# This file was autogenerated. DO NOT EDIT!
{
version = "${version}";
url = "${url}";
hash = "${hash}";
}
`;
export const updateVuetorrent = () => {
const FILE = `${FLAKE}/devices/nos/modules/qbittorrent/vuetorrent.nix`;
const OLD_VERSION = JSON.parse(spawnSync('nix',
['eval', '-f', FILE, '--json'],
{ shell: true }).stdout.toString()).version;
const VERSION = JSON.parse(spawnSync('curl',
['-s', 'https://api.github.com/repos/VueTorrent/VueTorrent/releases/latest'],
{ shell: true }).stdout.toString()).tag_name.replace('v', '');
const URL = `https://github.com/VueTorrent/VueTorrent/releases/download/v${VERSION}/vuetorrent.zip`;
const HASH = parseFetchurl(URL);
const fileText = genVueText(VERSION, HASH, URL);
writeFileSync(FILE, fileText);
return OLD_VERSION !== VERSION ? `Vuetorrent: ${OLD_VERSION} -> ${VERSION}` : '';
};