From 0ce82962bba78aecdb77403f3184478e20155126 Mon Sep 17 00:00:00 2001 From: Julia Lange Date: Tue, 26 Aug 2025 08:54:57 -0700 Subject: [PATCH 1/2] OSAuto, add extraPkgs option to OS --- nixosModules/automatic/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nixosModules/automatic/default.nix b/nixosModules/automatic/default.nix index 7a680f6..2f80ace 100644 --- a/nixosModules/automatic/default.nix +++ b/nixosModules/automatic/default.nix @@ -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; From 641e226f9bbff3a4d33448c421186ad4b8259ae3 Mon Sep 17 00:00:00 2001 From: Julia Lange Date: Tue, 26 Aug 2025 08:55:51 -0700 Subject: [PATCH 2/2] Fava, setup service; enable for Juri --- hosts/juri/host.nix | 5 +++ nixosModules/services/fava/service.nix | 45 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 nixosModules/services/fava/service.nix diff --git a/hosts/juri/host.nix b/hosts/juri/host.nix index 96c2110..9ca4456 100644 --- a/hosts/juri/host.nix +++ b/hosts/juri/host.nix @@ -65,6 +65,11 @@ in { server.domain = "ginko.woach.me"; }; + fava = { + enable = true; + port = "5128"; + }; + syncthing = { enable = true; devices = { diff --git a/nixosModules/services/fava/service.nix b/nixosModules/services/fava/service.nix new file mode 100644 index 0000000..12ea6c2 --- /dev/null +++ b/nixosModules/services/fava/service.nix @@ -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 + ]; + }; +}