-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
129 lines (116 loc) · 3.96 KB
/
Copy pathflake.nix
File metadata and controls
129 lines (116 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
description = "My NixOS system flake";
inputs = {
eupkgs.inputs.nixpkgs.follows = "nixpkgs-unstable";
eupkgs.url = "github:euvlok/pkgs";
nixcord.inputs.nixpkgs.follows = "nixpkgs-unstable";
nixcord.url = "github:FlameFlag/nixcord";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05-small";
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
sops-nix.url = "github:Mic92/sops-nix";
};
outputs =
inputs:
let
formatterSystems = [
"x86_64-linux"
];
ghidraMcpSystems = [
"x86_64-linux"
"aarch64-darwin"
];
forAllFormatterSystems = inputs.nixpkgs.lib.genAttrs formatterSystems;
forAllGhidraMcpSystems = inputs.nixpkgs.lib.genAttrs ghidraMcpSystems;
commonNixpkgs = import ./modules/cross/nixpkgs.nix { inherit inputs; };
equicordParseRules = builtins.fromJSON (
builtins.readFile "${inputs.nixcord}/modules/plugins/parse-rules.json"
);
equicordSettings = import ./modules/equicord/settings.nix {
lib = inputs.nixpkgs.lib;
parseRules = equicordParseRules;
};
mkPkgs =
system:
import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
inherit (commonNixpkgs.nixpkgs) overlays;
};
mkEquicordSettingsPackage =
pkgs:
pkgs.runCommand "equicord-settings"
{
nativeBuildInputs = [ pkgs.jq ];
}
''
mkdir -p "$out"
jq . ${pkgs.writeText "equicord-settings.json" (builtins.toJSON equicordSettings.jsonConfig)} > "$out/settings.json"
cp ${./ansible/files/apps/equicord/quickCss.css} "$out/quickCss.css"
'';
in
{
lib.equicordSettingsJson = equicordSettings.jsonConfig;
formatter = forAllFormatterSystems (
system:
let
pkgs = mkPkgs system;
in
pkgs.writeShellApplication {
name = "dotfiles-format";
runtimeInputs = with pkgs; [
git
gofumpt
nixfmt-tree
shfmt
];
text = ''
set -euo pipefail
repo_dir="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
cd "$repo_dir"
find . -path ./.git -prune -o -name '*.sh' -type f -exec shfmt -w -i 2 -bn {} +
find . -path ./.git -prune -o -name '*.go' -type f -exec gofumpt -w {} +
treefmt "$@"
'';
}
);
packages = forAllGhidraMcpSystems (
system:
let
pkgs = mkPkgs system;
ghidraMcp = pkgs.ghidra-mcp;
ghidraMcpHeadless = pkgs.ghidra-mcp-headless;
in
{
ghidra-mcp = ghidraMcp;
ghidra-mcp-headless = ghidraMcpHeadless;
ghidra-mcp-httpd = ghidraMcpHeadless.httpd;
ghidra-mcp-bridge = ghidraMcpHeadless.bridge;
ghidra-mcp-launcher = ghidraMcpHeadless.launcher;
ghidra = ghidraMcpHeadless.ghidra;
equicord-settings = mkEquicordSettingsPackage pkgs;
}
);
apps = forAllGhidraMcpSystems (
system:
let
pkgs = mkPkgs system;
ghidraMcp = pkgs.ghidra-mcp;
ghidraMcpHeadless = pkgs.ghidra-mcp-headless;
appFor = program: {
type = "app";
inherit program;
};
in
{
ghidra-mcp = appFor "${ghidraMcp}/bin/ghidra-mcp-serve";
ghidra-mcp-headless = appFor "${ghidraMcpHeadless.launcher}/bin/ghidra-mcp-headless";
ghidra-mcp-httpd = appFor "${ghidraMcpHeadless.httpd}/bin/ghidra-mcp-httpd";
ghidra-mcp-bridge = appFor "${ghidraMcpHeadless.bridge}/bin/ghidra-mcp-bridge";
default = appFor "${ghidraMcp}/bin/ghidra-mcp-serve";
}
);
nixosModules.default = import ./modules/nixos;
nixosConfigurations = import ./hosts/linux { inherit inputs; };
};
}