My Nix Configuration

[overlays.cinny] add custom nix commands patch for cinny

pyrox.dev f9da85ea 6050f32c

verified
+52
+5
overlays/cinny/default.nix
··· 1 + _: prev: { 2 + cinny-unwrapped = prev.cinny-unwrapped.overrideAttrs (old: { 3 + patches = (old.patches or [ ]) ++ [ ./nix-commands.patch ]; 4 + }); 5 + }
+47
overlays/cinny/nix-commands.patch
··· 1 + diff --git c/src/app/features/room/RoomInput.tsx i/src/app/features/room/RoomInput.tsx 2 + index eb214f62..d2b43481 100644 3 + --- c/src/app/features/room/RoomInput.tsx 4 + +++ i/src/app/features/room/RoomInput.tsx 5 + @@ -306,6 +306,12 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>( 6 + } else if (commandName === Command.UnFlip) { 7 + plainText = `${UNFLIP} ${plainText}`; 8 + customHtml = `${UNFLIP} ${customHtml}`; 9 + + } else if (commandName === Command.NixIssue) { 10 + + plainText = `https://github.com/nixos/nixpkgs/issues/${plainText}`; 11 + + customHtml = `https://github.com/nixos/nixpkgs/issues/${customHtml}`; 12 + + } else if (commandName === Command.NixPR) { 13 + + plainText = `https://github.com/nixos/nixpkgs/pull/${plainText}`; 14 + + customHtml = `https://github.com/nixos/nixpkgs/pull/${customHtml}`; 15 + } else if (commandName) { 16 + const commandContent = commands[commandName as Command]; 17 + if (commandContent) { 18 + diff --git c/src/app/hooks/useCommands.ts i/src/app/hooks/useCommands.ts 19 + index bc7d2892..bb6ce6f6 100644 20 + --- c/src/app/hooks/useCommands.ts 21 + +++ i/src/app/hooks/useCommands.ts 22 + @@ -52,6 +52,8 @@ export enum Command { 23 + ConvertToRoom = 'converttoroom', 24 + TableFlip = 'tableflip', 25 + UnFlip = 'unflip', 26 + + NixIssue = 'nixi', 27 + + NixPR = 'nixp', 28 + } 29 + 30 + export type CommandContent = { 31 + @@ -67,6 +69,16 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { 32 + 33 + const commands: CommandRecord = useMemo( 34 + () => ({ 35 + + [Command.NixPR]: { 36 + + name: Command.NixPR, 37 + + description: 'Link to nixpkgs PR.', 38 + + exe: async () => undefined, 39 + + }, 40 + + [Command.NixIssue]: { 41 + + name: Command.NixIssue, 42 + + description: 'Link to nixpkgs issue.', 43 + + exe: async () => undefined, 44 + + }, 45 + [Command.Me]: { 46 + name: Command.Me, 47 + description: 'Send action message',