Home

helix.drv @main - refs - log -
-
https://git.jolheiser.com/helix.drv.git
My Helix configuration as a Nix derivation
tree log patch
build with central nixpkgs Signed-off-by: jolheiser <git@jolheiser.com>
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQHamcKurJIIemlQH6rmeBN8PfXe5r9qs4Jg/QjOC6IucbK7PjNjuBW0P+ZTzMJMU2E Qw91SjIiqW+H9Ox+JCfAU= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
8 months ago
2 changed files, 130 additions(+), 93 deletions(-)
flake.lockflake.nix
M flake.lockflake.lock
 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
diff --git a/flake.lock b/flake.lock
index 1597b0a1544769f9764df135d2871121cbc87ef2..ec3f22a143e3f24bfbf03ef3db5e51c152335e89 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,24 +1,46 @@
 {
   "nodes": {
+    "jolheiser": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      },
+      "locked": {
+        "lastModified": 1730336659,
+        "narHash": "sha256-DYQUprBce8sXdBj7Ub1h/52GnGvxiXelvucVTcTXE8I=",
+        "ref": "refs/heads/main",
+        "rev": "69856a465c69e5b456ef652f0f5f17a12b9d8c02",
+        "revCount": 3,
+        "type": "git",
+        "url": "https://git.jolheiser.com/nixpkgs.git"
+      },
+      "original": {
+        "type": "git",
+        "url": "https://git.jolheiser.com/nixpkgs.git"
+      }
+    },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1715653339,
-        "narHash": "sha256-7lR9tpVXviSccl07GXI0+ve/natd24HAkuy1sQp0OlI=",
+        "lastModified": 1729880355,
+        "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "abd6d48f8c77bea7dc51beb2adfa6ed3950d2585",
+        "rev": "18536bf04cd71abd345f9579158841376fdd0c5a",
         "type": "github"
       },
       "original": {
         "owner": "nixos",
-        "ref": "nixpkgs-unstable",
+        "ref": "nixos-unstable",
         "repo": "nixpkgs",
         "type": "github"
       }
     },
     "root": {
       "inputs": {
-        "nixpkgs": "nixpkgs"
+        "jolheiser": "jolheiser",
+        "nixpkgs": [
+          "jolheiser",
+          "nixpkgs"
+        ]
       }
     }
   },
M flake.nixflake.nix
  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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
diff --git a/flake.nix b/flake.nix
index dad44ba18beb86173b66750686999390d836d374..0fd4eff9567a0d8efa4c12430867da96ce14f46d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,106 +1,121 @@
 {
   description = "jolheiser helix derivation";
-
   inputs = {
-    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+    jolheiser.url = "git+https://git.jolheiser.com/nixpkgs.git";
+    nixpkgs.follows = "jolheiser/nixpkgs";
   };
-
-  outputs = {
-    self,
-    nixpkgs,
-  }: let
-    pkgs = nixpkgs.legacyPackages.x86_64-linux;
-    tomlFormat = pkgs.formats.toml {};
-    config = import ./config.nix {pkgs = pkgs;};
-    buildGrammar = grammar: let
-      source = pkgs.fetchgit {
-        inherit (grammar) url rev sha256;
-      };
-      linkQueries = pkgs.lib.optionalString (builtins.hasAttr "queries" grammar) "cp -r ${source}/${grammar.queries} $out/queries";
-    in
-      pkgs.stdenv.mkDerivation {
-        pname = "helix-tree-sitter-grammar-${grammar.name}";
-        version = grammar.rev;
-        buildInputs = [pkgs.helix pkgs.git];
-        src = source;
-        dontInstall = true;
-        buildPhase = ''
-          runHook preBuild
+  outputs =
+    {
+      nixpkgs,
+      ...
+    }:
+    let
+      pkgs = nixpkgs.legacyPackages.x86_64-linux;
+      tomlFormat = pkgs.formats.toml { };
+      config = import ./config.nix { pkgs = pkgs; };
+      buildGrammar =
+        grammar:
+        let
+          source = pkgs.fetchgit {
+            inherit (grammar) url rev sha256;
+          };
+          linkQueries = pkgs.lib.optionalString (builtins.hasAttr "queries" grammar) "cp -r ${source}/${grammar.queries} $out/queries";
+        in
+        pkgs.stdenv.mkDerivation {
+          pname = "helix-tree-sitter-grammar-${grammar.name}";
+          version = grammar.rev;
+          buildInputs = [
+            pkgs.helix
+            pkgs.git
+          ];
+          src = source;
+          dontInstall = true;
+          buildPhase = ''
+            runHook preBuild
 
-          mkdir .helix
-          cat << EOF > .helix/languages.toml
-          use-grammars = { only = ["${grammar.name}"] }
-          [[grammar]]
-          name = "${grammar.name}"
-          source = { git = "${grammar.url}", rev = "${grammar.rev}" }
-          EOF
+            mkdir .helix
+            cat << EOF > .helix/languages.toml
+            use-grammars = { only = ["${grammar.name}"] }
+            [[grammar]]
+            name = "${grammar.name}"
+            source = { git = "${grammar.url}", rev = "${grammar.rev}" }
+            EOF
 
-          mkdir -p runtime/grammars/sources
-          cp -r ${source} runtime/grammars/sources/${grammar.name}
-          export CARGO_MANIFEST_DIR=$(pwd)/.helix
+            mkdir -p runtime/grammars/sources
+            cp -r ${source} runtime/grammars/sources/${grammar.name}
+            export CARGO_MANIFEST_DIR=$(pwd)/.helix
 
-          #hx -g fetch
-          hx -g build
+            #hx -g fetch
+            hx -g build
 
-          mkdir $out
-          cp runtime/grammars/${grammar.name}.so $out/${grammar.name}.so
-          ${linkQueries}
+            mkdir $out
+            cp runtime/grammars/${grammar.name}.so $out/${grammar.name}.so
+            ${linkQueries}
 
-          runHook postBuild
-        '';
-      };
-    builtGrammars =
-      builtins.map (grammar: {
+            runHook postBuild
+          '';
+        };
+      builtGrammars = builtins.map (grammar: {
         inherit (grammar) name;
         artifact = buildGrammar grammar;
-      })
-      config.grammars;
-    ignoreFile = pkgs.writeText "ignore" (builtins.concatStringsSep "\n" config.ignore);
-    configFile = pkgs.writeText "config.toml" (builtins.readFile (tomlFormat.generate "helix-config" config.settings));
-    languageFile = pkgs.writeText "languages.toml" (builtins.readFile (tomlFormat.generate "helix-languages" config.languages));
-    themeFiles =
-      pkgs.lib.mapAttrsToList (
-        name: value: {
-          inherit name;
-          file = pkgs.writeText "${name}.toml" (builtins.readFile (tomlFormat.generate "helix-theme-${name}" value));
-        }
-      )
-      config.themes;
-    themeLinks = builtins.map (theme: "ln -s ${theme.file} $out/home/helix/themes/${theme.name}.toml") themeFiles;
-    grammarLinks = builtins.map (grammar: "ln -s ${grammar.artifact}/${grammar.name}.so $out/lib/runtime/grammars/${grammar.name}.so") builtGrammars;
-    queryLinks = builtins.map (grammar: "ln -s ${grammar.artifact}/queries $out/lib/runtime/queries/${grammar.name}") builtGrammars;
-  in {
-    packages.x86_64-linux.default =
-      pkgs.runCommand "hx" {
-        buildInputs = [pkgs.makeWrapper];
-      } ''
-        mkdir $out
-        ln -s ${pkgs.helix}/* $out
-        rm $out/bin
+      }) config.grammars;
+      ignoreFile = pkgs.writeText "ignore" (builtins.concatStringsSep "\n" config.ignore);
+      configFile = pkgs.writeText "config.toml" (
+        builtins.readFile (tomlFormat.generate "helix-config" config.settings)
+      );
+      languageFile = pkgs.writeText "languages.toml" (
+        builtins.readFile (tomlFormat.generate "helix-languages" config.languages)
+      );
+      themeFiles = pkgs.lib.mapAttrsToList (name: value: {
+        inherit name;
+        file = pkgs.writeText "${name}.toml" (
+          builtins.readFile (tomlFormat.generate "helix-theme-${name}" value)
+        );
+      }) config.themes;
+      themeLinks = builtins.map (
+        theme: "ln -s ${theme.file} $out/home/helix/themes/${theme.name}.toml"
+      ) themeFiles;
+      grammarLinks = builtins.map (
+        grammar: "ln -s ${grammar.artifact}/${grammar.name}.so $out/lib/runtime/grammars/${grammar.name}.so"
+      ) builtGrammars;
+      queryLinks = builtins.map (
+        grammar: "ln -s ${grammar.artifact}/queries $out/lib/runtime/queries/${grammar.name}"
+      ) builtGrammars;
+    in
+    {
+      packages.x86_64-linux.default =
+        pkgs.runCommand "hx"
+          {
+            buildInputs = [ pkgs.makeWrapper ];
+          }
+          ''
+            mkdir $out
+            ln -s ${pkgs.helix}/* $out
+            rm $out/bin
 
-        rm $out/lib
-        mkdir -p $out/lib/runtime
-        ln -s ${pkgs.helix}/lib/runtime/* $out/lib/runtime
+            rm $out/lib
+            mkdir -p $out/lib/runtime
+            ln -s ${pkgs.helix}/lib/runtime/* $out/lib/runtime
 
-        rm $out/lib/runtime/grammars
-        mkdir $out/lib/runtime/grammars
-        ln -s ${pkgs.helix}/lib/runtime/grammars/* $out/lib/runtime/grammars
-        ${builtins.concatStringsSep "\n" grammarLinks}
+            rm $out/lib/runtime/grammars
+            mkdir $out/lib/runtime/grammars
+            ln -s ${pkgs.helix}/lib/runtime/grammars/* $out/lib/runtime/grammars
+            ${builtins.concatStringsSep "\n" grammarLinks}
 
-        rm $out/lib/runtime/queries
-        mkdir $out/lib/runtime/queries
-        ln -s ${pkgs.helix}/lib/runtime/queries/* $out/lib/runtime/queries
-        ${builtins.concatStringsSep "\n" queryLinks}
+            rm $out/lib/runtime/queries
+            mkdir $out/lib/runtime/queries
+            ln -s ${pkgs.helix}/lib/runtime/queries/* $out/lib/runtime/queries
+            ${builtins.concatStringsSep "\n" queryLinks}
 
-        mkdir -p $out/home/helix/themes
-        ln -s ${configFile} $out/home/helix/config.toml
-        ln -s ${languageFile} $out/home/helix/languages.toml
-        ${builtins.concatStringsSep "\n" themeLinks}
+            mkdir -p $out/home/helix/themes
+            ln -s ${configFile} $out/home/helix/config.toml
+            ln -s ${languageFile} $out/home/helix/languages.toml
+            ${builtins.concatStringsSep "\n" themeLinks}
 
-        mkdir -p $out/home/git
-        ln -s ${ignoreFile} $out/home/git/ignore
+            mkdir -p $out/home/git
+            ln -s ${ignoreFile} $out/home/git/ignore
 
-        makeWrapper ${pkgs.helix}/bin/hx $out/bin/hx --set HELIX_RUNTIME $out/lib/runtime --set XDG_CONFIG_HOME $out/home
-      '';
-  };
+            makeWrapper ${pkgs.helix}/bin/hx $out/bin/hx --set HELIX_RUNTIME $out/lib/runtime --set XDG_CONFIG_HOME $out/home
+          '';
+    };
 }