perf: my-lib under config

This commit is contained in:
xinyangli 2024-12-04 17:08:09 +08:00
parent b667f8bf3f
commit 241f7265d5
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
8 changed files with 33 additions and 32 deletions

View file

@ -84,11 +84,16 @@
overlayModule =
{ ... }:
{
_module.args.my-lib = import ./overlays/my-lib;
nixpkgs.overlays = [
editorOverlay
(import ./overlays/add-pkgs.nix)
];
options.my-lib = nixpkgs.lib.mkOption {
type = nixpkgs.lib.types.freeformType;
default = import ./overlays/my-lib;
};
config = {
nixpkgs.overlays = [
editorOverlay
(import ./overlays/add-pkgs.nix)
];
};
};
deploymentModule = {
deployment.targetUser = "xin";
@ -109,7 +114,7 @@
nur.nixosModules.nur
catppuccin.nixosModules.catppuccin
machines/calcite/configuration.nix
(mkHome "xin" "calcite")
# (mkHome "xin" "calcite")
];
hk-00 = [
./machines/dolomite/claw.nix
@ -142,17 +147,15 @@
user: host:
{ ... }:
{
imports = [
home-manager.nixosModules.home-manager
{
home-manager = {
sharedModules = sharedHmModules;
useGlobalPkgs = true;
useUserPackages = true;
};
home-manager.users.${user} = (import ./home).${user}.${host};
}
];
imports = [ home-manager.nixosModules.home-manager ];
config = {
home-manager = {
sharedModules = sharedHmModules;
useGlobalPkgs = true;
useUserPackages = true;
};
home-manager.users.${user} = (import ./home).${user}.${host};
};
};
mkNixos =
{

View file

@ -2,12 +2,11 @@
config,
pkgs,
lib,
my-lib,
...
}:
let
inherit (lib) getExe;
inherit (my-lib.settings) idpUrl forgejoDomain forgejoGitDomain;
inherit (config.my-lib.settings) idpUrl forgejoDomain forgejoGitDomain;
settings = {
service.DISABLE_REGISTRATION = true;
server = {

View file

@ -1,6 +1,6 @@
{ config, my-lib, ... }:
{ config, pkgs, ... }:
let
inherit (my-lib.settings) hedgedocDomain idpUrl;
inherit (config.my-lib.settings) hedgedocDomain idpUrl;
in
{
sops.secrets."hedgedoc/client_secret" = { };

View file

@ -1,6 +1,6 @@
{ config, my-lib, ... }:
{ config, pkgs, ... }:
let
inherit (my-lib.settings) idpUrl minifluxUrl;
inherit (config.my-lib.settings) idpUrl minifluxUrl;
in
{
sops = {

View file

@ -1,6 +1,6 @@
{ config, my-lib, ... }:
{ config, pkgs, ... }:
let
inherit (my-lib.settings) vaultwardenUrl;
inherit (config.my-lib.settings) vaultwardenUrl;
in
{
services.vaultwarden = {

View file

@ -1,6 +1,6 @@
{ my-lib, ... }:
{ pkgs, ... }:
let
inherit (my-lib.settings)
inherit (config.my-lib.settings)
gotosocialUrl
minifluxUrl
hedgedocDomain

View file

@ -1,12 +1,12 @@
{
config,
lib,
my-lib,
pkgs,
...
}:
with my-lib;
with config.my-lib;
let
inherit (my-lib.settings)
inherit (config.my-lib.settings)
minifluxUrl
gotosocialUrl
hedgedocDomain

View file

@ -2,7 +2,6 @@
pkgs,
config,
lib,
my-lib,
...
}:
let
@ -14,7 +13,7 @@ let
types
literalExpression
;
inherit (my-lib.settings)
inherit (config.my-lib.settings)
alertmanagerPort
;
cfg = config.custom.monitoring;