From b8693b725bb13347c64c27611fb17e30e5ca10b8 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 27 Jan 2025 18:16:59 -0500 Subject: [PATCH] feat: init pin-inputs script --- apps/packages.nix | 1 + apps/pin-inputs/.envrc | 2 + apps/pin-inputs/default.nix | 11 ++++++ apps/pin-inputs/eslint.config.ts | 3 ++ apps/pin-inputs/package-lock.json | Bin 0 -> 65495 bytes apps/pin-inputs/package.json | 18 +++++++++ apps/pin-inputs/src/app.ts | 60 ++++++++++++++++++++++++++++++ apps/pin-inputs/tsconfig.json | 10 +++++ 8 files changed, 105 insertions(+) create mode 100644 apps/pin-inputs/.envrc create mode 100644 apps/pin-inputs/default.nix create mode 100644 apps/pin-inputs/eslint.config.ts create mode 100644 apps/pin-inputs/package-lock.json create mode 100644 apps/pin-inputs/package.json create mode 100644 apps/pin-inputs/src/app.ts create mode 100644 apps/pin-inputs/tsconfig.json diff --git a/apps/packages.nix b/apps/packages.nix index 1b29e0e5..ee6c65fd 100644 --- a/apps/packages.nix +++ b/apps/packages.nix @@ -11,5 +11,6 @@ in listToAttrs (map (x: nameValuePair x (callPackage ./${x})) [ "extract-subs" "gen-docs" + "pin-inputs" "update-sources" ]) diff --git a/apps/pin-inputs/.envrc b/apps/pin-inputs/.envrc new file mode 100644 index 00000000..fd3dddda --- /dev/null +++ b/apps/pin-inputs/.envrc @@ -0,0 +1,2 @@ +use flake $FLAKE#node +npm ci diff --git a/apps/pin-inputs/default.nix b/apps/pin-inputs/default.nix new file mode 100644 index 00000000..1d6b1c75 --- /dev/null +++ b/apps/pin-inputs/default.nix @@ -0,0 +1,11 @@ +{buildApp, ...}: +buildApp { + src = ./.; + npmDepsHash = "sha256-s4eh0nL52/bS/yIo2BQgdTN6l3SiD2NTY2KntxjpIl4="; + + runtimeInputs = []; + + meta.description = '' + Takes a list of inputs to pin to their current rev in `flake.lock`. + ''; +} diff --git a/apps/pin-inputs/eslint.config.ts b/apps/pin-inputs/eslint.config.ts new file mode 100644 index 00000000..7d0908f3 --- /dev/null +++ b/apps/pin-inputs/eslint.config.ts @@ -0,0 +1,3 @@ +import eslintConf from 'eslint-conf'; + +export default eslintConf; diff --git a/apps/pin-inputs/package-lock.json b/apps/pin-inputs/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..9019d71ae2750279015bbacea3d81b6baf0a80e3 GIT binary patch literal 65495 zcmeIbX_u?^~!KHeiPW-f`bE0O_Rf1gul_+wTNT(=;^` zGuNB%+BNptO-d%tfQV;C#Ecmc^FROXZ{Xh#Pj_lZGHYba{5N3g{c*3G5AUnrP}GYfvnoHQT_HmtC1_Z;GUPO z_n)NvYx(cTohLf}75rVX%BOujZ1u&9mjiF(rwIgZh2$XksqW$*=Z7lq{jcLwpU2#4 z`@R-v-d6Ke>*^)WH~mLa1X>Jv{HLH{XVza0RNnKX`kr3iSW4vIfBuBZYsDkC54Y952OSh`UP~)ocd8u zd`HRQtL2km&7U~n z?rUCDgZ_!Kyg}_n)-as6%TfI0FXrwIVbR{j(O zDvp9TeLZDg&+{8||^{m8gM3wnB?`_%kd zj{P$+4p%Jx0VbAaL{?IiQix3%gIiCD8LWE>6qz{%bv<@6Ck6{`KACXsuoEhbJH#*= zMcW;yTda+iJeTLVt*8?Pry1KQAkGWt(8rOJ*-x`(p=;+Gh{u5k&TSZQ-0D& zJdSO^(EI@?mF)VBfOKT!`%m<}VEP`d^a3CpeGMoaeGpPAH!-xZ7p~hvuB-fTs!h-- znJnE&d$dzI+--Kmp%MA8U=b>fCJ@ia0wojL1naRr+uiPbX3Cq;KI5m5-{KeIus9fx zK?*SKU!Zzp=1xM+zZFt|+6AD%)q`;A;`637?}u#O=@Zd@sK%o1j`aOXn)oxK)lv+- z>r63qu;puWEaO_$^VoGvdP#FM>4NKX>fMo+Wdjkm;xv$WH1Fha5#q8(H5iqLM-6Kd2~ z4!z+#AxwivRT^H-Ny{-4DHx_ZU1lPD+FUWt;jo--r`jXV(~)Jr52B8|d>`W9VDe5P z{T}7?LhJ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Ea`5g;{+OG0 z^-wi;eP2ibslQxQNs+ZBE`l0%U+tvXKn!<6Cdw;*L%IjBTeHF1SbI*k_WK-OMOZ#m zEwGsm60s*9-8UA2vqG9_j3-*Sbz+;=({edGCOT7J`%a0!tk)`;ACn?~h0H&>6exO6foqjwhFVU* zafhF@1};VqAYlM6Ls1(So2E@biX%ZNy`3J0aI4oX;Qc^FeQ%mi$)q(?1+BU83%O=6XtN-Jydg)mhOCVE>-wa)2J_qhpjGC%Jnrx#R8 zzFu5{jN)?Ox)Y5n@cE|2?b23rpTWxoqaoYQZk^)BsDWxogJpv-C4!K`7#|$99h7*1@q=UZ_6XPKkLz^)$k=# zs}CST@IXxw5sg&nhrbdrzS|86vy`^8zy4J4Dk#iV%@-)N06CkcnYD=t_cZhiu|0q7kwE zMzJFzQ)t>L)z85plae^tQ3B>0axmst3jA+pDW6;zekvLFxn%oz0NJ%_+j-IOa5<`~r zK7|B=z4nEG5!VXRjU<)gP(G6}tc$6i#LtZ~s+!UPyC$UpI?JRI^!e(pgkI+>-IviZ zkLhzVx}X81ba4e%4`t#;&Gllmw&Q*5alP#b^38#Y=f*56xVC0$y*#!iY}?IK3Q8b% zx(-KLHcO|lYfS>4nOh5kANM9&K0#TH1jic~NlY*)-x=k&Go& literal 0 HcmV?d00001 diff --git a/apps/pin-inputs/package.json b/apps/pin-inputs/package.json new file mode 100644 index 00000000..fcd992cd --- /dev/null +++ b/apps/pin-inputs/package.json @@ -0,0 +1,18 @@ +{ + "name": "pin-inputs", + "version": "0.0.0", + "bin": "out/bin/app.cjs", + "type": "module", + "scripts": { + "build": "node_ver=$(node -v); esbuild src/app.ts --bundle --platform=node --target=\"node${node_ver:1:2}\" --outfile=out/bin/app.cjs" + }, + "devDependencies": { + "eslint-conf": "file:../config", + "@types/node": "22.10.10", + "esbuild": "0.24.2", + "eslint": "9.19.0", + "jiti": "2.4.2", + "pkg-types": "1.3.1", + "typescript": "5.7.3" + } +} diff --git a/apps/pin-inputs/src/app.ts b/apps/pin-inputs/src/app.ts new file mode 100644 index 00000000..629d5b1d --- /dev/null +++ b/apps/pin-inputs/src/app.ts @@ -0,0 +1,60 @@ +import { readFileSync, writeFileSync } from 'fs'; + +export const replaceInFile = (replace: RegExp, replacement: string, file: string) => { + const fileContents = readFileSync(file); + + const replaced = fileContents.toString().replace(replace, replacement); + + writeFileSync(file, replaced); +}; + +/* Constants */ +const FLAKE = process.env.FLAKE; + +if (!FLAKE) { + console.error('Environment variable FLAKE not found'); + process.exit(1); +} + +const FLAKE_LOCK = JSON.parse(readFileSync(`${FLAKE}/flake.lock`, 'utf8')).nodes; +const INPUT_REVS = new Map(); + +Object.entries(FLAKE_LOCK).forEach(([key, val]) => { + if (key !== 'root') { + // eslint-disable-next-line + INPUT_REVS.set(key, (val as any).locked.rev); + } +}); + +const INPUTS = process.argv.slice(2); + + +/** + * Gets the commit hash of the specified input in this flake. + * + * @param input the name of the input + * @returns the commit hash + */ +const getCurrentRev = (input: string): string => { + if (!INPUT_REVS.has(input)) { + throw new Error(`Input ${input} could not be found.`); + } + + return INPUT_REVS.get(input) as string; +}; + +INPUTS.forEach((input) => { + try { + const inputsFile = `${FLAKE}/inputs/default.nix`; + const rev = getCurrentRev(input); + + replaceInFile( + new RegExp(`(\\n[ ]*)${input} =.*\\n.*\\n.*`), + `$&\n$1 # FIXME: $1 rev = "${rev}";`, + inputsFile, + ); + } + catch (e) { + console.error((e as Error).message); + } +}); diff --git a/apps/pin-inputs/tsconfig.json b/apps/pin-inputs/tsconfig.json new file mode 100644 index 00000000..763e4667 --- /dev/null +++ b/apps/pin-inputs/tsconfig.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../config/tsconfig.base.json", + "includes": [ + "*.ts", + "**/*.ts", + "*.js", + "**/*.js" + ] +}