mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
feat: pulumi, nix-std, ...
This commit is contained in:
parent
d5da15e555
commit
6eeb622a8c
31 changed files with 244 additions and 106 deletions
|
|
@ -2,17 +2,17 @@
|
|||
lib,
|
||||
tree,
|
||||
inputs,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.attrsets) mapAttrs;
|
||||
inherit (std) set;
|
||||
in
|
||||
inputs.utils.lib.eachDefaultSystem (system: {
|
||||
devShells = let
|
||||
shells = mapAttrs (_: path:
|
||||
shells = set.map (_: path:
|
||||
import path rec {
|
||||
inherit tree inputs system;
|
||||
inherit tree inputs system lib std;
|
||||
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
})
|
||||
tree.shells;
|
||||
in
|
||||
|
|
|
|||
|
|
@ -1,22 +1,38 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
system,
|
||||
std,
|
||||
...
|
||||
}:
|
||||
with pkgs; let
|
||||
repo = import ../outputs.nix (inputs // {inherit inputs system;});
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
in
|
||||
mkShell {
|
||||
repo = import ../outputs.nix { inherit inputs; };
|
||||
inherit (std) set list;
|
||||
python = "python39";
|
||||
mergeEnvs = envs:
|
||||
pkgs.mkShell (list.foldl'
|
||||
(a: v: {
|
||||
buildInputs = a.buildInputs ++ v.buildInputs;
|
||||
nativeBuildInputs = a.nativeBuildInputs ++ v.nativeBuildInputs;
|
||||
})
|
||||
(pkgs.mkShell { })
|
||||
envs);
|
||||
requirements = builtins.readFile ../requirements.txt;
|
||||
mach-nix-wrapper = import inputs.mach-nix { inherit pkgs python; };
|
||||
pythonShell = mach-nix-wrapper.mkPythonShell { inherit requirements; };
|
||||
repoShell = mkShell {
|
||||
nativeBuildInputs =
|
||||
[
|
||||
go # Required for pulumi
|
||||
pulumi # Infrastructure as code
|
||||
python39Packages.pulumi # Pulumi for Python!
|
||||
pulumiPackages.pulumi-language-python # Python!
|
||||
deadnix # dead-code scanner
|
||||
alejandra # code formatter
|
||||
statix # anti-pattern finder
|
||||
]
|
||||
++ mapAttrsToList (name: _: (pkgs.writeShellScriptBin "${name}-rebuild" ''
|
||||
++ set.values (set.map (name: _: (pkgs.writeShellScriptBin "${name}-rebuild" ''
|
||||
darwin-rebuild switch --flake $REPO_ROOT#${name}
|
||||
''))
|
||||
repo.darwinConfigurations;
|
||||
}
|
||||
repo.darwinConfigurations);
|
||||
};
|
||||
in mergeEnvs [ repoShell pythonShell ]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue