patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 0659d104efeeb8f483c24d8ea8d38a5d928d9358 1468 bytes (raw)
name: Documentation/development/build-configuration.adoc 	 # note: path name is non-authoritative(*)

 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
 
= Configuring the Build
:page-parent: Development
:page-nav_order: 1
:example-caption: Test

// SPDX-FileCopyrightText: 2022 Unikie
// SPDX-FileCopyrightText: 2023 Alyssa Ross <hi@alyssa.is>
// SPDX-License-Identifier: GFDL-1.3-no-invariants-or-later OR CC-BY-SA-4.0

Some aspects of a Spectrum build can be customised using a build
configuration file.

By default, this configuration file should be called config.nix and located in
the root of the Spectrum source tree, but this can be overridden by setting
`spectrum-config` in the
https://nixos.org/manual/nix/stable/command-ref/env-common.html#env-NIX_PATH[NIX_PATH]
to the path of the configuration file.

The configuration file should contain an attribute set.  See
https://spectrum-os.org/git/spectrum/tree/lib/config.default.nix[lib/config.default.nix]
for supported configuration attributes and their default values.

.config.nix to build Spectrum with a https://nixos.org/manual/nixpkgs/unstable/#sec-overlays-definition[Nixpkgs overlay]
[example]
[source,nix]
----
{ default, ... }:

{
  pkgsArgs = default.pkgsArgs // {
    overlays = [
      (final: super: {
        weston = super.weston.overrideAttrs ({ patches ? [], ... }: {
          patches = patches ++ [
            path/to/weston.patch
          ];
        });
      })
    ] ++ default.pkgsArgs.overlays or [];
  };
}
----

.config.nix to adjust the version of the OS
[example]
[source,nix]
----
{ default, ... }:

{
  version = "0.0.1";
}
----

debug log:

solving 0659d104efeeb8f483c24d8ea8d38a5d928d9358 ...
found 0659d104efeeb8f483c24d8ea8d38a5d928d9358 in https://inbox.spectrum-os.org/spectrum-devel/20251112-updates-v2-4-88d96bf81b79@gmail.com/
found 545aa8c05ac40a101b5ee280015cde7ec4f3a66f in https://spectrum-os.org/git/spectrum
preparing index
index prepared:
100644 545aa8c05ac40a101b5ee280015cde7ec4f3a66f	Documentation/development/build-configuration.adoc

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20251112-updates-v2-4-88d96bf81b79@gmail.com/
diff --git a/Documentation/development/build-configuration.adoc b/Documentation/development/build-configuration.adoc
index 545aa8c05ac40a101b5ee280015cde7ec4f3a66f..0659d104efeeb8f483c24d8ea8d38a5d928d9358 100644

Checking patch Documentation/development/build-configuration.adoc...
Applied patch Documentation/development/build-configuration.adoc cleanly.

index at:
100644 0659d104efeeb8f483c24d8ea8d38a5d928d9358	Documentation/development/build-configuration.adoc

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).