Compare commits
6 Commits
1b3ce49ffa
...
c7283f4314
Author | SHA1 | Date |
---|---|---|
Zynh Ludwig | c7283f4314 | |
Zynh Ludwig | c534fe8fc6 | |
Zynh Ludwig | 4e41b079e4 | |
Zynh Ludwig | 4f33cd310d | |
Zynh Ludwig | 9d67cf3d60 | |
Zynh Ludwig | c96fbbb91e |
|
@ -3,6 +3,8 @@
|
|||
let
|
||||
cfg = config.snowhawk.redshift;
|
||||
cfgDir = config.xdg.configHome + "/redshift";
|
||||
|
||||
sops = config.snowhawk.sops.enable;
|
||||
in
|
||||
{
|
||||
options.snowhawk.redshift = {
|
||||
|
@ -14,12 +16,13 @@ in
|
|||
Unit = {
|
||||
Description = "redshift service";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = lib.mkIf sops [ "sops-nix.service" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "exec";
|
||||
ExecStart =
|
||||
let
|
||||
catFile = file: "$(${pkgs.coreutils}/bin/cat ${file})";
|
||||
catFile = file: "\$(${pkgs.coreutils}/bin/cat ${file})";
|
||||
toPaths = deg: "${cfgDir}/${deg}";
|
||||
fetchLatLon = lib.right
|
||||
(lib.strings.concatStringsSep ":")
|
||||
|
@ -27,14 +30,14 @@ in
|
|||
(map toPaths)
|
||||
[ "lat" "lon" ];
|
||||
in
|
||||
"${pkgs.redshift}/bin/redshift -l ${fetchLatLon}";
|
||||
''${pkgs.bash}/bin/bash -c "${pkgs.redshift}/bin/redshift -l ${fetchLatLon}"'';
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
sops.secrets = lib.mkIf sops {
|
||||
"locations/snowhawk/lat".path = "${cfgDir}/lat";
|
||||
"locations/snowhawk/lon".path = "${cfgDir}/lon";
|
||||
};
|
||||
|
|
|
@ -6,8 +6,8 @@ ssh_hosts:
|
|||
caveserver: ENC[AES256_GCM,data:Fm86oJgeHD/dVqYRKny2/GC7nr3UuR54W46RbS7qgb0UhDsoUkoorIFw+orNhVvHouCc//WtGPCzRFca8u/pkQ9uauCtX/JlSxgHB6Ks08FOTSg=,iv:nGGJo64mEcUQgO9no8uLrws6AtRNUd7nEsYVFVIXkno=,tag:roNPGw39YNEBb2NWllbtHA==,type:str]
|
||||
locations:
|
||||
snowhawk:
|
||||
lat: ENC[AES256_GCM,data:tDaccQ==,iv:l59sQXCNgXTLRJG7ialO9MJU1zgNXOMiN71Hr6ZWl5Y=,tag:uQaMPsrfHhO1C3hJ7ZJXJQ==,type:float]
|
||||
lon: ENC[AES256_GCM,data:+3gfq/VyzQ==,iv:tJT8D+wTPj9jZ9xATfUiDqI9Fg+Z9imtQoEY3OzHzXk=,tag:PP4Yad45yscRS4aBFjOqEA==,type:float]
|
||||
lat: ENC[AES256_GCM,data:N7CsvQ==,iv:BfSp2jXBZDEEyNHhpo3SAwEVIWI0timAT2S1l76ODn0=,tag:Mf99+rM/m3Wh8BmmITKjpg==,type:str]
|
||||
lon: ENC[AES256_GCM,data:dITeYwVzSA==,iv:s+St+As7wgAaUf8/qnAdCM932WY5c9S0qUFhUlzx3W0=,tag:iqqPhmHZ+t+CRZPdZxYVxA==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
|
@ -23,8 +23,8 @@ sops:
|
|||
SjZNOWNndEIrMDFZRnV3QlRheklvMncK5n4lzgSrEDQ0M8m4SAslQvl2vq39owY9
|
||||
s3SrXYCvQo6nsKKJMgaN0fnrSqxdSLbnrDYFchaF2fhdXozR8508PA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-07-24T06:51:29Z"
|
||||
mac: ENC[AES256_GCM,data:bBkRAhqN6dFAFUppG/qjuivvoMlpvwk2nox89DbntGCu/pj8BcdVRDbE7jN3gAYBbLiA/sw7BrwoBPhOgtYTL0qmH3ZEcvvhcsf0I2UQ8meTJMDDqqOI3f1AcHK2oqrqflkbnndsx8h48/wwza84WjORRVLibkclwueI1WvxhBc=,iv:sPKO51qkZyoYmtoR5CQw72gxGGkiWdgQdByLOHI5ySs=,tag:XcknL4zeg9pA7tbwHbnhvg==,type:str]
|
||||
lastmodified: "2024-07-24T08:39:41Z"
|
||||
mac: ENC[AES256_GCM,data:Rg/rkbSyCkVJfISTfHDdNAfwN8cygYya5zqfJg9ZfaVSmbUBoxkWInaEoXcvRLj7GbJl/ZE1coi7/wj4sIECAfUU56MRObxNFa29YPAhBGLb+mwuDDD8Sp9HssnqBbMQXgjUu+JNPRhXkNQJ8vE0UkGjAKjtu9BB4GzKs8GXQ2A=,iv:mkAqcQCIQl4uEn91MxavLY8yS5zjR+1/5BMWgNsK5Jo=,tag:fCyUVItQqbUBUwbCo3rNYA==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.9.0
|
||||
|
|
Loading…
Reference in New Issue