feat: lib makeEnvironment

This commit is contained in:
2025-02-05 23:38:56 +00:00
parent ea4952e1a0
commit c3415b2649

View File

@@ -50,7 +50,14 @@
in in
forAllSystemsWithPkgs [ (import rust-overlay) ] ({ system, pkgs }: forAllSystemsWithPkgs [ (import rust-overlay) ] ({ system, pkgs }:
{ {
packages.${system} = { packages.${system} =
let
rust.nativeBuildInputs = [
pkgs.pkgsBuildHost.rust-bin.stable."1.81.0".default
pkgs.pkg-config
];
in
{
nvim-alias = pkgs.callPackage ./package/nvim-alias.nix {}; nvim-alias = pkgs.callPackage ./package/nvim-alias.nix {};
nvim-pager = pkgs.callPackage ./package/nvim-pager.nix {}; nvim-pager = pkgs.callPackage ./package/nvim-pager.nix {};
printobstacle = pkgs.callPackage ./package/printobstacle.nix {}; printobstacle = pkgs.callPackage ./package/printobstacle.nix {};
@@ -61,17 +68,17 @@
migration-name = pkgs.callPackage ./package/migration-name.nix {}; migration-name = pkgs.callPackage ./package/migration-name.nix {};
prettify-log = pkgs.callPackage ./package/prettify-log/default.nix { prettify-log = pkgs.callPackage ./package/prettify-log/default.nix {
inherit (self.lib) cargoToml; inherit (self.lib) cargoToml;
nativeBuildInputs = [ inherit (rust) nativeBuildInputs;
pkgs.pkgsBuildHost.rust-bin.stable."1.81.0".default
pkgs.pkg-config
];
}; };
pg.pg-from = pkgs.callPackage ./package/postgres/pg-from/default.nix { pg = {
inherit (self.lib) cargoToml; pg-from = pkgs.callPackage ./package/postgres/pg-from/default.nix {
nativeBuildInputs = [ inherit (self.lib) cargoToml;
pkgs.pkgsBuildHost.rust-bin.stable."1.81.0".default inherit (rust) nativeBuildInputs;
pkgs.pkg-config };
]; pg-migration = pkgs.callPackage ./package/postgres/pg-migration/default.nix {
inherit (self.lib) cargoToml;
inherit (rust) nativeBuildInputs;
};
}; };
}; };
@@ -86,6 +93,7 @@
#prettify-log #prettify-log
nvim-pager nvim-pager
]) ++ (with pkgs; [ ]) ++ (with pkgs; [
git
jq jq
yq-go yq-go
curl curl
@@ -190,6 +198,10 @@
# -- For all systems -- # -- For all systems --
inherit dotEnv minorEnvironment parseEnv forAllSystemsWithPkgs forSpecSystemsWithPkgs; inherit dotEnv minorEnvironment parseEnv forAllSystemsWithPkgs forSpecSystemsWithPkgs;
makeEnvironment = envVars:
builtins.listToAttrs
(map (name: { inherit name; value = self.lib.getEnv name; }) envVars);
# -- Env processing -- # -- Env processing --
getEnv = varName: let getEnv = varName: let
var = builtins.getEnv varName; var = builtins.getEnv varName;