patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 0a13393164ad5d7f752e630763f3f97166479af5 2956 bytes (raw)
name: pkgs/default.nix 	 # 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
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
 
# SPDX-FileCopyrightText: 2023-2024 Alyssa Ross <hi@alyssa.is>
# SPDX-License-Identifier: MIT

{ ... } @ args:

let
  config = import ../lib/config.nix args;
  pkgs = import ./overlaid.nix ({ elaboratedConfig = config; } // args);

  inherit (pkgs.lib) cleanSource fileset makeScope optionalAttrs sourceByRegex;

  subprojects =
    project:
    let dir = project + "/subprojects"; in
    fileset.difference dir (fileset.fromSource (sourceByRegex dir [
      ".*\\.wrap"
      "packagefiles(/.*)?"
    ]));

  makeScopeWithSplicing = pkgs: pkgs.makeScopeWithSplicing' {
    otherSplices = {
      selfBuildBuild = makeScope pkgs.pkgsBuildBuild.newScope scope;
      selfBuildHost = makeScope pkgs.pkgsBuildHost.newScope scope;
      selfBuildTarget = makeScope pkgs.pkgsBuildTarget.newScope scope;
      selfHostHost = makeScope pkgs.pkgsHostHost.newScope scope;
      selfTargetTarget = optionalAttrs (pkgs.pkgsTargetTarget ? newScope)
        (makeScope pkgs.pkgsTargetTarget.newScope scope);
    };
    f = scope;
  };

  scope = self: let pkgs = self.callPackage ({ pkgs }: pkgs) {}; in {
    inherit config;

    callSpectrumPackage =
      path: (import path { inherit (self) callPackage; }).override;

    rootfs = self.callSpectrumPackage ../host/rootfs {};
    mount-flatpak = self.callSpectrumPackage ../tools/mount-flatpak {};
    spectrum-build-tools = self.callSpectrumPackage ../tools {
      appSupport = false;
      buildSupport = true;
    };
    spectrum-app-tools = self.callSpectrumPackage ../tools {};
    spectrum-host-tools = self.callSpectrumPackage ../tools {
      appSupport = false;
      hostSupport = true;
    };
    spectrum-driver-tools = self.callSpectrumPackage ../tools {
      appSupport = false;
      driverSupport = true;
    };
    spectrum-router = self.callSpectrumPackage ../tools/router {};
    spectrum-cgroup-setup = self.callSpectrumPackage ../tools/cgroup-setup {};
    xdg-desktop-portal-spectrum-host =
      self.callSpectrumPackage ../tools/xdg-desktop-portal-spectrum-host {};

    # Packages from the overlay, so it's possible to build them from
    # the CLI easily.
    inherit (pkgs) cloud-hypervisor dbus;

    pkgsMusl = makeScopeWithSplicing pkgs.pkgsMusl;
    pkgsStatic = makeScopeWithSplicing pkgs.pkgsStatic;

    srcWithNix = fileset.difference
      (fileset.fromSource (cleanSource ../.))
      (fileset.unions ([
        (subprojects ../tools)
      ] ++ map fileset.maybeMissing [
        ../Documentation/.jekyll-cache
        ../Documentation/_site
        ../host/initramfs/build
        ../host/rootfs/build
        ../img/app/build
        ../release/live/build
        ../tools/mount-flatpak/target
        ../tools/router/target
        ../tools/xdg-desktop-portal-spectrum-host/target
        ../vm/sys/net/build
      ]));

    src = fileset.difference
      self.srcWithNix
      (fileset.fileFilter ({ hasExt, ... }: hasExt "nix") ../.);
  };
in

makeScopeWithSplicing pkgs

debug log:

solving 0a13393164ad5d7f752e630763f3f97166479af5 ...
found 0a13393164ad5d7f752e630763f3f97166479af5 in https://inbox.spectrum-os.org/spectrum-devel/20260805-cgroups-v6-2-086c0f00f55f@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20260731-cgroups-v5-2-b325bac9d34f@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20260721-cgroups-v4-2-46b2e5fff7b6@gmail.com/
found 44f7b5ff78cb6b9e755292a6a417d0b627ed3fb0 in https://spectrum-os.org/git/spectrum
preparing index
index prepared:
100644 44f7b5ff78cb6b9e755292a6a417d0b627ed3fb0	pkgs/default.nix

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20260805-cgroups-v6-2-086c0f00f55f@gmail.com/
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 44f7b5ff78cb6b9e755292a6a417d0b627ed3fb0..0a13393164ad5d7f752e630763f3f97166479af5 100644

Checking patch pkgs/default.nix...
Applied patch pkgs/default.nix cleanly.

skipping https://inbox.spectrum-os.org/spectrum-devel/20260731-cgroups-v5-2-b325bac9d34f@gmail.com/ for 0a13393164ad5d7f752e630763f3f97166479af5
skipping https://inbox.spectrum-os.org/spectrum-devel/20260721-cgroups-v4-2-46b2e5fff7b6@gmail.com/ for 0a13393164ad5d7f752e630763f3f97166479af5
index at:
100644 0a13393164ad5d7f752e630763f3f97166479af5	pkgs/default.nix

(*) 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).