feat(nix): Rework a bit
This commit is contained in:
parent
a648941bac
commit
ed6fafda45
3 changed files with 38 additions and 18 deletions
43
default.nix
43
default.nix
|
@ -1,13 +1,44 @@
|
|||
{ pkgs ? import (import ./npins).nixpkgs {} }:
|
||||
{
|
||||
production = pkgs.buildNpmPackage {
|
||||
sources ? import ./npins,
|
||||
pkgs ? import sources.nixpkgs { },
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (pkgs.lib.fileset)
|
||||
fileFilter
|
||||
gitTrackedWith
|
||||
intersection
|
||||
toSource
|
||||
;
|
||||
in
|
||||
|
||||
{
|
||||
package = pkgs.buildNpmPackage {
|
||||
name = "metis";
|
||||
src = ./.;
|
||||
|
||||
src = toSource {
|
||||
root = ./.;
|
||||
fileset = intersection (gitTrackedWith { } ./.) (
|
||||
fileFilter ({ name, hasExt, ... }: !(hasExt "nix") && name != "npins") ./.
|
||||
);
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-RbjWNVY8KlPP9ajQRnrsWhOZiiyyMGQSY39lmZnTC1I=";
|
||||
|
||||
installPhase = ''
|
||||
cp -r public $out
|
||||
'';
|
||||
'';
|
||||
};
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
name = "metis.dev";
|
||||
|
||||
packages = [ pkgs.nodejs ];
|
||||
};
|
||||
|
||||
providers = {
|
||||
eleves-ens = "cloud.eleves.ens.fr";
|
||||
frama-agenda = "framagenda.org";
|
||||
dgnum-nc = "cloud.dgnum.eu";
|
||||
};
|
||||
shell = import ./shell.nix { inherit pkgs; };
|
||||
providers = import ./providers.nix;
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
let
|
||||
providers = {
|
||||
eleves-ens = "cloud.eleves.ens.fr";
|
||||
frama-agenda = "framagenda.org";
|
||||
dgnum-nc = "cloud.dgnum.eu";
|
||||
};
|
||||
in
|
||||
builtins.mapAttrs (name: value: "https://${value}/remote.php/dav/public-calendars/") providers
|
|
@ -1,4 +1 @@
|
|||
{ pkgs ? import (import ./npins).nixpkgs {} }:
|
||||
pkgs.mkShell {
|
||||
packages = [ pkgs.nodejs ];
|
||||
}
|
||||
(import ./. { }).devShell
|
||||
|
|
Loading…
Reference in a new issue