tangled
alpha
login
or
join now
pyrox.dev
/
nix
1
fork
atom
My Nix Configuration
1
fork
atom
overview
issues
pulls
pipelines
[overlays.cinny] add custom nix commands patch for cinny
pyrox.dev
11 months ago
f9da85ea
6050f32c
verified
This commit was signed with the committer's
known signature
.
pyrox.dev
SSH Key Fingerprint:
SHA256:ihSg8ro3xVhqiuGLMtUGTeMVgmEMlaXvSS4AFyYcM/o=
+52
2 changed files
expand all
collapse all
unified
split
overlays
cinny
default.nix
nix-commands.patch
+5
overlays/cinny/default.nix
···
1
1
+
_: prev: {
2
2
+
cinny-unwrapped = prev.cinny-unwrapped.overrideAttrs (old: {
3
3
+
patches = (old.patches or [ ]) ++ [ ./nix-commands.patch ];
4
4
+
});
5
5
+
}
+47
overlays/cinny/nix-commands.patch
···
1
1
+
diff --git c/src/app/features/room/RoomInput.tsx i/src/app/features/room/RoomInput.tsx
2
2
+
index eb214f62..d2b43481 100644
3
3
+
--- c/src/app/features/room/RoomInput.tsx
4
4
+
+++ i/src/app/features/room/RoomInput.tsx
5
5
+
@@ -306,6 +306,12 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
6
6
+
} else if (commandName === Command.UnFlip) {
7
7
+
plainText = `${UNFLIP} ${plainText}`;
8
8
+
customHtml = `${UNFLIP} ${customHtml}`;
9
9
+
+ } else if (commandName === Command.NixIssue) {
10
10
+
+ plainText = `https://github.com/nixos/nixpkgs/issues/${plainText}`;
11
11
+
+ customHtml = `https://github.com/nixos/nixpkgs/issues/${customHtml}`;
12
12
+
+ } else if (commandName === Command.NixPR) {
13
13
+
+ plainText = `https://github.com/nixos/nixpkgs/pull/${plainText}`;
14
14
+
+ customHtml = `https://github.com/nixos/nixpkgs/pull/${customHtml}`;
15
15
+
} else if (commandName) {
16
16
+
const commandContent = commands[commandName as Command];
17
17
+
if (commandContent) {
18
18
+
diff --git c/src/app/hooks/useCommands.ts i/src/app/hooks/useCommands.ts
19
19
+
index bc7d2892..bb6ce6f6 100644
20
20
+
--- c/src/app/hooks/useCommands.ts
21
21
+
+++ i/src/app/hooks/useCommands.ts
22
22
+
@@ -52,6 +52,8 @@ export enum Command {
23
23
+
ConvertToRoom = 'converttoroom',
24
24
+
TableFlip = 'tableflip',
25
25
+
UnFlip = 'unflip',
26
26
+
+ NixIssue = 'nixi',
27
27
+
+ NixPR = 'nixp',
28
28
+
}
29
29
+
30
30
+
export type CommandContent = {
31
31
+
@@ -67,6 +69,16 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
32
32
+
33
33
+
const commands: CommandRecord = useMemo(
34
34
+
() => ({
35
35
+
+ [Command.NixPR]: {
36
36
+
+ name: Command.NixPR,
37
37
+
+ description: 'Link to nixpkgs PR.',
38
38
+
+ exe: async () => undefined,
39
39
+
+ },
40
40
+
+ [Command.NixIssue]: {
41
41
+
+ name: Command.NixIssue,
42
42
+
+ description: 'Link to nixpkgs issue.',
43
43
+
+ exe: async () => undefined,
44
44
+
+ },
45
45
+
[Command.Me]: {
46
46
+
name: Command.Me,
47
47
+
description: 'Send action message',