Skip to content

Commit 4bd4261

Browse files
committed
refactor: make its based on nix/
1 parent f9f2cf7 commit 4bd4261

3 files changed

Lines changed: 103 additions & 70 deletions

File tree

flake.nix

Lines changed: 7 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -21,83 +21,20 @@
2121
);
2222
in
2323
{
24+
overlays.default = final: prev: {
25+
noctalia = final.callPackage ./nix/package.nix { };
26+
};
27+
2428
packages = forEachSystem (
2529
{ pkgs, ... }: {
26-
default = pkgs.stdenv.mkDerivation {
27-
pname = "noctalia";
28-
version = "5.0.0";
29-
30-
src = ./.;
31-
32-
postPatch = ''
33-
sed -i "s/'-march=native', '-mtune=native',//" meson.build
34-
'';
35-
36-
37-
nativeBuildInputs = with pkgs; [
38-
meson
39-
ninja
40-
pkg-config
41-
wayland-scanner
42-
];
43-
44-
buildInputs = with pkgs; [
45-
wayland
46-
wayland-protocols
47-
libGL
48-
libglvnd
49-
freetype
50-
fontconfig
51-
cairo
52-
pango
53-
libxkbcommon
54-
sdbus-cpp_2
55-
systemd
56-
pipewire
57-
pam
58-
curl
59-
libwebp
60-
];
61-
62-
mesonBuildType = "release";
63-
64-
ninjaFlags = [ "-v" ];
65-
66-
meta = with pkgs.lib; {
67-
description = "A lightweight Wayland shell and bar built directly on Wayland + OpenGL ES";
68-
homepage = "https://github.com/anomalyco/noctalia-shell";
69-
license = licenses.mit;
70-
platforms = platforms.linux;
71-
mainProgram = "noctalia";
72-
};
73-
};
30+
default = pkgs.callPackage ./nix/package.nix { };
7431
}
7532
);
7633

7734
devShells = forEachSystem (
7835
{ pkgs, system }: {
79-
default = pkgs.mkShell {
80-
inputsFrom = [ self.packages.${system}.default ];
81-
82-
buildInputs = with pkgs; [
83-
just
84-
clang-tools
85-
gdb
86-
];
87-
88-
shellHook = ''
89-
echo "Noctalia development environment"
90-
echo ""
91-
echo "Available commands:"
92-
echo " just configure - Configure debug build"
93-
echo " just build - Build debug"
94-
echo " just run - Run debug build"
95-
echo " just configure release - Configure release build"
96-
echo " just build release - Build release"
97-
echo " just run release - Run release build"
98-
echo ""
99-
echo "Note: Use 'just build' instead of 'nix build' due to sdbus-c++ API compatibility"
100-
'';
36+
default = pkgs.callPackage ./nix/devshell.nix {
37+
noctalia = self.packages.${system}.default;
10138
};
10239
}
10340
);

nix/devshell.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{ pkgs, noctalia }:
2+
3+
pkgs.mkShell {
4+
inputsFrom = [ noctalia ];
5+
6+
buildInputs = with pkgs; [
7+
just
8+
clang-tools
9+
gdb
10+
];
11+
12+
shellHook = ''
13+
echo "Noctalia development environment"
14+
echo ""
15+
echo "Available commands:"
16+
echo " just configure - Configure debug build"
17+
echo " just build - Build debug"
18+
echo " just run - Run debug build"
19+
echo " just configure release - Configure release build"
20+
echo " just build release - Build release"
21+
echo " just run release - Run release build"
22+
echo ""
23+
echo "Note: Use 'just build' instead of 'nix build' due to sdbus-c++ API compatibility"
24+
'';
25+
}

nix/package.nix

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{ lib,
2+
stdenv,
3+
meson,
4+
ninja,
5+
pkg-config,
6+
wayland-scanner,
7+
wayland,
8+
wayland-protocols,
9+
libGL,
10+
libglvnd,
11+
freetype,
12+
fontconfig,
13+
cairo,
14+
pango,
15+
libxkbcommon,
16+
sdbus-cpp_2,
17+
systemd,
18+
pipewire,
19+
pam,
20+
curl,
21+
libwebp
22+
}:
23+
24+
stdenv.mkDerivation {
25+
pname = "noctalia";
26+
version = "5.0.0";
27+
28+
src = ../.;
29+
30+
postPatch = ''
31+
# Remove -march=native and -mtune=native for reproducible builds
32+
sed -i "s/'-march=native', '-mtune=native',//" meson.build
33+
'';
34+
35+
nativeBuildInputs = [
36+
meson
37+
ninja
38+
pkg-config
39+
wayland-scanner
40+
];
41+
42+
buildInputs = [
43+
wayland
44+
wayland-protocols
45+
libGL
46+
libglvnd
47+
freetype
48+
fontconfig
49+
cairo
50+
pango
51+
libxkbcommon
52+
sdbus-cpp_2
53+
systemd
54+
pipewire
55+
pam
56+
curl
57+
libwebp
58+
];
59+
60+
mesonBuildType = "release";
61+
62+
ninjaFlags = [ "-v" ];
63+
64+
meta = with lib; {
65+
description = "A lightweight Wayland shell and bar built directly on Wayland + OpenGL ES";
66+
homepage = "https://github.com/anomalyco/noctalia-shell";
67+
license = licenses.mit;
68+
platforms = platforms.linux;
69+
mainProgram = "noctalia";
70+
};
71+
}

0 commit comments

Comments
 (0)