Compare commits
1 commit
4d6acdbb41
...
b6a1abc9b7
Author | SHA1 | Date | |
---|---|---|---|
chayleaf | b6a1abc9b7 |
|
@ -88,7 +88,7 @@
|
|||
|
||||
set -gx NOMCOMPAT ${nom-compat}
|
||||
# for posix compatibility
|
||||
set -gx SHELL ${pkgs.zsh}/bin/zsh
|
||||
set -gx SHELL zsh
|
||||
|
||||
set -g fish_color_autosuggestion 777 brblack
|
||||
set -g fish_color_command green
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
{ pkgs
|
||||
, pkgs'
|
||||
, lib
|
||||
, ... }:
|
||||
|
||||
let
|
||||
# there are few direct hits with the linux kernel, so use CCACHE_NODIRECT
|
||||
# (direct hits are file-based, non-direct are preprocessed file-based)
|
||||
ccacheVars = {
|
||||
CCACHE_CPP2 = "yes";
|
||||
CCACHE_COMPRESS = "1";
|
||||
CCACHE_UMASK = "007";
|
||||
CCACHE_DIR = "/var/cache/ccache";
|
||||
CCACHE_SLOPPINESS = "include_file_mtime,time_macros";
|
||||
CCACHE_NODIRECT = "1";
|
||||
};
|
||||
|
||||
buildCachedFirefox = useSccache: unwrapped:
|
||||
(unwrapped.override {
|
||||
buildMozillaMach = x: pkgs'.buildMozillaMach (x // {
|
||||
extraConfigureFlags = (x.extraConfigureFlags or [])
|
||||
++ lib.toList (if useSccache then "--with-ccache=sccache" else "--with-ccache");
|
||||
});
|
||||
}).overrideAttrs (prev: if useSccache then {
|
||||
nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [ pkgs'.sccache ];
|
||||
SCCACHE_DIR = "/var/cache/sccache";
|
||||
SCCACHE_MAX_FRAME_LENGTH = "104857600";
|
||||
RUSTC_WRAPPER = "${pkgs'.sccache}/bin/sccache";
|
||||
} else ccacheVars // {
|
||||
nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [ pkgs'.ccache ];
|
||||
});
|
||||
|
||||
ccacheConfig = ''
|
||||
${builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "export ${k}=${v}") ccacheVars)}
|
||||
if [ ! -d "$CCACHE_DIR" ]; then
|
||||
echo "====="
|
||||
echo "Directory '$CCACHE_DIR' does not exist"
|
||||
echo "Please create it with:"
|
||||
echo " sudo mkdir -m0770 '$CCACHE_DIR'"
|
||||
echo " sudo chown root:nixbld '$CCACHE_DIR'"
|
||||
echo "====="
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -w "$CCACHE_DIR" ]; then
|
||||
echo "====="
|
||||
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)"
|
||||
echo "Please verify its access permissions"
|
||||
echo "====="
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
|
||||
overrides = { extraConfig = ccacheConfig; };
|
||||
|
||||
cacheStdenv = pkgs: pkgs.ccacheStdenv.override overrides;
|
||||
|
||||
in {
|
||||
# read by system/modules/ccache.nix
|
||||
__dontIncludeCcacheOverlay = true;
|
||||
ccacheWrapper = pkgs.ccacheWrapper.override overrides;
|
||||
|
||||
buildFirefoxWithCcache = buildCachedFirefox false;
|
||||
buildFirefoxWithSccache = buildCachedFirefox true;
|
||||
|
||||
buildLinuxWithCcache = linux: linux.override {
|
||||
stdenv = cacheStdenv pkgs';
|
||||
buildPackages = pkgs'.buildPackages // {
|
||||
stdenv = cacheStdenv pkgs'.buildPackages;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -10,6 +10,24 @@ let
|
|||
inherit (pkgs) fetchgit fetchurl fetchFromGitHub dockerTools;
|
||||
};
|
||||
nixForNixPlugins = pkgs.nixVersions.nix_2_17;
|
||||
buildCachedFirefox = useSccache: unwrapped:
|
||||
(unwrapped.override {
|
||||
buildMozillaMach = x: pkgs'.buildMozillaMach (x // {
|
||||
extraConfigureFlags = (x.extraConfigureFlags or [])
|
||||
++ lib.toList (if useSccache then "--with-ccache=sccache" else "--with-ccache");
|
||||
});
|
||||
}).overrideAttrs (prev: if useSccache then {
|
||||
nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [ pkgs'.sccache ];
|
||||
SCCACHE_DIR = "/var/cache/sccache";
|
||||
SCCACHE_MAX_FRAME_LENGTH = "104857600";
|
||||
RUSTC_WRAPPER = "${pkgs'.sccache}/bin/sccache";
|
||||
} else {
|
||||
nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [ pkgs'.ccache ];
|
||||
CCACHE_CPP2 = "yes";
|
||||
CCACHE_COMPRESS = "1";
|
||||
CCACHE_UMASK = "007";
|
||||
CCACHE_DIR = "/var/cache/ccache";
|
||||
});
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -62,10 +80,11 @@ in
|
|||
|
||||
clang-tools_latest = pkgs.clang-tools_16;
|
||||
clang_latest = pkgs.clang_16;
|
||||
buildFirefoxWithCcache = buildCachedFirefox false;
|
||||
buildFirefoxWithSccache = buildCachedFirefox true;
|
||||
/*ghidra = pkgs.ghidra.overrideAttrs (old: {
|
||||
patches = old.patches ++ [ ./ghidra-stdcall.patch ];
|
||||
});*/
|
||||
gimp = callPackage ./gimp { inherit (pkgs) gimp; };
|
||||
home-daemon = callPackage ./home-daemon { };
|
||||
# pin version
|
||||
looking-glass-client = pkgs.looking-glass-client.overrideAttrs (old: {
|
||||
|
@ -102,7 +121,7 @@ in
|
|||
techmino = callPackage ./techmino { };
|
||||
|
||||
firefox-addons = lib.recurseIntoAttrs (callPackage ./firefox-addons { inherit nur sources; });
|
||||
mpvScripts = pkgs.mpvScripts // callPackage ./mpv-scripts { };
|
||||
mpvScripts = pkgs.mpvScripts // (callPackage ./mpv-scripts { });
|
||||
|
||||
qemu_7 = callPackage ./qemu_7.nix {
|
||||
stdenv = pkgs'.ccacheStdenv;
|
||||
|
@ -120,15 +139,8 @@ in
|
|||
# TODO: when https://gitlab.com/virtio-fs/virtiofsd/-/issues/96 is fixed remove this
|
||||
virtiofsd = callPackage ./qemu_virtiofsd.nix {
|
||||
qemu = pkgs'.qemu_7;
|
||||
};
|
||||
|
||||
qemu_7_ccache = pkgs'.qemu_7.override {
|
||||
stdenv = pkgs'.ccacheStdenv;
|
||||
};
|
||||
virtiofsd_ccache = pkgs'.virtiofsd.override {
|
||||
qemu = pkgs'.qemu_7_ccache;
|
||||
stdenv = pkgs'.ccacheStdenv;
|
||||
};
|
||||
gimp = callPackage ./gimp { inherit (pkgs) gimp; };
|
||||
}
|
||||
// import ./ccache.nix { inherit pkgs pkgs' lib sources; }
|
||||
// import ../system/hardware/bpi-r3/pkgs.nix { inherit pkgs pkgs' lib sources; }
|
||||
// (import ../system/hardware/bpi-r3/pkgs.nix { inherit pkgs pkgs' lib sources; })
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{ pkgs
|
||||
, pkgs'
|
||||
, lib
|
||||
, sources
|
||||
, ... }:
|
||||
|
@ -59,6 +60,31 @@ let
|
|||
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${ubootVersion}.tar.bz2";
|
||||
hash = "sha256-tqp9fnGPQFeNGrkU/A6AusDEz7neh2KiR9HWbR7+WTY=";
|
||||
};
|
||||
# there are few direct hits with the linux kernel, so use CCACHE_NODIRECT
|
||||
# (direct hits are file-based, non-direct are preprocessed file-based)
|
||||
ccacheConfig = ''
|
||||
export CCACHE_COMPRESS=1
|
||||
export CCACHE_DIR="/var/cache/ccache"
|
||||
export CCACHE_UMASK=007
|
||||
export CCACHE_SLOPPINESS=include_file_mtime,time_macros
|
||||
export CCACHE_NODIRECT=1
|
||||
if [ ! -d "$CCACHE_DIR" ]; then
|
||||
echo "====="
|
||||
echo "Directory '$CCACHE_DIR' does not exist"
|
||||
echo "Please create it with:"
|
||||
echo " sudo mkdir -m0770 '$CCACHE_DIR'"
|
||||
echo " sudo chown root:nixbld '$CCACHE_DIR'"
|
||||
echo "====="
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -w "$CCACHE_DIR" ]; then
|
||||
echo "====="
|
||||
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)"
|
||||
echo "Please verify its access permissions"
|
||||
echo "====="
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
|
||||
in rec {
|
||||
ubootBpiR3Sd = pkgs.buildUBoot {
|
||||
|
@ -308,5 +334,12 @@ in rec {
|
|||
MMC_MTK = yes;
|
||||
};
|
||||
};
|
||||
linux_bpiR3_ccache = linux_bpiR3.override {
|
||||
stdenv = pkgs'.ccacheStdenv.override { extraConfig = ccacheConfig; };
|
||||
buildPackages = pkgs'.buildPackages // {
|
||||
stdenv = pkgs'.buildPackages.ccacheStdenv.override { extraConfig = ccacheConfig; };
|
||||
};
|
||||
};
|
||||
linuxPackages_bpiR3 = pkgs.linuxPackagesFor linux_bpiR3;
|
||||
linuxPackages_bpiR3_ccache = pkgs.linuxPackagesFor linux_bpiR3_ccache;
|
||||
}
|
||||
|
|
|
@ -161,14 +161,14 @@ in {
|
|||
}
|
||||
];
|
||||
nix.distributedBuilds = true;
|
||||
# limit CI CPU usage to 30% since I'm running everything else off this server too
|
||||
systemd.services.nix-daemon.serviceConfig.CPUQuota = "240%";
|
||||
# limit CI CPU usage since I'm running everything else off this server too
|
||||
systemd.services.nix-daemon.serviceConfig.CPUQuota = "100%";
|
||||
nix.daemonCPUSchedPolicy = "idle";
|
||||
nix.daemonIOSchedClass = "idle";
|
||||
systemd.services.hydra-evaluator = lib.mkIf config.services.hydra.enable {
|
||||
# https://github.com/NixOS/hydra/issues/1186
|
||||
environment.GC_DONT_GC = "1";
|
||||
serviceConfig.CPUQuota = "240%";
|
||||
serviceConfig.CPUQuota = "100%";
|
||||
serviceConfig.CPUSchedulingPolicy = "idle";
|
||||
serviceConfig.IOSchedulingClass = "idle";
|
||||
};
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
{ config
|
||||
, lib
|
||||
, ... }:
|
||||
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
nix.settings.extra-sandbox-paths = lib.mkIf config.programs.ccache.enable [
|
||||
(assert config.programs.ccache.cacheDir == "/var/cache/ccache"; config.programs.ccache.cacheDir)
|
||||
config.programs.ccache.cacheDir
|
||||
"/var/cache/sccache"
|
||||
];
|
||||
impermanence.directories = lib.mkIf config.programs.ccache.enable [
|
||||
config.programs.ccache.cacheDir
|
||||
"/var/cache/sccache"
|
||||
];
|
||||
nixpkgs.overlays = lib.mkIf (config.programs.ccache.enable && config.programs.ccache.packageNames == []) [
|
||||
(self: super: {
|
||||
ccacheWrapper = if self?__dontIncludeCcacheOverlay then super.ccacheWrapper else super.ccacheWrapper.override {
|
||||
ccacheWrapper = super.ccacheWrapper.override {
|
||||
extraConfig = ''
|
||||
export CCACHE_COMPRESS=1
|
||||
export CCACHE_DIR="${config.programs.ccache.cacheDir}"
|
||||
|
|
|
@ -100,16 +100,7 @@ in {
|
|||
kitty.terminfo
|
||||
# rxvt-unicode-unwrapped.terminfo
|
||||
]);
|
||||
programs.fish.interactiveShellInit = lib.mkIf cfg.minimal ''
|
||||
set -gx SHELL ${pkgs.zsh}/bin/zsh
|
||||
set -g fish_color_autosuggestion 777 brblack
|
||||
set -g fish_color_command green
|
||||
set -g fish_color_operator white
|
||||
set -g fish_color_param white
|
||||
set -g fish_key_bindings fish_vi_key_bindings
|
||||
set -g fish_cursor_insert line
|
||||
set -g fish_cursor_replace underscore
|
||||
'';
|
||||
# TODO: minimal fish config
|
||||
programs.vim = lib.mkIf cfg.minimal {
|
||||
defaultEditor = lib.mkDefault true;
|
||||
package = pkgs.vim-full.customize {
|
||||
|
|
|
@ -127,9 +127,6 @@ in {
|
|||
{ directory = /var/lib/openldap; inherit (config.services.openldap) user group; mode = "0755"; }
|
||||
] ++ lib.optionals (config.services.scanservjs.enable or false) [
|
||||
{ directory = /var/lib/scanservjs; user = "scanservjs"; group = "scanservjs"; mode = "0750"; }
|
||||
] ++ lib.optionals config.programs.ccache.enable [
|
||||
{ directory = config.programs.ccache.cacheDir; user = "root"; group = "nixbld"; mode = "0770"; }
|
||||
{ directory = /var/cache/sccache; user = "root"; group = "nixbld"; mode = "0770"; }
|
||||
] ++ cfg.directories);
|
||||
files = map (x:
|
||||
if builtins.isPath x then toString x
|
||||
|
|
|
@ -192,6 +192,6 @@ in {
|
|||
};
|
||||
virtualisation.spiceUSBRedirection.enable = true;
|
||||
users.groups.libvirtd.members = [ "root" ] ++ cfg.libvirtdGroup;
|
||||
environment.systemPackages = [ (pkgs.virtiofsd_ccache or pkgs.virtiofsd) ];
|
||||
environment.systemPackages = with pkgs; [ virtiofsd ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue