perf: speed up evaluation and reduce memory

This commit is contained in:
Moritz Böhme 2025-08-01 20:27:20 +02:00
parent 8aa5e8d620
commit 2ef87bbded
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
7 changed files with 12 additions and 86 deletions

View file

@ -1,7 +1,7 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{pkgs, ...}: { {pkgs, inputs, ...}: {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -43,7 +43,7 @@
home-manager.users.moritz.home.packages = with pkgs; [ home-manager.users.moritz.home.packages = with pkgs; [
anki anki
stable.calibre # NOTE: breaks often in unstable (inputs.stable.legacyPackages.${pkgs.system}.calibre) # NOTE: breaks often in unstable
]; ];
networking.firewall.allowedTCPPorts = [9090]; networking.firewall.allowedTCPPorts = [9090];

View file

@ -1,63 +0,0 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.my.nixpkgs;
overlayType = mkOptionType {
name = "nixpkgs-overlay";
description = "nixpkgs overlay";
check = lib.isFunction;
merge = lib.mergeOneOption;
};
in {
options.my.nixpkgs = {
overlays = mkOption {
default = [];
type = types.listOf overlayType;
example =
literalExpression
''
[
(self: super: {
openssh = super.openssh.override {
hpnSupport = true;
kerberos = self.libkrb5;
};
})
]
'';
};
channels = mkOption {
default = {};
example = literalExpression ''
{
stable = inputs.nixpkgs-stable;
}
'';
type = with types; attrsOf package;
};
overlaysForAllChannels = mkEnableOption "apply overlays for all channels";
};
config.nixpkgs = {
overlays = let
channelOverlays = _: prev:
mapAttrs
(
_: value:
import value {
inherit (prev) system;
config.allowUnfree = true;
overlays = optional cfg.overlaysForAllChannels cfg.overlays;
}
)
cfg.channels;
in
cfg.overlays ++ [channelOverlays];
config.allowUnfree = true;
};
}

View file

@ -12,23 +12,6 @@ in {
]; ];
my = { my = {
nixpkgs = {
overlays = [
(
_: prev: {
nur = import inputs.nur {
pkgs = prev;
nurpkgs = prev;
};
}
)
];
channels = {
master = inputs.master;
stable = inputs.stable;
};
};
shell = { shell = {
abbreviations = { abbreviations = {
us = "systemctl --user"; us = "systemctl --user";
@ -164,6 +147,8 @@ in {
xdg.userDirs.enable = true; xdg.userDirs.enable = true;
}; };
nixpkgs.config.allowUnfree = true;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;

View file

@ -74,7 +74,7 @@ in {
(inputs.filetags.packages.${pkgs.system}.default) (inputs.filetags.packages.${pkgs.system}.default)
keepassxc keepassxc
pavucontrol pavucontrol
stable.libreoffice # NOTE: breaks often (inputs.stable.legacyPackages.${pkgs.system}.libreoffice) # NOTE: breaks often
signal-desktop signal-desktop
vlc vlc
]; ];

View file

@ -2,6 +2,7 @@
config, config,
lib, lib,
pkgs, pkgs,
inputs,
... ...
}: }:
with lib; let with lib; let
@ -11,7 +12,7 @@ in {
enable = mkEnableOption "chromium"; enable = mkEnableOption "chromium";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.stable.chromium; default = inputs.stable.legacyPackages.${pkgs.system}.chromium;
defaultText = "pkgs.chromium"; defaultText = "pkgs.chromium";
description = "Chromium package to install."; description = "Chromium package to install.";
}; };

View file

@ -65,7 +65,10 @@ in {
// Overrides // Overrides
${cfg.arkenfox.overrides} ${cfg.arkenfox.overrides}
''; '';
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ extensions.packages = with (import inputs.nur {
pkgs = pkgs;
nurpkgs = pkgs;
}).repos.rycee.firefox-addons; [
darkreader darkreader
istilldontcareaboutcookies istilldontcareaboutcookies
kagi-search kagi-search

View file

@ -70,7 +70,7 @@
# SSH # SSH
services.openssh = { services.openssh = {
package = pkgs.master.openssh; # HACK: to fix CVE-2024-6387 package = pkgs.openssh;
settings = { settings = {
# Disable ssh password login # Disable ssh password login
PasswordAuthentication = lib.mkDefault false; PasswordAuthentication = lib.mkDefault false;