summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 1d05cc3e9f7ed70348b1b522949afb8934a8299d (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
{
  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; [
            rustfmt
            rust-analyzer
            clippy
            sqlx-cli
          ];
        };
      });
}