feat(nix): Rework a bit

This commit is contained in:
Tom Hubrecht 2024-10-24 00:08:51 +02:00
parent a648941bac
commit ed6fafda45
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
3 changed files with 38 additions and 18 deletions

View file

@ -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"; name = "metis";
src = ./.;
src = toSource {
root = ./.;
fileset = intersection (gitTrackedWith { } ./.) (
fileFilter ({ name, hasExt, ... }: !(hasExt "nix") && name != "npins") ./.
);
};
npmDepsHash = "sha256-RbjWNVY8KlPP9ajQRnrsWhOZiiyyMGQSY39lmZnTC1I="; npmDepsHash = "sha256-RbjWNVY8KlPP9ajQRnrsWhOZiiyyMGQSY39lmZnTC1I=";
installPhase = '' installPhase = ''
cp -r public $out 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;
} }

View file

@ -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

View file

@ -1,4 +1 @@
{ pkgs ? import (import ./npins).nixpkgs {} }: (import ./. { }).devShell
pkgs.mkShell {
packages = [ pkgs.nodejs ];
}