aboutsummaryrefslogtreecommitdiff
path: root/flake-parts/flake.nix
blob: af3ecc0aca967a3aa01bfe1675b48b7125328cd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  description = "Description for the project";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
    devenv.url = "github:cachix/devenv";
  };

  outputs = inputs@{ flake-parts, nixpkgs, ... }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [
        inputs.devenv.flakeModule
      ];
      systems = nixpkgs.lib.systems.flakeExposed;
      perSystem = { config, self', inputs', pkgs, system, ... }: {

        packages.default = pkgs.hello;

        devenv.shells.projectA = {
          packages = [ config.packages.default  pkgs.jq ];
          languages.python.enable = true;
          languages.python.poetry.enable = true;
          languages.python.poetry.activate.enable = true;
          enterShell = ''
            echo this is a Django project
            pip list
          '';
        };

        devenv.shells.projectB = {
          packages = [ config.packages.default ];
          languages.python.enable = true;
          languages.python.poetry.enable = true;
          languages.python.poetry.activate.enable = true;
          enterShell = ''
            echo this is an ansible project
          '';
        };

        devenv.shells.projectC = {
          packages = [ config.packages.default ];
          languages.opentofu.enable = true;
          enterShell = ''
            echo this is a terraform project
          '';
        };
      };
    };
}