diff --git a/modules/noctalia/check.nix b/modules/noctalia/check.nix new file mode 100644 index 0000000..3529391 --- /dev/null +++ b/modules/noctalia/check.nix @@ -0,0 +1,21 @@ +{ + pkgs, + self, +}: + +let + noctaliaWrapped = + (self.wrapperModules.noctalia.apply { + inherit pkgs; + }).wrapper; + +in +pkgs.runCommand "noctalia-test" { } '' + # if the config is invalid the text helix will complain here. + # sady no other dedicated check config command exists + res=$(${pkgs.lib.getExe noctaliaWrapped} config validate) + echo $res + if [[ ''${#res} == 0 ]]; then + touch $out + fi +'' diff --git a/modules/noctalia/module.nix b/modules/noctalia/module.nix new file mode 100644 index 0000000..e450aad --- /dev/null +++ b/modules/noctalia/module.nix @@ -0,0 +1,55 @@ +{ + config, + lib, + wlib, + ... +}: +let + tomlFmt = config.pkgs.formats.toml { }; +in +{ + _class = "wrapper"; + options = { + settings = lib.mkOption { + type = tomlFmt.type; + description = '' + Noctalia Settings + See + ''; + default = { }; + }; + "config.toml" = lib.mkOption { + type = wlib.types.file config.pkgs; + default.path = tomlFmt.generate "noctalia-config" config.settings; + }; + }; + + config = { + # waiting for noctalia to be updated to v5 in nixpkgs + package = config.pkgs.callPackage ./package.nix { }; + env = { + NOCTALIA_CONFIG_HOME = toString ( + config.pkgs.linkFarm "noctalia-config" [ + { + name = "noctalia/config.toml"; + path = config."config.toml".path; + } + ] + ); + }; + meta = { + maintainers = [ + { + # waiting to become a nixpkgs maintainer + github = "kruemmelspalter"; + githubId = 54735589; + name = "kruemmelspalter"; + email = "kruemmelspalter@kruemmelspalter.org"; + matrix = "@kruemmelsplater:kruemmelspalter.org"; + keys = [ { fingerprint = "28F5 4BD4 73F1 7495 24BF F4BD 4F4A 2EFA E386 71C8"; } ]; + } + ]; + platforms = lib.platforms.linux; + }; + }; +} diff --git a/modules/noctalia/package.nix b/modules/noctalia/package.nix new file mode 100644 index 0000000..62e1e0e --- /dev/null +++ b/modules/noctalia/package.nix @@ -0,0 +1,101 @@ +### waiting for noctalia to be updated to v5 in nixpkgs +### adapted from upstream at (licensed MIT) +{ + lib, + config, + stdenv, + fetchFromGitHub, + meson, + ninja, + pkg-config, + wayland-scanner, + wayland, + wayland-protocols, + libGL, + libglvnd, + freetype, + fontconfig, + cairo, + pango, + harfbuzz, + libxkbcommon, + sdbus-cpp_2, + systemdLibs, + pipewire, + pam, + curl, + libwebp, + glib, + polkit, + librsvg, + libqalculate, + libxml2, + jemalloc, + autoAddDriverRunpath, + cudaSupport ? config.cudaSupport, +}: + +stdenv.mkDerivation { + pname = "noctalia"; + version = "4.7.7-unstable-2026-06-11"; + + strictDeps = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "noctalia-dev"; + repo = "noctalia"; + rev = "7421f80b041e81d6e202a25ade6bfc59d716dd43"; + hash = "sha256-H+uwJBulU/0Qt+BGUvlyrTPgcdOfojSalklpEuKKD2c="; + }; + + postPatch = '' + # Remove -march=native and -mtune=native for reproducible builds + substituteInPlace meson.build --replace-fail "'-march=native', '-mtune=native'," "" + ''; + + nativeBuildInputs = [ + meson + ninja + pkg-config + wayland-scanner + ] + ++ lib.optional cudaSupport autoAddDriverRunpath; + + buildInputs = [ + wayland + wayland-protocols + libGL + libglvnd + freetype + fontconfig + cairo + pango + harfbuzz + libxkbcommon + sdbus-cpp_2 + systemdLibs + pipewire + pam + curl + libwebp + glib + polkit + librsvg + libqalculate + libxml2 + jemalloc + ]; + + mesonBuildType = "release"; + + ninjaFlags = [ "-v" ]; + + meta = { + description = "Sleek and minimal desktop shell thoughtfully crafted for Wayland"; + homepage = "https://github.com/noctalia-dev/noctalia"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + mainProgram = "noctalia"; + }; +}