-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
57 lines (54 loc) · 1.77 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
{
description = "A Gnome extension to mimic macOS's Rectangle tiling.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
gitignore.url = "github:hercules-ci/gitignore.nix";
gitignore.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, gitignore }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (gitignore.lib) gitignoreSource;
pkgs = (import nixpkgs) { inherit system; };
nodejs = pkgs.nodejs;
node2nixOutput = import ./nix { inherit pkgs nodejs system; };
nodeDeps = node2nixOutput.nodeDependencies;
buildDependencies = with pkgs; [
glib
nodejs
typescript
unzip
zip
];
in
{
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
packages.default = pkgs.stdenv.mkDerivation {
name = "gnome-extensions-rectangle";
version = "master";
src = gitignoreSource ./.;
nativeBuildInputs = buildDependencies;
dontCheck = true;
dontConfigure = true;
dontFixup = true;
buildPhase = ''
runHook preBuild
ln -sf ${nodeDeps}/lib/node_modules ./node_modules
make pack
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/gnome-shell/extensions/[email protected]
unzip rectangle.zip -d $out/share/gnome-shell/extensions/[email protected]
cp rectangle.zip $out/
runHook postInstall
'';
};
devShell = pkgs.mkShell {
packages = buildDependencies;
};
}
);
}