1
0
Fork 0

home/fb4: Modularize

This commit is contained in:
Malte Brandy 2018-02-14 10:22:45 +01:00
parent 10e737c423
commit e754de6051
5 changed files with 78 additions and 11 deletions

View file

@ -1,11 +0,0 @@
{ pkgs, ... }:
{
imports = [
../snippets/everywhere.nix
../snippets/graphical.nix
];
home.packages = with pkgs; [
xautolock
syncthing
];
}

17
home/hosts/fb4/home.nix Normal file
View file

@ -0,0 +1,17 @@
{ pkgs, ... }:
{
imports = [
../../snippets/everywhere.nix
../../snippets/graphical.nix
# ./syncthing.nix
# ./nix-gc.nix
# ./nix-update-channel.nix
];
home.packages = with pkgs; [
xautolock
syncthing
];
systemd.user.systemctlPath = "/usr/bin/systemctl";
}

21
home/hosts/fb4/nix-gc.nix Normal file
View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
systemd.user = {
services.nix-gc = {
Unit = {
Description = "Collect garbage";
};
Service = {
Type = "oneshot";
ExecStart="${pkgs.nix}/bin/nix-collect-garbage --delete-older-than 5d";
};
};
timers.nix-gc = {
Timer = {
OnCalendar = "22:00";
Persistent = "true";
};
};
};
}

View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
systemd.user = {
services.nix-update = {
Unit = {
Description = "Update nix-channel";
};
Service = {
Type = "oneshot";
ExecStart="${pkgs.nix}/bin/nix-channel --update";
};
};
timers.nix-update = {
Timer = {
OnCalendar = "22:00";
Persistent = "true";
};
};
};
}

View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
systemd.user = {
services.syncthing = {
Unit = {
Description = "Syncthing";
ConditionHost = "fb04217";
Wants= "syncthing-inotify.service";
};
Service = {
ExecStart="${pkgs.syncthing}/bin/syncthing -no-browser -no-restart -logflags=0";
Restart="on-failure";
SuccessExitStatus="3 4";
RestartForceExitStatus="3 4";
};
};
};
}