all repos — infra @ da1bed0778a22c587e6c2fb54596b1825328ccd8

infrastructure manifests and setup notes

flake.nix (view raw)

 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
 50
 51
 52
 53
 54
 55
 56
 57
{
  inputs.nixpkgs.url = "github:nixos/nixpkgs";

  outputs =
    { self
    , nixpkgs
    ,
    }:
    let
      supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
      nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
    in
    {
      packages = forAllSystems (system:
        let
          pkgs = nixpkgsFor.${system};
          fsrv = self.packages.${system}.fsrv;
          files = pkgs.lib.fileset.toSource {
            root = ./.;
            fileset = pkgs.lib.fileset.unions [
              ./index.html
            ];
          };
        in
        {
          yarrContainer = pkgs.dockerTools.buildLayeredImage {
            name = "sini:5000/yarr";
            tag = "latest";
            contents = [
              pkgs.yarr
            ];
            config = {
              Entrypoint = [ "${pkgs.yarr}/bin/yarr" ];
              ExposedPorts = { "7070/tcp" = { }; };
            };
          };
        });

      defaultPackage = forAllSystems (system: self.packages.${system}.fsrv);
      devShells = forAllSystems (system:
        let
          pkgs = nixpkgsFor.${system};
        in
        {
          default = pkgs.mkShell {
            nativeBuildInputs = with pkgs; [
              kubectl
              kubectx
              kubernetes-helm
              go
              awscli2
            ];
          };
        });
    };
}