dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

commit cdc1ab05cc03a7b4c4ad59b4ff57ddfe0e604ce2
parent 4b630a42ef1583f19fc758abf50ff788508f6285
Author: Chris <chris@echoz.io>
Date:   Thu,  9 Oct 2025 02:20:17 +0200

feat: add nom

Diffstat:
Mflake.lock | 6+++---
Amodules/nom/default.nix | 48++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/flake.lock b/flake.lock @@ -215,11 +215,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1759961361, - "narHash": "sha256-DxfwAmQCEKukZ0YphpRRwSD0shLKtHPW2PzBE2QqrDg=", + "lastModified": 1759968174, + "narHash": "sha256-Vx4izwEN/bzk7MWkPtVpcAAb1NDav51bt1eaHGy+YlQ=", "owner": "echozio", "repo": "sec", - "rev": "c48ebbb73d602c48f87ff588bb1313368c9c518f", + "rev": "1a9b4ac77ab1a6c35c29878a43bf297467384e0e", "type": "github" }, "original": { diff --git a/modules/nom/default.nix b/modules/nom/default.nix @@ -0,0 +1,48 @@ +{ + lib, + pkgs, + + user, + ... +}: +{ + home-manager.users.${user} = + { config, ... }: + { + options.programs.nom = { + settings = lib.mkOption { + type = + with lib.types; + let + jsonValue = nullOr (oneOf [ + (attrsOf jsonValue) + (listOf jsonValue) + number + str + bool + ]); + in + jsonValue; + default = null; + }; + }; + + config = + let + cfg = config.programs.nom; + in + { + home.packages = [ pkgs.nom ]; + + xdg.configFile."nom/config.yml" = lib.mkIf (cfg.settings != null) { + text = builtins.toJSON cfg.settings; + }; + + programs.nom.settings = { + database = lib.mkDefault "../../etc/.nom.db"; + ordering = lib.mkDefault "desc"; + refreshInterval = 1; + }; + }; + }; +}