Skip to content

Commit

Permalink
Merge pull request #284 from nix-community/nixos-facter
Browse files Browse the repository at this point in the history
kexec: Save more space by using python3 minimal
  • Loading branch information
Mic92 authored Sep 24, 2024
2 parents 8650b1d + 881fad4 commit debda57
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nix/kexec-installer/module.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{ config, lib, modulesPath, pkgs, ... }:
let
restore-network = pkgs.writers.writePython3Bin "restore-network" { flakeIgnore = [ "E501" ]; }
./restore_routes.py;
writePython3 = pkgs.writers.makePythonWriter
pkgs.python3Minimal pkgs.python3Packages pkgs.buildPackages.python3Packages;

# writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin)
writePython3Bin = name: writePython3 "/bin/${name}";

restore-network = writePython3Bin "restore-network" {
flakeIgnore = [ "E501" ];
} ./restore_routes.py;

# does not link with iptables enabled
iprouteStatic = pkgs.pkgsStatic.iproute2.override { iptables = null; };
Expand Down
1 change: 1 addition & 0 deletions nix/noninteractive.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
imports = [
./zfs-minimal.nix
./no-bootloaders.nix
./python-minimal.nix
./noveau-workaround.nix
# reduce closure size by removing perl
"${modulesPath}/profiles/perlless.nix"
Expand Down
15 changes: 15 additions & 0 deletions nix/python-minimal.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
nixpkgs.overlays = [
(final: prev: {
bcachefs-tools = prev.bcachefs-tools.overrideAttrs (old: {
python3 = prev.python3Minimal;
});
cifs-utils = prev.cifs-utils.overrideAttrs (old: {
python3 = prev.python3Minimal;
});
nfs-utils = prev.nfs-utils.overrideAttrs (old: {
python3 = prev.python3Minimal;
});
})
];
}
2 changes: 2 additions & 0 deletions nix/zfs-minimal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ let
zfs = pkgs.zfsUnstable.override {
# this overrides saves 10MB
samba = pkgs.coreutils;

python3 = pkgs.python3Minimal;
};
in
{
Expand Down

0 comments on commit debda57

Please sign in to comment.