diff --git a/TODO.md b/TODO.md index d6ea8a9..b4c6d62 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,11 @@ # TODO +* config.mainuser to extraArgs +* split modules to nixosModules and hmModules +* backup gitea with rustic +* fix waybar config (icons and catppuccin theme) + + * move nginx config to respective profiles * ocis confid and metadata backup (take zfs snapshot and backup it) * grafana for all services @@ -7,14 +13,23 @@ * use sops for all occurrences of hashedPassword * auto-import gpg keys * config qbittorrent -* fix waybar config * change writeShellScript and writeShellScriptBin to writeShellApplication -* fix mime, fix aria2 +* remove aria2? * move overlay and packages to root folder * Change all 'latest' tags in docker container to digest: "statping/statping@sha256:aaaaa" * or add cmd to all containers: "--pull=newer" * fix global hotkeys for obs (use hyprland pass dispatcher) + +https://github.com/catppuccin/rofi +https://github.com/catppuccin/waybar +https://github.com/catppuccin/base16 +https://github.com/catppuccin/hyprlock +https://github.com/catppuccin/obs +https://github.com/catppuccin/spicetify +https://github.com/catppuccin/whoogle +https://github.com/catppuccin/dark-reader + ## Tips: * Copy sparse files diff --git a/modules/pass-store.nix b/modules/pass-store.nix index 4d94eec..af53f49 100644 --- a/modules/pass-store.nix +++ b/modules/pass-store.nix @@ -1,7 +1,7 @@ { pkgs, config, lib, ... }: -with lib; let cfg = config.services.password-store; + inherit (lib) mkEnableOption mkOption types escapeShellArg mkIf makeBinPath; in { options.services.password-store = { enable = mkEnableOption "password-store"; @@ -27,7 +27,7 @@ in { Service = { Environment = [ "GIT_SSH_COMMAND='ssh -i ${cfg.sshKey} -o IdentitiesOnly=yes'" - "PATH=${with pkgs; makeBinPath [ git openssh ]}" + "PATH=${makeBinPath [ pkgs.git pkgs.openssh ]}" ]; ExecStart = pkgs.writeShellScript "activate-secrets" '' set -euo pipefail diff --git a/profiles/applications/mako.nix b/profiles/applications/mako.nix index 8898ebb..f2fb7b7 100644 --- a/profiles/applications/mako.nix +++ b/profiles/applications/mako.nix @@ -1,10 +1,10 @@ -{ pkgs, config, ... }: { +{ pkgs, config, lib, ... }: { home-manager.users.${config.mainuser} = { systemd.user.services.mako = { Service = { ExecStart = "${pkgs.mako}/bin/mako"; Environment = - [ "PATH=${pkgs.lib.makeBinPath [ pkgs.bash pkgs.mpv ]}" ]; + [ "PATH=${lib.makeBinPath [ pkgs.bash pkgs.mpv ]}" ]; }; Install = rec { After = [ "hyprland-session.target" ]; diff --git a/profiles/workspace/catppuccin/catppuccin.nix b/profiles/workspace/catppuccin/catppuccin.nix index 74fc812..4a0d09a 100644 --- a/profiles/workspace/catppuccin/catppuccin.nix +++ b/profiles/workspace/catppuccin/catppuccin.nix @@ -4,6 +4,11 @@ boot.loader.grub.catppuccin.enable = true; console.catppuccin.enable = true; + environment.systemPackages = [ + pkgs.libsForQt5.qtstyleplugin-kvantum + pkgs.libsForQt5.qt5ct + ]; + home-manager.users.${config.mainuser} = { catppuccin.accent = cfg.accent; catppuccin.flavor = cfg.flavor; @@ -31,6 +36,25 @@ wayland.windowManager.hyprland.extraConfig = '' exec=hyprctl setcursor catppuccin-${cfg.flavor}-${cfg.accent}-cursors ${toString cfg.thm.cursorSize} ''; + + xdg.configFile = { + qt5ct = { + target = "qt5ct/qt5ct.conf"; + text = lib.generators.toINI { } { + Appearance = { + icon_theme = "Papirus-${cfg.gtkTheme}"; + }; + }; + }; + qt6ct = { + target = "qt6ct/qt6ct.conf"; + text = lib.generators.toINI { } { + Appearance = { + icon_theme = "Papirus-${cfg.gtkTheme}"; + }; + }; + }; + }; }; themes.base16.extraParams = { diff --git a/scripts/json2nix.py b/scripts/json2nix.py deleted file mode 100644 index 676d1c7..0000000 --- a/scripts/json2nix.py +++ /dev/null @@ -1,84 +0,0 @@ -"""Converts JSON objects into nix (hackishly).""" - -import sys -import json - - -INDENT = " " * 2 - - -def strip_comments(t): - # fixme: doesn't work if JSON strings contain // - return "\n".join(l.partition("//")[0] for l in t.split("\n")) - - -def indent(s): - return "\n".join(INDENT + i for i in s.split("\n")) - - -def nix_stringify(s): - # fixme: this doesn't handle string interpolation and possibly has more bugs - return json.dumps(s) - - -def sanitize_key(s): - if s and s.isalnum() and not s[0].isdigit(): - return s - return nix_stringify(s) - - -def flatten_obj_item(k, v): - keys = [k] - val = v - while isinstance(val, dict) and len(val) == 1: - k = next(iter(val.keys())) - keys.append(k) - val = val[k] - return keys, val - - -def fmt_object(obj, flatten): - fields = [] - for k, v in obj.items(): - if flatten: - keys, val = flatten_obj_item(k, v) - formatted_key = ".".join(sanitize_key(i) for i in keys) - else: - formatted_key = sanitize_key(k) - val = v - fields.append(f"{formatted_key} = {fmt_any(val, flatten)};") - - return "{\n" + indent("\n".join(fields)) + "\n}" - - -def fmt_array(o, flatten): - body = indent("\n".join(fmt_any(i, flatten) for i in o)) - return f"[\n{body}\n]" - - -def fmt_any(o, flatten): - if isinstance(o, str) or isinstance(o, bool) or isinstance(o, int): - return json.dumps(o) - if isinstance(o, list): - return fmt_array(o, flatten) - if isinstance(o, dict): - return fmt_object(o, flatten) - raise TypeError(f"Unknown type {type(o)!r}") - - -def main(): - flatten = "--flatten" in sys.argv - args = [a for a in sys.argv[1:] if not a.startswith("--")] - - if len(args) < 1: - print(f"Usage: {sys.argv[0]} [--flatten] ", file=sys.stderr) - sys.exit(1) - - with open(args[0], "r") as f: - data = json.loads(strip_comments(f.read())) - - print(fmt_any(data, flatten=flatten)) - - -if __name__ == "__main__": - main()