use pkgs.lib.recursiveUpdate instead of //

nix-rearch
pegasust 2022-12-13 11:42:17 -07:00
parent fc8bb4c1d3
commit ddefaff28e
6 changed files with 18 additions and 10 deletions

View File

@ -158,7 +158,7 @@ font:
#style: Bold Italic #style: Bold Italic
# Point size # Point size
# size: 11.0 size: 9.0
# Offset is the extra space around each character. `offset.y` can be thought # Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter # of as modifying the line spacing, and `offset.x` as modifying the letter

View File

@ -25,10 +25,16 @@ in
''; '';
example = true; example = true;
}; };
options.base.alacritty._actualConfig = myLib.mkOption {
type = myLib.types.attrs;
visible = false;
default = actualConfig;
description = "underlying default config";
};
config.programs.alacritty = { config.programs.alacritty = {
enable = cfg.enable; enable = cfg.enable;
settings = actualConfig // { settings = myLib.recursiveUpdate actualConfig {
font.normal.family = cfg.font.family; font.normal.family = cfg.font.family;
}; };
}; };

View File

@ -3,10 +3,11 @@
, ... , ...
}@inputs: }@inputs:
let let
_lib = lib // import ../../lib { inherit pkgs lib; }; recursiveUpdate = lib.recursiveUpdate;
_lib = recursiveUpdate lib (import ../../lib { inherit pkgs lib; });
in in
# TODO: Unpollute inputs # TODO: Unpollute inputs
inputs // { recursiveUpdate inputs {
proj_root = builtins.toString ./../../..; proj_root = builtins.toString ./../../..;
myLib = _lib; myLib = _lib;
} }

View File

@ -124,10 +124,10 @@ in
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
enableAutosuggestions = true; enableAutosuggestions = true;
shellAliases = { shellAliases = pkgs.lib.recursiveUpdate {
nix-rebuild = "sudo nixos-rebuild switch"; nix-rebuild = "sudo nixos-rebuild switch";
hm-switch = "home-manager switch --flake"; hm-switch = "home-manager switch --flake";
} // (myHome.shellAliases or { }); } (myHome.shellAliases or { });
history = { history = {
size = 10000; size = 10000;
path = "${config.xdg.dataHome}/zsh/history"; path = "${config.xdg.dataHome}/zsh/history";

View File

@ -2,8 +2,9 @@
, lib ? pkgs.lib , lib ? pkgs.lib
, ... }@flake_import: , ... }@flake_import:
let serde = import ./serde { inherit pkgs lib; }; let serde = import ./serde { inherit pkgs lib; };
recursiveUpdate = lib.recursiveUpdate;
in in
pkgs.lib // lib // { recursiveUpdate (recursiveUpdate pkgs.lib lib) {
fromYaml = serde.fromYaml; fromYaml = serde.fromYaml;
fromYamlPath = serde.fromYamlPath; fromYamlPath = serde.fromYamlPath;
} }

View File

@ -2,7 +2,7 @@
let let
hostname = specialArgs.hostname; hostname = specialArgs.hostname;
enableSSH = specialArgs.enableSSH or true; enableSSH = specialArgs.enableSSH or true;
_networking = { hostName = hostname; } // (specialArgs._networking or { }); _networking = lib.recursiveUpdate { hostName = hostname; } (specialArgs._networking or { });
_boot = specialArgs._boot or { }; _boot = specialArgs._boot or { };
_services = specialArgs._services or { }; _services = specialArgs._services or { };
includeHardware = specialArgs.includeHardware or true; includeHardware = specialArgs.includeHardware or true;
@ -63,7 +63,7 @@ with lib;
]; ];
# tailscale is mandatory : ^) # tailscale is mandatory : ^)
# inherit services; # inherit services;
services = _services // { services = lib.recursiveUpdate _services {
tailscale.enable = true; tailscale.enable = true;
}; };
# create a oneshot job to authenticate to Tailscale # create a oneshot job to authenticate to Tailscale
@ -97,7 +97,7 @@ with lib;
# Don't touch networking.firewall.enable, just configure everything else. # Don't touch networking.firewall.enable, just configure everything else.
# inherit networking; # inherit networking;
# inherit _networking; # inherit _networking;
networking = _networking // { networking = lib.recursiveUpdate _networking {
firewall = firewall =
if _networking ? firewall.enable && _networking.firewall.enable then { if _networking ? firewall.enable && _networking.firewall.enable then {
trustedInterfaces = _networking.firewall.trustedInterfaces or [ ] ++ [ trustedInterfaces = _networking.firewall.trustedInterfaces or [ ] ++ [