@adrifer/winix 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +291 -0
- package/dist/backends/nix/index.d.ts +18 -0
- package/dist/backends/nix/index.js +442 -0
- package/dist/cli/activation.d.ts +6 -0
- package/dist/cli/activation.js +19 -0
- package/dist/cli/analysis.d.ts +30 -0
- package/dist/cli/analysis.js +170 -0
- package/dist/cli/commands/apply.d.ts +14 -0
- package/dist/cli/commands/apply.js +180 -0
- package/dist/cli/commands/check.d.ts +6 -0
- package/dist/cli/commands/check.js +46 -0
- package/dist/cli/commands/init.d.ts +5 -0
- package/dist/cli/commands/init.js +69 -0
- package/dist/cli/commands/inspect.d.ts +1 -0
- package/dist/cli/commands/inspect.js +24 -0
- package/dist/cli/commands/switch.d.ts +7 -0
- package/dist/cli/commands/switch.js +40 -0
- package/dist/cli/commands/update.d.ts +6 -0
- package/dist/cli/commands/update.js +33 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +122 -0
- package/dist/cli/loader.d.ts +11 -0
- package/dist/cli/loader.js +49 -0
- package/dist/cli/run.d.ts +4 -0
- package/dist/cli/run.js +26 -0
- package/dist/cli/types-gen/parser.d.ts +14 -0
- package/dist/cli/types-gen/parser.js +275 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/types.d.ts +106 -0
- package/dist/core/types.js +2 -0
- package/dist/evaluator/index.d.ts +20 -0
- package/dist/evaluator/index.js +184 -0
- package/dist/helpers/account.d.ts +46 -0
- package/dist/helpers/account.js +165 -0
- package/dist/helpers/darwin.d.ts +36 -0
- package/dist/helpers/darwin.js +38 -0
- package/dist/helpers/home.d.ts +40 -0
- package/dist/helpers/home.js +63 -0
- package/dist/helpers/index.d.ts +14 -0
- package/dist/helpers/index.js +7 -0
- package/dist/helpers/nix.d.ts +36 -0
- package/dist/helpers/nix.js +157 -0
- package/dist/helpers/nixos.d.ts +53 -0
- package/dist/helpers/nixos.js +86 -0
- package/dist/helpers/options.d.ts +10 -0
- package/dist/helpers/options.js +1 -0
- package/dist/helpers/overlay.d.ts +13 -0
- package/dist/helpers/overlay.js +29 -0
- package/dist/helpers/platforms.d.ts +21 -0
- package/dist/helpers/platforms.js +62 -0
- package/dist/helpers/utils.d.ts +6 -0
- package/dist/helpers/utils.js +8 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +5 -0
- package/dist/sdk/index.d.ts +26 -0
- package/dist/sdk/index.js +183 -0
- package/dist/types/common.d.ts +10 -0
- package/dist/types/common.js +1 -0
- package/dist/types/darwin.d.ts +86 -0
- package/dist/types/darwin.js +1 -0
- package/dist/types/home.d.ts +45 -0
- package/dist/types/home.js +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types/nixos.d.ts +225 -0
- package/dist/types/nixos.js +1 -0
- package/dist/types/programs.d.ts +67 -0
- package/dist/types/programs.js +1 -0
- package/index.d.ts +5 -0
- package/package.json +69 -0
- package/types/bundled/darwin.d.ts +476 -0
- package/types/bundled/home-manager.d.ts +4674 -0
- package/types/bundled/nixos.d.ts +19991 -0
- package/types/index.d.ts +8 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { PackageRef, Script } from "./common.js";
|
|
2
|
+
import type { ImportRef, NixExpr } from "../core/types.js";
|
|
3
|
+
export interface NixSettings extends Record<string, unknown> {
|
|
4
|
+
"experimental-features"?: string[] | string | NixExpr;
|
|
5
|
+
experimentalFeatures?: string[] | string | NixExpr;
|
|
6
|
+
substituters?: string[] | NixExpr;
|
|
7
|
+
"trusted-public-keys"?: string[] | NixExpr;
|
|
8
|
+
trustedPublicKeys?: string[] | NixExpr;
|
|
9
|
+
"trusted-users"?: string[] | NixExpr;
|
|
10
|
+
trustedUsers?: string[] | NixExpr;
|
|
11
|
+
"auto-optimise-store"?: boolean | NixExpr;
|
|
12
|
+
autoOptimiseStore?: boolean | NixExpr;
|
|
13
|
+
}
|
|
14
|
+
export interface NixGcOptions extends Record<string, unknown> {
|
|
15
|
+
automatic?: boolean;
|
|
16
|
+
dates?: string;
|
|
17
|
+
interval?: Record<string, number>;
|
|
18
|
+
options?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface NixOptions extends Record<string, unknown> {
|
|
21
|
+
gc?: NixGcOptions;
|
|
22
|
+
settings?: NixSettings;
|
|
23
|
+
package?: PackageRef;
|
|
24
|
+
}
|
|
25
|
+
export interface NixpkgsOptions extends Record<string, unknown> {
|
|
26
|
+
config?: NixConfig;
|
|
27
|
+
overlays?: unknown[];
|
|
28
|
+
hostPlatform?: string;
|
|
29
|
+
pkgs?: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface NixConfig extends Record<string, unknown> {
|
|
32
|
+
allowUnfree?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface FirewallOptions extends Record<string, unknown> {
|
|
35
|
+
enable?: boolean;
|
|
36
|
+
allowedTCPPorts?: number[];
|
|
37
|
+
allowedUDPPorts?: number[];
|
|
38
|
+
}
|
|
39
|
+
export interface NetworkingOptions extends Record<string, unknown> {
|
|
40
|
+
hostName?: string;
|
|
41
|
+
hostId?: string;
|
|
42
|
+
firewall?: FirewallOptions;
|
|
43
|
+
useDHCP?: boolean;
|
|
44
|
+
interfaces?: Record<string, {
|
|
45
|
+
useDHCP?: boolean;
|
|
46
|
+
ipv4?: unknown;
|
|
47
|
+
} & Record<string, unknown>>;
|
|
48
|
+
nameservers?: string[];
|
|
49
|
+
wireless?: {
|
|
50
|
+
enable?: boolean;
|
|
51
|
+
} & Record<string, unknown>;
|
|
52
|
+
networkmanager?: {
|
|
53
|
+
enable?: boolean;
|
|
54
|
+
} & Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
export interface UserOptions extends Record<string, unknown> {
|
|
57
|
+
isNormalUser?: boolean;
|
|
58
|
+
extraGroups?: string[];
|
|
59
|
+
uid?: number;
|
|
60
|
+
shell?: PackageRef;
|
|
61
|
+
home?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface UsersOptions extends Record<string, unknown> {
|
|
64
|
+
users?: Record<string, UserOptions>;
|
|
65
|
+
groups?: Record<string, Record<string, unknown>>;
|
|
66
|
+
defaultUserShell?: PackageRef;
|
|
67
|
+
}
|
|
68
|
+
export interface NixosSystemOptions extends Record<string, unknown> {
|
|
69
|
+
stateVersion?: string;
|
|
70
|
+
activationScripts?: Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
export interface BootOptions extends Record<string, unknown> {
|
|
73
|
+
isContainer?: boolean;
|
|
74
|
+
kernel?: {
|
|
75
|
+
sysctl?: Record<string, string | number | boolean>;
|
|
76
|
+
} & Record<string, unknown>;
|
|
77
|
+
loader?: Record<string, unknown>;
|
|
78
|
+
kernelModules?: string[];
|
|
79
|
+
kernelPackages?: PackageRef;
|
|
80
|
+
extraModulePackages?: PackageRef[];
|
|
81
|
+
supportedFilesystems?: string[];
|
|
82
|
+
initrd?: {
|
|
83
|
+
availableKernelModules?: string[];
|
|
84
|
+
kernelModules?: string[];
|
|
85
|
+
supportedFilesystems?: string[];
|
|
86
|
+
} & Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
export interface SystemdService extends Record<string, unknown> {
|
|
89
|
+
description?: string;
|
|
90
|
+
serviceConfig?: Record<string, unknown>;
|
|
91
|
+
script?: Script;
|
|
92
|
+
path?: PackageRef[];
|
|
93
|
+
wantedBy?: string[];
|
|
94
|
+
after?: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface SystemdTimer extends Record<string, unknown> {
|
|
97
|
+
description?: string;
|
|
98
|
+
timerConfig?: Record<string, unknown>;
|
|
99
|
+
wantedBy?: string[];
|
|
100
|
+
}
|
|
101
|
+
export interface SystemdOptions extends Record<string, unknown> {
|
|
102
|
+
services?: Record<string, SystemdService>;
|
|
103
|
+
timers?: Record<string, SystemdTimer>;
|
|
104
|
+
tmpfiles?: {
|
|
105
|
+
rules?: string[];
|
|
106
|
+
} & Record<string, unknown>;
|
|
107
|
+
mounts?: Record<string, unknown>[];
|
|
108
|
+
}
|
|
109
|
+
export interface ServicesOptions extends Record<string, unknown> {
|
|
110
|
+
}
|
|
111
|
+
export interface NixosSecurityOptions extends Record<string, unknown> {
|
|
112
|
+
sudo?: {
|
|
113
|
+
wheelNeedsPassword?: boolean;
|
|
114
|
+
extraRules?: Array<{
|
|
115
|
+
groups?: string[];
|
|
116
|
+
commands?: Array<{
|
|
117
|
+
command: string;
|
|
118
|
+
options?: string[];
|
|
119
|
+
} & Record<string, unknown>>;
|
|
120
|
+
} & Record<string, unknown>>;
|
|
121
|
+
} & Record<string, unknown>;
|
|
122
|
+
pam?: {
|
|
123
|
+
services?: Record<string, {
|
|
124
|
+
text?: string;
|
|
125
|
+
touchIdAuth?: boolean;
|
|
126
|
+
} & Record<string, unknown>>;
|
|
127
|
+
} & Record<string, unknown>;
|
|
128
|
+
rtkit?: {
|
|
129
|
+
enable?: boolean;
|
|
130
|
+
} & Record<string, unknown>;
|
|
131
|
+
polkit?: {
|
|
132
|
+
enable?: boolean;
|
|
133
|
+
} & Record<string, unknown>;
|
|
134
|
+
}
|
|
135
|
+
export interface I18nOptions extends Record<string, unknown> {
|
|
136
|
+
defaultLocale?: string;
|
|
137
|
+
supportedLocales?: string[];
|
|
138
|
+
}
|
|
139
|
+
export interface TimeOptions extends Record<string, unknown> {
|
|
140
|
+
timeZone?: string;
|
|
141
|
+
}
|
|
142
|
+
export interface EnvironmentOptions extends Record<string, unknown> {
|
|
143
|
+
systemPackages?: PackageRef[];
|
|
144
|
+
shells?: PackageRef[];
|
|
145
|
+
variables?: Record<string, string>;
|
|
146
|
+
pathsToLink?: string[];
|
|
147
|
+
etc?: Record<string, {
|
|
148
|
+
text?: string;
|
|
149
|
+
source?: string;
|
|
150
|
+
mode?: string;
|
|
151
|
+
} & Record<string, unknown>>;
|
|
152
|
+
interactiveShellInit?: Script;
|
|
153
|
+
}
|
|
154
|
+
export interface FontsOptions extends Record<string, unknown> {
|
|
155
|
+
packages?: PackageRef[];
|
|
156
|
+
enableDefaultPackages?: boolean;
|
|
157
|
+
fontconfig?: {
|
|
158
|
+
defaultFonts?: {
|
|
159
|
+
serif?: string[];
|
|
160
|
+
sansSerif?: string[];
|
|
161
|
+
monospace?: string[];
|
|
162
|
+
emoji?: string[];
|
|
163
|
+
} & Record<string, unknown>;
|
|
164
|
+
} & Record<string, unknown>;
|
|
165
|
+
}
|
|
166
|
+
export interface OciContainerOptions extends Record<string, unknown> {
|
|
167
|
+
image: string;
|
|
168
|
+
autoStart?: boolean;
|
|
169
|
+
ports?: string[];
|
|
170
|
+
volumes?: string[];
|
|
171
|
+
environment?: Record<string, string>;
|
|
172
|
+
extraOptions?: string[];
|
|
173
|
+
}
|
|
174
|
+
export interface VirtualisationOptions extends Record<string, unknown> {
|
|
175
|
+
podman?: {
|
|
176
|
+
enable?: boolean;
|
|
177
|
+
} & Record<string, unknown>;
|
|
178
|
+
docker?: {
|
|
179
|
+
enable?: boolean;
|
|
180
|
+
} & Record<string, unknown>;
|
|
181
|
+
ociContainers?: {
|
|
182
|
+
backend?: "podman" | "docker";
|
|
183
|
+
containers?: Record<string, OciContainerOptions>;
|
|
184
|
+
} & Record<string, unknown>;
|
|
185
|
+
libvirtd?: {
|
|
186
|
+
enable?: boolean;
|
|
187
|
+
} & Record<string, unknown>;
|
|
188
|
+
}
|
|
189
|
+
export interface WslOptions extends Record<string, unknown> {
|
|
190
|
+
enable?: boolean;
|
|
191
|
+
defaultUser?: string | NixExpr;
|
|
192
|
+
extraBin?: Array<{
|
|
193
|
+
src?: string | NixExpr;
|
|
194
|
+
} & Record<string, unknown>>;
|
|
195
|
+
wslConf?: {
|
|
196
|
+
interop?: {
|
|
197
|
+
enabled?: boolean;
|
|
198
|
+
appendWindowsPath?: boolean;
|
|
199
|
+
} & Record<string, unknown>;
|
|
200
|
+
} & Record<string, unknown>;
|
|
201
|
+
interop?: {
|
|
202
|
+
register?: boolean;
|
|
203
|
+
} & Record<string, unknown>;
|
|
204
|
+
}
|
|
205
|
+
export interface NixosOptions extends Record<string, unknown> {
|
|
206
|
+
imports?: ImportRef[];
|
|
207
|
+
nix?: NixOptions;
|
|
208
|
+
nixpkgs?: NixpkgsOptions;
|
|
209
|
+
networking?: NetworkingOptions;
|
|
210
|
+
users?: UsersOptions;
|
|
211
|
+
boot?: BootOptions;
|
|
212
|
+
services?: ServicesOptions;
|
|
213
|
+
security?: NixosSecurityOptions;
|
|
214
|
+
i18n?: I18nOptions;
|
|
215
|
+
time?: TimeOptions;
|
|
216
|
+
systemd?: SystemdOptions;
|
|
217
|
+
environment?: EnvironmentOptions;
|
|
218
|
+
fonts?: FontsOptions;
|
|
219
|
+
virtualisation?: VirtualisationOptions;
|
|
220
|
+
programs?: Record<string, unknown>;
|
|
221
|
+
wsl?: WslOptions;
|
|
222
|
+
system?: NixosSystemOptions;
|
|
223
|
+
homeManager?: Record<string, unknown>;
|
|
224
|
+
"home-manager"?: Record<string, unknown>;
|
|
225
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Attrs, PackageRef, Script } from "./common.js";
|
|
2
|
+
import type { NixExpr } from "../core/types.js";
|
|
3
|
+
export interface ZshPlugin extends Record<string, unknown> {
|
|
4
|
+
name?: string;
|
|
5
|
+
src?: PackageRef;
|
|
6
|
+
file?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ZshOptions extends Record<string, unknown> {
|
|
9
|
+
enable?: boolean;
|
|
10
|
+
enableCompletion?: boolean;
|
|
11
|
+
autosuggestion?: {
|
|
12
|
+
enable?: boolean;
|
|
13
|
+
} & Record<string, unknown>;
|
|
14
|
+
syntaxHighlighting?: {
|
|
15
|
+
enable?: boolean;
|
|
16
|
+
} & Record<string, unknown>;
|
|
17
|
+
plugins?: ZshPlugin[];
|
|
18
|
+
shellAliases?: Record<string, string> | NixExpr;
|
|
19
|
+
initContent?: Script;
|
|
20
|
+
initExtra?: Script;
|
|
21
|
+
envExtra?: Script;
|
|
22
|
+
defaultKeymap?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GitInclude extends Record<string, unknown> {
|
|
25
|
+
condition?: string;
|
|
26
|
+
contents?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface GitOptions extends Record<string, unknown> {
|
|
29
|
+
enable?: boolean;
|
|
30
|
+
userName?: string;
|
|
31
|
+
userEmail?: string;
|
|
32
|
+
settings?: Record<string, unknown>;
|
|
33
|
+
extraConfig?: Record<string, unknown>;
|
|
34
|
+
includes?: GitInclude[];
|
|
35
|
+
aliases?: Record<string, string>;
|
|
36
|
+
signing?: {
|
|
37
|
+
key?: string;
|
|
38
|
+
format?: "ssh" | "gpg";
|
|
39
|
+
} & Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
export interface StarshipOptions extends Record<string, unknown> {
|
|
42
|
+
enable?: boolean;
|
|
43
|
+
enableZshIntegration?: boolean;
|
|
44
|
+
settings?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
export interface FzfOptions extends Record<string, unknown> {
|
|
47
|
+
enable?: boolean;
|
|
48
|
+
enableZshIntegration?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface ZoxideOptions extends Record<string, unknown> {
|
|
51
|
+
enable?: boolean;
|
|
52
|
+
enableZshIntegration?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface TmuxOptions extends Record<string, unknown> {
|
|
55
|
+
enable?: boolean;
|
|
56
|
+
terminal?: string;
|
|
57
|
+
keyMode?: string;
|
|
58
|
+
plugins?: PackageRef[];
|
|
59
|
+
extraConfig?: Script;
|
|
60
|
+
}
|
|
61
|
+
export interface NeovimOptions extends Record<string, unknown> {
|
|
62
|
+
enable?: boolean;
|
|
63
|
+
defaultEditor?: boolean;
|
|
64
|
+
viAlias?: boolean;
|
|
65
|
+
vimAlias?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export type ProgramSettings = Attrs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adrifer/winix",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript-first system configuration for NixOS, nix-darwin, and Home Manager",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Adrian Fernandez",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/adrifer/winix.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/adrifer/winix/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/adrifer/winix#readme",
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"nix",
|
|
20
|
+
"nixos",
|
|
21
|
+
"nix-darwin",
|
|
22
|
+
"home-manager",
|
|
23
|
+
"typescript",
|
|
24
|
+
"configuration"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./types": {
|
|
35
|
+
"import": "./dist/types/index.js",
|
|
36
|
+
"types": "./dist/types/index.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./types/bundled": {
|
|
39
|
+
"types": "./types/index.d.ts"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"bin": {
|
|
43
|
+
"winix": "dist/cli/index.js"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"types",
|
|
48
|
+
"index.d.ts",
|
|
49
|
+
"LICENSE",
|
|
50
|
+
"README.md"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/fix-dts-imports.mjs",
|
|
54
|
+
"dev": "tsc --watch",
|
|
55
|
+
"test": "vitest",
|
|
56
|
+
"lint": "eslint src/",
|
|
57
|
+
"check": "tsc --noEmit",
|
|
58
|
+
"prepack": "npm run build",
|
|
59
|
+
"generate:types": "npx tsx scripts/generate-types.ts",
|
|
60
|
+
"generate:types:nixos": "npx tsx scripts/generate-types.ts nixos",
|
|
61
|
+
"generate:types:hm": "npx tsx scripts/generate-types.ts home-manager",
|
|
62
|
+
"generate:types:darwin": "npx tsx scripts/generate-types.ts darwin"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/node": "^22.0.0",
|
|
66
|
+
"typescript": "^5.7.0",
|
|
67
|
+
"vitest": "^3.0.0"
|
|
68
|
+
}
|
|
69
|
+
}
|