mirror of
https://github.com/Username404-59/Dotfiles-NixOS.git
synced 2026-07-03 12:58:07 +02:00
Build optimized dash
This commit is contained in:
parent
7ab1f130fa
commit
96fb834e0f
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, functions, ... }:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This should be in /etc/nixos/ together with the rest.
|
This should be in /etc/nixos/ together with the rest.
|
||||||
@ -157,7 +157,9 @@ in
|
|||||||
# networking.firewall.enable = false;
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
# Replaces /bin/sh with dash (which is faster than bash)
|
# Replaces /bin/sh with dash (which is faster than bash)
|
||||||
environment.binsh = "${pkgs.dash}/bin/dash";
|
environment.binsh = "${
|
||||||
|
(functions.mkWithCFlags pkgs.dash "-Ofast -flto -fwhole-program -fno-unroll-loops")
|
||||||
|
}/bin/dash";
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
|
|||||||
@ -17,6 +17,12 @@ let
|
|||||||
});
|
});
|
||||||
mkPatchedAuto = pkg: mkPatched pkg [ nixtamal.${pkg.pname + "-patch"} ];
|
mkPatchedAuto = pkg: mkPatched pkg [ nixtamal.${pkg.pname + "-patch"} ];
|
||||||
|
|
||||||
|
mkWithCFlags = pkg: flags: (pkg.override {
|
||||||
|
stdenv = pkgs.fastStdenv; # Faster GCC
|
||||||
|
}).overrideAttrs (old: {
|
||||||
|
NIX_CFLAGS_COMPILE = (old.NIX_CFLAGS_COMPILE or "") + " ${flags}"; # https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Optimize-Options.html
|
||||||
|
});
|
||||||
|
|
||||||
importFlake = flakeRef:
|
importFlake = flakeRef:
|
||||||
let
|
let
|
||||||
src = nixtamal.${flakeRef};
|
src = nixtamal.${flakeRef};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user