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 = {
|
||||
enable = enableGraphical;
|
||||
startServices = "sd-switch";
|
||||
|
||||
services = builtins.listToAttrs (
|
||||
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;
|
||||
});
|
||||
services = lib.mkMerge [
|
||||
|
||||
in
|
||||
lib.attrsets.nameValuePair "automapaper-${name}" ({
|
||||
Install = {
|
||||
WantedBy = [ "niri.service" ];
|
||||
};
|
||||
Unit = {
|
||||
Description = "Automapaper for display ${name}";
|
||||
PartOf = "graphical-session.target";
|
||||
After = "graphical-session.target";
|
||||
Requisite = "graphical-session.target";
|
||||
};
|
||||
(builtins.listToAttrs (
|
||||
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;
|
||||
});
|
||||
|
||||
Service = {
|
||||
ExecStart = "${
|
||||
inputs.automapaper.packages.${pkgs.system}.automapaper
|
||||
}/bin/automapaper -C ${display_config}/config.toml";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
})
|
||||
) displays
|
||||
);
|
||||
in
|
||||
lib.attrsets.nameValuePair "automapaper-${name}" ({
|
||||
Install = {
|
||||
WantedBy = [ "niri.service" ];
|
||||
};
|
||||
Unit = {
|
||||
Description = "Automapaper for display ${name}";
|
||||
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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue