File size: 1,762 Bytes
32b2b27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
838d0fd
ba4c3b0
32b2b27
 
 
 
 
 
 
ba4c3b0
32b2b27
 
 
 
0943b8b
32b2b27
0943b8b
32b2b27
 
 
 
838d0fd
32b2b27
0943b8b
1284341
32b2b27
0943b8b
32b2b27
b95c3c8
 
32b2b27
 
0943b8b
 
 
 
32b2b27
 
838d0fd
 
ba4c3b0
32b2b27
0943b8b
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
58
59
60
61
62
63
64
{
  # Websurfx NixOS flake
  inputs = {
    naersk.url = "github:nix-community/naersk/master";
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    utils.url = "github:numtide/flake-utils";
  };

  outputs = {
    naersk,
    nixpkgs,
    self,
    utils,
  }:
  # We do this for all systems - namely x86_64-linux, aarch64-linux,
  # x86_64-darwin and aarch64-darwin
    utils.lib.eachDefaultSystem (system: let
      pkgs = import nixpkgs {inherit system;};
      naersk-lib = pkgs.callPackage naersk {};
    in rec {
      # Build via "nix build .#default"
      packages.default = naersk-lib.buildPackage {
        # The build dependencies
        buildInputs = with pkgs; [pkg-config openssl];
        src = ./.;
      };

      # Enter devshell with all the tools via "nix develop"
      # or "nix-shell"
      devShells.default = with pkgs;
        mkShell {
          buildInputs = [
            actionlint
            cargo
            docker
            haskellPackages.hadolint
            nodejs
            nodePackages_latest.cspell
            nodePackages_latest.eslint
            nodePackages_latest.markdownlint-cli2
            nodePackages_latest.stylelint
            redis
            rustPackages.clippy
            rust-analyzer
            cargo-watch
            rustc
            rustfmt
            yamllint
            openssl
            pkg-config
          ];
          RUST_SRC_PATH = rustPlatform.rustLibSrc;
          shellHook = ''
            export PATH="$PATH:$HOME/.cargo/bin"
            export NODE_PATH="$NODE_PATH:./node_modules"
          '';
        };

      # Build via "nix build .#websurfx", which is basically just
      # calls the build function
      packages.websurfx = packages.default;
    });