summaryrefslogtreecommitdiff
path: root/flake.nix
blob: d67bd177a6341383160d0e5e667e3c5dd6a24c75 (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
{
  inputs = {
    nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable-small;
  };

  outputs = { self, nixpkgs }:
    let
      systems = { "x86_64-linux" = {}; };
      combine = fn: with builtins;
        let
          parts = mapAttrs (s: _: fn (nixpkgs.legacyPackages.${s})) systems;
          keys = foldl' (a: b: a // b) {} (attrValues parts);
        in
          mapAttrs (k: _: mapAttrs (s: _: parts.${s}.${k} or {}) systems) keys;
    in
      {
        nixosModule = import ./module.nix self;
      } // combine (pkgs: rec {
        packages = rec {
          minor-skulk = pkgs.callPackage ./default.nix {};
          default = minor-skulk;
        };

        devShells.default = pkgs.mkShell {
          inputsFrom = [ packages.default ];
          packages = with pkgs; [
            cargo-audit
            rustfmt
            rust-analyzer
            clippy
            sqlx-cli
          ];
        };
      });
}