random stuff
This commit is contained in:
parent
946efccf70
commit
8eab6d8682
19
TODO.md
19
TODO.md
@ -1,5 +1,11 @@
|
|||||||
# TODO
|
# 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
|
* move nginx config to respective profiles
|
||||||
* ocis confid and metadata backup (take zfs snapshot and backup it)
|
* ocis confid and metadata backup (take zfs snapshot and backup it)
|
||||||
* grafana for all services
|
* grafana for all services
|
||||||
@ -7,14 +13,23 @@
|
|||||||
* use sops for all occurrences of hashedPassword
|
* use sops for all occurrences of hashedPassword
|
||||||
* auto-import gpg keys
|
* auto-import gpg keys
|
||||||
* config qbittorrent
|
* config qbittorrent
|
||||||
* fix waybar config
|
|
||||||
* change writeShellScript and writeShellScriptBin to writeShellApplication
|
* change writeShellScript and writeShellScriptBin to writeShellApplication
|
||||||
* fix mime, fix aria2
|
* remove aria2?
|
||||||
* move overlay and packages to root folder
|
* move overlay and packages to root folder
|
||||||
* Change all 'latest' tags in docker container to digest: "statping/statping@sha256:aaaaa"
|
* Change all 'latest' tags in docker container to digest: "statping/statping@sha256:aaaaa"
|
||||||
* or add cmd to all containers: "--pull=newer"
|
* or add cmd to all containers: "--pull=newer"
|
||||||
* fix global hotkeys for obs (use hyprland pass dispatcher)
|
* 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:
|
## Tips:
|
||||||
|
|
||||||
* Copy sparse files
|
* Copy sparse files
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.services.password-store;
|
cfg = config.services.password-store;
|
||||||
|
inherit (lib) mkEnableOption mkOption types escapeShellArg mkIf makeBinPath;
|
||||||
in {
|
in {
|
||||||
options.services.password-store = {
|
options.services.password-store = {
|
||||||
enable = mkEnableOption "password-store";
|
enable = mkEnableOption "password-store";
|
||||||
@ -27,7 +27,7 @@ in {
|
|||||||
Service = {
|
Service = {
|
||||||
Environment = [
|
Environment = [
|
||||||
"GIT_SSH_COMMAND='ssh -i ${cfg.sshKey} -o IdentitiesOnly=yes'"
|
"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" ''
|
ExecStart = pkgs.writeShellScript "activate-secrets" ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{ pkgs, config, ... }: {
|
{ pkgs, config, lib, ... }: {
|
||||||
home-manager.users.${config.mainuser} = {
|
home-manager.users.${config.mainuser} = {
|
||||||
systemd.user.services.mako = {
|
systemd.user.services.mako = {
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.mako}/bin/mako";
|
ExecStart = "${pkgs.mako}/bin/mako";
|
||||||
Environment =
|
Environment =
|
||||||
[ "PATH=${pkgs.lib.makeBinPath [ pkgs.bash pkgs.mpv ]}" ];
|
[ "PATH=${lib.makeBinPath [ pkgs.bash pkgs.mpv ]}" ];
|
||||||
};
|
};
|
||||||
Install = rec {
|
Install = rec {
|
||||||
After = [ "hyprland-session.target" ];
|
After = [ "hyprland-session.target" ];
|
||||||
|
@ -4,6 +4,11 @@
|
|||||||
boot.loader.grub.catppuccin.enable = true;
|
boot.loader.grub.catppuccin.enable = true;
|
||||||
console.catppuccin.enable = true;
|
console.catppuccin.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.libsForQt5.qtstyleplugin-kvantum
|
||||||
|
pkgs.libsForQt5.qt5ct
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.users.${config.mainuser} = {
|
home-manager.users.${config.mainuser} = {
|
||||||
catppuccin.accent = cfg.accent;
|
catppuccin.accent = cfg.accent;
|
||||||
catppuccin.flavor = cfg.flavor;
|
catppuccin.flavor = cfg.flavor;
|
||||||
@ -31,6 +36,25 @@
|
|||||||
wayland.windowManager.hyprland.extraConfig = ''
|
wayland.windowManager.hyprland.extraConfig = ''
|
||||||
exec=hyprctl setcursor catppuccin-${cfg.flavor}-${cfg.accent}-cursors ${toString cfg.thm.cursorSize}
|
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 = {
|
themes.base16.extraParams = {
|
||||||
|
@ -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.json>", 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()
|
|
Loading…
x
Reference in New Issue
Block a user