tree-wide: remove top-level "with lib;"

This commit is contained in:
teutat3s 2024-06-13 02:14:25 +02:00
parent cdfe4d6bcb
commit 472474ffda
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
30 changed files with 65 additions and 44 deletions

View file

@ -5,7 +5,9 @@
profiles, profiles,
... ...
}: }:
with lib; let let
inherit (lib) mkForce;
# Gets hostname of host to be bundled inside iso # Gets hostname of host to be bundled inside iso
# Copied from https://github.com/divnix/digga/blob/30ffa0b02272dc56c94fd3c7d8a5a0f07ca197bf/modules/bootstrap-iso.nix#L3-L11 # Copied from https://github.com/divnix/digga/blob/30ffa0b02272dc56c94fd3c7d8a5a0f07ca197bf/modules/bootstrap-iso.nix#L3-L11
getFqdn = config: let getFqdn = config: let

View file

@ -5,7 +5,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
programs.adb.enable = true; programs.adb.enable = true;

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
users.users."${psCfg.user.name}" = { users.users."${psCfg.user.name}" = {

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in { in {

View file

@ -4,11 +4,11 @@
lib, lib,
... ...
}: }:
with lib; let let
cfg = config.pub-solar.core; cfg = config.pub-solar.core;
in { in {
options.pub-solar.core.disk-encryption-active = mkOption { options.pub-solar.core.disk-encryption-active = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = true; default = true;
description = "Whether it should be assumed that there is a cryptroot device"; description = "Whether it should be assumed that there is a cryptroot device";
}; };
@ -17,7 +17,7 @@ in {
boot = { boot = {
# Mount / luks device in initrd # Mount / luks device in initrd
# Allow fstrim to work on it. # Allow fstrim to work on it.
initrd = mkIf cfg.disk-encryption-active { initrd = lib.mkIf cfg.disk-encryption-active {
luks.devices."cryptroot" = { luks.devices."cryptroot" = {
allowDiscards = true; allowDiscards = true;
}; };

View file

@ -3,7 +3,7 @@
lib, lib,
... ...
}: }:
with lib; let let
cfg = config.pub-solar.core; cfg = config.pub-solar.core;
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {

View file

@ -4,8 +4,9 @@
lib, lib,
... ...
}: }:
with lib; let let
cfg = config.pub-solar.core.hibernation; cfg = config.pub-solar.core.hibernation;
inherit (lib) mkOption types mkIf;
in { in {
options.pub-solar.core.hibernation = { options.pub-solar.core.hibernation = {
enable = mkOption { enable = mkOption {

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: }:
with lib; { {
config = { config = {
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
cfg = config.pub-solar.core; cfg = config.pub-solar.core;
in { in {

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
services.udev.packages = [pkgs.yubikey-personalization]; services.udev.packages = [pkgs.yubikey-personalization];

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
virtualisation.docker.enable = true; virtualisation.docker.enable = true;

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
users.users."${psCfg.user.name}".packages = with pkgs; [ users.users."${psCfg.user.name}".packages = with pkgs; [

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
programs.steam.enable = true; programs.steam.enable = true;

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
tomlFormat = pkgs.formats.toml {}; tomlFormat = pkgs.formats.toml {};
sessionVariables = { sessionVariables = {
@ -22,8 +22,8 @@ in {
]; ];
options.pub-solar.graphical = { options.pub-solar.graphical = {
wayland.software-renderer.enable = mkOption { wayland.software-renderer.enable = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = false; default = false;
description = "Feature flag enabling wlroots software renderer, useful in VMs"; description = "Feature flag enabling wlroots software renderer, useful in VMs";
}; };

View file

@ -5,8 +5,9 @@
flake, flake,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
inherit (lib) mkIf mkOption types;
in { in {
options.pub-solar.graphical = { options.pub-solar.graphical = {
v4l2loopback.enable = mkOption { v4l2loopback.enable = mkOption {
@ -25,8 +26,8 @@ in {
''; '';
}; };
environment.systemPackages = with pkgs; mkIf psCfg.graphical.v4l2loopback.enable [ environment.systemPackages = mkIf psCfg.graphical.v4l2loopback.enable [
linuxPackages.v4l2loopback pkgs.linuxPackages.v4l2loopback
]; ];
programs.sway.enable = true; programs.sway.enable = true;

View file

@ -1,8 +1,23 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib;
let let
inherit (lib)
any
attrValues
concatMapStringsSep
concatStrings
flatten
literalExpression
mapAttrs'
mapAttrsToList
mkDefault
mkEnableOption
mkIf
mkMerge
mkOption
nameValuePair
types;
cfg = config.services.invoiceplane; cfg = config.services.invoiceplane;
eachSite = cfg.sites; eachSite = cfg.sites;
user = "invoiceplane"; user = "invoiceplane";

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
home-manager.users."${psCfg.user.name}" = { home-manager.users."${psCfg.user.name}" = {

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
programs.evince.enable = true; programs.evince.enable = true;

View file

@ -5,7 +5,7 @@
lib, lib,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
services.avahi.enable = true; services.avahi.enable = true;

View file

@ -5,17 +5,17 @@
flake, flake,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
cfg = config.pub-solar.terminal-life; cfg = config.pub-solar.terminal-life;
in { in {
options.pub-solar.terminal-life = { options.pub-solar.terminal-life = {
full = mkOption { full = lib.mkOption {
description = '' description = ''
Enable a full version, which includes more nvim plugins and lsps. Enable a full version, which includes more nvim plugins and lsps.
''; '';
default = false; default = false;
type = types.bool; type = lib.types.bool;
}; };
}; };

View file

@ -5,8 +5,9 @@
... ...
}: let }: let
psCfg = config.pub-solar; psCfg = config.pub-solar;
inherit (lib) mkIf mkOption types;
in in
with lib; { {
imports = [ imports = [
./home.nix ./home.nix
]; ];

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in { in {

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in {
boot.kernelParams = [ boot.kernelParams = [

View file

@ -4,9 +4,10 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
cfg = config.pub-solar.wireguard-client; cfg = config.pub-solar.wireguard-client;
inherit (lib) mkOption types;
in { in {
options.pub-solar.wireguard-client = { options.pub-solar.wireguard-client = {
ownIPs = mkOption { ownIPs = mkOption {

View file

@ -15,10 +15,10 @@ with self;
install -D -m755 cockroach $out/bin/cockroach install -D -m755 cockroach $out/bin/cockroach
cp -r lib $out/lib cp -r lib $out/lib
''; '';
meta = with lib; { meta = {
homepage = "https://www.cockroachlabs.com"; homepage = "https://www.cockroachlabs.com";
description = "A scalable, survivable, strongly-consistent SQL database"; description = "A scalable, survivable, strongly-consistent SQL database";
platforms = ["x86_64-linux"]; platforms = ["x86_64-linux"];
maintainers = with maintainers; [mic92]; maintainers = [ lib.maintainers.mic92 ];
}; };
} }

View file

@ -11,11 +11,11 @@ let
sha256 = "818a7641068932ed6436d0af0a3bb77bbbde29df0a7142c8bd1a249e7c2f0d38"; sha256 = "818a7641068932ed6436d0af0a3bb77bbbde29df0a7142c8bd1a249e7c2f0d38";
}; };
meta = with lib; { meta = {
description = "A simple namespaced plugin facility"; description = "A simple namespaced plugin facility";
homepage = https://github.com/ironfroggy/straight.plugin; homepage = "https://github.com/ironfroggy/straight.plugin";
license = licenses.mit; license = lib.licenses.mit;
maintainers = [ maintainers.makefu ]; maintainers = [ lib.maintainers.makefu ];
}; };
}; };
in in

View file

@ -5,7 +5,7 @@
flake, flake,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in { in {

View file

@ -6,7 +6,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;
tritonshell = flake.inputs.tritonshell; tritonshell = flake.inputs.tritonshell;

View file

@ -5,7 +5,7 @@
flake, flake,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in { in {