nixos module needed some fixes

This commit is contained in:
Sebastian Moser
2026-05-14 08:17:01 +02:00
parent 55c85ad716
commit 2907d7e236
3 changed files with 17 additions and 17 deletions

View File

@@ -311,10 +311,16 @@ in rec {
};
};
}) // rec {
############################## SOME GLOBAL OUTPUTS ##############################
inherit inputs self;
############################## NIXOS MODULES ##############################
nixosModules.default = { system, lib, config, ... }: {
nixosModules.default = { system, lib, config, pkgs, ... }: {
options.mize = {
debuginary = lib.mkOption {
enable = lib.mkEnableOption "enable the mize damon";
debugBinary = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
example = "/home/user/here/mize";
@@ -337,26 +343,24 @@ in rec {
};
};
config = lib.mkIf config.mize.enable {
systemd.user.services.mize = {
description = "the mize daemon";
wantedBy = [ "default.target" ];
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ]; # this should mean DISPLAY and WAYLAND_DISPLAY are set in the service env...
environment = {
MIZE_CONFIG_FILES = let fileInStore = (pkgs.formats.toml {}).generate "mize-daemon-config.toml" config.mize.config; in if config.mize.debugConfigFile then "${config.mize.debugConfigFile}" else "${fileInStore}";
MIZE_CONFIG_FILES = let fileInStore = (pkgs.formats.toml {}).generate "mize-daemon-config.toml" config.mize.config; in if config.mize.debugConfigFile == null then "${fileInStore}" else "${config.mize.debugConfigFile}";
};
serviceConfig = {
Restart = "on-failure";
ExecStart = if config.mize.debuginary == null then "${self.packages.${system}.mize}/bin/mize daemon" else "${config.mize.debugBinary} daemon";
ExecStart = if config.mize.debugBinary == null then "${self.packages.${system}.mize}/bin/mize daemon" else "${config.mize.debugBinary} daemon";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ]; # this should mean DISPLAY and WAYLAND_DISPLAY are set in the service env...
};
};
};
};
# for what we do the nixos and home-manager api is identical
homeModules.default = nixosModules.default;
}) // {
############################## SOME GLOBAL OUTPUTS ##############################
inherit inputs self;
};
}

View File

@@ -69,10 +69,6 @@ pub fn mount(sub_matches: &ArgMatches) -> MizeResult<()> {
pub fn daemon(sub_matches: &ArgMatches) -> MizeResult<()> {
let instance = Mize::with_config(config_from_cli_args(sub_matches)?)?;
// load all parts we need for any mize application... making a fat daemon for now.
// in the future parts should be loaded on demand (from .so files and from parts.mize.works)
ppc
instance.wait();
return Ok(());

View File

@@ -39,7 +39,7 @@ fn main() {
// match command
let result = match cli_matches.subcommand() {
// mi daemon
Some(("daemon", sub_matches)) => cli::run(sub_matches),
Some(("daemon", sub_matches)) => cli::daemon(sub_matches),
Some(("is-running", sub_matches)) => cli::is_running(sub_matches),