Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ noctalia
# OS
.DS_Store
Thumbs.db

# Nix
.envrc
.direnv/
result/
result
result-*
24 changes: 24 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
description = "Noctalia - A lightweight Wayland shell and bar";

inputs = {
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
};

outputs =
{ self, nixpkgs }:
let
inherit (nixpkgs) lib;

systems = [
"x86_64-linux"
"aarch64-linux"
];

forEachSystem =
perSystem:
lib.genAttrs systems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
perSystem { inherit pkgs system; }
);

mkDate =
longDate:
nixpkgs.lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
];

version = mkDate (self.lastModifiedDate or "19700101") + "" + (self.shortRev or "dirty");
in
{
overlays.default = final: prev: {
noctalia = final.callPackage ./nix/package.nix { inherit version; };
};

packages = forEachSystem (
{ pkgs, ... }:
{
default = pkgs.callPackage ./nix/package.nix { inherit version; };
}
);

devShells = forEachSystem (
{ pkgs, system }:
{
default = pkgs.callPackage ./nix/devshell.nix {
noctalia = self.packages.${system}.default;
};
}
);

apps = forEachSystem (
{ system, ... }:
{
default = {
type = "app";
program = lib.getExe self.packages.${system}.default;
};
}
);
};
}
29 changes: 29 additions & 0 deletions nix/devshell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
pkgs,
noctalia,
}:
pkgs.mkShell {
inputsFrom = [ noctalia ];

nativeBuildInputs = with pkgs; [
# Workflow & Hooks
just
lefthook

# Formatting (required by justfile)
clang-tools
gnugrep
gnused
findutils

# Debugging
gdb
];

shellHook = ''
# Point to local assets so binaries find resources without installation
export NOCTALIA_ASSETS_DIR="$PWD/assets"

echo " Noctalia dev-shell | 'just --list' to see available tasks"
'';
}
77 changes: 77 additions & 0 deletions nix/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
lib,
stdenv,
version,
meson,
ninja,
pkg-config,
wayland-scanner,
wayland,
wayland-protocols,
libGL,
libglvnd,
freetype,
fontconfig,
cairo,
pango,
libxkbcommon,
sdbus-cpp_2,
systemd,
pipewire,
pam,
curl,
libwebp,
glib,
polkit
}:

stdenv.mkDerivation {
pname = "noctalia";
inherit version;

src = lib.cleanSource ../.;

postPatch = ''
# Remove -march=native and -mtune=native for reproducible builds
sed -i "s/'-march=native', '-mtune=native',//" meson.build
'';

nativeBuildInputs = [
meson
ninja
pkg-config
wayland-scanner
];

buildInputs = [
wayland
wayland-protocols
libGL
libglvnd
freetype
fontconfig
cairo
pango
libxkbcommon
sdbus-cpp_2
systemd
pipewire
pam
curl
libwebp
glib
polkit
];

mesonBuildType = "release";

ninjaFlags = [ "-v" ];

meta = with lib; {
description = "A lightweight Wayland shell and bar built directly on Wayland + OpenGL ES";
homepage = "https://github.com/noctalia-dev/noctalia-shell";
license = licenses.mit;
platforms = platforms.linux;
mainProgram = "noctalia";
};
}
Loading