make extendable using merge
This commit is contained in:
parent
4b4736f6eb
commit
3d79cf4cb3
1 changed files with 61 additions and 57 deletions
118
common/home.nix
118
common/home.nix
|
|
@ -156,66 +156,70 @@ in
|
||||||
|
|
||||||
systemd.user = {
|
systemd.user = {
|
||||||
enable = enableGraphical;
|
enable = enableGraphical;
|
||||||
|
startServices = "sd-switch";
|
||||||
|
|
||||||
services = builtins.listToAttrs (
|
services = lib.mkMerge [
|
||||||
builtins.map (
|
|
||||||
{
|
|
||||||
name,
|
|
||||||
horizontal,
|
|
||||||
vertical,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
display_config =
|
|
||||||
let
|
|
||||||
display-shader = pkgs.substituteAll {
|
|
||||||
src = ../modules/automapaper/display-with_vars.glsl;
|
|
||||||
background = inputs.nix-colors.lib.conversions.hexToGLSLVec "0a000a";
|
|
||||||
foreground = inputs.nix-colors.lib.conversions.hexToGLSLVec "192291";
|
|
||||||
};
|
|
||||||
state-shader = ../modules/automapaper/state-game_of_life.glsl;
|
|
||||||
init-shader = ../modules/automapaper/init.glsl;
|
|
||||||
# General configurations
|
|
||||||
cycles = 2000;
|
|
||||||
tps = 30;
|
|
||||||
horizontal-dot-size = 10;
|
|
||||||
vertical-dot-size = 10;
|
|
||||||
in
|
|
||||||
(import ../modules/automapaper/config.nix {
|
|
||||||
inherit (pkgs) writeTextFile;
|
|
||||||
inherit
|
|
||||||
init-shader
|
|
||||||
state-shader
|
|
||||||
display-shader
|
|
||||||
tps
|
|
||||||
cycles
|
|
||||||
;
|
|
||||||
display = name;
|
|
||||||
horizontal = builtins.div horizontal horizontal-dot-size;
|
|
||||||
vertical = builtins.div vertical vertical-dot-size;
|
|
||||||
});
|
|
||||||
|
|
||||||
in
|
(builtins.listToAttrs (
|
||||||
lib.attrsets.nameValuePair "automapaper-${name}" ({
|
builtins.map (
|
||||||
Install = {
|
{
|
||||||
WantedBy = [ "niri.service" ];
|
name,
|
||||||
};
|
horizontal,
|
||||||
Unit = {
|
vertical,
|
||||||
Description = "Automapaper for display ${name}";
|
...
|
||||||
PartOf = "graphical-session.target";
|
}:
|
||||||
After = "graphical-session.target";
|
let
|
||||||
Requisite = "graphical-session.target";
|
display_config =
|
||||||
};
|
let
|
||||||
|
display-shader = pkgs.substituteAll {
|
||||||
|
src = ../modules/automapaper/display-with_vars.glsl;
|
||||||
|
background = inputs.nix-colors.lib.conversions.hexToGLSLVec "0a000a";
|
||||||
|
foreground = inputs.nix-colors.lib.conversions.hexToGLSLVec "192291";
|
||||||
|
};
|
||||||
|
state-shader = ../modules/automapaper/state-game_of_life.glsl;
|
||||||
|
init-shader = ../modules/automapaper/init.glsl;
|
||||||
|
# General configurations
|
||||||
|
cycles = 2000;
|
||||||
|
tps = 30;
|
||||||
|
horizontal-dot-size = 10;
|
||||||
|
vertical-dot-size = 10;
|
||||||
|
in
|
||||||
|
(import ../modules/automapaper/config.nix {
|
||||||
|
inherit (pkgs) writeTextFile;
|
||||||
|
inherit
|
||||||
|
init-shader
|
||||||
|
state-shader
|
||||||
|
display-shader
|
||||||
|
tps
|
||||||
|
cycles
|
||||||
|
;
|
||||||
|
display = name;
|
||||||
|
horizontal = builtins.div horizontal horizontal-dot-size;
|
||||||
|
vertical = builtins.div vertical vertical-dot-size;
|
||||||
|
});
|
||||||
|
|
||||||
Service = {
|
in
|
||||||
ExecStart = "${
|
lib.attrsets.nameValuePair "automapaper-${name}" ({
|
||||||
inputs.automapaper.packages.${pkgs.system}.automapaper
|
Install = {
|
||||||
}/bin/automapaper -C ${display_config}/config.toml";
|
WantedBy = [ "niri.service" ];
|
||||||
Restart = "on-failure";
|
};
|
||||||
};
|
Unit = {
|
||||||
})
|
Description = "Automapaper for display ${name}";
|
||||||
) displays
|
PartOf = "graphical-session.target";
|
||||||
);
|
After = "graphical-session.target";
|
||||||
|
Requisite = "graphical-session.target";
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = "${
|
||||||
|
inputs.automapaper.packages.${pkgs.system}.automapaper
|
||||||
|
}/bin/automapaper -C ${display_config}/config.toml";
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
) displays
|
||||||
|
))
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg = {
|
xdg = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue