My Nix Configuration

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

pyrox.dev f9da85ea 6050f32c

verified
Changed files
+52
overlays
+5
overlays/cinny/default.nix
···
+
_: prev: {
+
cinny-unwrapped = prev.cinny-unwrapped.overrideAttrs (old: {
+
patches = (old.patches or [ ]) ++ [ ./nix-commands.patch ];
+
});
+
}
+47
overlays/cinny/nix-commands.patch
···
+
diff --git c/src/app/features/room/RoomInput.tsx i/src/app/features/room/RoomInput.tsx
+
index eb214f62..d2b43481 100644
+
--- c/src/app/features/room/RoomInput.tsx
+
+++ i/src/app/features/room/RoomInput.tsx
+
@@ -306,6 +306,12 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
+
} else if (commandName === Command.UnFlip) {
+
plainText = `${UNFLIP} ${plainText}`;
+
customHtml = `${UNFLIP} ${customHtml}`;
+
+ } else if (commandName === Command.NixIssue) {
+
+ plainText = `https://github.com/nixos/nixpkgs/issues/${plainText}`;
+
+ customHtml = `https://github.com/nixos/nixpkgs/issues/${customHtml}`;
+
+ } else if (commandName === Command.NixPR) {
+
+ plainText = `https://github.com/nixos/nixpkgs/pull/${plainText}`;
+
+ customHtml = `https://github.com/nixos/nixpkgs/pull/${customHtml}`;
+
} else if (commandName) {
+
const commandContent = commands[commandName as Command];
+
if (commandContent) {
+
diff --git c/src/app/hooks/useCommands.ts i/src/app/hooks/useCommands.ts
+
index bc7d2892..bb6ce6f6 100644
+
--- c/src/app/hooks/useCommands.ts
+
+++ i/src/app/hooks/useCommands.ts
+
@@ -52,6 +52,8 @@ export enum Command {
+
ConvertToRoom = 'converttoroom',
+
TableFlip = 'tableflip',
+
UnFlip = 'unflip',
+
+ NixIssue = 'nixi',
+
+ NixPR = 'nixp',
+
}
+
+
export type CommandContent = {
+
@@ -67,6 +69,16 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
+
+
const commands: CommandRecord = useMemo(
+
() => ({
+
+ [Command.NixPR]: {
+
+ name: Command.NixPR,
+
+ description: 'Link to nixpkgs PR.',
+
+ exe: async () => undefined,
+
+ },
+
+ [Command.NixIssue]: {
+
+ name: Command.NixIssue,
+
+ description: 'Link to nixpkgs issue.',
+
+ exe: async () => undefined,
+
+ },
+
[Command.Me]: {
+
name: Command.Me,
+
description: 'Send action message',