added lact
This commit is contained in:
Generated
+4
-4
@@ -1048,11 +1048,11 @@
|
||||
"quickshell": "quickshell"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756054748,
|
||||
"narHash": "sha256-2foGqHuyLmaZb59MEKbWmLubsLApH/b+nJEu/SQePS8=",
|
||||
"lastModified": 1756691994,
|
||||
"narHash": "sha256-DeFBhcUJs4JHRKsRAaG+j9GjWgPIiW3JQmsneFGkc9Q=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "7a5635507eb857c544f22c76d9c5e7a6624d01ea",
|
||||
"revCount": 3761,
|
||||
"rev": "ee37fc5f6d585da93bf87a861d3c54baa5f4f168",
|
||||
"revCount": 3762,
|
||||
"type": "git",
|
||||
"url": "https://git.sakamoto.dev/kenji/illogical-impulse.git"
|
||||
},
|
||||
|
||||
@@ -8,20 +8,13 @@
|
||||
protontricks
|
||||
wl-clipboard
|
||||
tldr
|
||||
lact
|
||||
anki
|
||||
];
|
||||
imports = [
|
||||
../../packages/virtualbox/default.nix
|
||||
../../packages/lact/default.nix
|
||||
];
|
||||
|
||||
systemd.services.lact = {
|
||||
description = "AMDGPU Control Daemon";
|
||||
after = ["multi-user.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.lact}/bin/lact daemon";
|
||||
};
|
||||
custom.lact = {
|
||||
enable = true;
|
||||
};
|
||||
# services = {
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption mkIf;
|
||||
this = config.custom.lact;
|
||||
|
||||
configFile =
|
||||
pkgs.runCommand "lact-config.yaml" {
|
||||
json = pkgs.writers.writeJSON "lact-config.json" this.settings;
|
||||
} ''
|
||||
# Merge with the defaults
|
||||
${lib.getExe pkgs.yq} -s '.[0] * .[1]' $json ${./lact-default-config.yaml} > config.json
|
||||
# Convert keys to numeric values where possible. It depends on this for some reason.
|
||||
${lib.getExe pkgs.yj} -jy -k < config.json > $out
|
||||
'';
|
||||
in {
|
||||
options.custom.lact = {
|
||||
enable = mkEnableOption "my LACT module";
|
||||
settings = mkOption {
|
||||
default = {};
|
||||
type = lib.types.submodule {
|
||||
freeformType = (pkgs.formats.yaml {}).type;
|
||||
};
|
||||
description = ''
|
||||
Settings for LACT. Settings are merged with the defaults.
|
||||
|
||||
The easiest method of acquiring the settings is to delete
|
||||
`/etc/lact/config.yaml`, enter your settings and look at the file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf this.enable {
|
||||
systemd.packages = with pkgs; [
|
||||
lact
|
||||
];
|
||||
systemd.services.lactd.wantedBy = ["multi-user.target"];
|
||||
|
||||
environment.etc."lact/config.yaml" = mkIf (this.settings != {}) {
|
||||
source = configFile;
|
||||
};
|
||||
systemd.services.lactd = {
|
||||
# Restart if config changed
|
||||
restartTriggers = mkIf (this.settings != {}) [configFile];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
daemon:
|
||||
log_level: info
|
||||
admin_groups:
|
||||
- wheel
|
||||
- sudo
|
||||
disable_clocks_cleanup: false
|
||||
apply_settings_timer: 5
|
||||
gpus: {}
|
||||
Reference in New Issue
Block a user