diff options
author | Janne Heß <janne@hess.ooo> | 2024-03-27 19:10:27 +0100 |
---|---|---|
committer | Valentin Gagarin <valentin.gagarin@tweag.io> | 2024-03-28 09:28:12 +0100 |
commit | fcc95ff8172cc68a0d2d52aa1e8ef2120d2904ec (patch) | |
tree | 8de1a02f7d1624c97562c7736896a6c95c74ec04 /doc/packages | |
parent | bc77c7a9730833c7668c92288c6af950e7270cb5 (diff) |
treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
Diffstat (limited to 'doc/packages')
-rw-r--r-- | doc/packages/darwin-builder.section.md | 3 | ||||
-rw-r--r-- | doc/packages/eclipse.section.md | 66 | ||||
-rw-r--r-- | doc/packages/emacs.section.md | 13 | ||||
-rw-r--r-- | doc/packages/steam.section.md | 2 | ||||
-rw-r--r-- | doc/packages/urxvt.section.md | 4 | ||||
-rw-r--r-- | doc/packages/weechat.section.md | 6 |
6 files changed, 53 insertions, 41 deletions
diff --git a/doc/packages/darwin-builder.section.md b/doc/packages/darwin-builder.section.md index 7225e630d5cc..ca8519c5bf5f 100644 --- a/doc/packages/darwin-builder.section.md +++ b/doc/packages/darwin-builder.section.md @@ -154,6 +154,7 @@ To do this, you just need to set the `virtualisation.darwin-builder.*` parameter in the example below and rebuild. ```nix + { darwin-builder = nixpkgs.lib.nixosSystem { system = linuxSystem; modules = [ @@ -166,6 +167,8 @@ in the example below and rebuild. virtualisation.darwin-builder.workingDirectory = "/var/lib/darwin-builder"; } ]; + }; + } ``` You may make any other changes to your VM in this attribute set. For example, diff --git a/doc/packages/eclipse.section.md b/doc/packages/eclipse.section.md index e19510e131a0..acf34b57571a 100644 --- a/doc/packages/eclipse.section.md +++ b/doc/packages/eclipse.section.md @@ -13,11 +13,13 @@ Once an Eclipse variant is installed, it can be run using the `eclipse` command, If you prefer to install plugins in a more declarative manner, then Nixpkgs also offer a number of Eclipse plugins that can be installed in an _Eclipse environment_. This type of environment is created using the function `eclipseWithPlugins` found inside the `nixpkgs.eclipses` attribute set. This function takes as argument `{ eclipse, plugins ? [], jvmArgs ? [] }` where `eclipse` is a one of the Eclipse packages described above, `plugins` is a list of plugin derivations, and `jvmArgs` is a list of arguments given to the JVM running the Eclipse. For example, say you wish to install the latest Eclipse Platform with the popular Eclipse Color Theme plugin and also allow Eclipse to use more RAM. You could then add: ```nix -packageOverrides = pkgs: { - myEclipse = with pkgs.eclipses; eclipseWithPlugins { - eclipse = eclipse-platform; - jvmArgs = [ "-Xmx2048m" ]; - plugins = [ plugins.color-theme ]; +{ + packageOverrides = pkgs: { + myEclipse = with pkgs.eclipses; eclipseWithPlugins { + eclipse = eclipse-platform; + jvmArgs = [ "-Xmx2048m" ]; + plugins = [ plugins.color-theme ]; + }; }; } ``` @@ -33,32 +35,34 @@ If there is a need to install plugins that are not available in Nixpkgs then it Expanding the previous example with two plugins using the above functions, we have: ```nix -packageOverrides = pkgs: { - myEclipse = with pkgs.eclipses; eclipseWithPlugins { - eclipse = eclipse-platform; - jvmArgs = [ "-Xmx2048m" ]; - plugins = [ - plugins.color-theme - (plugins.buildEclipsePlugin { - name = "myplugin1-1.0"; - srcFeature = fetchurl { - url = "http://…/features/myplugin1.jar"; - hash = "sha256-123…"; - }; - srcPlugin = fetchurl { - url = "http://…/plugins/myplugin1.jar"; - hash = "sha256-123…"; - }; - }); - (plugins.buildEclipseUpdateSite { - name = "myplugin2-1.0"; - src = fetchurl { - stripRoot = false; - url = "http://…/myplugin2.zip"; - hash = "sha256-123…"; - }; - }); - ]; +{ + packageOverrides = pkgs: { + myEclipse = with pkgs.eclipses; eclipseWithPlugins { + eclipse = eclipse-platform; + jvmArgs = [ "-Xmx2048m" ]; + plugins = [ + plugins.color-theme + (plugins.buildEclipsePlugin { + name = "myplugin1-1.0"; + srcFeature = fetchurl { + url = "http://…/features/myplugin1.jar"; + hash = "sha256-123…"; + }; + srcPlugin = fetchurl { + url = "http://…/plugins/myplugin1.jar"; + hash = "sha256-123…"; + }; + }) + (plugins.buildEclipseUpdateSite { + name = "myplugin2-1.0"; + src = fetchurl { + stripRoot = false; + url = "http://…/myplugin2.zip"; + hash = "sha256-123…"; + }; + }) + ]; + }; }; } ``` diff --git a/doc/packages/emacs.section.md b/doc/packages/emacs.section.md index c50c7815537d..2ced251f3e46 100644 --- a/doc/packages/emacs.section.md +++ b/doc/packages/emacs.section.md @@ -16,7 +16,7 @@ The Emacs package comes with some extra helpers to make it easier to configure. projectile use-package ])); - } + }; } ``` @@ -102,10 +102,12 @@ This provides a fairly full Emacs start file. It will load in addition to the us Sometimes `emacs.pkgs.withPackages` is not enough, as this package set has some priorities imposed on packages (with the lowest priority assigned to GNU-devel ELPA, and the highest for packages manually defined in `pkgs/applications/editors/emacs/elisp-packages/manual-packages`). But you can't control these priorities when some package is installed as a dependency. You can override it on a per-package-basis, providing all the required dependencies manually, but it's tedious and there is always a possibility that an unwanted dependency will sneak in through some other package. To completely override such a package, you can use `overrideScope`. ```nix -overrides = self: super: rec { - haskell-mode = self.melpaPackages.haskell-mode; - ... -}; +let + overrides = self: super: rec { + haskell-mode = self.melpaPackages.haskell-mode; + # ... + }; +in ((emacsPackagesFor emacs).overrideScope overrides).withPackages (p: with p; [ # here both these package will use haskell-mode of our own choice @@ -113,3 +115,4 @@ overrides = self: super: rec { dante ]) ``` +} diff --git a/doc/packages/steam.section.md b/doc/packages/steam.section.md index a1e88b0d9710..c9a09962f62d 100644 --- a/doc/packages/steam.section.md +++ b/doc/packages/steam.section.md @@ -51,7 +51,7 @@ Use `programs.steam.enable = true;` if you want to add steam to `systemPackages` you need to add: ```nix - steam.override { withJava = true; }; + steam.override { withJava = true; } ``` ## steam-run {#sec-steam-run} diff --git a/doc/packages/urxvt.section.md b/doc/packages/urxvt.section.md index 7aff0997dd2b..1d40c92ed73f 100644 --- a/doc/packages/urxvt.section.md +++ b/doc/packages/urxvt.section.md @@ -65,7 +65,9 @@ A plugin can be any kind of derivation, the only requirement is that it should a If the plugin is itself a Perl package that needs to be imported from other plugins or scripts, add the following passthrough: ```nix -passthru.perlPackages = [ "self" ]; +{ + passthru.perlPackages = [ "self" ]; +} ``` This will make the urxvt wrapper pick up the dependency and set up the Perl path accordingly. diff --git a/doc/packages/weechat.section.md b/doc/packages/weechat.section.md index 755b6e6ad1ea..295397f476b0 100644 --- a/doc/packages/weechat.section.md +++ b/doc/packages/weechat.section.md @@ -3,9 +3,9 @@ WeeChat can be configured to include your choice of plugins, reducing its closure size from the default configuration which includes all available plugins. To make use of this functionality, install an expression that overrides its configuration, such as: ```nix -weechat.override {configure = {availablePlugins, ...}: { +weechat.override {configure = ({availablePlugins, ...}: { plugins = with availablePlugins; [ python perl ]; - } + }); } ``` @@ -59,7 +59,7 @@ weechat.override { ]; init = '' /set plugins.var.python.jabber.key "val" - '': + ''; }; } ``` |