Use callPackage whenever possible

This commit is contained in:
Manuel Thalmann 2024-05-11 20:24:37 +02:00
parent 4dc4923656
commit 2a0a3aebf9
3 changed files with 11 additions and 12 deletions

View file

@ -120,7 +120,7 @@
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration {
modules =
let
getUserConfig = import ./lib/utils/user-config.nix { inherit lib; };
getUserConfig = pkgs.callPackage (import ./lib/utils/user-config.nix);
userConfigPath = getUserConfig { inherit hostname username; };
in [
(

View file

@ -1,4 +1,4 @@
{ lib, machine, ... }: {
{ lib, machine, pkgs, ... }: {
imports = [
./modules/custom-build-vm.nix
./modules/custom-sops-nix.nix
@ -38,7 +38,7 @@
lib.attrsets.concatMapAttrs (username: user:
let
hostname = machine.name;
getUserConfig = import ./utils/user-config.nix { inherit lib; };
getUserConfig = pkgs.callPackage (import ./utils/user-config.nix);
configPath = getUserConfig { inherit hostname username; };
in
if (configPath != null)

View file

@ -1,11 +1,10 @@
{ lib, ... }:
{ pkgs, hostname, username, ... }:
let
tryFiles = import ./try-files.nix { inherit lib; };
tryFiles = pkgs.callPackage (import ./try-files.nix) { };
in
{ hostname, username, ... }:
tryFiles [
../users/${username}/${hostname}.nix
../users${username}/common.nix
../users/${username}.nix
]
null
tryFiles [
../users/${username}/${hostname}.nix
../users${username}/common.nix
../users/${username}.nix
]
null