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
21 changes: 21 additions & 0 deletions modules/noctalia/check.nix
Original file line number Diff line number Diff line change
@@ -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
''
55 changes: 55 additions & 0 deletions modules/noctalia/module.nix
Original file line number Diff line number Diff line change
@@ -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 <https://docs.noctalia.dev/v5/>
'';
default = { };
};
"config.toml" = lib.mkOption {
type = wlib.types.file config.pkgs;
default.path = tomlFmt.generate "noctalia-config" config.settings;
};
};

config = {
# package needs to be specified manually
# package = ...
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 = "@kruemmelspalter:kruemmelspalter.org";
keys = [ { fingerprint = "28F5 4BD4 73F1 7495 24BF F4BD 4F4A 2EFA E386 71C8"; } ];
}
];
platforms = lib.platforms.linux;
};
};
}