-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/no-x-libs: add more replacements #204287
Conversation
@Artturin Is there an easy way to measure the delta in the closure size? |
this doesn't change the closure size much (atleast for a minimal-ish system assuming i did the comparison correctly) but instead reduces the dependency tree size ( reducing compilation times if compiling from ex staging) {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/refs/pull/204287/head";
# commit before the above pr
nixpkgs-before.url = "github:NixOS/nixpkgs/7bfceb02093f2c7ea0ea7e353c99b26e9a4022fc";
};
outputs = inputs:
let
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
pkgs-before = import inputs.nixpkgs-before { system = "x86_64-linux"; };
node = pkgs.nixos ({ modulesPath, ... }: {
fileSystems."/".device = "ignore-root-device";
boot.loader.grub.enable = false;
imports = [
(modulesPath + "/profiles/minimal.nix")
];
networking.networkmanager = {
enable = true;
plugins = pkgs.lib.mkForce [];
};
});
node-before = pkgs-before.nixos ({ modulesPath, ... }: {
fileSystems."/".device = "ignore-root-device";
boot.loader.grub.enable = false;
imports = [
(modulesPath + "/profiles/minimal.nix")
];
networking.networkmanager = {
enable = true;
plugins = pkgs.lib.mkForce [];
};
nixpkgs.overlays = [
(_: super: {
# had to add this because the compilation was broken before
stoken = super.stoken.override { withGTK3 = false; };
})
];
});
closureInfo = pkgs.closureInfo { rootPaths = [ node.config.system.build.toplevel ]; };
closureInfoBefore = pkgs.closureInfo { rootPaths = [ node-before.config.system.build.toplevel ]; };
in
{
packages.x86_64-linux.default = pkgs.runCommand "compare"
{
inherit closureInfo closureInfoBefore;
nativeBuildInputs = [ pkgs.nodePackages.insect ];
} ''
sizeBytes=$(cat $closureInfo/total-nar-size)
sizeBeforeBytes=$(cat $closureInfoBefore/total-nar-size)
insect "$((sizeBeforeBytes - sizeBytes)) bytes -> megabytes"
touch $out
'';
packages.x86_64-linux.has-libX = closureInfoBefore;
packages.x86_64-linux.no-libX = closureInfo;
};
}
|
nixos/modules/config/no-x-libs.nix
Outdated
# translateManpages -> perlPackages.po4a -> texlive-combined-basic -> texlive-core-big -> libX11 | ||
util-linux = super.util-linux.override { translateManpages = false; }; | ||
# dep of graphviz, libXpm is optional for Xpm support | ||
gd = super.gd.override { libXpm = null; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please add an option instead of overwriting packages to null? This would for example break if we access libXpm.version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gd = super.gd.override { libXpm = null; }; | |
gd = super.gd.override { withXorg = false; }; |
pkgs/top-level/all-packages.nix
Outdated
libX11 = null; | ||
libGL = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me create a PR that adds a proper option for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nixos/modules/config/no-x-libs.nix
Outdated
# translateManpages -> perlPackages.po4a -> texlive-combined-basic -> texlive-core-big -> libX11 | ||
util-linux = super.util-linux.override { translateManpages = false; }; | ||
# dep of graphviz, libXpm is optional for Xpm support | ||
gd = super.gd.override { libXpm = null; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gd = super.gd.override { libXpm = null; }; | |
gd = super.gd.override { withXorg = false; }; |
FYI you motivated to try this again especially for my simd branch and I created the following PRs: |
Related
|
eccd9f5
to
b7afcc1
Compare
2be05f1
to
2cff6fd
Compare
wait until https://nixpk.gs/pr-tracker.html?pr=204426 is in master |
2cff6fd
to
2c01d5f
Compare
Why not merge this into staging? |
Needed to create a new PR because force pushing that one almost deadlocked my computer. #211428 |
all-packages: change -nox overrides to callPackage's so there is no infinite recursion when replacing the package with a overlay
2c01d5f
to
9a34bb2
Compare
This PR causes this error:
|
imagemagick = super.imagemagick.override { libX11Support = false; libXtSupport = false; }; | ||
imagemagickBig = super.imagemagickBig.override { libX11Support = false; libXtSupport = false; }; | ||
libdevil = super.libdevil-nox; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libdevil -> libdevil-nox -> libdevil -> libdevil-nox ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing this back to
libdevil-nox = callPackage ../development/libraries/libdevil {
inherit (darwin.apple_sdk.frameworks) OpenGL;
withXorg = false;
};
will work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, working!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry, messed this up when rebasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @SuperSandro2000
all-packages: change -nox overrides to callPackage's so there is no infinite recursion when replacing the package with a overlay
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes