flake.nix (view raw)
1{
2 inputs.nixpkgs.url = "github:nixos/nixpkgs";
3
4 outputs =
5 { self
6 , nixpkgs
7 ,
8 }:
9 let
10 supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
11 forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
12 nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
13 in
14 {
15 packages = forAllSystems (system:
16 let
17 pkgs = nixpkgsFor.${system};
18 fsrv = self.packages.${system}.fsrv;
19 files = pkgs.lib.fileset.toSource {
20 root = ./.;
21 fileset = pkgs.lib.fileset.unions [
22 ./index.html
23 ];
24 };
25 in
26 {
27 yarrContainer = pkgs.dockerTools.buildLayeredImage {
28 name = "sini:5000/yarr";
29 tag = "latest";
30 contents = [
31 pkgs.yarr
32 ];
33 config = {
34 Entrypoint = [ "${pkgs.yarr}/bin/yarr" ];
35 ExposedPorts = { "7070/tcp" = { }; };
36 };
37 };
38 });
39
40 defaultPackage = forAllSystems (system: self.packages.${system}.fsrv);
41 devShells = forAllSystems (system:
42 let
43 pkgs = nixpkgsFor.${system};
44 in
45 {
46 default = pkgs.mkShell {
47 nativeBuildInputs = with pkgs; [
48 kubectl
49 kubectx
50 kubernetes-helm
51 go
52 awscli2
53 ];
54 };
55 });
56 };
57}