nixos module needed some fixes
This commit is contained in:
26
flake.nix
26
flake.nix
@@ -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 {
|
||||
};
|
||||
|
||||
};
|
||||
systemd.user.services.mize = {
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user