Use nix flake functionality for development

This commit is contained in:
Martin Puppe 2022-04-08 01:47:18 +02:00
parent 8c56307c55
commit dd5f51d9cc
10 changed files with 61 additions and 25 deletions

View file

@ -1,8 +1,22 @@
{
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
let overlay = import ./overlay.nix;
in flake-utils.lib.eachDefaultSystem (system:
inputs.financier = {
url = "gitlab:mpuppe/financier";
flake = false;
};
outputs = inputs@{ self, nixpkgs, ... }:
let
financierVersion = "1.7.3";
nodeVersion = "12";
overlay = final: prev: {
financier-dist = import ./dist.nix {
inherit financierVersion;
inherit (prev) pkgs system;
};
};
in inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
@ -11,8 +25,18 @@
in {
packages = { inherit (pkgs) financier-dist; };
defaultPackage = self.packages.${system}.financier-dist;
devShell = pkgs.mkShell {
packages = with pkgs; [ nodePackages.node2nix ];
shellHook = ''
export FINANCIER_SRC="${inputs.financier}"
export FINANCIER_NODE_VERSION="${nodeVersion}"
'';
};
}) // {
inherit overlay;
nixosModule = import ./module.nix;
nixosModule = {
imports = [ ./module.nix ];
nixpkgs.overlays = [ self.overlay ];
};
};
}