about summary refs log tree commit diff
path: root/flake.nix
blob: 3e72e8904c487117bc00bac284f5078eca50b9e7 (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
{
  description = ''
    specimen, application and server configuration.
    enjoy! :)
  '';

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  };

  outputs = { self, nixpkgs }:
  let
    inherit (nixpkgs) lib;

    name = "specimen";
    systems = [ "x86_64-linux" "aarch64-linux" ];

    pkgsForSystem = system: import nixpkgs { inherit system; };

    forAllSystems = f: lib.genAttrs systems
      (system: f { inherit system; pkgs = pkgsForSystem system; });
  in
  {
    packages = forAllSystems ({ system, pkgs }: {
      default = pkgs.callPackage ./application/. { };
    });

    devShells = forAllSystems ({ system, pkgs }: {
      default = pkgs.mkShell {
       buildInputs = with pkgs; [ go gopls delve go-task golangci-lint ];
      };
    });

    nixosConfigurations = forAllSystems ({ system, pkgs }: {
      ${name} = {
        inherit system;
        modules = [
          ./configuration/configuration.nix
        ];
      };
    });
  };
}