ccache lix

This commit is contained in:
Grimmauld 2024-05-09 21:56:59 +02:00
parent 9f14173c43
commit f969379666
Signed by: Grimmauld
GPG Key ID: C2946668769F91FB
5 changed files with 56 additions and 44 deletions

View File

@ -34,11 +34,13 @@ let
hash = "sha256-vmzj7gF8jwHdqxN+dQiJ4MRxKpHvBTzbrUvFgt1DK8I=";
}
];
# enable ccache for lix if ccache is enabled
enable_lix_ccache = true;
in
{
imports = [
"${nivSources.agenix}/modules/age.nix"
(import "${nivSources.lix-module}/module.nix" { lix = nivSources.lix-pkg; })
"${nivSources.nixos-mailserver}/default.nix"
"${nivSources.nixos-matrix-modules}/module.nix"
@ -48,8 +50,6 @@ in
# (builtins.getFlake "git+${nivSources.nixos-mailserver.repo}").nixosModules.default
] ++ lib.optionals (builtins.hasAttr build_target host_modules) host_modules.${build_target};
nixpkgs.hostPlatform = system;
system.nixos = {
distroId = "lixos";
distroName = "LixOS";
@ -77,24 +77,40 @@ in
))
];
nixpkgs.pkgs =
nixpkgs =
let
src = nivSources.nixpkgs;
unpatched = import src { inherit config system; };
inherit (unpatched) applyPatches fetchpatch;
config = {
allowUnfree = true;
};
unpatched = import src { inherit config system; };
inherit (unpatched) applyPatches fetchpatch;
in
import (applyPatches {
{
hostPlatform = system;
pkgs = import (applyPatches {
name = "nixpkgs-patched";
inherit src;
patches = map fetchpatch nixpkgs_patches;
}) { inherit config; };
nixpkgs.overlays = lib.singleton (
final: prev: { agenix = final.callPackage "${nivSources.agenix}/pkgs/agenix.nix" { }; }
);
overlays = [
(import (
if enable_lix_ccache then
"${
applyPatches {
name = "lix-overlay-ccache";
src = nivSources.lix-module;
patches = [ ./patches/lix-ccache.patch ];
}
}/overlay.nix"
else
"${nivSources.lix-module}/overlay.nix"
) { lix = nivSources.lix-pkg; })
(final: prev: { agenix = final.callPackage "${nivSources.agenix}/pkgs/agenix.nix" { }; })
];
};
_module.args = {
system = "x86_64-linux";

View File

@ -17,22 +17,22 @@
"homepage": "https://nyx.chaotic.cx",
"owner": "chaotic-cx",
"repo": "nyx",
"rev": "986bdd8abf617176a67a463c81c4d18d2bc7913f",
"sha256": "1fvh1wnwm91am94hjj09dhff3vya2syqn66fmvh7vqrcviy5vlay",
"rev": "dcb0f06376629577a71a5322566acaf5c33bc232",
"sha256": "0cgddk9mdw6v1dmz55w2xcfbg26mxyyqs21hcbk0lpz6rgcb7lqg",
"type": "tarball",
"url": "https://github.com/chaotic-cx/nyx/archive/986bdd8abf617176a67a463c81c4d18d2bc7913f.tar.gz",
"url": "https://github.com/chaotic-cx/nyx/archive/dcb0f06376629577a71a5322566acaf5c33bc232.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"lix-module": {
"branch": "main",
"repo": "https://git.lix.systems/lix-project/nixos-module.git",
"rev": "d15ff50703ea83b595249eb3e67d2e668235d5a6",
"rev": "c8ab1e79ba0140bc75731c75177242089506260b",
"type": "git"
},
"lix-pkg": {
"branch": "main",
"repo": "https://git.lix.systems/lix-project/lix.git",
"rev": "8552519bb81fc2ee2d11e76594fd7de9393f4fe9",
"rev": "9ae90612a7535b87f26f2f9ff6b6ef2bb066998f",
"type": "git"
},
"nixos-mailserver": {

View File

@ -1,5 +1,11 @@
{ config, lib, ... }:
{
programs.ccache.packageNames = [
"agenix"
"the-powder-toy"
"mcontrolcenter"
];
nixpkgs.overlays =
map
(

View File

@ -1,22 +1,12 @@
diff --git a/package.nix b/package.nix
index 0186b7472..da783e152 100644
--- a/package.nix
+++ b/package.nix
@@ -1,7 +1,7 @@
{
pkgs,
lib,
- stdenv,
+ ccacheStdenv,
aws-sdk-cpp,
# If the patched version of Boehm isn't passed, then patch it based off of
# pkgs.boehmgc. This allows `callPackage`ing this file without needing to
@@ -81,6 +81,8 @@ let
inherit (__forDefaults) canRunInstalled;
inherit (lib) fileset;
diff --git a/overlay.nix b/overlay.nix
index 649aa28..cd8134f 100644
--- a/overlay.nix
+++ b/overlay.nix
@@ -26,6 +26,7 @@ let
lixPkg = (final.callPackage (lix + "/package.nix") {
build-release-notes = false;
versionSuffix = "-lix${versionSuffix}";
+ stdenv = prev.ccacheStdenv;
boehmgc-nix = boehmgc-patched;
});
+ stdenv = ccacheStdenv;
+
version = lib.fileContents ./.version + versionSuffix;
aws-sdk-cpp-nix = aws-sdk-cpp.override {

View File

@ -11,9 +11,9 @@ in
{
imports = [ ./hardware-configuration.nix ];
# boot = {
# kernelPackages = pkgs.linuxPackages_latest;
# };
# boot = {
# kernelPackages = pkgs.linuxPackages_latest;
# };
networking.hostName = "grimmauld-nixos-server";
networking.domain = "grimmauld.de";