Compare commits
2 commits
3a49fecf1d
...
641e226f9b
| Author | SHA1 | Date | |
|---|---|---|---|
| 641e226f9b | |||
| 0ce82962bb |
3 changed files with 57 additions and 6 deletions
|
|
@ -65,6 +65,11 @@ in {
|
|||
server.domain = "ginko.woach.me";
|
||||
};
|
||||
|
||||
fava = {
|
||||
enable = true;
|
||||
port = "5128";
|
||||
};
|
||||
|
||||
syncthing = {
|
||||
enable = true;
|
||||
devices = {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
{ config, pkgs, lib, hostname, usernameList, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
system.timezone = lib.mkOption { default = "America/Los_Angeles"; };
|
||||
system.extraFonts = lib.mkOption { default = []; };
|
||||
system.isNonEFI = lib.mkEnableOption
|
||||
options.system = {
|
||||
timezone = lib.mkOption { default = "America/Los_Angeles"; };
|
||||
extraFonts = lib.mkOption { default = []; };
|
||||
extraPkgs = lib.mkOption { default = []; };
|
||||
isNonEFI = lib.mkEnableOption
|
||||
"Enable if you are running a non-EFI system";
|
||||
system.users.bigWheels = lib.mkOption { default = []; };
|
||||
users.bigWheels = lib.mkOption { default = []; };
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
|
|
@ -33,7 +34,7 @@
|
|||
git
|
||||
neovim
|
||||
xdg-user-dirs
|
||||
];
|
||||
] ++ config.system.extraPkgs;
|
||||
|
||||
# XDG Compliance
|
||||
nix.settings.use-xdg-base-directories = true;
|
||||
|
|
|
|||
45
nixosModules/services/fava/service.nix
Normal file
45
nixosModules/services/fava/service.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options.fava = {
|
||||
enable = lib.mkEnableOption "Enables fava double entry accounting";
|
||||
ledgerFile = lib.mkOption { default = "/var/lib/fava/ledger.beancount"; };
|
||||
port = lib.mkOption { default = "5000"; };
|
||||
host = lib.mkOption { default = "localhost"; };
|
||||
};
|
||||
|
||||
config = lib.mkIf config.fava.enable {
|
||||
systemd.services.fava = {
|
||||
description = "Fava";
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.fava}/bin/fava --port ${config.fava.port} --host ${config.fava.host} ${config.fava.ledgerFile}";
|
||||
Type = "simple";
|
||||
User = "fava";
|
||||
Group = "fava";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
NoNewPrivileges = true;
|
||||
PrivateTmp = true;
|
||||
PrivateDevices = true;
|
||||
ProtectHome = true;
|
||||
ProtectSystem = "full";
|
||||
ReadWriteDirectories = "/var/lib/fava";
|
||||
};
|
||||
};
|
||||
|
||||
users.users.fava = {
|
||||
home = "/var/lib/fava";
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
group = "fava";
|
||||
};
|
||||
users.groups.fava = {};
|
||||
|
||||
system.extraPkgs = [
|
||||
pkgs.beancount
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue