diff --git a/fake_flake.nix b/fake_flake.nix index b60af68..7bc0f8a 100644 --- a/fake_flake.nix +++ b/fake_flake.nix @@ -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 { - name = "nixpkgs-patched"; - inherit src; - patches = map fetchpatch nixpkgs_patches; - }) { inherit config; }; + { + 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"; diff --git a/nix/sources.json b/nix/sources.json index 564c5c0..b1a2749 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -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///archive/.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": { diff --git a/overlays/default.nix b/overlays/default.nix index bf3b844..c730556 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,11 @@ { config, lib, ... }: { + programs.ccache.packageNames = [ + "agenix" + "the-powder-toy" + "mcontrolcenter" + ]; + nixpkgs.overlays = map ( diff --git a/patches/lix-ccache.patch b/patches/lix-ccache.patch index 6072e0c..2736dad 100644 --- a/patches/lix-ccache.patch +++ b/patches/lix-ccache.patch @@ -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 { diff --git a/specific/grimmauld-nixos-server/configuration.nix b/specific/grimmauld-nixos-server/configuration.nix index 28b1549..9664d23 100644 --- a/specific/grimmauld-nixos-server/configuration.nix +++ b/specific/grimmauld-nixos-server/configuration.nix @@ -11,10 +11,10 @@ in { imports = [ ./hardware-configuration.nix ]; -# boot = { -# kernelPackages = pkgs.linuxPackages_latest; -# }; - + # boot = { + # kernelPackages = pkgs.linuxPackages_latest; + # }; + networking.hostName = "grimmauld-nixos-server"; networking.domain = "grimmauld.de"; services.openssh.enable = true;