Browse Source

add flake

main
Milan 1 month ago
parent
commit
9f036dcc73
  1. 26
      flake.lock
  2. 34
      flake.nix

26
flake.lock

@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1631740134,
"narHash": "sha256-JIGBKzcFiNlxD9+7klPsgUGTC7e01CgtXjBoOVoLTy4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3b72a3af7a30d15ba2af35b685d5ca61e2ce5e3f",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

34
flake.nix

@ -0,0 +1,34 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs, ... }: let
systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
overlay = final: prev: {
rusty-lg-backend = final.callPackage ./nix/backend.nix {
srcDir = ./backend;
};
rusty-lg-frontend = final.callPackage ./nix/frontend.nix {
srcDir = ./frontend;
};
};
# Memoize nixpkgs for different platforms for efficiency.
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ overlay ];
});
in {
inherit overlay;
packages = builtins.mapAttrs (system: pkgs: {
inherit (pkgs)
rusty-lg-backend
rusty-lg-frontend
;
}) nixpkgsFor;
};
}
Loading…
Cancel
Save