summaryrefslogtreecommitdiff
path: root/flake.nix
blob: c2697678995c4a090e059fc23fc4532ff64ab37f (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
{
  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
      combine (pkgs: rec {
        packages = rec {
          label-tracker = pkgs.callPackage ./default.nix {};
          default = label-tracker;
        };

        devShells.default = pkgs.mkShell {
          inputsFrom = [ packages.default ];
          packages = with pkgs; [ rustfmt rust-analyzer clippy ];
        };
      }) // {
        nixosModule = import ./module.nix { inherit self; };
      };
}