86 lines
2.1 KiB
Nix
86 lines
2.1 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling";
|
|
systems.url = "github:nix-systems/default";
|
|
devenv.url = "github:cachix/devenv";
|
|
devenv.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
nixConfig = {
|
|
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
|
|
extra-substituters = "https://devenv.cachix.org";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
|
|
let
|
|
forEachSystem = nixpkgs.lib.genAttrs (import systems);
|
|
in
|
|
{
|
|
packages = forEachSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
images.hello = pkgs.dockerTools.buildImage {
|
|
name = "hello-docker";
|
|
config = {
|
|
Cmd = [ "${pkgs.hello}/bin/hello" ];
|
|
};
|
|
};
|
|
|
|
website = pkgs.stdenv.mkDerivation
|
|
(
|
|
let
|
|
# TODO: DRY
|
|
gems = pkgs.bundlerEnv {
|
|
name = "static";
|
|
gemdir = ./src;
|
|
};
|
|
in
|
|
{
|
|
version = "0.0.1";
|
|
name = "website";
|
|
|
|
src = ./src;
|
|
|
|
buildInputs = [
|
|
gems
|
|
gems.wrappedRuby
|
|
];
|
|
|
|
sourceRoot = "src";
|
|
|
|
buildPhase = ''
|
|
bundle exec jekyll build
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r _site/* $out/
|
|
'';
|
|
}
|
|
);
|
|
}
|
|
);
|
|
|
|
devShells = forEachSystem
|
|
(system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
gems = pkgs.bundlerEnv {
|
|
name = "static";
|
|
gemdir = ./src;
|
|
};
|
|
in
|
|
{
|
|
default = devenv.lib.mkShell {
|
|
inherit inputs pkgs;
|
|
modules = [
|
|
{
|
|
packages = [ gems gems.wrappedRuby ];
|
|
}
|
|
];
|
|
};
|
|
});
|
|
};
|
|
}
|