Compare commits

..

37 Commits

Author SHA1 Message Date
Lennart J. Kurzweg (Nx2)
e26ac7cbe2 Merge branch 'master' of ssh://ssh.nx2.site:20022/nx2/dotfiles into gitea 2024-11-11 14:02:59 +01:00
Lennart J. Kurzweg (Nx2)
66221229ca gitea, crashes 2024-11-11 14:02:21 +01:00
Lennart J. Kurzweg (Nx2)
9b36c29009 i accedentally deleted my tuda eduroam 2024-11-11 10:33:33 +01:00
Lennart J. Kurzweg (Nx2)
55587f35f6 merge fixups 2024-11-09 23:57:48 +01:00
Lennart J. Kurzweg (Nx2)
966f9d67fc Merge branch 'master' of ssh://ssh.nx2.site:20022/nx2/dotfiles 2024-11-09 23:56:05 +01:00
Lennart J. Kurzweg (Nx2)
2e1c0f495b better nxsent 2024-11-09 23:56:00 +01:00
Lennart J. Kurzweg (Nx2)
ab4c26c178 Merge branch 'master' of ssh://ssh.nx2.site:20022/nx2/dotfiles 2024-11-09 20:24:22 +01:00
Lennart J. Kurzweg (Nx2)
91a5a6def8 manual sops merge before merge 2024-11-09 20:06:45 +01:00
Lennart J. Kurzweg (Nx2)
104d1334df huge cleanup 2024-11-09 19:48:52 +01:00
Lennart J. Kurzweg (Nx2)
c19c270775 newer curl 2024-11-08 13:48:37 +01:00
Lennart J. Kurzweg (Nx2)
c5c41087b5 dm new style 2024-11-08 13:48:27 +01:00
Lennart J. Kurzweg (Nx2)
924f48b15a nx2site001 2024-11-08 13:48:02 +01:00
Lennart J. Kurzweg (Nx2)
6abff56bbd tuda-moodle-rice 2024-11-08 13:42:49 +01:00
Lennart J. Kurzweg (Nx2)
5f9c6dd0a3 yazi more rice 2024-11-07 16:34:01 +01:00
Lennart J. Kurzweg (Nx2)
c426029a25 adb 2024-11-07 16:33:56 +01:00
Lennart J. Kurzweg (Nx2)
1790336aa5 Merge branch 'master' of ssh://ssh.nx2.site:20022/nx2/dotfiles 2024-11-06 13:53:22 +01:00
Lennart J. Kurzweg (Nx2)
06a630319d prettier code 2024-11-06 13:53:19 +01:00
Lennart J. Kurzweg (Nx2)
1814068cfe better zathura rice 2024-11-06 13:52:53 +01:00
Lennart J. Kurzweg (Nx2)
096f31d81a all nixd paths 2024-11-06 13:52:43 +01:00
Lennart J. Kurzweg (Nx2)
148bd4c481 accent is the always visible border 2024-11-06 13:42:44 +01:00
Lennart J. Kurzweg (Nx2)
f9d4921726 userChrome mynixos.com 2024-11-06 13:42:04 +01:00
Lennart J. Kurzweg (Nx2)
169d6eda11 ~/shared ownwership fix 2024-10-30 00:55:44 +01:00
Lennart J. Kurzweg (Nx2)
97f33c7b8d diffrent rice 2024-10-30 00:55:16 +01:00
Lennart J. Kurzweg (Nx2)
340c514a99 more fuse (still sucks) 2024-10-28 16:10:02 +01:00
Lennart J. Kurzweg (Nx2)
b3d3c983c2 nixd spelling 2024-10-28 13:43:22 +01:00
Lennart J. Kurzweg (Nx2)
3a30fc2131 Merge branch 'master' of ssh://ssh.nx2.site:20022/nx2/dotfiles 2024-10-25 02:12:55 +02:00
Lennart J. Kurzweg (Nx2)
abd5b60ffa nixd 2024-10-25 02:12:52 +02:00
Lennart J. Kurzweg (Nx2)
e3e52fb656 themed Zathura 2024-10-24 13:02:22 +02:00
Lennart J. Kurzweg (Nx2)
115a6d3c83 fcitx not working wip 2024-10-23 12:58:02 +02:00
Lennart J. Kurzweg (Nx2)
14df46a631 flake bump 2024-10-23 00:16:39 +02:00
Lennart J. Kurzweg (Nx2)
0c92fcd686 lzg theeme 2024-10-23 00:16:28 +02:00
Lennart J. Kurzweg (Nx2)
085d593ce1 new ssh 2024-10-22 23:00:30 +02:00
Lennart J. Kurzweg (Nx2)
fb082f76ed new sync version vesktop 2024-10-22 23:00:18 +02:00
Lennart J. Kurzweg (Nx2)
89ed2c0748 gs 2024-10-22 22:59:43 +02:00
Lennart J. Kurzweg (Nx2)
a32d8ad3ce better curk 2024-10-22 22:59:31 +02:00
Lennart J. Kurzweg (Nx2)
d93ae4a78b tuda eduroam 2024-10-17 17:18:07 +02:00
Lennart J. Kurzweg (Nx2)
8f3b04c191 spotify grey screen fix 2024-10-17 17:17:51 +02:00
54 changed files with 1877 additions and 2460 deletions

View File

@@ -1,7 +1,8 @@
{ pkgs, inputs, ... }: { pkgs, inputs, lib, host, ... }:
{ {
imports = [ imports = ([
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
./system-modules/adb.nix
./system-modules/auto-mount.nix ./system-modules/auto-mount.nix
./system-modules/hardware-configuration.nix ./system-modules/hardware-configuration.nix
./system-modules/fuse.nix ./system-modules/fuse.nix
@@ -25,8 +26,8 @@
./system-modules/kanata.nix ./system-modules/kanata.nix
./system-modules/kodi.nix ./system-modules/kodi.nix
./system-modules/networking.nix ./system-modules/networking.nix
./system-modules/nixd.nix
./system-modules/nvidia.nix ./system-modules/nvidia.nix
./system-modules/nx2site.nix
./system-modules/ollama.nix ./system-modules/ollama.nix
./system-modules/qmk.nix ./system-modules/qmk.nix
./system-modules/sops.nix ./system-modules/sops.nix
@@ -36,7 +37,13 @@
./system-modules/users.nix ./system-modules/users.nix
./system-modules/virtualisation.nix ./system-modules/virtualisation.nix
./system-modules/ydotool.nix ./system-modules/ydotool.nix
]; ]) ++ (if (host == "NxACE") then [
./system-modules/nx2site.nix
./system-modules/postgres.nix
./system-modules/nx2site/proxy.nix
# ./system-modules/nx2site/gitea.nix
# ./system-modules/nx2site/vaultwarden.nix
] else []);
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@@ -80,7 +87,7 @@
git-crypt git-crypt
lazygit # home-manager module is bugged lazygit # home-manager module is bugged
wget wget
curl curlHTTP3
zip zip
unzip unzip
p7zip p7zip

View File

@@ -3,9 +3,9 @@ pkgs: rec {
lib = import ../nxlib/ricelib.nix pkgs.lib; lib = import ../nxlib/ricelib.nix pkgs.lib;
transparency = 0.8; transparency = 0.8;
rounding = 10; rounding = 3;
gap-size = 10; gap-size = 5;
border-width = 3; border-width = 2;
color = color =
let let
dark = (-0.5); dark = (-0.5);

69
flake.lock generated
View File

@@ -181,11 +181,11 @@
"systems": "systems_4" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1726560853,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -302,11 +302,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1729113795, "lastModified": 1729629261,
"narHash": "sha256-tV6aeQZ1wvAVDi+JW+IpXH9xQjZX+ZNFsuQCfWj2zWs=", "narHash": "sha256-IJtor2qFpsZkCm4UMnCHOSosW9GXKZVOm7DILtJJgoM=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "b57086aa4362117c1f1025246f618d760e44b026", "rev": "29997ef4ba8ef0a80390e80199998d1390177454",
"revCount": 5349, "revCount": 5366,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@@ -334,11 +334,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728383680, "lastModified": 1729596320,
"narHash": "sha256-/SeOrMuPEOjngI+MBlzqxQ/sJxkJFIYoef+wJ/PmX2w=", "narHash": "sha256-sBPr6O2Ad916f+L7biAjmJVx4TLDITC4joKgeOT47V8=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-plugins", "repo": "hyprland-plugins",
"rev": "d05eb1ffba2ebffb5b4e1b407f134a4dcb411a88", "rev": "4d7f0b5d8b952f31f7d2e29af22ab0a55ca5c219",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -514,11 +514,11 @@
}, },
"nixpkgs-latest": { "nixpkgs-latest": {
"locked": { "locked": {
"lastModified": 1729121138, "lastModified": 1729631290,
"narHash": "sha256-YwgV6ORMYDj32ucAIDjUY+6vV7Sv5RNbnnsQx4+QNw8=", "narHash": "sha256-zVL79jvDihxcnq9FKkAoILYWxGmxCw1DGdBnpv/B+3s=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f67841950fe8e33ae6597cc2dac1bc179c3c2627", "rev": "1f9d2cf67508efd9b5e81cdf7af556bbbfe02377",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -574,11 +574,11 @@
}, },
"nixpkgs-stable_3": { "nixpkgs-stable_3": {
"locked": { "locked": {
"lastModified": 1728156290, "lastModified": 1729357638,
"narHash": "sha256-uogSvuAp+1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss=", "narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "17ae88b569bb15590549ff478bab6494dde4a907", "rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -590,11 +590,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1728888510, "lastModified": 1729413321,
"narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=", "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c", "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -636,11 +636,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1728909085, "lastModified": 1729449015,
"narHash": "sha256-WLxED18lodtQiayIPDE5zwAfkPJSjHJ35UhZ8h3cJUg=", "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c0b1da36f7c34a7146501f684e9ebdf15d2bebf8", "rev": "89172919243df199fe237ba0f776c3e3e3d72367",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -651,11 +651,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1722415718, "lastModified": 1729265718,
"narHash": "sha256-5US0/pgxbMksF92k1+eOa8arJTJiPvsdZj9Dl+vJkM4=", "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c3392ad349a5227f4a3464dce87bcc5046692fce", "rev": "ccc0c2126893dd20963580b6478d1a10a4512185",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -785,17 +785,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1721441897, "lastModified": 1729391507,
"narHash": "sha256-gYGX9/22tPNeF7dR6bWN5rsrpU4d06GnQNNgZ6ZiXz0=", "narHash": "sha256-as0I9xieJUHf7kiK2a9znDsVZQTFWhM1pLivII43Gi0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "b7996075da11a2d441cfbf4e77c2939ce51506fd", "rev": "784981a9feeba406de38c1c9a3decf966d853cca",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "b7996075da11a2d441cfbf4e77c2939ce51506fd",
"type": "github" "type": "github"
} }
}, },
@@ -807,11 +806,11 @@
"nixpkgs-stable": "nixpkgs-stable_3" "nixpkgs-stable": "nixpkgs-stable_3"
}, },
"locked": { "locked": {
"lastModified": 1728345710, "lastModified": 1729587807,
"narHash": "sha256-lpunY1+bf90ts+sA2/FgxVNIegPDKCpEoWwOPu4ITTQ=", "narHash": "sha256-YOc4033a/j1TbdLfkaSOSX2SrvlmuM+enIFoveNTCz4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "06535d0e3d0201e6a8080dd32dbfde339b94f01b", "rev": "26642e8f193f547e72d38cd4c0c4e45b49236d27",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -928,11 +927,11 @@
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1729081599, "lastModified": 1729473414,
"narHash": "sha256-TE8h7u3b39yMgtboXMxaZ+I5hfa1jpTP/MXxLPZhLew=", "narHash": "sha256-ffiEVFCUMnShcSa4hvCbT1EQeu7c2lVOk6OdaxjiUmU=",
"owner": "sxyazi", "owner": "sxyazi",
"repo": "yazi", "repo": "yazi",
"rev": "a6c9c93d586422fbb212707bfb09c9039585b40b", "rev": "0e118b5b3a5baacf7fe62971e2bfe2b0ad972bab",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -22,6 +22,7 @@
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-latest, home-manager, ... }@inputs: let outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-latest, home-manager, ... }@inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
user = "nx2"; user = "nx2";
domain = "nx2.site";
config = { allowUnfree = true; allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; }; config = { allowUnfree = true; allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; };
@@ -42,7 +43,7 @@
enable = if (host == "NxXPS" || host == "NxNORTH") then true else false; enable = if (host == "NxXPS" || host == "NxNORTH") then true else false;
prime = if (host == "NxXPS") then true else false; prime = if (host == "NxXPS") then true else false;
}; };
in { inherit inputs user host pkgs-unstable pkgs-latest secrets rice nvidia; }; in { inherit inputs user host domain pkgs-unstable pkgs-latest secrets rice nvidia; };
}; };
in { in {
NxXPS = make-nixos-system "NxXPS"; NxXPS = make-nixos-system "NxXPS";
@@ -59,13 +60,12 @@
enable = if (host == "NxXPS" || host == "NxNORTH") then true else false; enable = if (host == "NxXPS" || host == "NxNORTH") then true else false;
prime = if (host == "NxXPS") then true else false; prime = if (host == "NxXPS") then true else false;
}; };
in { inherit inputs system user host pkgs-unstable pkgs-latest rice secrets nvidia; }; in { inherit inputs system user host domain pkgs-unstable pkgs-latest rice secrets nvidia; };
}; };
in { in {
"${user}@NxXPS" = make-home-configuration "NxXPS" user; "${user}@NxXPS" = make-home-configuration "NxXPS" user;
"${user}@NxNORTH" = make-home-configuration "NxNORTH" user; "${user}@NxNORTH" = make-home-configuration "NxNORTH" user;
"${user}@NxACE" = make-home-configuration "NxACE" user; "${user}@NxACE" = make-home-configuration "NxACE" user;
"tv@NxACE" = make-home-configuration "NxACE" "tv";
}; };
}; };
} }

View File

@@ -1,9 +1,5 @@
{ pkgs, lib, user, ... }: { ... }:
lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [
bash
];
programs.bash = { programs.bash = {
enable = true; enable = true;
shellAliases = { shellAliases = {
@@ -19,11 +15,5 @@ lib.mkIf (user != "tv")
"checkjobs" "checkjobs"
]; ];
enableCompletion = false; enableCompletion = false;
# initExtra = ''
# if [[ $- == *i* ]] # if interactive
# then
# eval "$(${pkgs.starship}/bin/starship init bash)"
# fi
# '';
}; };
} }

View File

@@ -1,11 +1,15 @@
{ pkgs, lib, rice, user, secrets, ... }: { pkgs, lib, rice, user, secrets, ... }:
let let
channels = [ channels = [
"Caedrel"
"NoWay4u_Sir"
"zackrawrr"
"agurin" "agurin"
"asmongold" "asmongold"
"Broeki" "Broeki"
"Broxah" "Broxah"
"Caedrel" # "Caedrel"
"chrissyofficial" "chrissyofficial"
"EintrachtSpandau" "EintrachtSpandau"
"GamesDoneQuick" "GamesDoneQuick"
@@ -28,7 +32,7 @@ let
"maxim" "maxim"
"NASA" "NASA"
"NNOPrime" "NNOPrime"
"NoWay4u_Sir" # "NoWay4u_Sir"
"OfficialMikeShinoda" "OfficialMikeShinoda"
"ow_esports" "ow_esports"
"PrimeGaming" "PrimeGaming"
@@ -41,7 +45,7 @@ let
"Trick2g" "Trick2g"
"TSM_ImperialHal" "TSM_ImperialHal"
"Xisuma" "Xisuma"
"zackrawrr" # "zackrawrr"
]; ];
tabber = channel-name: { tabber = channel-name: {
highlightsEnabled = true; highlightsEnabled = true;
@@ -57,14 +61,11 @@ let
type = "split"; type = "split";
}; };
}; };
in in {
lib.mkIf (user != "tv") home = {
{ packages = with pkgs; [ chatterino2 ];
home.packages = with pkgs; [ file = {
chatterino2 ".local/share/chatterino/Settings/settings.json".text = with secrets.chatterino; ''
];
home.file.".local/share/chatterino/Settings/settings.json".text = with secrets.chatterino; ''
{ {
"accounts": { "accounts": {
"current": "${username}", "current": "${username}",
@@ -734,671 +735,7 @@ lib.mkIf (user != "tv")
} }
} }
''; '';
# home.file.".local/share/chatterino/Settings/settings.json".text = builtins.toJSON { ".local/share/chatterino/Settings/window-layout.json".text = builtins.toJSON {
# hotkeys = {
# addedDefaults = [
# "change channel"
# "close popup window"
# "create clip"
# "delete"
# "emote picker"
# "focus down"
# "focus left"
# "focus right"
# "focus up"
# "go to end of input"
# "go to end of input with selection"
# "go to start of input"
# "go to start of input with selection"
# "new popup window"
# "new popup window from tab"
# "new split"
# "new tab"
# "next message"
# "open debug popup"
# "open quick switcher"
# "open settings"
# "popup accept"
# "popup focus search box"
# "popup reject"
# "popup scroll down"
# "popup scroll up"
# "popup select last tab"
# "popup select next tab"
# "popup select previous tab"
# "popup select tab #1"
# "popup select tab #2"
# "popup select tab #3"
# "popup select tab #4"
# "popup select tab #5"
# "popup select tab #6"
# "popup select tab #7"
# "popup select tab #8"
# "previous message"
# "reconnect"
# "reload emotes"
# "remove tab"
# "reopen split"
# "scroll page down"
# "scroll page up"
# "scroll to bottom"
# "scroll to top"
# "select last tab"
# "select next tab"
# "select previous tab"
# "select tab #1"
# "select tab #2"
# "select tab #3"
# "select tab #4"
# "select tab #5"
# "select tab #6"
# "select tab #7"
# "select tab #8"
# "send message"
# "send message and keep text"
# "show global search"
# "show search"
# "toggle live tabs only"
# "toggle local r9k"
# "toggle tab visibility"
# "zoom in"
# "zoom out"
# "zoom reset"
# ];
# "close popup window" = {
# action = "delete";
# keySequence = "Esc";
# category = "popupWindow";
# arguments = [ ];
# };
# "popup accept" = {
# action = "accept";
# keySequence = "Return";
# category = "popupWindow";
# arguments = [ ];
# };
# "popup focus search box" = {
# action = "search";
# keySequence = "Ctrl+F";
# category = "popupWindow";
# arguments = [ ];
# };
# "popup reject" = {
# action = "reject";
# keySequence = "Esc";
# category = "popupWindow";
# arguments = [ ];
# };
# "popup scroll down" = {
# action = "scrollPage";
# keySequence = "PgDown";
# category = "popupWindow";
# arguments = [
# "down"
# ];
# };
# "popup scroll up" = {
# action = "scrollPage";
# keySequence = "PgUp";
# category = "popupWindow";
# arguments = [
# "up"
# ];
# };
# "popup select last tab" = {
# action = "openTab";
# keySequence = "Ctrl+9";
# category = "popupWindow";
# arguments = [
# "last"
# ];
# };
# "popup select next tab" = {
# action = "openTab";
# keySequence = "Ctrl+Tab";
# category = "popupWindow";
# arguments = [
# "next"
# ];
# };
# "popup select previous tab" = {
# action = "openTab";
# keySequence = "Ctrl+Shift+Tab";
# category = "popupWindow";
# arguments = [
# "previous"
# ];
# };
# "popup select tab #1" = {
# action = "openTab";
# keySequence = "Ctrl+1";
# category = "popupWindow";
# arguments = [
# "0"
# ];
# };
# "popup select tab #2" = {
# action = "openTab";
# keySequence = "Ctrl+2";
# category = "popupWindow";
# arguments = [
# "1"
# ];
# };
# "popup select tab #3" = {
# action = "openTab";
# keySequence = "Ctrl+3";
# category = "popupWindow";
# arguments = [
# "2"
# ];
# };
# "popup select tab #4" = {
# action = "openTab";
# keySequence = "Ctrl+4";
# category = "popupWindow";
# arguments = [
# "3"
# ];
# };
# "popup select tab #5" = {
# action = "openTab";
# keySequence = "Ctrl+5";
# category = "popupWindow";
# arguments = [
# "4"
# ];
# };
# "popup select tab #6" = {
# action = "openTab";
# keySequence = "Ctrl+6";
# category = "popupWindow";
# arguments = [
# "5"
# ];
# };
# "popup select tab #7" = {
# action = "openTab";
# keySequence = "Ctrl+7";
# category = "popupWindow";
# arguments = [
# "6"
# ];
# };
# "popup select tab #8" = {
# action = "openTab";
# keySequence = "Ctrl+8";
# category = "popupWindow";
# arguments = [
# "7"
# ];
# };
# "change channel" = {
# action = "changeChannel";
# keySequence = "Ctrl+R";
# category = "split";
# arguments = [ ];
# };
# "create clip" = {
# action = "createClip";
# keySequence = "Alt+X";
# category = "split";
# arguments = [ ];
# };
# delete = {
# action = "delete";
# keySequence = "Ctrl+W";
# category = "split";
# arguments = [ ];
# };
# "focus down" = {
# action = "focus";
# keySequence = "Alt+Down";
# category = "split";
# arguments = [
# "down"
# ];
# };
# "focus left" = {
# action = "focus";
# keySequence = "Alt+Left";
# category = "split";
# arguments = [
# "left"
# ];
# };
# "focus right" = {
# action = "focus";
# keySequence = "Alt+Right";
# category = "split";
# arguments = [
# "right"
# ];
# };
# "focus up" = {
# action = "focus";
# keySequence = "Alt+Up";
# category = "split";
# arguments = [
# "up"
# ];
# };
# "open debug popup" = {
# action = "debug";
# keySequence = "F10";
# category = "split";
# arguments = [ ];
# };
# reconnect = {
# action = "reconnect";
# keySequence = "Ctrl+F5";
# category = "split";
# arguments = [ ];
# };
# "reload emotes" = {
# action = "reloadEmotes";
# keySequence = "F5";
# category = "split";
# arguments = [ ];
# };
# "scroll page down" = {
# action = "scrollPage";
# keySequence = "PgDown";
# category = "split";
# arguments = [
# "down"
# ];
# };
# "scroll page up" = {
# action = "scrollPage";
# keySequence = "PgUp";
# category = "split";
# arguments = [
# "up"
# ];
# };
# "scroll to bottom" = {
# action = "scrollToBottom";
# keySequence = "Ctrl+End";
# category = "split";
# arguments = [ ];
# };
# "scroll to top" = {
# action = "scrollToTop";
# keySequence = "Ctrl+Home";
# category = "split";
# arguments = [ ];
# };
# "show global search" = {
# action = "showGlobalSearch";
# keySequence = "Ctrl+Shift+F";
# category = "split";
# arguments = [ ];
# };
# "show search" = {
# action = "showSearch";
# keySequence = "Ctrl+F";
# category = "split";
# arguments = [ ];
# };
# "emote picker" = {
# action = "openEmotesPopup";
# keySequence = "Ctrl+E";
# category = "splitInput";
# arguments = [ ];
# };
# "go to end of input" = {
# action = "cursorToEnd";
# keySequence = "End";
# category = "splitInput";
# arguments = [
# "withoutSelection"
# ];
# };
# "go to end of input with selection" = {
# action = "cursorToEnd";
# keySequence = "Shift+End";
# category = "splitInput";
# arguments = [
# "withSelection"
# ];
# };
# "go to start of input" = {
# action = "cursorToStart";
# keySequence = "Home";
# category = "splitInput";
# arguments = [
# "withoutSelection"
# ];
# };
# "go to start of input with selection" = {
# action = "cursorToStart";
# keySequence = "Shift+Home";
# category = "splitInput";
# arguments = [
# "withSelection"
# ];
# };
# "next message" = {
# action = "nextMessage";
# keySequence = "Down";
# category = "splitInput";
# arguments = [ ];
# };
# "previous message" = {
# action = "previousMessage";
# keySequence = "Up";
# category = "splitInput";
# arguments = [ ];
# };
# "send message" = {
# action = "sendMessage";
# keySequence = "Return";
# category = "splitInput";
# arguments = [ ];
# };
# "send message and keep text" = {
# action = "sendMessage";
# keySequence = "Ctrl+Return";
# category = "splitInput";
# arguments = [
# "keepInput"
# ];
# };
# "new popup window" = {
# action = "popup";
# keySequence = "Ctrl+N";
# category = "window";
# arguments = [
# "split"
# ];
# };
# "new popup window from tab" = {
# action = "popup";
# keySequence = "Ctrl+Shift+N";
# category = "window";
# arguments = [
# "window"
# ];
# };
# "new split" = {
# action = "newSplit";
# keySequence = "Ctrl+T";
# category = "window";
# arguments = [ ];
# };
# "new tab" = {
# action = "newTab";
# keySequence = "Ctrl+Shift+T";
# category = "window";
# arguments = [ ];
# };
# "open quick switcher" = {
# action = "openQuickSwitcher";
# keySequence = "Ctrl+K";
# category = "window";
# arguments = [ ];
# };
# "open settings" = {
# action = "openSettings";
# keySequence = "Ctrl+P";
# category = "window";
# arguments = [ ];
# };
# "remove tab" = {
# action = "removeTab";
# keySequence = "Ctrl+Shift+W";
# category = "window";
# arguments = [ ];
# };
# "reopen split" = {
# action = "reopenSplit";
# keySequence = "Ctrl+G";
# category = "window";
# arguments = [ ];
# };
# "select last tab" = {
# action = "openTab";
# keySequence = "Ctrl+9";
# category = "window";
# arguments = [
# "last"
# ];
# };
# "select next tab" = {
# action = "openTab";
# keySequence = "Ctrl+Tab";
# category = "window";
# arguments = [
# "next"
# ];
# };
# "select previous tab" = {
# action = "openTab";
# keySequence = "Ctrl+Shift+Tab";
# category = "window";
# arguments = [
# "previous"
# ];
# };
# "select tab #1" = {
# action = "openTab";
# keySequence = "Ctrl+1";
# category = "window";
# arguments = [
# "0"
# ];
# };
# "select tab #2" = {
# action = "openTab";
# keySequence = "Ctrl+2";
# category = "window";
# arguments = [
# "1"
# ];
# };
# "select tab #3" = {
# action = "openTab";
# keySequence = "Ctrl+3";
# category = "window";
# arguments = [
# "2"
# ];
# };
# "select tab #4" = {
# action = "openTab";
# keySequence = "Ctrl+4";
# category = "window";
# arguments = [
# "3"
# ];
# };
# "select tab #5" = {
# action = "openTab";
# keySequence = "Ctrl+5";
# category = "window";
# arguments = [
# "4"
# ];
# };
# "select tab #6" = {
# action = "openTab";
# keySequence = "Ctrl+6";
# category = "window";
# arguments = [
# "5"
# ];
# };
# "select tab #7" = {
# action = "openTab";
# keySequence = "Ctrl+7";
# category = "window";
# arguments = [
# "6"
# ];
# };
# "select tab #8" = {
# action = "openTab";
# keySequence = "Ctrl+8";
# category = "window";
# arguments = [
# "7"
# ];
# };
# "toggle live tabs only" = {
# action = "setTabVisibility";
# keySequence = "Ctrl+Shift+L";
# category = "window";
# arguments = [
# "toggleLiveOnly"
# ];
# };
# "toggle local r9k" = {
# action = "toggleLocalR9K";
# keySequence = "Ctrl+H";
# category = "window";
# arguments = [ ];
# };
# "toggle tab visibility" = {
# action = "setTabVisibility";
# keySequence = "Ctrl+U";
# category = "window";
# arguments = [
# "toggle"
# ];
# };
# "zoom in" = {
# action = "zoom";
# keySequence = "Ctrl++";
# category = "window";
# arguments = [
# "in"
# ];
# };
# "zoom out" = {
# action = "zoom";
# keySequence = "Ctrl+-";
# category = "window";
# arguments = [
# "out"
# ];
# };
# "zoom reset" = {
# action = "zoom";
# keySequence = "Ctrl+0";
# category = "window";
# arguments = [
# "reset"
# ];
# };
# };
# misc = {
# currentVersion = "2.5.1";
# lockNotebookLayout = false;
# };
# ui = {
# lastSelectChannelTab = 0;
# lastSelectIrcConn = -1;
# };
# appearance = {
# theme = {
# name = "Black";
# };
# tabVisibility = 1;
# smoothScrollingNewMessages = true;o
# currentFontFamily = rice.font.base.name;
# messages = {
# alternateMessageBackground = true;
# showTimestamps = false;
# timestampFormat = "h =mm";
# separateMessages = true;
# lastMessagePattern = 10;
# lastMessageColor = "#ff7f0002";
# usernameDisplayMode = 1;
# };
# currentFontSize = 12;
# splitheader = {
# showUptime = true;
# showViewerCount = true;
# showGame = true;
# showTitle = true;
# };
# boldScale = 63.0;
# };
# accounts = secrets.chatterino.accounts;
# behaviour = {
# pauseOnHoverDuration = 5.0;
# usernameRightClickBehavior = 0;
# usernameRightClickBehaviorWithModifier = 1;
# showJoins = false;
# };
# highlighting = {
# selfMessageHighlight = {
# enabled = true;
# color = "#73008cff";
# };
# badges = [
# {
# name = "broadcaster";
# displayName = "Broadcaster";
# showInMentions = false;
# alert = false;
# sound = false;
# soundUrl = "";
# color = "#7f7f3f49";
# }
# {
# name = "admin";
# displayName = "Admin";
# showInMentions = false;
# alert = false;
# sound = false;
# soundUrl = "";
# color = "#7f7f3f49";
# }
# {
# name = "staff";
# displayName = "Staff";
# showInMentions = false;
# alert = false;
# sound = false;
# soundUrl = "";
# color = "#7f7f3f49";
# }
# {
# name = "moderator";
# displayName = "Moderator";
# showInMentions = false;
# alert = false;
# sound = false;
# soundUrl = "";
# }
# {
# name = "vip";
# displayName = "VIP";
# showInMentions = false;
# alert = false;
# sound = false;
# soundUrl = "";
# color = "#7f7f3578";
# }
# ];
# };
# emotes = {
# removeSpacesBetweenEmotes = false;
# showUnlistedSevenTVEmotes = true;
# };
# similarity = {
# similarityEnabled = false;
# hideSimilar = false;
# hideSimilarMaxDelay = 30;
# hideSimilarMaxMessagesToCheck = 5;
# };
# };
home.file.".local/share/chatterino/Settings/window-layout.json".text = builtins.toJSON {
windows = [ windows = [
{ {
emotePopup = { emotePopup = {
@@ -1415,4 +752,6 @@ lib.mkIf (user != "tv")
} }
]; ];
}; };
};
};
} }

View File

@@ -1,5 +1,4 @@
{ lib, user, ... }: { lib, user, ... }:
lib.mkIf (user != "tv")
{ {
programs = { programs = {
direnv = { direnv = {

View File

@@ -6,7 +6,9 @@ lib.mkIf (host != "NxACE")
vesktop vesktop
]; ];
file.".config/vesktop/settings/settings.json".text = /* json */ ''{ file.".config/vesktop/settings/settings.json".text = let
settingsSyncVersion = "1729179678715";
in /* json */ ''{
"notifyAboutUpdates": true, "notifyAboutUpdates": true,
"autoUpdate": false, "autoUpdate": false,
"autoUpdateNotification": true, "autoUpdateNotification": true,
@@ -188,7 +190,7 @@ lib.mkIf (host != "NxACE")
"authenticated": false, "authenticated": false,
"url": "https://api.vencord.dev/", "url": "https://api.vencord.dev/",
"settingsSync": false, "settingsSync": false,
"settingsSyncVersion": 1725386648445 "settingsSyncVersion": ${settingsSyncVersion}
} }
} }
''; '';

View File

@@ -177,6 +177,25 @@
} }
} }
@-moz-document domain(mynixos.com) {
body, html {
background-color: transparent !important;
}
header, footer {
background-color: rgba(0,0,0,0.5) !important;
border-radius: ${builtins.toString rice.rounding}px;
}
}
@-moz-document domain(moodle.informatik.tu-darmstadt.de) {
body, html , .main-inner, .main-inner * {
background-color: transparent !important;
}
.bg-primary {
background-color: rgba(${rice.lib.hex-to-rgb-comma-string accent.base}, 0.5) !important!
}
}
@-moz-document domain(nx2.site) { @-moz-document domain(nx2.site) {
html { html {
background: radial-gradient(rgba(255, 255, 255, 0.8) 5%, transparent 5%) !important; background: radial-gradient(rgba(255, 255, 255, 0.8) 5%, transparent 5%) !important;

View File

@@ -1,5 +1,4 @@
{ pkgs, lib, rice, user, ... }: { pkgs, lib, rice, user, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
fish fish
@@ -81,7 +80,7 @@ lib.mkIf (user != "tv")
lzd = "lazydocker"; lzd = "lazydocker";
d = "docker"; d = "docker";
dcmp = "docker compose"; dcmp = "docker compose";
nxsent = ''sent -c \${rice.color.foreground} -b \${rice.color.background}''; # nxsent = ''sent -c \${rice.color.foreground} -b \${rice.color.background}'';
# ya = "yazi"; # function # ya = "yazi"; # function
# nxfiglet = "figlet"; # nxfiglet = "figlet";

View File

@@ -1,270 +0,0 @@
{ config, pkgs, rice, lib, user, ... }:
lib.mkIf (user != "tv")
{
home.packages = with pkgs; [
foot
];
programs.foot = {
enable = true;
# background = rice.color.background;
# foreground = rice.color.foreground;
# cursor = rice.color.foreground;
# color0 = rice.color.black.base;
# color8 = rice.color.black.bright;
# color1 = rice.color.red.base;
# color9 = rice.color.red.bright;
# color2 = rice.color.green.base;
# color10 = rice.color.green.bright;
# color3 = rice.color.yellow.base;
# color11 = rice.color.yellow.bright;
# color4 = rice.color.blue.base;
# color12 = rice.color.blue.bright;
# color5 = rice.color.magenta.base;
# color13 = rice.color.magenta.bright;
# color6 = rice.color.cyan.base;
# color14 = rice.color.cyan.bright;
# color7 = rice.color.white.base;
# color15 = rice.color.white.bright;
# background_opacity = builtins.toString rice.transparency;
# window_padding_width = 5;
# remember_window_size = false;
# settings = {
# main = {
# shell = ''$SHELL (if set, otherwise user's default shell from /etc/passwd)'';
# term = ''foot (or xterm-256color if built with -Dterminfo=disabled)'';
# login-shell = ''no'';
# # app-id = ''foot'';
# title = ''foot'';
# locked-title = ''no'';
# font = ''${rice.font.code.name}:size=8'';
# font-size-adjustment = ''0.5'';
# line-height = "<font metrics>";
# letter-spacing = ''0'';
# horizontal-letter-offset = ''0'';
# vertical-letter-offset = ''0'';
# underline-offset = "<font metrics>";
# underline-thickness = "<font underline thickness>";
# # box-drawings-uses-font-glyphs = "no";
# # dpi-aware = ''no'';
# # initial-window-size-pixels = ''700x500'';
# # initial-window-size-chars = "<COLSxROWS>";
# # initial-window-mode = ''windowed'';
# pad = ''5x5'';
# resize-by-cells = ''yes'';
# resize-keep-grid = ''yes'';
# resize-delay-ms = ''100'';
# # bold-text-in-bright = false;
# word-delimiters = '',│`|:"'()[]{}<>'';
# selection-target = ''primary'';
# workers = "<number of logical CPUs>";
# utmp-helper = ''/usr/lib/utempter/utempter'';
# # environment = {
# # name = ''value'';
# # };
# };
# bell = {
# urgent = ''no'';
# notify = ''no'';
# visual = ''no'';
# command = '''';
# command-focused = ''no'';
# };
# desktop-notifications = {
# command = ''notify-send --wait --app-name ''${app-id} --icon ''${app-id} --category ''${category} --urgency ''${urgency} --expire-time ''${expire-time} --hint STRING:image-path:''${icon} --hint BOOLEAN:suppress-sound:''${muted} --hint STRING:sound-name:''${sound-name} --replace-id ''${replace-id} ''${action-argument} --print-id -- ''${title} ''${body}'';
# command-action-argument = ''--action ''${action-name}=''${action-label}'';
# close = ''""'';
# inhibit-when-focused = ''yes'';
# };
# scrollback = {
# lines = ''1000'';
# multiplier = ''3.0'';
# indicator-position = ''relative'';
# indicator-format = ''""'';
# };
# url = {
# launch = ''xdg-open ''${url}'';
# label-letters = ''sadfjklewcmpgh'';
# osc8-underline = ''url-mode'';
# protocols = ''http, https, ftp, ftps, file, gemini, gopher'';
# uri-characters = ''abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]'';
# };
# cursor = {
# style = ''block'';
# color = "<inverse foreground/background>";
# blink = ''no'';
# blink-rate = ''500'';
# beam-thickness = ''1.5'';
# underline-thickness = "<font underline thickness>";
# };
# mouse = {
# hide-when-typing = ''no'';
# alternate-scroll-mode = ''yes'';
# };
# touch = {
# long-press-delay = ''400'';
# };
# colors = {
# alpha = ''1.0'';
# background = ''242424'';
# foreground = ''ffffff'';
# flash = ''7f7f00'';
# flash-alpha = ''0.5'';
# # Normal/regular colors (color palette 0-7)
# regular0 = ''242424'';
# regular1 = ''f62b5a'';
# regular2 = ''47b413'';
# regular3 = ''e3c401'';
# regular4 = ''24acd4'';
# regular5 = ''f2affd'';
# regular6 = ''13c299'';
# regular7 = ''e6e6e6'';
# # Bright colors (color palette 8-15)
# bright0 = ''616161'';
# bright1 = ''ff4d51'';
# bright2 = ''35d450'';
# bright3 = ''e9e836'';
# bright4 = ''5dc5f8'';
# bright5 = ''feabf2'';
# bright6 = ''24dfc4'';
# bright7 = ''ffffff'';
# # dimmed colors (see foot.ini(5) man page)
# # dim0 = "<not set>";
# # ...
# # dim7 = "<not-set>";
# # The remaining 256-color palette
# # 16 = <256-color palette #16>
# # ...
# # 255 = <256-color palette #255>
# # Misc colors
# selection-foreground = "<inverse foreground/background>";
# selection-background = "<inverse foreground/background>";
# jump-labels = "<regular0> <regular3>";
# scrollback-indicator = "<regular0> <bright4>";
# search-box-no-match = "<regular0> <regular1>";
# search-box-match = "<regular0> <regular3>";
# urls = "<regular3>";
# };
# csd = {
# preferred = ''server'';
# size = ''26'';
# font = "<primary font>";
# color = "<foreground color>";
# hide-when-maximized = ''no'';
# double-click-to-maximize = ''yes'';
# border-width = ''0'';
# border-color = "<csd.color>";
# button-width = ''26'';
# button-color = "<background color>";
# button-minimize-color = "<regular4>";
# button-maximize-color = "<regular2>";
# button-close-color = "<regular1>";
# };
# key-bindings = {
# scrollback-up-page = ''Shift+Page_Up'';
# scrollback-up-half-page = ''none'';
# scrollback-up-line = ''none'';
# scrollback-down-page = ''Shift+Page_Down'';
# scrollback-down-half-page = ''none'';
# scrollback-down-line = ''none'';
# scrollback-home = ''none'';
# scrollback-end = ''none'';
# clipboard-copy = ''Control+Shift+c XF86Copy'';
# clipboard-paste = ''Control+Shift+v XF86Paste'';
# primary-paste = ''Shift+Insert'';
# search-start = ''Control+Shift+r'';
# font-increase = ''Control+plus Control+equal Control+KP_Add'';
# font-decrease = ''Control+minus Control+KP_Subtract'';
# font-reset = ''Control+0 Control+KP_0'';
# spawn-terminal = ''Control+Shift+n'';
# minimize = ''none'';
# maximize = ''none'';
# fullscreen = ''none'';
# pipe-visible = ''[sh -c "xurls | fuzzel | xargs -r firefox"] none'';
# pipe-scrollback = ''[sh -c "xurls | fuzzel | xargs -r firefox"] none'';
# pipe-selected = ''[xargs -r firefox] none'';
# pipe-command-output = ''[wl-copy] none'';
# show-urls-launch = ''Control+Shift+o'';
# show-urls-copy = ''none'';
# show-urls-persistent = ''none'';
# prompt-prev = ''Control+Shift+z'';
# prompt-next = ''Control+Shift+x'';
# unicode-input = ''Control+Shift+u'';
# noop = ''none'';
# };
# search-bindings = {
# cancel = ''Control+g Control+c Escape'';
# commit = ''Return'';
# find-prev = ''Control+r'';
# find-next = ''Control+s'';
# cursor-left = ''Left Control+b'';
# cursor-left-word = ''Control+Left Mod1+b'';
# cursor-right = ''Right Control+f'';
# cursor-right-word = ''Control+Right Mod1+f'';
# cursor-home = ''Home Control+a'';
# cursor-end = ''End Control+e'';
# delete-prev = ''BackSpace'';
# delete-prev-word = ''Mod1+BackSpace Control+BackSpace'';
# delete-next = ''Delete'';
# delete-next-word = ''Mod1+d Control+Delete'';
# extend-char = ''Shift+Right'';
# extend-to-word-boundary = ''Control+w Control+Shift+Right'';
# extend-to-next-whitespace = ''Control+Shift+w'';
# extend-line-down = ''Shift+Down'';
# extend-backward-char = ''Shift+Left'';
# extend-backward-to-word-boundary = ''Control+Shift+Left'';
# extend-backward-to-next-whitespace = ''none'';
# extend-line-up = ''Shift+Up'';
# clipboard-paste = ''Control+v Control+Shift+v Control+y XF86Paste'';
# primary-paste = ''Shift+Insert'';
# unicode-input = ''none'';
# quit = ''none'';
# scrollback-up-page = ''Shift+Page_Up'';
# scrollback-up-half-page = ''none'';
# scrollback-up-line = ''none'';
# scrollback-down-page = ''Shift+Page_Down'';
# scrollback-down-half-page = ''none'';
# scrollback-down-line = ''none'';
# scrollback-home = ''none'';
# scrollback-end = ''none'';
# };
# url-bindings = {
# cancel = ''Control+g Control+c Control+d Escape'';
# toggle-url-visible = ''t'';
# };
# text-bindings = {
# "\x03" = ''Mod4+c'';
# };
# mouse-bindings = {
# scrollback-up-mouse = ''BTN_WHEEL_BACK'';
# scrollback-down-mouse = ''BTN_WHEEL_FORWARD'';
# font-increase = ''Control+BTN_WHEEL_BACK'';
# font-decrease = ''Control+BTN_WHEEL_FORWARD'';
# selection-override-modifiers = ''Shift'';
# primary-paste = ''BTN_MIDDLE'';
# select-begin = ''BTN_LEFT'';
# select-begin-block = ''Control+BTN_LEFT'';
# select-extend = ''BTN_RIGHT'';
# select-extend-character-wise = ''Control+BTN_RIGHT'';
# select-word = ''BTN_LEFT-2'';
# select-word-whitespace = ''Control+BTN_LEFT-2'';
# select-quote = ''BTN_LEFT-3'';
# select-row = ''BTN_LEFT-4'';
# # vim: ft = ''dosini'';
# };
# };
};
}

View File

@@ -1,5 +1,4 @@
{ pkgs, lib, user, rice, ... }: { pkgs, rice, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
git git
@@ -11,9 +10,7 @@ lib.mkIf (user != "tv")
# List of directories to check # List of directories to check
directories=( directories=(
"$HOME/nix-dots" "$HOME/nix-dots"
"$HOME/shared/nx-obsidian-vault" "$HOME/obsidian-vault"
"$HOME/shared/HSMW/Praxis/BCAM/bolt-llmserver"
"$HOME/shared/HSMW/Praxis/BCAM/bcam-tools"
"$HOME/Pictures/wallpapers" "$HOME/Pictures/wallpapers"
) )
echo "" echo ""
@@ -56,13 +53,19 @@ lib.mkIf (user != "tv")
windowSize = "normal"; windowSize = "normal";
gui.theme = with rice.color; { gui.theme = with rice.color; {
lightTheme = false; lightTheme = false;
activeBorderColor = [ border "bold"]; activeBorderColor = [ foreground "bold" ];
inactiveBorderColor = [ black.bright ]; inactiveBorderColor = [ border ];
optionsTextColor = [ blue.base ]; optionsTextColor = [ tertiary.base ];
selectedLineBgColor = [ foreground ]; selectedLineBgColor = [ secondary.base ];
selectedRangeByColor = [ magenta.bright ]; selectedRangeByColor = [ weird.bright ];
showRandomTip = true; showRandomTip = true;
animateExplosion = true; animateExplosion = true;
cherryPickedCommitFgColor = [ accent.base ]; # Foreground color of copied commit
cherryPickedCommitBgColor = [ secondary.dark ]; # Background color of copied commit
markedBaseCommitFgColor = [ accent.base ]; # Foreground color of marked base commit (for rebase)
markedBaseCommitBgColor = [ secondary.dark ]; # Background color of marked base commit (for rebase)
unstagedChangesColor = [ negative.base ]; # Color for file with unstaged changes
defaultFgColor = [ "default" ]; # Default text color
}; };
}; };
}; };

View File

@@ -1,16 +1,15 @@
{ pkgs, pkgs-unstable, ... }: { pkgs, pkgs-unstable, ... }:
{ {
# there also is a system module # there also is a system module
home.packages = with pkgs; [ home.packages = (with pkgs; [
gnupg gnupg
gpg-tui gpg-tui
] ++ ( with pkgs-unstable; [ ]) ++ ( with pkgs-unstable; [
pinentry-all pinentry-all
]); ]);
# services.pcscd.enable = true; # services.pcscd.enable = true;
services.gpg-agent = services.gpg-agent = let
let
min2sec = min: (min * 60); min2sec = min: (min * 60);
in { in {
enable = true; enable = true;
@@ -22,7 +21,7 @@
enableFishIntegration = true; enableFishIntegration = true;
defaultCacheTtlSsh = min2sec 60; defaultCacheTtlSsh = min2sec 60;
defaultCacheTtl = min2sec 30; defaultCacheTtl = min2sec 30;
# pinentryPackage = pkgs.pinentry-gtk2; # pinentryPackage = pkgs.pinentry-curses;
}; };
home.file.".gnupg/gpg.conf".text = '' home.file.".gnupg/gpg.conf".text = ''

View File

@@ -1,5 +1,4 @@
{ config, pkgs, lib, rice, user, ... }: { config, pkgs, lib, rice, user, ... }: let
let
# theme-name = "Colloid-Pink-Dark-Compact"; # theme-name = "Colloid-Pink-Dark-Compact";
# theme-package = pkgs.colloid-gtk-theme.override { # theme-package = pkgs.colloid-gtk-theme.override {
# themeVariants = [ "pink" ]; # themeVariants = [ "pink" ];
@@ -14,9 +13,7 @@ let
tweaks = [ "rimless" "black" ]; tweaks = [ "rimless" "black" ];
variant = "macchiato"; variant = "macchiato";
}; };
in in {
lib.mkIf (user != "tv")
{
home.packages = with pkgs; [ home.packages = with pkgs; [
# gnome.gnome-themes-extra # gnome.gnome-themes-extra
# gnome.adwaita-icon-theme # gnome.adwaita-icon-theme

View File

@@ -2,8 +2,9 @@
{ {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
nixfmt-classic # nix formater # nixfmt-classic # nix formater
nil # nix language server # nil # nix language server
# nixd # specified in nixd.nix
python311Packages.python-lsp-server python311Packages.python-lsp-server
ruff ruff
ruff-lsp ruff-lsp
@@ -14,6 +15,7 @@
vale-ls # style-checker lsp (needs vale) vale-ls # style-checker lsp (needs vale)
ltex-ls # Ltex (language tool) ltex-ls # Ltex (language tool)
] ++ (with pkgs-unstable; [ ] ++ (with pkgs-unstable; [
bash-language-server
helix helix
]); ]);
sessionVariables = { sessionVariables = {
@@ -60,7 +62,7 @@
}; };
}; };
keys.normal = { keys.normal = {
"C-g" = [":new" ":insert-output lazygit" ":buffer-close!" ":redraw"]; "C-g" = [ ":new" ":insert-output lazygit" ":buffer-close!" ":redraw" ];
"A-`" = [ "no_op" ]; "A-`" = [ "no_op" ];
"`" = [ "no_op" ]; "`" = [ "no_op" ];
}; };
@@ -72,9 +74,13 @@
}; };
languages = { languages = {
language = [ language = [
{
name = "nix";
language-servers = [ "nixd" "nil" ];
}
{ {
name = "latex"; name = "latex";
language-servers = ["texlab" "language-tool"]; language-servers = [ "texlab" "language-tool" ];
} }
{ {
name = "markdown"; name = "markdown";
@@ -118,6 +124,9 @@
} }
]; ];
language-server = { language-server = {
"nixd" = {
command = "nixd";
};
"style-check" = { "style-check" = {
command = lib.getExe pkgs.vale-ls; command = lib.getExe pkgs.vale-ls;
}; };

View File

@@ -1,11 +1,8 @@
{ pkgs, lib, user, ... }: { pkgs, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = [ home = {
pkgs.hyprland-autoname-workspaces packages = with pkgs; [ hyprland-autoname-workspaces ];
]; file.".config/hyprland-autoname-workspaces/config.toml".text = ''
home.file.".config/hyprland-autoname-workspaces/config.toml".text = ''
version = "1.1.14" version = "1.1.14"
[class] [class]
@@ -106,4 +103,5 @@ lib.mkIf (user != "tv")
client_dup_active = "*{icon}*{delim}{icon}{counter_unfocused_sup}" client_dup_active = "*{icon}*{delim}{icon}{counter_unfocused_sup}"
client_dup_fullscreen = "[{icon}]{delim}{icon}{counter_unfocused_sup}" client_dup_fullscreen = "[{icon}]{delim}{icon}{counter_unfocused_sup}"
''; '';
};
} }

View File

@@ -46,9 +46,7 @@ let
}; };
}; };
}; };
in in {
lib.mkIf (user != "tv")
{
home.packages = (with pkgs; [ home.packages = (with pkgs; [
# hyprland itself is a system package # hyprland itself is a system package
hyprland-protocols hyprland-protocols
@@ -164,8 +162,8 @@ lib.mkIf (user != "tv")
gaps_in = builtins.div rice.gap-size 2; gaps_in = builtins.div rice.gap-size 2;
gaps_out = rice.gap-size; gaps_out = rice.gap-size;
border_size = rice.border-width; border_size = rice.border-width;
"col.active_border" = "rgba(${rice.lib.nohash rice.color.border}ff) rgba(${rice.lib.nohash rice.color.border2}ff) 90deg"; "col.active_border" = "rgba(${rice.lib.nohash rice.color.border2}ff) rgba(${rice.lib.nohash rice.color.border}ff) 90deg";
"col.inactive_border" = "rgba(${rice.lib.nohash rice.color.background}ff) rgba(${rice.lib.nohash rice.color.border2}ff) 90deg"; "col.inactive_border" = "rgba(${rice.lib.nohash rice.color.background}ff) rgba(${rice.lib.nohash rice.color.border}ff) 90deg";
# cursor_inactive_timeout = 10; # cursor_inactive_timeout = 10;
@@ -230,7 +228,7 @@ lib.mkIf (user != "tv")
dwindle = { dwindle = {
preserve_split = true; # you probably want this preserve_split = true; # you probably want this
no_gaps_when_only = false; no_gaps_when_only = true;
}; };
# master = { # master = {
@@ -267,10 +265,10 @@ lib.mkIf (user != "tv")
"opacity ${transparency}, code-oss" "opacity ${transparency}, code-oss"
"opacity ${transparency}, VSCodium" "opacity ${transparency}, VSCodium"
"opacity ${transparency}, Code" "opacity ${transparency}, Code"
"opacity ${transparency}, sent" # "opacity ${transparency}, sent"
"opacity ${transparency}, neovide" "opacity ${transparency}, neovide"
"opacity ${transparency}, obsidian" "opacity ${transparency}, obsidian"
"opacity ${transparency}, zathura" # "opacity ${transparency}, zathura"
# "bordercolor rgba(${rice.lib.nohash rice.color.foreground}ff) rgba(${rice.lib.nohash rice.color.background}${rice.lib.float-to-drune rice.transparency}), Alacritty" # "bordercolor rgba(${rice.lib.nohash rice.color.foreground}ff) rgba(${rice.lib.nohash rice.color.background}${rice.lib.float-to-drune rice.transparency}), Alacritty"
# "bordercolor rgba(${rice.lib.nohash rice.color.foreground}ff) rgba(${rice.lib.nohash rice.color.background}${rice.lib.float-to-drune rice.transparency}), Kitty" # "bordercolor rgba(${rice.lib.nohash rice.color.foreground}ff) rgba(${rice.lib.nohash rice.color.background}${rice.lib.float-to-drune rice.transparency}), Kitty"
"opacity ${transparency}, discord" "opacity ${transparency}, discord"
@@ -297,6 +295,7 @@ lib.mkIf (user != "tv")
"float, title:^(Compact folders)$" "float, title:^(Compact folders)$"
"tile, sent" "tile, sent"
"fullscreen, wlogout" "fullscreen, wlogout"
"fullscreen, sent"
"workspace 14, lutris" "workspace 14, lutris"
"workspace 100, title:^(Apex Legends)$" "workspace 100, title:^(Apex Legends)$"
"workspace 100, ^(cyberpunk2077.exe)$" "workspace 100, ^(cyberpunk2077.exe)$"
@@ -332,6 +331,7 @@ lib.mkIf (user != "tv")
"SUPER, F5, exec, nx_gcal_event force-lookup" "SUPER, F5, exec, nx_gcal_event force-lookup"
"SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate" "SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate"
"SUPER, F6, exec, kitty -e 'htop'" "SUPER, F6, exec, kitty -e 'htop'"
"SUPER, F7, exec, kitty -e 'nmtui'"
''SUPER, F8, exec, find ~/Pictures/wallpapers/* -type f -not -path "~/Pictures/wallpapers/.git/*" | sort -R | head -n 1 | xargs swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120'' ''SUPER, F8, exec, find ~/Pictures/wallpapers/* -type f -not -path "~/Pictures/wallpapers/.git/*" | sort -R | head -n 1 | xargs swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120''
''SUPER, F9, exec, kitty -e sh -c 'change_colors_json $(swww query | sed -n 1p | sed -e "s-.*image: --g") && nh home switch && firefox /home/${user}/.config/color-pallete.html' '' ''SUPER, F9, exec, kitty -e sh -c 'change_colors_json $(swww query | sed -n 1p | sed -e "s-.*image: --g") && nh home switch && firefox /home/${user}/.config/color-pallete.html' ''
''SUPER SHIFT, F9, exec, firefox /home/${user}/.config/color-pallete.html '' ''SUPER SHIFT, F9, exec, firefox /home/${user}/.config/color-pallete.html ''

View File

@@ -1,36 +1,31 @@
{ config, pkgs, rice, lib, user, ... }: { rice, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [
kitty
];
programs.kitty = { programs.kitty = {
enable = true; enable = true;
font = { font = {
name = rice.font.code.name2; name = rice.font.code.name2;
package = rice.font.code.package; package = rice.font.code.package;
}; };
settings = { settings = with rice.color; {
background = rice.color.background; background = background;
foreground = rice.color.foreground; foreground = foreground;
cursor = rice.color.foreground; cursor = foreground;
color0 = rice.color.black.base; color0 = black.base;
color8 = rice.color.black.bright; color8 = black.bright;
color1 = rice.color.red.base; color1 = red.base;
color9 = rice.color.red.bright; color9 = red.bright;
color2 = rice.color.green.base; color2 = green.base;
color10 = rice.color.green.bright; color10 = green.bright;
color3 = rice.color.yellow.base; color3 = yellow.base;
color11 = rice.color.yellow.bright; color11 = yellow.bright;
color4 = rice.color.blue.base; color4 = blue.base;
color12 = rice.color.blue.bright; color12 = blue.bright;
color5 = rice.color.magenta.base; color5 = magenta.base;
color13 = rice.color.magenta.bright; color13 = magenta.bright;
color6 = rice.color.cyan.base; color6 = cyan.base;
color14 = rice.color.cyan.bright; color14 = cyan.bright;
color7 = rice.color.white.base; color7 = white.base;
color15 = rice.color.white.bright; color15 = white.bright;
background_opacity = builtins.toString rice.transparency; background_opacity = builtins.toString rice.transparency;
window_padding_width = 5; window_padding_width = 5;
remember_window_size = false; remember_window_size = false;

View File

@@ -1,10 +1,6 @@
{ pkgs, rice, lib, user, ... }: { pkgs, rice, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = [ home.packages = with pkgs; [ libnotify ];
pkgs.mako
pkgs.libnotify
];
services.mako = with rice; { services.mako = with rice; {
enable = true; enable = true;
defaultTimeout = 5000; # in ms defaultTimeout = 5000; # in ms

6
home-modules/nixd.nix Normal file
View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
nixd
];
}

View File

@@ -1,9 +1,6 @@
{ config, pkgs, secrets, lib, user, ... }: { config, pkgs, secrets, ... }: let
let
sep = " "; sep = " ";
in in {
lib.mkIf (user != "tv")
{
home = { home = {
file."${config.xdg.dataHome}/nx-gcal-event-credentials.json".text = '' file."${config.xdg.dataHome}/nx-gcal-event-credentials.json".text = ''
{ {
@@ -26,7 +23,7 @@ lib.mkIf (user != "tv")
# (pkgs.python311.withPackages (python-pkgs: [ # (pkgs.python311.withPackages (python-pkgs: [
# python-pkgs.google # python-pkgs.google
# ])) # ]))
(writeScriptBin "nx_gcal_event" '' (writeScriptBin "nx_gcal_event" /* python */ ''
#!${pkgs.python3}/bin/python3 #!${pkgs.python3}/bin/python3
import datetime import datetime
import os import os

99
home-modules/nx2site.nix Normal file
View File

@@ -0,0 +1,99 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writeShellApplication {
name = "nxmd";
text = let
ascii_size = (pkgs.writers.writePython3Bin "ascii_size" {
# libraries = with pkgs.python311Packages; [ ];
flakeIgnore = [];
} /* python */ ''
from sys import argv
with open(argv[1], "r", encoding='utf-8') as f:
raw = f.read()
sraw = raw.split("\n")
linestart = 0
lineend = 0
started = False
for linenum in range(len(sraw)):
if sraw[linenum].strip() == "```ascii":
linestart = linenum
started = True
if started and sraw[linenum].strip() == "```":
lineend = linenum
break
maxwidth = 0
for linenum in range(linestart, lineend):
linewidth = len(sraw[linenum])
if linewidth > maxwidth:
maxwidth = linewidth
print(f"Maximum length of the `ascii` code clock is {maxwidth} characters.")
px = (1 / maxwidth) * 1500
vw = (1 / maxwidth) * 150
snew = sraw
snew[3] = "aaw: " + str(round(vw, 2))
snew[4] = "aawm: " + str(round(px, 2))
new = "\n".join(snew)
with open(argv[1], "w", encoding='utf-8') as f:
f.write(new)
print(f"The resulting font sizes are {px}px (aawm) and {vw}vw (aam).")
print(f"You can now use the push operation on {argv[1]}.")
''
);
in /* bash */ ''
ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}')
nxdate="$(date +'%A the ')"
nxdate="$nxdate""$ord"
nxdate="$nxdate""$(date +' of %B %Y')"
if [[ $# -eq 0 ]]; then
echo "Error: No arguments provided."
echo "Usage: $0 push <markdown-file>"
exit 1
fi
if [[ "$1" == "push" ]]; then
if [[ ! "$2" =~ \.md$ ]]; then
echo "Error: Second argument must be a markdown (.md) file"
echo "Usage: $0 push <markdown-file>"
exit 1
fi
pandoc \
"$2" \
--highlight-style=breezeDark \
--standalone \
--mathjax \
--ascii \
--template /var/nginx/assets/template.html \
--metadata pdate="$nxdate" \
--verbose --from markdown-markdown_in_html_blocks+raw_html \
-o /var/nginx/webroot/"$(basename "$2" .md )".html
echo pushed "$2"
elif [[ "$1" == "ascii-size" ]]; then
if [[ ! "$2" =~ \.md$ ]]; then
echo "Error: Second argument must be a markdown (.md) file"
echo "Usage: $0 ascii-size <markdown-file>"
exit 1
fi
${ascii_size}/bin/ascii_size "$2"
else
echo "Error: First argument must be 'push'"
echo "Usage: $0 push <markdown-file>"
exit 1
fi
'';
})
];
}

View File

@@ -1,5 +1,4 @@
{ config, pkgs, lib, user, ... }: { config, pkgs, lib, user, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
libreoffice libreoffice

View File

@@ -1,5 +1,6 @@
{ config, pkgs, lib, user, ... }: { pkgs, ... }:
let {
home = let
python-with-packages = pkgs.python3.withPackages (pp: with pp; [ python-with-packages = pkgs.python3.withPackages (pp: with pp; [
ipython ipython
pipdeptree pipdeptree
@@ -8,14 +9,12 @@ let
debugpy debugpy
black black
]); ]);
in in {
lib.mkIf (user != "tv") packages = [
{
home.packages = [
python-with-packages python-with-packages
]; ];
sessionVariables = {
home.sessionVariables = {
PYTHONPATH = "${python-with-packages}/${python-with-packages.sitePackages}"; PYTHONPATH = "${python-with-packages}/${python-with-packages.sitePackages}";
}; };
};
} }

View File

@@ -1,5 +1,4 @@
{ pkgs, lib, user, ... }: { pkgs, lib, user, ... }:
lib.mkIf (user != "tv")
{ {
qt = { qt = {
platformTheme = "gtk"; platformTheme = "gtk";

View File

@@ -1,13 +1,11 @@
{ pkgs, rice, lib, user, ... }: { pkgs, rice, ... }: {
let
trdr = "${rice.lib.float-to-drune rice.transparency}";
in
lib.mkIf (user != "tv")
{
home.packages = with pkgs; [ home.packages = with pkgs; [
rofi-wayland rofi-wayland
]; ];
home.file.".config/rofi/config.rasi".text = '' home.file = let
trdr = "${rice.lib.float-to-drune rice.transparency}";
in with rice.color; {
".config/rofi/config.rasi".text = ''
configuration { configuration {
show-icons: false; show-icons: false;
display-drun: ""; display-drun: "";
@@ -17,8 +15,8 @@ lib.mkIf (user != "tv")
* { * {
font: "${rice.font.code.name2} 12"; font: "${rice.font.code.name2} 12";
foreground: ${rice.color.foreground}; foreground: ${foreground};
background-color: ${rice.color.background}${trdr}; background-color: ${background}${trdr};
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
spacing: 0px; spacing: 0px;
@@ -26,10 +24,10 @@ lib.mkIf (user != "tv")
} }
#window { #window {
background-color: ${rice.color.background}${trdr}; background-color: ${background}${trdr};
border: ${builtins.toString rice.border-width}px; border: ${builtins.toString rice.border-width}px;
border-radius: ${builtins.toString rice.rounding}; border-radius: ${builtins.toString rice.rounding};
border-color: ${rice.color.border}; border-color: ${border};
} }
#mainbox { #mainbox {
border: 0; border: 0;
@@ -39,7 +37,7 @@ lib.mkIf (user != "tv")
border: 0px; border: 0px;
} }
#textbox { #textbox {
text-color: ${rice.color.foreground}; text-color: ${foreground};
} }
#listview { #listview {
fixed-height: 0; fixed-height: 0;
@@ -57,9 +55,9 @@ lib.mkIf (user != "tv")
border-radius: ${if rice.rounding > 0 then "2" else "0"}px; border-radius: ${if rice.rounding > 0 then "2" else "0"}px;
} }
#element.normal.normal { background-color: ${rice.color.background}${trdr}; text-color: ${rice.color.accent.base}; } #element.normal.normal { background-color: ${background}${trdr}; text-color: ${accent.base}; }
#element.selected.normal { background-color: ${rice.color.tertiary.base}${trdr}; text-color: ${rice.color.background}; } #element.selected.normal { background-color: ${tertiary.base}${trdr}; text-color: ${background}; }
#element.alternate.normal { background-color: ${rice.color.background}${trdr}; text-color: ${rice.color.secondary.base}; } #element.alternate.normal { background-color: ${background}${trdr}; text-color: ${secondary.base}; }
#scrollbar { #scrollbar {
@@ -72,12 +70,12 @@ lib.mkIf (user != "tv")
border: ${builtins.toString rice.border-width}px dash; border: ${builtins.toString rice.border-width}px dash;
} }
#button.selected { #button.selected {
text-color: ${rice.color.foreground}; text-color: ${foreground};
} }
#inputbar { #inputbar {
spacing: 0; spacing: 0;
text-color: ${rice.color.background}; text-color: ${background};
background-color: ${rice.color.accent.base}${trdr}; background-color: ${accent.base}${trdr};
padding: 0; padding: 0;
margine-bottom: 2px; margine-bottom: 2px;
children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
@@ -85,23 +83,23 @@ lib.mkIf (user != "tv")
#prompt { #prompt {
spacing: 0; spacing: 0;
background-color: transparent; background-color: transparent;
text-color: ${rice.color.foreground}; text-color: ${foreground};
} }
#textbox-prompt-colon { #textbox-prompt-colon {
expand: false; expand: false;
str: ">"; str: ">";
margin: 0px 0.3em 0em 0em ; margin: 0px 0.3em 0em 0em ;
text-color: ${rice.color.background}; text-color: ${background};
background-color: transparent; background-color: transparent;
} }
#case-indicator { #case-indicator {
spacing: 0; spacing: 0;
text-color: ${rice.color.foreground}; text-color: ${foreground};
background-color: transparent; background-color: transparent;
} }
#entry { #entry {
spacing: 0; spacing: 0;
text-color: ${rice.color.background}; text-color: ${background};
background-color: transparent; background-color: transparent;
placeholder: ""; placeholder: "";
} }
@@ -111,4 +109,5 @@ lib.mkIf (user != "tv")
text-color: inherit; text-color: inherit;
} }
''; '';
};
} }

View File

@@ -1,4 +1,4 @@
{ pkgs, rice, user, ... }: { pkgs, rice, ... }:
let let
my-sent = pkgs.sent.override { my-sent = pkgs.sent.override {
patches = [ patches = [
@@ -11,25 +11,14 @@ in
{ {
home = { home = {
packages = [ packages = [
# pkgs.sent
my-sent my-sent
]; (pkgs.writeShellApplication {
file.".local/share/sent.patch".text = '' name = "nxsent";
diff --git a/config.def.h b/config.def.h text = with rice.color; let
index 60eb376..64e7f05 100644 in /* bash */ ''
--- a/config.def.h echo "$@" | sent -c "${accent.base}" -b "${background}"
+++ b/config.def.h
@@ -9,8 +9,8 @@ static char *fontfallbacks[] = {
#define FONTSZ(x) ((int)(10.0 * powf(1.1288, (x)))) /* x in [0, NUMFONTSCALES-1] */
static const char *colors[] = {
- "#000000", /* foreground color */
- "#FFFFFF", /* background color */
+ "${rice.color.foreground}", /* foreground color */
+ "${rice.color.background}", /* background color */
};
static const float linespacing = 1.4;
''; '';
})
];
}; };
} }

View File

@@ -1,15 +1,10 @@
{ config, pkgs, lib, system, user, allowed, secrets, ... }: { pkgs, domain, ... }:
lib.mkIf (user != "tv")
{ {
home = {
home.packages = with pkgs; [ packages = with pkgs; [ sshfs ];
sshfs file.".ssh/config".text = ''
];
home.file.".ssh/config".text = ''
HOST nxace HOST nxace
HostName nx2.site HostName ssh.${domain}
User nx2 User nx2
Port 50022 Port 50022
@@ -18,19 +13,15 @@ lib.mkIf (user != "tv")
User nx2 User nx2
Port 50022 Port 50022
HOST nxrpi
HostName nx2.site
User pi
Port 50023
HOST nxrpil HOST nxrpil
HostName 192.168.178.31 HostName 192.168.178.31
User pi User nx2
Port 50023 Port 22
HOST nxgit HOST nxgit
HostName git.nx2.site HostName ssh.${domain}
User git User git
Port 20022 Port 20022
''; '';
};
} }

View File

@@ -1,10 +1,5 @@
{ pkgs, lib, user, rice, ... }: { lib, rice, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = [
pkgs.starship
];
programs.starship = { programs.starship = {
enable = true; enable = true;
# enableBashIntegration = true; # enableBashIntegration = true;

View File

@@ -1,9 +1,6 @@
{ pkgs, lib, user, ... }: { pkgs, ... }: let
let
vws = pkgs.vale.withStyles (s: [ s.alex s.google ]); vws = pkgs.vale.withStyles (s: [ s.alex s.google ]);
in in {
lib.mkIf (user != "tv")
{
home = { home = {
packages = [ packages = [
vws vws

View File

@@ -123,7 +123,7 @@ if __name__ == "__main__":
accent = ensure_color(c=palette[0], alter_sat=False) accent = ensure_color(c=palette[0], alter_sat=False)
secondary = ensure_color(c=palette[1], alter_sat=True) secondary = ensure_color(c=palette[1], alter_sat=True)
tertiary = ensure_color(c=palette[2], alter_sat=False) tertiary = ensure_color(c=palette[2], alter_sat=False)
weird = alter_hue(ilist=secondary, hue=180) weird = alter_hue(ilist=accent, hue=80)
special = alter_hue(ilist=accent, hue=180) special = alter_hue(ilist=accent, hue=180)
foreground = alter_l(accent, 0.9) foreground = alter_l(accent, 0.9)
background = alter_l(accent, 0.1) background = alter_l(accent, 0.1)

View File

@@ -1,9 +1,6 @@
{ lib, pkgs, user, rice, ... }: { lib, pkgs, user, rice, ... }: let
let
sep = " "; sep = " ";
in in {
lib.mkIf (user != "tv")
{
home.packages = home.packages =
let let
waybar_mode_script = /*bash*/ '' waybar_mode_script = /*bash*/ ''
@@ -100,10 +97,10 @@ lib.mkIf (user != "tv")
exec = "cclock"; exec = "cclock";
restart-interval = 60; restart-interval = 60;
}; };
"custom/ctimeremaining" = { # "custom/ctimeremaining" = {
exec = "nx_gcal_event lookup"; # exec = "nx_gcal_event lookup";
restart-interval = 60; # restart-interval = 60;
}; # };
"custom/mode" = { "custom/mode" = {
exec = "cat /tmp/waybar-mode"; exec = "cat /tmp/waybar-mode";
interval = "once"; interval = "once";
@@ -184,7 +181,6 @@ lib.mkIf (user != "tv")
#clock, #clock,
#custom-cclock, #custom-cclock,
#custom-ctimeremaining,
#custom-mode, #custom-mode,
#battery, #battery,
#cpu, #cpu,

View File

@@ -1,11 +1,9 @@
{ config, pkgs, lib, user, rice,... }: { pkgs, rice,... }:
lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [ home = {
wlogout packages = with pkgs; [ wlogout ];
]; file = {
".config/wlogout/style.css".text = /* css */ ''
home.file.".config/wlogout/style.css".text = ''
* { all: unset; } * { all: unset; }
window { window {
@@ -25,15 +23,14 @@ lib.mkIf (user != "tv")
} }
button:hover { button:hover {
color: ${rice.color.blue.base} ; color: ${rice.color.blue.base};
} }
button:focus { button:focus {
color: ${rice.color.blue.base} ; color: ${rice.color.blue.base};
} }
''; '';
".config/wlogout/layout".text = /* json */ ''
home.file.".config/wlogout/layout".text = ''
{ {
"label": "lock", "label": "lock",
"action": "hyprlock", "action": "hyprlock",
@@ -83,16 +80,6 @@ lib.mkIf (user != "tv")
"keybind": "h" "keybind": "h"
} }
''; '';
# lock { background-image: image(url("./lock.png")); } };
# lock:focus { background-image: image(url("./lock-hover.png")); } };
# logout { background-image: image(url("./logout.png")); }
# logout:focus { background-image: image(url("./logout-hover.png")); }
# suspend { background-image: image(url("./suspend.png")); }
# suspend:focus { background-image: image(url("./suspend-hover.png")); }
# shutdown { background-image: image(url("./power.png")); }
# shutdown:focus { background-image: image(url("./power-hover.png")); }
# reboot { background-image: image(url("./restart.png")); }
# reboot:focus { background-image: image(url("./restart-hover.png")); }
# hibernate { background-image: image(url("./hibernate.png")); }
# hibernate:hover { background-image: image(url("./hibernate-hover.png"));}
} }

View File

@@ -1,6 +1,5 @@
{ pkgs, lib, system, user, rice, inputs, ... }: { pkgs, system, rice, inputs, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
# yazi # yazi
@@ -169,12 +168,12 @@ lib.mkIf (user != "tv")
hovered = { underline = true; }; hovered = { underline = true; };
}; };
which = { which = {
mask = { bg = "#3c3836"; }; mask = { bg = black.base; };
cand = { fg = "#83a598"; }; cand = { fg = accent.base; };
rest = { fg = "#928374"; }; rest = { fg = secondary.base; };
desc = { fg = "#fe8019"; }; desc = { fg = tertiary.base; };
separator = " "; separator = " ";
separator_style = { fg = "#504945"; }; separator_style = { fg = foreground; };
}; };
help = { help = {
on = { fg = "#fe8019"; }; on = { fg = "#fe8019"; };

36
home-modules/zathura.nix Normal file
View File

@@ -0,0 +1,36 @@
{ pkgs, rice, ... }:
{
programs.zathura = {
enable = true;
options = with rice.color; {
completion-bg = background;
completion-fg = foreground;
completion-highlight-bg = background;
completion-highlight-fg = accent.base;
default-bg = "rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString rice.transparency})";
default-fg = foreground;
highlight-active-color = "rgba(${rice.lib.hex-to-rgb-comma-string accent.base},0.5)";
highlight-color = "rgba(${rice.lib.hex-to-rgb-comma-string secondary.base},0.5)";
highlight-fg = "rgba(${rice.lib.hex-to-rgb-comma-string secondary.base},0.5)";
index-active-bg = background;
inputbar-bg = background;
inputbar-fg = foreground;
notification-bg = background;
notification-error-bg = background;
notification-error-fg = foreground;
notification-fg = foreground;
notification-warning-bg = background;
notification-warning-fg = foreground;
recolor = true;
recolor-darkcolor = foreground;
recolor-keephue = true;
recolor-lightcolor = background;
selection-clipboard = "clipboard";
statusbar-bg = black.base;
statusbar-fg = foreground;
n-completion-items = 9999999999999;
exec-command = "open";
};
};
}

View File

@@ -1,5 +1,4 @@
{ config, pkgs, lib, user, ... }: { pkgs, ... }:
lib.mkIf (user != "tv")
{ {
home.packages = [ home.packages = [
pkgs.zoxide pkgs.zoxide

View File

@@ -1,4 +1,4 @@
{ pkgs, pkgs-unstable, lib, host, user, inputs, ... }: { pkgs, pkgs-unstable, host, user, inputs, ... }:
{ {
imports = [ imports = [
./home-modules/auto-mount.nix ./home-modules/auto-mount.nix
@@ -24,9 +24,12 @@
./home-modules/latex.nix ./home-modules/latex.nix
./home-modules/mako.nix ./home-modules/mako.nix
# ./home-modules/matrix.nix # ./home-modules/matrix.nix
# ./home-modules/nm.nix
./home-modules/nh.nix ./home-modules/nh.nix
./home-modules/nixd.nix
./home-modules/nvidia.nix ./home-modules/nvidia.nix
./home-modules/nx-gcal-event.nix ./home-modules/nx2site.nix
# ./home-modules/nx-gcal-event.nix
./home-modules/obs.nix ./home-modules/obs.nix
./home-modules/office.nix ./home-modules/office.nix
./home-modules/ollama.nix ./home-modules/ollama.nix
@@ -50,17 +53,19 @@
./home-modules/waybar.nix ./home-modules/waybar.nix
./home-modules/wlogout.nix ./home-modules/wlogout.nix
./home-modules/yazi.nix ./home-modules/yazi.nix
./home-modules/zoxide.nix ]; ./home-modules/zathura.nix
./home-modules/zoxide.nix
];
home.username = user; home.username = user;
home.homeDirectory = "/home/${user}"; home.homeDirectory = "/home/${user}";
home.stateVersion = "24.05"; home.stateVersion = "24.05";
home.packages = with pkgs; [ home.packages = with pkgs; [
chromium chromium
zathura # zathura
xfce.thunar xfce.thunar
spotify # spotify
spicetify-cli spicetify-cli
swww playerctl swww playerctl
@@ -87,12 +92,14 @@
wl-clipboard wl-clipboard
xclip xclip
xournal xournal
ghostscript
inputs.zen-browser.packages."${system}".default inputs.zen-browser.packages."${system}".default
] ++ (with pkgs-unstable; [ ] ++ (with pkgs-unstable; [
obsidian obsidian
firefox firefox
spotify
]) ++ (if host != "NxACE" then (with pkgs; [ ]) ++ (if host != "NxACE" then (with pkgs; [
signal-desktop signal-desktop
zoom-us zoom-us

File diff suppressed because one or more lines are too long

7
system-modules/adb.nix Normal file
View File

@@ -0,0 +1,7 @@
{ host, lib, ... }:
lib.mkIf (host != "NxACE")
{
programs.adb = {
enable = true;
};
}

View File

@@ -1,7 +1,7 @@
{ config, pkgs, pkgs-unstable, lib, host, inputs, ... }: { config, pkgs, pkgs-unstable, lib, host, domain, inputs, ... }:
let let
grub-theme-ascii-diana = (pkgs.fetchFromGitea { grub-theme-ascii-diana = (pkgs.fetchFromGitea {
domain = "git.nx2.site"; domain = "git.${domain}";
owner = "nx2"; owner = "nx2";
repo = "grub-theme-ascii-diana"; repo = "grub-theme-ascii-diana";
rev = "0.5.0"; rev = "0.5.0";

View File

@@ -1,5 +1,4 @@
{ pkgs, user, host, lib, ... }: { pkgs, user, ... }:
if (host != "NxACE") then
{ {
services.greetd = { services.greetd = {
enable = true; enable = true;
@@ -23,30 +22,3 @@ if (host != "NxACE") then
TTYVTDisallocate = true; TTYVTDisallocate = true;
}; };
} }
else
{
environment.systemPackages = with pkgs; [
sddm
# where-is-my-sddm-theme
];
services.xserver = {
displayManager = {
defaultSession = "hyprland";
sddm = {
enable = true;
# theme = "where_is_my_sddm_theme";
settings = {
theme = {
# background = /home/nx2/Pictures/
passwordFontSize = 12;
passwordInputCursorVisible = true;
};
};
};
autoLogin = lib.mkIf (host == "NxACE") {
enable = true;
user = "tv";
};
};
};
}

View File

@@ -13,4 +13,9 @@
# }; # };
}; };
users.users."${user}".extraGroups = [ "docker" ]; users.users."${user}".extraGroups = [ "docker" ];
networking.firewall.allowedTCPPorts = [
80
443
8384
];
} }

View File

@@ -1,28 +1,87 @@
{ pkgs-unstable, ... }: { pkgs, pkgs-unstable, ... }:
{ {
# i18n.inputMethod = {
# type = "fcitx5";
# enable = true;
# fcitx5.addons = with pkgs; [
# fcitx5-gtk # alternatively, kdePackages.fcitx5-qt
# fcitx5-chinese-addons # table input method support
# fcitx5-nord # a color theme
# ];
# };
i18n.inputMethod = { i18n.inputMethod = {
enabled = "fcitx5"; enabled = "fcitx5";
# type = "fcitx5"; # for later than 24.05 fcitx5.waylandFrontend = true;
# enable = true; fcitx5.addons = with pkgs; [
fcitx5 = { fcitx5-gtk # alternatively, kdePackages.fcitx5-qt
waylandFrontend = true; fcitx5-chinese-addons # table input method support
addons = with pkgs-unstable; [ fcitx5-nord # a color theme
rime-data
fcitx5-rime
fcitx5-gtk
fcitx5-chinese-addons
fcitx5-catppuccin
]; ];
}; };
}; # i18n.inputMethod = {
services.xserver.desktopManager.runXdgAutostartIfNone = true; # enabled = "fcitx5";
environment.variables = { # ignoreUserConfig = true;
GLFW_IM_MODULE = "fcitx"; # waylandFrontend = true;
GTK_IM_MODULE = "fcitx"; # fcitx5 = {
INPUT_METHOD = "fcitx"; # addons = with pkgs-unstable; [
XMODIFIERS = "@im=fcitx"; # rime-data
IMSETTINGS_MODULE = "fcitx"; # fcitx5-rime
QT_IM_MODULE = "fcitx";
SDL_IM_MODULE = "fcitx"; # # Chinese
}; # fcitx5-chinese-addons
# fcitx5-table-extra
# fcitx5-pinyin-moegirl
# fcitx5-pinyin-zhwiki
# # Japanese
# # fcitx5-mozc
# ];
# settings = {
# globalOptions = {
# Hotkey = {
# # Enumerate when press trigger key repeatedly
# EnumerateWithTriggerKeys = "True";
# # Skip first input method while enumerating
# EnumerateSkipFirst = "False";
# };
# "Hotkey/EnumerateForwardKeys" = { "0" = "Control+space"; };
# "Hotkey/EnumerateBackwardKeys" = { "0" = "Control+Shift+space"; };
# "Hotkey/PrevPage" = { "0" = "Up"; };
# "Hotkey/NextPage" = { "0" = "Down"; };
# "Hotkey/PrevCandidate" = { "0" = "Shift+Tab"; };
# "Hotkey/NextCandidate" = { "0" = "Tab"; };
# Behavior = {
# ActiveByDefault = "False"; # Active By Default
# ShareInputState = "No"; # Share Input State
# PreeditEnabledByDefault = "True"; # Show preedit in application
# ShowInputMethodInformation = "True"; # Show Input Method Information when switch input method
# showInputMethodInformationWhenFocusIn = "False"; # Show Input Method Information when changing focus
# CompactInputMethodInformation = "True"; # Show compact input method information
# ShowFirstInputMethodInformation = "True"; # Show first input method information
# DefaultPageSize = "5"; # Default page size
# OverrideXkbOption = "False"; # Override Xkb Option
# PreloadInputMethod = "True"; # Preload input method to be used by default
# };
# };
# inputMethod = {
# "Groups/0" = {
# "Name" = "Default";
# "Default Layout" = "us";
# "DefaultIM" = "mozc";
# };
# "Groups/0/Items/0" = {
# "Name" = "keyboard-us";
# "Layout" = null;
# };
# "Groups/0/Items/1" = {
# "Name" = "mozc";
# "Layout" = null;
# };
# "GroupOrder" = {
# "0" = "Default";
# };
# };
# };
# };
# };
} }

View File

@@ -1,7 +1,12 @@
{ config, pkgs, ...}: { config, pkgs, ...}:
{ {
environment.systemPackages = with pkgs; [ environment = {
systemPackages = with pkgs; [
jmtpfs jmtpfs
simple-mtpfs
android-file-transfer
]; ];
};
programs.fuse.userAllowOther = true;
} }

View File

@@ -16,7 +16,7 @@
fileSystems = if host != "NxACE" then { fileSystems = if host != "NxACE" then {
"/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; }; "/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
"/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; }; "/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; };
"/home/${user}/shared" = { device = "/dev/disk/by-label/shared"; fsType = "ntfs"; options = [ "uid:1000" "gid:100" ]; }; "/home/${user}/shared" = { device = "/dev/disk/by-label/shared"; fsType = "ntfs"; options = [ "uid=1000" "gid=100" ]; };
} else { } else {
"/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; }; "/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
"/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; }; "/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; };

View File

@@ -1,4 +1,4 @@
{ config, lib, host, secrets, ... }: { pkgs, lib, host, secrets, ... }:
{ {
# sops.secrets = { # sops.secrets = {
# "wireless-networking.env" = {}; # "wireless-networking.env" = {};
@@ -13,29 +13,20 @@
networkmanager = { networkmanager = {
enable = true; enable = true;
}; };
enableIPv6 = false; enableIPv6 = true;
firewall.allowedTCPPorts = [ firewall.allowedTCPPorts = [
80 80
443 443
]; ];
# wireless = { };
# enable = true; environment.etc = {
# environmentFile = config.sops.secrets."wireless-networking.env"; "ssl/certs/tuda-eduroam-root.crt".source = "${pkgs.cacert.unbundled}/etc/ssl/certs/T-TeleSec_GlobalRoot_Class_2:1.crt";
# networks = { };
# eduroam = lib.mkIf (host == "NxXPS") { sops.secrets = {
# auth = '' "eduroam/tuda_nmconnection" = {
# ssid="eduroam" mode = "0600";
# key_mgmt=WPA-EAP owner = "root";
# eap=PEAP path = "/etc/NetworkManager/system-connections/eduroam.nmconnection";
# identity=${secrets.email.tuda.tuid}lan01@tu-darmstadt.de };
# password="@NXXPSEDUROAMPW@"
# domain_suffix_match="radius.hrz.tu-darmstadt.de"
# anonymous_identity="eduroam@tu-darmstadt.de"
# phase2="auth=MSCHAPV2"
# ca_cert="/etc/ssl/certs/ca-bundle.crt"
# '';
# };
# };
# };
}; };
} }

8
system-modules/nixd.nix Normal file
View File

@@ -0,0 +1,8 @@
{ inputs, ... }:
{
nix.nixPath = [
"nixpkgs=${inputs.nixpkgs}"
"nixpkgs-unstable=${inputs.nixpkgs-unstable}"
"nixpkgs-latest=${inputs.nixpkgs-latest}"
];
}

View File

@@ -1,45 +1,47 @@
{ config, pkgs, lib, user, host, ... }: { config, pkgs, domain, secrets, ... }:
# lib.mkIf false
lib.mkIf (host == "NxACE")
# ((import ./nx2site/proxy.nix { inherit config pkgs lib user; }) //
(
{ {
sops.secrets = { sops.secrets = {
"nx2site/namecheap.pw" = { }; "nx2site/namecheap.pw" = { };
# "nx2site/cloudflare/api-token-dns-edit" = { };
"nx2site/cloudflare/global-api-key" = { };
}; };
systemd = { systemd = {
timers."namecheap-dynamic-dns" = { timers."dynamic-dns" = {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = {
OnBootSec = "2m"; OnBootSec = "2m";
OnUnitActiveSec = "10m"; OnUnitActiveSec = "10m";
Unit = "namecheap-dynamic-dns.service"; Unit = "dynamic-dns.service";
}; };
}; };
services."namecheap-dynamic-dns" = let services."dynamic-dns" = let
u = let u = let
domain = "nx2.site"; account_id = secrets.email.gmail-online.mail;
passord-file-path = config.sops.secrets."nx2site/namecheap.pw".path; zone_id = "33fecab36e060f49d492127345ea95a0";
# passord-file-path = config.sops.secrets."nx2site/namecheap.pw".path; record_id = {
log-file-path = "/var/log/update_namecheap.log"; base = "58d3412e8d88889d1a611b3669f0700f";
count-file-path = "/var/log/update_namecheap-count.txt"; sub = "fc861353142bc05d5dbad1799178e6a1";
in pkgs.writers.writePython3Bin "update_namecheap" { base6 = "d1b90e21d2d747dcb30448bd65312927";
sub6 = "b8082b7afe9e80971fc9f9dda16ec284";
};
passord-file-path = config.sops.secrets."nx2site/cloudflare/global-api-key".path;
log-file-path = "/var/log/couldflare.log";
count-file-path = "/var/log/cloudflare-count.txt";
in pkgs.writers.writePython3Bin "dyn_dns" {
libraries = with pkgs.python311Packages; [ requests ]; libraries = with pkgs.python311Packages; [ requests ];
flakeIgnore = [ "E501" "E305" "E701" "E704" "E302" "E114" "F841" ]; flakeIgnore = [ "E501" "E305" "E701" "E704" "E302" "E114" "F841" "E121" "E261" "E303"];
} '' } /* python */ ''
import requests import requests
import argparse import subprocess
import socket
from datetime import datetime from datetime import datetime
def get_public_ip(): return requests.get('https://ipinfo.io/ip').text.strip() def get_public_ip(ipv6=False):
return subprocess.run(['${pkgs.curl}/bin/curl', '-s', '-6' if ipv6 else '-4', 'https://ifconfig.me'], capture_output=True, text=True).stdout.strip()
def get_dns_ip(): return socket.gethostbyname_ex('${domain}')[2][0] def main():
def main(force_update):
my_ip = get_public_ip() my_ip = get_public_ip()
dns_ip = get_dns_ip() my_ip6 = get_public_ip(ipv6=True)
with open("${count-file-path}", "r") as f: with open("${count-file-path}", "r") as f:
content = f.read() content = f.read()
@@ -49,73 +51,136 @@ lib.mkIf (host == "NxACE")
with open("${count-file-path}", "w") as f: with open("${count-file-path}", "w") as f:
f.write(str(count)) f.write(str(count))
if not (force_update or my_ip != dns_ip): # 4
print(f"Host IP and DNS response are both {my_ip} --> No Action") with open("${passord-file-path}", 'r') as pw_file:
exit(0) pw = pw_file.read().strip()
else:
with open("${passord-file-path}", 'r') as pw_file: pw = pw_file.read().strip()
# Perform DNS updates # Perform DNS updates
resp_base = requests.get(f"https://dynamicdns.park-your-domain.com/update?host=@&domain=${domain}&password={pw}&ip={my_ip}") # https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-update-dns-record
resp_subd = requests.get(f"https://dynamicdns.park-your-domain.com/update?host=*&domain=${domain}&password={pw}&ip={my_ip}") resp_base = requests.patch(
'https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records/${record_id.base}',
headers={
'Content-Type': 'application/json',
'X-Auth-Email': '${account_id}',
'X-Auth-Key': pw
},
json={
"comment": "Domain verification record",
"name": "${domain}",
"proxied": True,
"settings": {},
"tags": [],
"ttl": 1, # automatic
"content": my_ip,
"type": "A"
}
)
resp_subd = requests.patch(
'https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records/${record_id.sub}',
headers={
'Content-Type': 'application/json',
'X-Auth-Email': '${account_id}',
'X-Auth-Key': pw
},
json={
"comment": "Domain verification record",
"name": "${domain}",
"proxied": True,
"settings": {},
"tags": [],
"ttl": 1, # automatic
"content": my_ip,
"type": "A"
}
)
if resp_base.status_code != 200:
print(resp_base.text)
# Reset the count file
with open("${count-file-path}", 'w') as f: f.write('0')
now_str = datetime.now().strftime('%Y/%m/%d-%R') now_str = datetime.now().strftime('%Y/%m/%d-%R')
log_entry = f"At {now_str} - from {dns_ip} to {my_ip} - {count} times - Response {resp_base.status_code}{' - (forced)' if force_update else ' '}\n" log_entry = f"At {now_str} - to {my_ip} - Response {resp_base.status_code}\n"
print(log_entry, end="")
with open("${log-file-path}", 'a') as log_file:
log_file.write(log_entry)
# Perform DNS updates
# https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-update-dns-record
resp_base = requests.patch(
'https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records/${record_id.base6}',
headers={
'Content-Type': 'application/json',
'X-Auth-Email': '${account_id}',
'X-Auth-Key': pw
},
json={
"comment": "Domain verification record",
"name": "${domain}",
"proxied": True,
"settings": {},
"tags": [],
"ttl": 1, # automatic
"content": my_ip6,
"type": "AAAA"
}
)
resp_subd = requests.patch(
'https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records/${record_id.sub6}',
headers={
'Content-Type': 'application/json',
'X-Auth-Email': '${account_id}',
'X-Auth-Key': pw
},
json={
"comment": "Domain verification record",
"name": "${domain}",
"proxied": True,
"settings": {},
"tags": [],
"ttl": 1, # automatic
"content": my_ip6,
"type": "AAAA"
}
)
if resp_base.status_code != 200:
print(resp_base.text)
now_str = datetime.now().strftime('%Y/%m/%d-%R')
log_entry = f"At {now_str} - to {my_ip6} - Response {resp_base.status_code}\n"
print(log_entry, end="") print(log_entry, end="")
with open("${log-file-path}", 'a') as log_file: log_file.write(log_entry) with open("${log-file-path}", 'a') as log_file: log_file.write(log_entry)
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser() main()
parser.add_argument('-f', '--force', action='store_true', help='Force update')
args = parser.parse_args()
main(args.force)
''; '';
in { in {
script = '' script = ''
set -eu set -eu
${u}/bin/update_namecheap ${u}/bin/dyn_dns
''; '';
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "root";
}; };
}; };
}; };
# I can't use this becasue API Access for Namecheap needs a static whitelisted IP, which I don't have
# security.acme = {
# acceptTerms = true;
# certs."nx2site" = { };
# };
environment.systemPackages = with pkgs; [
certbot
(writeShellApplication {
name = "refresh_ssl_certificate";
runtimeInputs = [ certbot ];
# https://forum.endeavouros.com/t/tutorial-add-a-systemd-boot-loader-menu-entry-for-a-windows-installation-using-a-separate-esp-partition/37431
text = let
webroot = /home/nx2/nx2site/staticweb/content;
in /*bash*/ ''
cartbot
ls ${webroot}
'';
})
];
networking.hosts = { # docker network inspect nx2site_default | grep -E "Name|IPv4" | tr "\n" " " | sed -r 's- +- -g;s-\n?"Name": -\n-g' | sed -r '1d;2d;s-"(.+?)", "IPv4Address": "(.+)/16",- "\2" = [ "\1.docker" ];-g' networking.hosts = { # docker network inspect nx2site_default | grep -E "Name|IPv4" | tr "\n" " " | sed -r 's- +- -g;s-\n?"Name": -\n-g' | sed -r '1d;2d;s-"(.+?)", "IPv4Address": "(.+)/16",- "\2" = [ "\1.docker" ];-g'
"172.1.2.1" = [ "staticweb.docker" ]; # "172.1.2.1" = [ "staticweb.docker" ];
"172.1.3.1" = [ "matrix.docker" ]; # "172.1.3.1" = [ "matrix.docker" ];
# "172.1.0.9" = [ "matrixdb.docker" ]; # "172.1.0.9" = [ "matrixdb.docker" ];
"172.1.4.1" = [ "matrix-ss.docker" ]; # "172.1.4.1" = [ "matrix-ss.docker" ];
# "172.1.0.7" = [ "matrix-ssdb.docker" ]; # "172.1.0.7" = [ "matrix-ssdb.docker" ];
"172.1.5.1" = [ "pw.docker" ]; "172.1.5.1" = [ "pw.docker" ];
"172.1.6.1" = [ "git.docker" ]; "172.1.6.1" = [ "git.docker" ];
# "172.1.0.10" = [ "gitdb.docker" ]; # "172.1.0.10" = [ "gitdb.docker" ];
"172.1.7.1" = [ "nn.docker" ]; # "172.1.7.1" = [ "nn.docker" ];
"172.1.8.1" = [ "llm.docker" ]; # "172.1.8.1" = [ "llm.docker" ];
# "172.1.9.1" = [ "proxy.docker" ]; # "172.1.9.1" = [ "proxy.docker" ];
"172.1.10.1" = [ "share.docker" ]; # "172.1.10.1" = [ "share.docker" ];
"172.1.11.1" = [ "odq.docker" ]; # "172.1.11.1" = [ "odq.docker" ];
}; };
}) }

View File

@@ -0,0 +1,71 @@
{ config, pkgs-unstable, domain, ... }:
{
sops.secrets = {
"postgres-pw" = { owner = "gitea"; };
};
services.gitea = {
enable = true;
package = pkgs-unstable.gitea;
group = "gitea"; # default
user = "gitea"; # default
appName = "NxGit";
stateDir = "/var/lib/gitea"; # default
useWizard = false; # default
# camoHmacKeyFile = ;
customDir = "${config.services.gitea.stateDir}/custom"; # default
database = {
createDatabase = false; # default
host = "127.0.0.1"; # default
port = 5432;
passwordFile = config.sops.secrets."postgres-pw".path;
# path = "${config.services.gitea.stateDir}/data/gitea.db"; # default
# socket = "/run/postgresql";
socket = null;
type = "postgres";
name = "gitea"; # default
user = "gitea"; # default
};
dump = {
enable = true;
backupDir = "${config.services.gitea.stateDir}/dump"; # default
file = null; # default
interval = "daily";
type = "zip"; # default
};
extraConfig = null; # default
lfs = {
enable = false; # default
contentDir = "${config.services.gitea.stateDir}/data/lfs"; # default
};
mailerPasswordFile = null; # default
metricsTokenFile = null; # default
repositoryRoot = "${config.services.gitea.stateDir}/repositories"; # default
settings = {
log = {
LEVEL = "Info";
# LEVEL = "Error";
ROOT_PATH = "${config.services.gitea.stateDir}/log"; # default
};
i18n = {
LANGS = "en-US";
};
server = {
DISABLE_SSH = false; # default
SSH_PORT = 20022;
DOMAIN = "pw2.${domain}";
HTTP_ADDR = "http://${config.services.gitea.settings.server.DOMAIN}:${toString config.services.gitea.settings.server.HTTP_PORT}/";
HTTP_PORT = 3000; # default
PROTOCOL = "http"; # default
ROOT_URL = "https:pw2.${domain}/"; # default
STATIC_ROOT_PATH = "${config.services.gitea.stateDir}/static";
};
session = {
COOKIE_SECURE = true;
};
service = {
DISABLE_REGISTRATION = true;
};
};
};
}

View File

@@ -1,35 +1,56 @@
{ config, pkgs, lib, user }: { config, pkgs, lib, domain, ... }:
lib.mkIf false
{ {
sops.secrets = { sops.secrets = {
"nx2site/sslCertificate.pem" = { owner = config.services.nginx.user; }; "nx2site/sslCertificate.pem" = { owner = config.services.nginx.user; };
"nx2site/sslCertificateKey.pem" = { owner = config.services.nginx.user; }; "nx2site/sslCertificateKey.pem" = { owner = config.services.nginx.user; };
"nx2site/dhparams.pem" = { owner = config.services.nginx.user; }; "nx2site/dhparams.pem" = { owner = config.services.nginx.user; };
}; };
services.nginx = { security.acme = {
acceptTerms = true;
defaults = {
email = "acme@${domain}";
webroot = "/var/nginx/webroot";
group = "nginx";
};
certs = {
"${domain}" = {
extraDomainNames = builtins.map (subd: "${subd}.${domain}") [ "git" "git2" "pw" "pw2" "sync" ];
};
};
};
users.users."nginx" = {
extraGroups = [ "nginx" "acme" ];
useDefaultShell = false;
linger = true;
home = "/var/nginx/";
homeMode = "770";
createHome = true;
isSystemUser = true;
isNormalUser = false;
};
systemd.services.nginx.serviceConfig.ProtectHome = "read-only";
services.nginx = let
dl = [
{ addr = "0.0.0.0"; port = 443; ssl = true; }
{ addr = "0.0.0.0"; port = 80; ssl = false; }
{ addr = "[::0]"; port = 443; ssl = true; }
{ addr = "[::0]"; port = 80; ssl = false; }
];
in {
enable = true; enable = true;
user = "nginx";
group = "nginx";
additionalModules = []; additionalModules = [];
# appendConfig = ''''; # appendConfig = '''';
clientMaxBodySize = "20m"; clientMaxBodySize = "20m";
defaultHTTPListenPort = 80; defaultHTTPListenPort = 80;
defaultListenAddresses = [ "0.0.0.0" ] ++ lib.optional config.networking.enableIPv6 "[::0]"; defaultListenAddresses = [ "0.0.0.0" ] ++ lib.optional config.networking.enableIPv6 "[::0]";
defaultListen = [ { defaultListen = dl;
addr = "0.0.0.0";
ssl = true;
port = 443;
proxyProtocol = true;
}];
defaultMimeTypes = "${pkgs.mailcap}/etc/nginx/mime.types"; defaultMimeTypes = "${pkgs.mailcap}/etc/nginx/mime.types";
defaultSSLListenPort = 443; defaultSSLListenPort = 443;
enableQuicBPF = true; enableQuicBPF = true;
enableReload = true; enableReload = true;
# eventsConfig = '''';
# logError = ;
# mapHashBucketSize = ;
# mapHashMaxSize = ;
package = pkgs.nginxQuic; package = pkgs.nginxQuic;
# preStart = true;
proxyResolveWhileRunning = false; proxyResolveWhileRunning = false;
proxyTimeout = "20s"; proxyTimeout = "20s";
recommendedBrotliSettings = true; recommendedBrotliSettings = true;
@@ -39,142 +60,81 @@ lib.mkIf false
recommendedTlsSettings = true; recommendedTlsSettings = true;
recommendedZstdSettings = true; recommendedZstdSettings = true;
serverTokens = false; serverTokens = false;
# sslCiphers = true;
sslDhparam = config.sops.secrets."nx2site/dhparams.pem".path; sslDhparam = config.sops.secrets."nx2site/dhparams.pem".path;
sslProtocols = "TLSv1.2 TLSv1.3"; sslProtocols = "TLSv1.2 TLSv1.3";
statusPage = false; statusPage = false;
streamConfig = ""; # udp config streamConfig = ""; # udp config
validateConfigFile = true; validateConfigFile = true;
upstreams = {
"staticweb".servers = { "staticweb.docker:80" = {}; };
"matrix".servers = { "matrix.docker:80" = {}; };
"matrix-ss".servers = { "matrix-ss.docker:80" = {}; };
"pw".servers = { "pw.docker:80" = {}; };
"git".servers = { "git.docker:80" = {}; };
"nn".servers = { "nn.docker:80" = {}; };
"llm".servers = { "llm.docker:80" = {}; };
"share".servers = { "share.docker:80" = {}; };
"sync".servers = { "localhost:8384" = {}; };
};
virtualHosts = let virtualHosts = let
sslCertificate = config.sops.secrets."nx2site/sslCertificate.pem".path; vh = {
sslCertificateKey = config.sops.secrets."nx2site/sslCertificateKey.pem".path; kTLS = true;
kTLS = true; http2 = true; http3 = true; http3_hq = true; quic = true; http2 = true;
in http3 = true;
{ http3_hq = true;
"nx2.site" = { quic = true;
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic; addSSL = true;
listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ]; enableACME = true;
};
in {
"${domain}" = vh // {
root = "/var/nginx/webroot";
default = true;
listen = dl;
locations = { locations = {
"/" = { "/" = {
proxyPass = "http://staticweb"; extraConfig = ''
# extraConfig = [ ''add_header Alt-Svc 'h3=":443"; ma=86400';'' ''add_header Cache-Control "public";'' ] ++ common-location-conf; index index.html;
if ($request_uri ~ ^/(.*)\.html(\?|$)) {
return 301 /$1;
}
try_files $uri $uri.html $uri/ /404.html =404;
'';
}; };
"/.well-known/matrix/client" = { "~^(/ba)$" = { return = "301 /BA.pdf"; };
return = ''200 '{"m.homeserver": {"base_url": "https://matrix.nx2.site"}, "org.matrix.msc3575.proxy": {"url": "https://matrix-ss.nx2.site"}}' ''; "/.well-known/matrix/client" = { return = "502"; };
extraConfig = [ "default_type application/json;" "add_header Access-Control-Allow-Origin *;" ]; "/.well-known/matrix/server" = { return = "502"; };
};
"/.well-known/matrix/server" = {
return = ''200 '{"m.server":"matrix.nx2.site:443"}' '';
extraConfig = [ "default_type application/json;" "add_header Access-Control-Allow-Origin *;" ];
};
"~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync)" = {
proxyPass = "http://matrix-ss";
# extraConfig = [ ''proxy_set_header X-Forwarded-For $remote_addr;'' ''proxy_set_header X-Forwarded-Proto $scheme;'' ''proxy_set_header Host $host;'' ];
};
"~ ^(\/_matrix|\/_synapse\/client)" = {
return = ''200 '{"m.server":"matrix.nx2.site:443"}' '';
# extraConfig = [];
}; };
}; };
"matrix.${domain}" = {
listen = dl;
locations = { "~.*" = { return = "502"; }; };
}; };
"matrix.nx2.site" = { "pw.${domain}" = vh // {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic; listen = dl;
listen = [ locations = let d = "pw.docker:80"; in {
{ addr = "0.0.0.0"; port = 443; ssl = true; } "/" = { proxyPass = "http://${d}"; };
{ addr = "0.0.0.0"; port = 8448; ssl = true; } "/admin" = { proxyPass = "http://${d}"; };
]; "/notifications/hub" = { proxyPass = "http://${d}"; };
locations = { "/notifications/hub/negotiate" = { proxyPass = "http://${d}"; };
"/" = {
proxyPass = "http://matrix";
# extraConfig = [ ''add_header Alt-Svc 'h3=":443"; ma=86400';'' ''add_header Cache-Control "public";'' ] ++ common-location-conf;
}; };
}; };
}; "pw2.${domain}" = vh // {
"matrix-ss.nx2.site" = { listen = dl;
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic; locations = let d = "127.0.0.1:3000"; in {
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ]; "/" = { proxyPass = "http://${d}"; };
# "resolver 1.1.1.1;" "/admin" = { proxyPass = "http://${d}"; };
# "client_max_body_size 500M;" "/notifications/hub" = { proxyPass = "http://${d}"; };
# ]; "/notifications/hub/negotiate" = { proxyPass = "http://${d}"; };
locations = {
"/" = { proxyPass = "http://pw"; };
}; };
}; };
# "dev.nx2.site" = { "sync.${domain}" = vh // {
# inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic; listen = dl;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ]; locations = { "/" = { proxyPass = "http://127.0.0.1:11434"; }; };
# locations = {
# "/" = {
# proxyPass = "http://dev";
# };
# };
# };
"pw.nx2.site" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
locations = {
"/" = { proxyPass = "http://pw"; };
"/admin" = { proxyPass = "http://pw"; };
"/notifications/hub" = { proxyPass = "http://pw"; };
"/notifications/hub/negotiate" = { proxyPass = "http://pw"; };
}; };
"git.${domain}" = vh // {
listen = dl;
locations = { "/" = { proxyPass = "http://git.docker:3000"; }; };
}; };
"share.nx2.site" = { "git2.${domain}" = vh // {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic; listen = dl;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ]; locations = { "/" = { proxyPass = "http://127.0.0.1:8222"; }; };
locations = {
"/" = { proxyPass = "http://share"; # ''proxy_hide_header Content-Disposition;''
# ''proxy_set_header Content-Disposition $upstream_http_content_disposition;''
# ''proxy_set_header X-Real-IP $remote_addr;''
# ''proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;''
# ''proxy_set_header Host $http_host;''
# ];
};
"/socket.io" = {
proxyPass = "http://share/socket.io";
proxyWebsockets = true;
# extraConfig = [
# ''proxy_http_version 1.1;''
# ''proxy_set_header Upgrade $http_upgrade;''
# ''proxy_set_header Connection "upgrade";''
# ];
};
};
};
"sync.nx2.site" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
locations = {
"/" = { proxyPass = "http://sync"; };
};
};
"git.nx2.site" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
locations = {
"/" = { proxyPass = "http://git"; };
};
};
"~^(.*)\.nx2\.site$" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
root = "/home/nx2/nx2site/staticweb/xcontent/";
locations = {
"~.*" = { return = "502 /502.html"; };
}; };
"~^(.*).${domain}$" = {
listen = dl;
root = "/var/nginx/webroot";
locations = { "~.*" = { return = "301 https://${domain}/502.html"; }; };
}; };
}; };
}; };
} }

View File

View File

@@ -0,0 +1,83 @@
{ config, pkgs, lib, user, ... }:
{
services = {
postgresql = {
enable = true;
package = pkgs.postgresql_12;
dataDir = "/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}"; # default
# identMap = ''
# ${user} ${user} ${user}
# '';
enableJIT = false; # default
initdbArgs = []; # default
checkConfig = true; # default
enableTCPIP = false;
# # extraPlugins =
initialScript = null; # default
authentication = lib.mkForce ''
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust #scram-sha-256
host all all ::1/128 trust #scram-sha-256
'';
# recoveryConfig = null;
ensureDatabases = [
"gitea"
# "vaultwarden"
];
settings = {
port = 5432; # default
listen_addresses = "localhost";
log_line_prefix = "[%p] "; # default
shared_preload_libraries = [ ]; # default
};
ensureUsers = [
# {
# name = "${user}";
# ensureDBOwnership = false;
# ensureClauses = {
# login = true;
# # inherit
# createdb = true;
# bypassrls = true;
# superuser = true;
# createrole = true;
# replication = true;
# };
# }
{
# as liong as there is no declarative user management you gotta set a pw by hand
# sudo -u postgres psql -c "ALTER USER gitea PASSWORD 'new-passwd';"
name = "gitea";
ensureDBOwnership = true;
}
];
};
# postgresqlBackup = {
# enable
# startAt
# location
# databases
# backupAll
# compression
# }
# postgresqlWalReceiver.receivers."main" = {
# postgresqlPackage = pkgs.postgresql_15;
# directory = /mnt/pg_wal/main/;
# slot = "main_wal_receiver";
# connection = "postgresql://user@somehost";
# compress
# extraArgs
# synchronous
# environment
# statusInterval
# };
# }
};
}

View File

@@ -1,5 +1,10 @@
{ config, lib, user, host, secrets, ...}: {
let config,
lib,
user,
host,
secrets,
... }: let
# helper funcitons # helper funcitons
conv = _: device: with device; { "${name}" = {id = id;};}; conv = _: device: with device; { "${name}" = {id = id;};};
justname = devices: (builtins.map (device: device.name)) devices; justname = devices: (builtins.map (device: device.name)) devices;
@@ -24,15 +29,11 @@ let
daniel-dcim = { name = "daniel-dcim"; path = "/vault/Pictures/Daniel"; }; daniel-dcim = { name = "daniel-dcim"; path = "/vault/Pictures/Daniel"; };
tessa-dcim = { name = "tessa-dcim"; path = "/vault/Pictures/Tessa"; }; tessa-dcim = { name = "tessa-dcim"; path = "/vault/Pictures/Tessa"; };
}; };
in in {
lib.mkIf (user != "tv")
{
sops.secrets = { sops.secrets = {
"syncthing/${host}/cert.pem" = { owner = user; }; "syncthing/${host}/cert.pem" = { owner = user; };
"syncthing/${host}/key.pem" = { owner = user; }; "syncthing/${host}/key.pem" = { owner = user; };
}; };
services.syncthing = with (builtins.mapAttrs conv devices); { services.syncthing = with (builtins.mapAttrs conv devices); {
enable = true; enable = true;
user = "${user}"; user = "${user}";

View File

@@ -1,22 +1,31 @@
{ pkgs, lib, host, user, ... }: { pkgs, user, ... }:
{ {
users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish
users.users."${user}" = { users.users."${user}" = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" "audio" "video" "docker" "libvirtd" "uinput" "input" "ydotool" ]; extraGroups = [
"networkmanager"
"wheel"
"audio"
"video"
"docker"
"libvirtd"
"uinput"
"input"
"ydotool"
"acme"
"nginx"
"adbusers"
"gitea"
"postgres"
];
useDefaultShell = true; useDefaultShell = true;
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID1RPCcS8DtIf75a2FEW4d8X6WTVeLlmretoLqppvZlJ" # From [A] GPG Sub Key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID1RPCcS8DtIf75a2FEW4d8X6WTVeLlmretoLqppvZlJ" # From [A] GPG Sub Key
]; ];
}; };
users.users.tv = lib.mkIf (host == "NxACE") {
isNormalUser = true;
extraGroups = [ "networkmanager" "audio" "video" "uinput" ];
useDefaultShell = true;
};
programs = { programs = {
bash = { bash = {