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..a009613 --- /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 = { + # 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; + }; + }; +}