Files
nixos/modules/nixos/home.nix
T

51 lines
1.1 KiB
Nix
Raw Normal View History

2025-10-16 17:23:21 -05:00
{
config,
lib,
pkgs,
...
}:
2022-04-25 22:25:04 -05:00
let
cfg = config.greg.home;
2022-04-25 22:25:04 -05:00
in
with lib;
2022-04-25 22:25:04 -05:00
{
options.greg.home = mkOption {
type = types.bool;
default = true;
description = "Sets the device up to be part of my home network";
};
2022-04-25 22:25:04 -05:00
config = mkIf cfg {
2025-10-16 17:23:21 -05:00
age.secrets.attic.file = ../../secrets/attic.age;
networking.domain = "thehellings.lan";
2025-10-16 17:23:21 -05:00
time.timeZone = "America/Chicago";
systemd.services.attic-client = {
enable = true;
description = "Attic client watch-store service";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
Restart = "on-failure";
RestartSec = "5s";
};
preStart = ''
set -x
mkdir -p $XDG_CONFIG_HOME/attic
cp ${config.age.secrets.attic.path} $XDG_CONFIG_HOME/attic/config.toml
'';
script = "${pkgs.attic-client}/bin/attic watch-store default";
environment = {
XDG_CONFIG_HOME = "/var/lib/attic-client";
};
};
systemd.tmpfiles.rules = [
"d /var/lib/attic-client 0755 root root -"
];
};
2022-04-25 22:25:04 -05:00
}