-
Notifications
You must be signed in to change notification settings - Fork 11
/
flake.nix
57 lines (53 loc) · 2.02 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }@inputs:
utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in rec {
packages = rec {
default = import ./default.nix { inherit pkgs; };
customized = cssFile:
pkgs.stdenv.mkDerivation rec {
name = "Xess-customized";
version = "latest";
src = ./.;
buildInputs = with pkgs; [ nodePackages.clean-css-cli ];
phases = "installPhase";
installPhase = ''
mkdir -p $out/static/css
cleancss -o $out/static/css/xess.css ${cssFile} $src/xess-base.css
ln -s $out/static/css/xess.css $out/gruvbox.css
cp $src/sample.html $out
'';
};
# example customized css files
aoi = customized ./custom/aoi.css;
cherry = customized ./custom/cherry.css;
green = customized ./custom/green.css;
kafon = customized ./custom/kafon.css;
combined = pkgs.runCommand "combined" {} ''
mkdir -p $out
ln -s ${iaso}/static/css/xess.css $out/xess.css
ln -s ${aoi}/static/css/xess.css $out/aoi.css
ln -s ${cherry}/static/css/xess.css $out/cherry.css
ln -s ${green}/static/css/xess.css $out/green.css
ln -s ${kafon}/static/css/xess.css $out/kafon.css
'';
iaso = pkgs.stdenv.mkDerivation rec {
name = "Xess";
version = "latest";
src = ./.;
buildInputs = with pkgs; [ nodePackages.clean-css-cli ];
phases = "installPhase";
installPhase = ''
mkdir -p $out/static/css
cleancss -o $out/static/css/xess.css $src/classic/iaso.css
'';
};
};
devShell = import ./shell.nix { inherit pkgs; };
});
}