Compare commits

...

25 Commits

Author SHA1 Message Date
Lennart J. Kurzweg (Nx2)
c61e6c9980 whoops, i need git-crypt 2024-09-04 17:20:09 +02:00
Lennart J. Kurzweg (Nx2)
d626a5bd7d Merge branch 'master' of ssh://git.nx2.site:20022/nx2/dotfiles 2024-09-04 17:17:16 +02:00
Lennart J. Kurzweg (Nx2)
5eda39414a flake.lock update 2024-09-04 17:12:59 +02:00
Lennart J. Kurzweg (Nx2)
cbe9371e66 better hotkeys 2024-09-04 17:12:41 +02:00
Lennart J. Kurzweg (Nx2)
a10b22b9e3 better fish aliases 2024-09-04 17:12:20 +02:00
Lennart J. Kurzweg (Nx2)
fd3ca3a1d3 fctix autostart + exec-once cleanup 2024-09-04 17:11:25 +02:00
Lennart J. Kurzweg (Nx2)
f2589a350d shared owned by nx2 2024-09-04 17:10:46 +02:00
Lennart J. Kurzweg (Nx2)
f24b4ae320 zen-browser through flake 2024-09-04 17:10:15 +02:00
Lennart J. Kurzweg (Nx2)
689ef45935 ooo 2024-09-04 17:08:09 +02:00
Lennart J. Kurzweg (Nx2)
2492c5bd80 vesktop signin fix 2024-09-04 17:00:36 +02:00
Lennart J. Kurzweg (Nx2)
c9c6423bb3 fcitx5 + katana 2024-09-04 17:00:12 +02:00
Lennart J. Kurzweg (Nx2)
d7cc5f77d7 colors from wallpapers 2024-09-04 16:59:05 +02:00
Lennart J. Kurzweg (Nx2)
20f8ea51c6 screen 2024-08-26 23:24:57 +02:00
Lennart J. Kurzweg (Nx2)
52d81b9175 ip range fix 2024-08-26 23:24:45 +02:00
Lennart J. Kurzweg (Nx2)
befa7fe91e Merge branch 'master' of ssh://git.nx2.site:20022/nx2/dotfiles 2024-08-26 21:38:01 +02:00
Lennart J. Kurzweg (Nx2)
4eead91953 syncthing+nx2site(trying) 2024-08-26 21:37:36 +02:00
Lennart J. Kurzweg (Nx2)
ce84d681e0 ++++++ 2024-08-26 21:25:51 +02:00
Lennart J. Kurzweg (Nx2)
5d1d2c49e5 Merge branch 'master' of ssh://git.nx2.site:20022/nx2/dotfiles 2024-07-28 17:19:29 +02:00
Lennart J. Kurzweg (Nx2)
73b0e338fc nx2site save (unused) 2024-07-28 17:19:25 +02:00
Lennart J. Kurzweg (Nx2)
4b42af4523 merge north master 2024-07-23 17:45:11 +02:00
Lennart J. Kurzweg (Nx2)
1e0af7a61b flake restructure 2024-07-23 17:35:57 +02:00
Lennart J. Kurzweg (Nx2)
ad784f41f9 new ollama 2024-07-23 14:08:49 +02:00
Lennart J. Kurzweg (Nx2)
ad885f7675 nvidia 555 2024-07-23 14:08:38 +02:00
Lennart J. Kurzweg (Nx2)
97ef1500ab switch to zen for north 2024-07-23 14:08:25 +02:00
Lennart J. Kurzweg (Nx2)
d29a12094a chtterino new token 2024-07-23 14:08:05 +02:00
38 changed files with 1569 additions and 1092 deletions

View File

@@ -1,31 +1,33 @@
{ pkgs, pkgs-unstable, lib, inputs, allowed, nvidia, ... }:
{ pkgs, inputs, ... }:
{
imports = [
inputs.sops-nix.nixosModules.sops
./system-modules/hardware-configuration.nix
./system-modules/fuse.nix
./system-modules/nvidia.nix
./system-modules/users.nix
./system-modules/sound.nix
./system-modules/fonts.nix
./system-modules/auto-mount.nix
./system-modules/boot.nix
./system-modules/gc.nix
./system-modules/dm.nix
./system-modules/networking.nix
# ./system-modules/virtualisation.nix
./system-modules/sshd.nix
./system-modules/gpg.nix
./system-modules/sops.nix
./system-modules/syncthing.nix
./system-modules/hsmw.nix # old
./system-modules/docker.nix
./system-modules/fcitx5.nix
./system-modules/fonts.nix
./system-modules/fuse.nix
./system-modules/gc.nix
./system-modules/gpg.nix
./system-modules/hardware-configuration.nix
./system-modules/health_reminder.nix
./system-modules/ydotool.nix
./system-modules/ollama.nix
./system-modules/nx2site.nix
./system-modules/hsmw.nix
./system-modules/kanata.nix
./system-modules/kodi.nix
./system-modules/networking.nix
./system-modules/nvidia.nix
./system-modules/nx2site.nix
./system-modules/ollama.nix
./system-modules/qmk.nix
];
./system-modules/sops.nix
./system-modules/sound.nix
./system-modules/sshd.nix
./system-modules/syncthing.nix
./system-modules/users.nix
./system-modules/virtualisation.nix
./system-modules/ydotool.nix ];
@@ -60,23 +62,12 @@
hardware.bluetooth.powerOnBoot = true; #
services.blueman.enable = true;
# nixpkgs.config.allowUnfree = true;
nixpkgs.config = {
# allowUnfree = true;
# allowUnfreePredicate = (pkg: true);
allowUnfreePredicate = let
string-list = allowed.unfree-packages ++ (if nvidia.enable == true then nvidia.unfree else []);
in pkg: builtins.elem (lib.getName pkg) string-list;
cudaSupport = nvidia.enable;
enableParallelBuildingByDefault = true;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; ([
git
lazygit # home-manager module is bugged
git-crypt
lazygit # home-manager module is bugged
wget
curl
zip
@@ -84,7 +75,6 @@
p7zip
unar
nano
micro
htop
direnv
openssl

43
flake-modules/allowed.nix Normal file
View File

@@ -0,0 +1,43 @@
{
unfree = [
"discord"
"spotify"
"obsidian"
"zoom-us"
"zoom"
# since the predicate ist to be set in the flake and not in a module
# it is impossible to make the list dynamic and respect nvidia.enable
"nvidia-x11"
"nvidia-settings"
"nvidia-persistenced"
"cudatoolkit"
"cuda-merged"
"cuda_cuobjdump"
"cuda_gdb"
"cuda_nvcc"
"cuda_nvdisasm"
"cuda_nvprune"
"cuda_cccl"
"cuda_cudart"
"cuda_cupti"
"cuda_cuxxfilt"
"cuda_nvml_dev"
"cuda_nvrtc"
"cuda_nvtx"
"cuda_profiler_api"
"cuda_sanitizer_api"
"libcublas"
"libcufft"
"libcurand"
"libcusolver"
"libnvjitlink"
"libcusparse"
"libnpp"
];
inecure = [
# "electron-25.9.0"
];
}

13
flake-modules/colors.json Normal file
View File

@@ -0,0 +1,13 @@
{
"base": {
"foreground": "#eedce2",
"background": "#221016"
},
"to_alter": {
"accent": "#ac5271",
"secondary": "#f20c5b",
"tertiary": "#d5a287",
"special": "#51ac8d",
"weird": "#0cf2a3"
}
}

4
flake-modules/nvidia.nix Normal file
View File

@@ -0,0 +1,4 @@
{
enable = false;
prime = false;
}

63
flake-modules/rice.nix Normal file
View File

@@ -0,0 +1,63 @@
pkgs: rec {
lib = import ../nxlib/ricelib.nix pkgs.lib;
transparency = 0.8;
rounding = 10;
gap-size = 10;
border-width = 3;
color =
let
dark = (-0.5);
bright = (0.5);
alter-set = let f = lib.alter-luminace-hex; in color-name: color-value: { base = color-value; dark = f color-value dark; bright = f color-value bright; };
alter = let f = lib.alter-luminace-hex; in color-value: { base = color-value; dark = f color-value dark; bright = f color-value bright; };
# ccolor = builtins.mapAttrs alter-set (builtins.fromJSON (builtins.readFile ./colors.json));
ccolor = builtins.mapAttrs alter-set {
black = "#111111"; # "#111111" "#001100";
white = "#dddddd"; # "#dddddd" "#66dd66";
blue = "#4444dd"; # "#3333dd" "#003300";
cyan = "#44dddd"; # "#11dddd" "#00dd55";
green = "#44dd44"; # "#11dd11" "#11dd11";
magenta = "#dd44dd"; # "#dd11dd" "#005500";
red = "#dd4444"; # "#dd1111" "#00aa00";
yellow = "#dd4444"; # "#dddd11" "#ffff00";
};
facolor = builtins.mapAttrs alter-set (builtins.fromJSON (builtins.readFile ./colors.json)).to_alter;
fbcolor = (builtins.fromJSON (builtins.readFile ./colors.json)).base;
fcolor = facolor // fbcolor;
xcolor = with ccolor; with fcolor; rec {
background = "#000000";
# foreground = "#dddddd";
# accent = blue;
# secondary = cyan;
# tertiary = magenta;
# special = yellow;
# weird = green;
positive = alter "#00dd00";
negative = alter "#dd0000";
border = accent.base;
border2 = secondary.base;
};
in ccolor // fcolor // xcolor;
font = {
code = {
name = "JetBrainsMono-NF";
name2 = "JetBrainsMono Nerd Font";
package = (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; });
# name = "CascadiaCove-NF";
# package = (pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; });
};
base = {
# name = "NewComputerModern08";
# package = pkgs.newcomputermodern;
name = "Atkinson Hyperlegible";
package = pkgs.atkinson-hyperlegible;
};
};
cursor = {
name = "Bibata-Original-Classic";
package = pkgs.bibata-cursors;
size = 24;
};
}

243
flake.lock generated
View File

@@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1718642173,
"narHash": "sha256-iyj4D6c77uROAH9QdZjPd9SKnS/DuACMESqaEKnBgI8=",
"lastModified": 1724233980,
"narHash": "sha256-w0j/3OeSrpx+S8if1M2ONBsZvJQ1hBQkdTQEiMCHy7o=",
"owner": "KZDKM",
"repo": "Hyprspace",
"rev": "2f3edb68f47a8f5d99d10b322e9a85a285f53cc7",
"rev": "743ec37d02bb2b7261f28de16bf404cebfd96105",
"type": "github"
},
"original": {
@@ -20,6 +20,39 @@
"type": "github"
}
},
"aquamarine": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"hyprwayland-scanner": [
"hyprland",
"hyprwayland-scanner"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1724273991,
"narHash": "sha256-+aUSOXKGpS5CRm1oTitgNAr05ThQNbKIXalZHl3nC6Y=",
"owner": "hyprwm",
"repo": "aquamarine",
"rev": "9a3161ad4c78dc420d1cbb3aae638222608c7de4",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "aquamarine",
"type": "github"
}
},
"crane": {
"inputs": {
"flake-compat": [
@@ -53,29 +86,6 @@
"type": "github"
}
},
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1719875691,
"narHash": "sha256-DtfpH7yivPHcfXV0EL70NwCKlg6nVTZGNngWkPshQjM=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "f2c6c0e41d6c2c82524b9d104bcfd1750a426d1b",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-compat": {
"flake": false,
"locked": {
@@ -97,11 +107,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1719877454,
"narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=",
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "4e3583423212f9303aa1a6337f8dffb415920e4f",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
@@ -132,21 +142,6 @@
}
},
"flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
@@ -193,11 +188,11 @@
]
},
"locked": {
"lastModified": 1719827385,
"narHash": "sha256-qs+nU20Sm8czHg3bhGCqiH+8e13BJyRrKONW34g3i50=",
"lastModified": 1720042825,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "391ca6e950c2525b4f853cbe29922452c14eda82",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github"
},
"original": {
@@ -223,11 +218,11 @@
]
},
"locked": {
"lastModified": 1718450675,
"narHash": "sha256-jpsns6buS4bK+1sF8sL8AaixAiCRjA+nldTKvcwmvUs=",
"lastModified": 1722623071,
"narHash": "sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "66d5b46ff94efbfa6fa3d1d1b66735f1779c34a6",
"rev": "912d56025f03d41b1ad29510c423757b4379eb1c",
"type": "github"
},
"original": {
@@ -238,6 +233,7 @@
},
"hyprland": {
"inputs": {
"aquamarine": "aquamarine",
"hyprcursor": "hyprcursor",
"hyprlang": "hyprlang",
"hyprutils": "hyprutils",
@@ -247,11 +243,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1719938427,
"narHash": "sha256-b0QtvQtFAtuOVBNPEUYf4V2VNGChTukkrLH/JlCQds8=",
"lastModified": 1724596623,
"narHash": "sha256-pLbNiAfpE8rW2e1Ih7Epi0LfyDmFv+UYU2BXg7Sj66U=",
"ref": "refs/heads/main",
"rev": "6247a6b537fd1c05ecf35420529fab1adf83143e",
"revCount": 4903,
"rev": "b672118f9238a48a18efd741cbcda387c5552238",
"revCount": 5136,
"submodules": true,
"type": "git",
"url": "https://github.com/hyprwm/Hyprland"
@@ -279,11 +275,11 @@
]
},
"locked": {
"lastModified": 1719784423,
"narHash": "sha256-D7O5+nh2Wn9tQPJArWHrDSZeEfBCtj5zTGd86701LPE=",
"lastModified": 1723143591,
"narHash": "sha256-dPcWAeRJoG5CyWC32X3XX+Og0v/k1/S1N0T5dQWT32k=",
"owner": "hyprwm",
"repo": "hyprland-plugins",
"rev": "98cb18c6fcfe8196ef4150d09fbae305b7bb2954",
"rev": "b73d7b901d8cb1172dd25c7b7159f0242c625a77",
"type": "github"
},
"original": {
@@ -306,11 +302,11 @@
]
},
"locked": {
"lastModified": 1714869498,
"narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=",
"lastModified": 1721326555,
"narHash": "sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "e06482e0e611130cd1929f75e8c1cf679e57d161",
"rev": "5a11232266bf1a1f5952d5b179c3f4b2facaaa84",
"type": "github"
},
"original": {
@@ -335,11 +331,11 @@
]
},
"locked": {
"lastModified": 1717881852,
"narHash": "sha256-XeeVoKHQgfKuXoP6q90sUqKyl7EYy3ol2dVZGM+Jj94=",
"lastModified": 1724174162,
"narHash": "sha256-fOOBLwil6M9QWMCiSULwjMQzrXhHXUnEqmjHX5ZHeVI=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "ec6938c66253429192274d612912649a0cfe4d28",
"rev": "16e5c9465f04477d8a3dd48a0a26bf437986336c",
"type": "github"
},
"original": {
@@ -354,11 +350,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1719780938,
"narHash": "sha256-YocumFkp3FCgN3UCXp95EV7IvAwhQdlSav8cCB0oHv0=",
"lastModified": 1723307169,
"narHash": "sha256-gYfdNU65hqCLLzFG1WbNmkBbzHUKpSdeOBaeDEs34sM=",
"owner": "h3rmt",
"repo": "hyprswitch",
"rev": "4dbba183fcbaa63de64e973d5dc9bba883765aa3",
"rev": "a669b50adb9ba7790a5c1abaeecbd97ce42a842f",
"type": "github"
},
"original": {
@@ -380,11 +376,11 @@
]
},
"locked": {
"lastModified": 1719316102,
"narHash": "sha256-dmRz128j/lJmMuTYeCYPfSBRHHQO3VeH4PbmoyAhHzw=",
"lastModified": 1722869141,
"narHash": "sha256-0KU4qhyMp441qfwbirNg3+wbm489KnEjXOz2I/RbeFs=",
"owner": "hyprwm",
"repo": "hyprutils",
"rev": "1f6bbec5954f623ff8d68e567bddcce97cd2f085",
"rev": "0252fd13e78e60fb0da512a212e56007515a49f7",
"type": "github"
},
"original": {
@@ -405,11 +401,11 @@
]
},
"locked": {
"lastModified": 1719067853,
"narHash": "sha256-mAnZG/eQy72Fp1ImGtqCgUrDumnR1rMZv2E/zgP4U74=",
"lastModified": 1721324119,
"narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "914f083741e694092ee60a39d31f693d0a6dc734",
"rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30",
"type": "github"
},
"original": {
@@ -423,7 +419,7 @@
"crane": "crane",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts_2",
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_3",
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay"
@@ -445,11 +441,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1719075281,
"narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=",
"lastModified": 1724224976,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
"type": "github"
},
"original": {
@@ -459,16 +455,32 @@
"type": "github"
}
},
"nixpkgs-latest": {
"locked": {
"lastModified": 1724604894,
"narHash": "sha256-ihWojFUzRYZ3i6xcxbzxMDAn5cX2FCtymu02MPjNA4c=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "669ce8b640c2ac856f714897aaffc5feb614ad57",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1719876945,
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"lastModified": 1722555339,
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
}
},
"nixpkgs-stable": {
@@ -489,27 +501,27 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1719663039,
"narHash": "sha256-tXlrgAQygNIy49LDVFuPXlWD2zTQV9/F8pfoqwwPJyo=",
"lastModified": 1721524707,
"narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4a1e673523344f6ccc84b37f4413ad74ea19a119",
"rev": "556533a23879fc7e5f98dd2e0b31a6911a213171",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.11",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1719848872,
"narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=",
"lastModified": 1724224976,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
"type": "github"
},
"original": {
@@ -551,11 +563,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1719838683,
"narHash": "sha256-Zw9rQjHz1ilNIimEXFeVa1ERNRBF8DoXDhLAZq5B4pE=",
"lastModified": 1724316499,
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d032c1a6dfad4eedec7e35e91986becc699d7d69",
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841",
"type": "github"
},
"original": {
@@ -564,6 +576,22 @@
"type": "indirect"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1724479785,
"narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": [
@@ -598,15 +626,16 @@
"root": {
"inputs": {
"Hyprspace": "Hyprspace",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager",
"hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins",
"hyprswitch": "hyprswitch",
"lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs_4",
"nixpkgs-latest": "nixpkgs-latest",
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix"
"sops-nix": "sops-nix",
"zen-browser": "zen-browser"
}
},
"rust-overlay": {
@@ -642,11 +671,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1719873517,
"narHash": "sha256-D1dxZmXf6M2h5lNE1m6orojuUawVPjogbGRsqSBX+1g=",
"lastModified": 1723501126,
"narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "a11224af8d824935f363928074b4717ca2e280db",
"rev": "be0eec2d27563590194a9206f551a6f73d52fa34",
"type": "github"
},
"original": {
@@ -702,11 +731,11 @@
]
},
"locked": {
"lastModified": 1718619174,
"narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=",
"lastModified": 1724073926,
"narHash": "sha256-nWlUL43jOFHf+KW6Hqrx+W/r1XdXuDyb0wC/SrHsOu4=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623",
"rev": "a08ecbbf33598924e93542f737fc6169a26b481e",
"type": "github"
},
"original": {
@@ -714,6 +743,24 @@
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1724745035,
"narHash": "sha256-WhTJaCw0XDR9gAQ6uEIMkT7bKsHXBafj1GJnRsWXHpk=",
"owner": "MarceColl",
"repo": "zen-browser-flake",
"rev": "723039271547eb4c648e5bd774e2f7bc73564b16",
"type": "github"
},
"original": {
"owner": "MarceColl",
"repo": "zen-browser-flake",
"type": "github"
}
}
},
"root": "root",

289
flake.nix
View File

@@ -2,244 +2,69 @@
description = "Multisystem NixOS Flake of Lennart J. Kurzweg";
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs = { url = "nixpkgs/nixos-24.05"; };
nixpkgs-unstable = { url = "nixpkgs/nixos-unstable"; };
nixpkgs-latest = { url = "github:nixos/nixpkgs?ref=master"; };
home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
lanzaboote = { url = "github:nix-community/lanzaboote/v0.3.0"; };
hyprland = {
url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
# url = "github:hyprwm/Hyprland";
# inputs.nixpkgs.follows = "nixpkgs";
};
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
Hyprspace = {
url = "github:KZDKM/Hyprspace";
inputs.hyprland.follows = "hyprland";
};
hyprswitch.url = "github:h3rmt/hyprswitch/release";
hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; };
hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; };
Hyprspace = { url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; };
hyprswitch = { url = "github:h3rmt/hyprswitch/release"; };
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.3.0";
# inputs.nixpkgs.follows = "nixpkgs-unstable";
};
#arion = {
# url = "github:hercules-ci/arion";
# inputs.nixpkgs.follows = "nixpkgs";
#};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
# yazi.url = "github:sxyazi/yazi";
# firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; };
zen-browser.url = "github:MarceColl/zen-browser-flake";
};
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs:
let
system = "x86_64-linux";
pkgs-config = {
allowUnfree = true;
# cudaSupport = nvidia.enable;
# enableParallelBuildingByDefault = true;
};
pkgs = import nixpkgs {
system = system;
config = pkgs-config;
};
pkgs-unstable = import nixpkgs-unstable {
system = system;
config = pkgs-config;
};
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-latest, home-manager, ... }@inputs: let
system = "x86_64-linux";
user = "nx2";
user = "nx2";
config = { allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; };
pkgs = import nixpkgs { inherit system config; };
pkgs-unstable = import nixpkgs-unstable { inherit system config; };
pkgs-latest = import nixpkgs-latest { inherit system config; };
nvidia = {
enable = true;
prime = true;
# unfree = if enable then [
unfree = [
"cuda_cccl"
"cuda_cudart"
"cuda_cuobjdump"
"cuda_cupti"
"cuda_cuxxfilt"
"cuda_gdb"
"cuda-merged"
"cuda_nvcc"
"cuda_nvdisasm"
"cuda_nvml_dev"
"cuda_nvprune"
"cuda_nvrtc"
"cuda_nvtx"
"cuda_profiler_api"
"cuda_sanitizer_api"
"cudatoolkit"
"libcublas"
"libcufft"
"libcurand"
"libcusolver"
"libcusparse"
"libnpp"
"libnvjitlink"
"nviaia-x11"
"nvidia-persistenced"
"nvidia-settings"
"nvidia-x11"
];
# ] else [];
};
allowed = {
unfree-packages = [
"discord"
"obsidian"
"spotify"
"zoom"
"zoom-us"
] ++ nvidia.unfree;
inecure-packages = [
"electron-25.9.0"
];
};
secrets = import ./git-crypt/secrets.nix;
rice = rec {
lib = import ./nxlib/ricelib.nix { lib = nixpkgs.lib; };
transparency = 0.8;
rounding = 10;
gap-size = 10;
border-width = 3;
color =
let
dark = (-0.5);
bright = (0.5);
alter-set = let f = rice.lib.alter-luminace-hex; in color-name: color-value: { base = color-value; dark = f color-value dark; bright = f color-value bright; };
alter = let f = rice.lib.alter-luminace-hex; in color-value: { base = color-value; dark = f color-value dark; bright = f color-value bright; };
ccolor = builtins.mapAttrs alter-set {
black = "#000022"; # "#111111" "#001100";
white = "#ddddff"; # "#dddddd" "#66dd66";
blue = "#4422ff"; # "#3333dd" "#003300";
cyan = "#11dddd"; # "#11dddd" "#00dd55";
green = "#11dd44"; # "#11dd11" "#11dd11";
magenta = "#6622dd"; # "#dd11dd" "#005500";
red = "#dd1166"; # "#dd1111" "#00aa00";
yellow = "#dd6611"; # "#dddd11" "#ffff00";
};
xcolor = with ccolor; rec {
background = black.dark;
foreground = white.base;
border = cyan.base;
border2 = blue.base;
accent = blue;
secondary = cyan;
tertiary = magenta;
special = yellow;
weird = green;
positive = alter "#00dd00";
negative = alter "#dd0000";
};
# ccolor = builtins.mapAttrs alter-set {
# black = "#112200";
# white = "#ddffdd";
# blue = "#779944";
# cyan = "#11ffcc";
# green = "#00ff00";
# magenta = "#449999";
# red = "#dd2200";
# yellow = "#ffff11";
# };
# xcolor = with ccolor; rec {
# background = black.dark; # black.dark;
# foreground = white.base; # white.base;
# border = accent.base; # cyan.base;
# border2 = yellow.base; # blue.base;
# accent = green; # blue;
# secondary = red; # cyan;
# tertiary = yellow; # magenta;
# special = blue; # yellow;
# weird = magenta; # green;
# positive = alter "#00dd00"; # alter "#00dd00";
# negative = alter "#dd0000"; # alter "#dd0000";
# };
in ccolor // xcolor;
font = {
code = {
name = "JetBrainsMono-NF";
name2 = "JetBrainsMono Nerd Font";
package = (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; });
# name = "CascadiaCove-NF";
# package = (pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; });
};
base = {
# name = "NewComputerModern08";
# package = pkgs.newcomputermodern;
name = "Atkinson Hyperlegible";
package = pkgs.atkinson-hyperlegible;
};
};
cursor = {
name = "Bibata-Original-Classic";
package = pkgs.bibata-cursors;
size = 24;
};
};
in
{
nixosConfigurations = {
NxXPS = let host = "NxXPS"; in nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./configuration.nix ];
specialArgs = { inherit inputs user host pkgs-unstable allowed secrets rice nvidia; };
};
NxNORTH = let host = "NxNORTH"; in nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./configuration.nix ];
specialArgs = { inherit inputs user host pkgs-unstable allowed secrets rice nvidia; };
};
NxACE = let host = "NxACE"; nvidia.enable = false; in nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./configuration.nix ];
specialArgs = { inherit inputs user host pkgs-unstable allowed secrets rice nvidia; };
};
};
homeConfigurations = {
"${user}@NxXPS" = let host = "NxXPS"; in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
};
"${user}@NxNORTH" = let host = "NxNORTH"; in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
};
"${user}@NxACE" = let host = "NxACE"; nvidia.enable = false; in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
};
"tv@NxACE" =
let
host = "NxACE";
user = "tv";
nvidia.enable = pkgs.kib.mkForce false;
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
};
nvidia-set = import ./flake-modules/nvidia.nix;
secrets = import ./git-crypt/secrets.nix;
rice = import ./flake-modules/rice.nix pkgs;
in {
nixosConfigurations = let
make-nixos-system = host: nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./configuration.nix ];
specialArgs = let
nvidia = nvidia-set // {
enable = if (host == "NxXPS" || host == "NxNORTH") 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 {
NxXPS = make-nixos-system "NxXPS";
NxNORTH = make-nixos-system "NxNORTH";
NxACE = make-nixos-system "NxACE";
};
homeConfigurations = let
make-home-configuration = host: user: home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = let
nvidia = nvidia-set // {
enable = if (host == "NxXPS" || host == "NxNORTH") 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 {
"${user}@NxXPS" = make-home-configuration "NxXPS" user;
"${user}@NxNORTH" = make-home-configuration "NxNORTH" user;
"${user}@NxACE" = make-home-configuration "NxACE" user;
"tv@NxACE" = make-home-configuration "NxACE" "tv";
};
};
}

Binary file not shown.

View File

@@ -0,0 +1,7 @@
{ ... }:
{
services.udiskie = {
enable = true;
notify = true;
};
}

14
home-modules/direnv.nix Executable file
View File

@@ -0,0 +1,14 @@
{ lib, user, ... }:
lib.mkIf (user != "tv")
{
programs = {
direnv = {
enable = true;
# enableBashIntegration = true;
nix-direnv.enable = true;
config = {
hide_env_diff = true;
};
};
};
}

View File

@@ -1,492 +1,198 @@
{ config, pkgs, pkgs-unstable, lib, host, user, allowed, ... }:
{ pkgs, lib, host, ... }:
lib.mkIf (host != "NxACE")
{
home.packages = [
pkgs-unstable.vesktop
];
home = {
packages = with pkgs; [
vesktop
];
home.file.".config/vesktop/settings/settings.json".text = ''
{
"notifyAboutUpdates": true,
"autoUpdate": false,
"autoUpdateNotification": true,
"useQuickCss": true,
"themeLinks": [
"https://luckfire.github.io/amoled-cord/src/amoled-cord.css"
],
"enabledThemes": [],
"enableReactDevtools": false,
"frameless": false,
"transparent": true,
"winCtrlQ": false,
"macosTranslucency": false,
"disableMinSize": false,
"winNativeTitleBar": false,
"plugins": {
"BadgeAPI": {
"enabled": true
},
"CommandsAPI": {
"enabled": true
},
"ContextMenuAPI": {
"enabled": true
},
"MemberListDecoratorsAPI": {
"enabled": false
},
"MessageAccessoriesAPI": {
"enabled": false
},
"MessageDecorationsAPI": {
"enabled": false
},
"MessageEventsAPI": {
"enabled": false
},
"MessagePopoverAPI": {
"enabled": false
},
"NoticesAPI": {
"enabled": true
},
"ServerListAPI": {
"enabled": false
},
"NoTrack": {
"enabled": true
},
"Settings": {
"enabled": true,
"settingsLocation": "aboveActivity"
},
"SupportHelper": {
"enabled": true
},
"ChatInputButtonAPI": {
"enabled": false
},
"AlwaysAnimate": {
"enabled": true
},
"AlwaysTrust": {
"enabled": true
},
"AnonymiseFileNames": {
"enabled": false
},
"WebRichPresence (arRPC)": {
"enabled": false
},
"BANger": {
"enabled": false
},
"BetterFolders": {
"enabled": false
},
"BetterGifAltText": {
"enabled": false
},
"BetterGifPicker": {
"enabled": false
},
"BetterNotesBox": {
"enabled": false
},
"BetterRoleDot": {
"enabled": false
},
"BetterUploadButton": {
"enabled": false
},
"BiggerStreamPreview": {
"enabled": false
},
"BlurNSFW": {
"enabled": false
},
"CallTimer": {
"enabled": false
},
"ClearURLs": {
"enabled": false
},
"ClientTheme": {
"enabled": false
},
"ColorSighted": {
"enabled": false
},
"ConsoleShortcuts": {
"enabled": false
},
"CopyUserURLs": {
"enabled": false
},
"CrashHandler": {
"enabled": true
},
"CustomRPC": {
"enabled": false
},
"Dearrow": {
"enabled": false
},
"Decor": {
"enabled": false
},
"DisableCallIdle": {
"enabled": false
},
"EmoteCloner": {
"enabled": false
},
"Experiments": {
"enabled": false
},
"F8Break": {
"enabled": false
},
"FakeNitro": {
"enabled": false
},
"FakeProfileThemes": {
"enabled": true
},
"FavoriteEmojiFirst": {
"enabled": false
},
"FavoriteGifSearch": {
"enabled": false
},
"FixCodeblockGap": {
"enabled": false
},
"FixSpotifyEmbeds": {
"enabled": false
},
"FixYoutubeEmbeds": {
"enabled": false
},
"ForceOwnerCrown": {
"enabled": false
},
"FriendInvites": {
"enabled": false
},
"GameActivityToggle": {
"enabled": false
},
"GifPaste": {
"enabled": false
},
"GreetStickerPicker": {
"enabled": false
},
"HideAttachments": {
"enabled": false
},
"iLoveSpam": {
"enabled": false
},
"IgnoreActivities": {
"enabled": false
},
"ImageZoom": {
"enabled": false
},
"InvisibleChat": {
"enabled": false
},
"KeepCurrentChannel": {
"enabled": false
},
"LastFMRichPresence": {
"enabled": false
},
"LoadingQuotes": {
"enabled": false
},
"MemberCount": {
"enabled": false
},
"MessageClickActions": {
"enabled": false
},
"MessageLinkEmbeds": {
"enabled": false
},
"MessageLogger": {
"enabled": false
},
"MessageTags": {
"enabled": false
},
"MoreCommands": {
"enabled": false
},
"MoreKaomoji": {
"enabled": false
},
"MoreUserTags": {
"enabled": false
},
"Moyai": {
"enabled": false
},
"MutualGroupDMs": {
"enabled": false
},
"NewGuildSettings": {
"enabled": false
},
"NoBlockedMessages": {
"enabled": false
},
"NoDevtoolsWarning": {
"enabled": false
},
"NoF1": {
"enabled": false
},
"NoMosaic": {
"enabled": false
},
"NoPendingCount": {
"enabled": false
},
"NoProfileThemes": {
"enabled": false
},
"NoReplyMention": {
"enabled": false
},
"NoScreensharePreview": {
"enabled": false
},
"NoTypingAnimation": {
"enabled": false
},
"NoUnblockToJump": {
"enabled": false
},
"NormalizeMessageLinks": {
"enabled": false
},
"NotificationVolume": {
"enabled": false
},
"NSFWGateBypass": {
"enabled": false
},
"OnePingPerDM": {
"enabled": false
},
"oneko": {
"enabled": false
},
"OpenInApp": {
"enabled": false
},
"Party mode 🎉": {
"enabled": false
},
"PermissionFreeWill": {
"enabled": false
},
"PermissionsViewer": {
"enabled": false
},
"petpet": {
"enabled": false
},
"PictureInPicture": {
"enabled": false
},
"PinDMs": {
"enabled": false
},
"PlainFolderIcon": {
"enabled": false
},
"PlatformIndicators": {
"enabled": false
},
"PreviewMessage": {
"enabled": false
},
"PronounDB": {
"enabled": false
},
"QuickMention": {
"enabled": false
},
"QuickReply": {
"enabled": false
},
"ReactErrorDecoder": {
"enabled": false
},
"ReadAllNotificationsButton": {
"enabled": false
},
"RelationshipNotifier": {
"enabled": false
},
"RevealAllSpoilers": {
"enabled": false
},
"ReverseImageSearch": {
"enabled": false
},
"ReviewDB": {
"enabled": false
},
"RoleColorEverywhere": {
"enabled": true
},
"SearchReply": {
"enabled": false
},
"SecretRingToneEnabler": {
"enabled": false
},
"SendTimestamps": {
"enabled": false
},
"ServerListIndicators": {
"enabled": false
},
"ServerProfile": {
"enabled": false
},
"ShikiCodeblocks": {
"enabled": false
},
"ShowAllMessageButtons": {
"enabled": false
},
"ShowConnections": {
"enabled": false
},
"ShowHiddenChannels": {
"enabled": false
},
"ShowMeYourName": {
"enabled": false
},
"ShowTimeouts": {
"enabled": false
},
"SilentMessageToggle": {
"enabled": false
},
"SilentTyping": {
"enabled": false
},
"SortFriendRequests": {
"enabled": false
},
"SpotifyControls": {
"enabled": false
},
"SpotifyCrack": {
"enabled": false
},
"SpotifyShareCommands": {
"enabled": false
},
"StartupTimings": {
"enabled": false
},
"SuperReactionTweaks": {
"enabled": false
},
"TextReplace": {
"enabled": false
},
"ThemeAttributes": {
"enabled": false
},
"TimeBarAllActivities": {
"enabled": false
},
"Translate": {
"enabled": false
},
"TypingIndicator": {
"enabled": false
},
"TypingTweaks": {
"enabled": false
},
"Unindent": {
"enabled": false
},
"UnsuppressEmbeds": {
"enabled": false
},
"UrbanDictionary": {
"enabled": false
},
"UserVoiceShow": {
"enabled": false
},
"USRBG": {
"enabled": false
},
"ValidUser": {
"enabled": false
},
"VoiceChatDoubleClick": {
"enabled": false
},
"VcNarrator": {
"enabled": false
},
"VencordToolbox": {
"enabled": false
},
"ViewIcons": {
"enabled": false
},
"ViewRaw": {
"enabled": false
},
"VoiceMessages": {
"enabled": false
},
"WebContextMenus": {
"enabled": true,
"addBack": true
},
"WebKeybinds": {
"enabled": true
},
"WhoReacted": {
"enabled": false
},
"Wikisearch": {
"enabled": false
},
"XSOverlay": {
"enabled": false
}
},
"notifications": {
"timeout": 5000,
"position": "bottom-right",
"useNative": "not-focused",
"logLimit": 50
},
"cloud": {
"authenticated": false,
"url": "https://api.vencord.dev/",
"settingsSync": false,
"settingsSyncVersion": 1710459223618
}
}
'';
file.".config/vesktop/settings/settings.json".text = /* json */ ''{
"notifyAboutUpdates": true,
"autoUpdate": false,
"autoUpdateNotification": true,
"useQuickCss": true,
"themeLinks": [
"https://luckfire.github.io/amoled-cord/src/amoled-cord.css"
],
"enabledThemes": [],
"enableReactDevtools": false,
"frameless": false,
"transparent": true,
"winCtrlQ": false,
"macosTranslucency": false,
"disableMinSize": false,
"winNativeTitleBar": false,
"plugins": {
"BadgeAPI": { "enabled": true },
"CommandsAPI": { "enabled": true },
"ContextMenuAPI": { "enabled": true },
"MemberListDecoratorsAPI": { "enabled": false },
"MessageAccessoriesAPI": { "enabled": false },
"MessageDecorationsAPI": { "enabled": false },
"MessageEventsAPI": { "enabled": false },
"MessagePopoverAPI": { "enabled": false },
"NoticesAPI": { "enabled": true },
"ServerListAPI": { "enabled": false },
"NoTrack": { "enabled": true },
"Settings": {
"enabled": true,
"settingsLocation": "aboveActivity"
},
"SupportHelper": { "enabled": true },
"ChatInputButtonAPI": { "enabled": false },
"AlwaysAnimate": { "enabled": true },
"AlwaysTrust": { "enabled": true },
"AnonymiseFileNames": { "enabled": false },
"WebRichPresence (arRPC)": { "enabled": false },
"BANger": { "enabled": false },
"BetterFolders": { "enabled": false },
"BetterGifAltText": { "enabled": false },
"BetterGifPicker": { "enabled": false },
"BetterNotesBox": { "enabled": false },
"BetterRoleDot": { "enabled": false },
"BetterUploadButton": { "enabled": false },
"BiggerStreamPreview": { "enabled": false },
"BlurNSFW": { "enabled": false },
"CallTimer": { "enabled": false },
"ClearURLs": { "enabled": false },
"ClientTheme": { "enabled": false },
"ColorSighted": { "enabled": false },
"ConsoleShortcuts": { "enabled": false },
"CopyUserURLs": { "enabled": false },
"CrashHandler": { "enabled": true },
"CustomRPC": { "enabled": false },
"Dearrow": { "enabled": false },
"Decor": { "enabled": false },
"DisableCallIdle": { "enabled": false },
"EmoteCloner": { "enabled": false },
"Experiments": { "enabled": false },
"F8Break": { "enabled": false },
"FakeNitro": { "enabled": false },
"FakeProfileThemes": { "enabled": true },
"FavoriteEmojiFirst": { "enabled": false },
"FavoriteGifSearch": { "enabled": false },
"FixCodeblockGap": { "enabled": false },
"FixSpotifyEmbeds": { "enabled": false },
"FixYoutubeEmbeds": { "enabled": false },
"ForceOwnerCrown": { "enabled": false },
"FriendInvites": { "enabled": false },
"GameActivityToggle": { "enabled": false },
"GifPaste": { "enabled": false },
"GreetStickerPicker": { "enabled": false },
"HideAttachments": { "enabled": false },
"iLoveSpam": { "enabled": false },
"IgnoreActivities": { "enabled": false },
"ImageZoom": { "enabled": false },
"InvisibleChat": { "enabled": false },
"KeepCurrentChannel": { "enabled": false },
"LastFMRichPresence": { "enabled": false },
"LoadingQuotes": { "enabled": false },
"MemberCount": { "enabled": false },
"MessageClickActions": { "enabled": false },
"MessageLinkEmbeds": { "enabled": false },
"MessageLogger": { "enabled": false },
"MessageTags": { "enabled": false },
"MoreCommands": { "enabled": false },
"MoreKaomoji": { "enabled": false },
"MoreUserTags": { "enabled": false },
"Moyai": { "enabled": false },
"MutualGroupDMs": { "enabled": false },
"NewGuildSettings": { "enabled": false },
"NoBlockedMessages": { "enabled": false },
"NoDevtoolsWarning": { "enabled": false },
"NoF1": { "enabled": false },
"NoMosaic": { "enabled": false },
"NoPendingCount": { "enabled": false },
"NoProfileThemes": { "enabled": false },
"NoReplyMention": { "enabled": false },
"NoScreensharePreview": { "enabled": false },
"NoTypingAnimation": { "enabled": false },
"NoUnblockToJump": { "enabled": false },
"NormalizeMessageLinks": { "enabled": false },
"NotificationVolume": { "enabled": false },
"NSFWGateBypass": { "enabled": false },
"OnePingPerDM": { "enabled": false },
"oneko": { "enabled": false },
"OpenInApp": { "enabled": false },
"Party mode 🎉": { "enabled": false },
"PermissionFreeWill": { "enabled": false },
"PermissionsViewer": { "enabled": false },
"petpet": { "enabled": false },
"PictureInPicture": { "enabled": false },
"PinDMs": { "enabled": false },
"PlainFolderIcon": { "enabled": false },
"PlatformIndicators": { "enabled": false },
"PreviewMessage": { "enabled": false },
"PronounDB": { "enabled": false },
"QuickMention": { "enabled": false },
"QuickReply": { "enabled": false },
"ReactErrorDecoder": { "enabled": false },
"ReadAllNotificationsButton": { "enabled": false },
"RelationshipNotifier": { "enabled": false },
"RevealAllSpoilers": { "enabled": false },
"ReverseImageSearch": { "enabled": false },
"ReviewDB": { "enabled": false },
"RoleColorEverywhere": { "enabled": true },
"SearchReply": { "enabled": false },
"SecretRingToneEnabler": { "enabled": false },
"SendTimestamps": { "enabled": false },
"ServerListIndicators": { "enabled": false },
"ServerProfile": { "enabled": false },
"ShikiCodeblocks": { "enabled": false },
"ShowAllMessageButtons": { "enabled": false },
"ShowConnections": { "enabled": false },
"ShowHiddenChannels": { "enabled": false },
"ShowMeYourName": { "enabled": false },
"ShowTimeouts": { "enabled": false },
"SilentMessageToggle": { "enabled": false },
"SilentTyping": { "enabled": false },
"SortFriendRequests": { "enabled": false },
"SpotifyControls": { "enabled": false },
"SpotifyCrack": { "enabled": false },
"SpotifyShareCommands": { "enabled": false },
"StartupTimings": { "enabled": false },
"SuperReactionTweaks": { "enabled": false },
"TextReplace": { "enabled": false },
"ThemeAttributes": { "enabled": false },
"TimeBarAllActivities": { "enabled": false },
"Translate": { "enabled": false },
"TypingIndicator": { "enabled": false },
"TypingTweaks": { "enabled": false },
"Unindent": { "enabled": false },
"UnsuppressEmbeds": { "enabled": false },
"UrbanDictionary": { "enabled": false },
"UserVoiceShow": { "enabled": false },
"USRBG": { "enabled": false },
"ValidUser": { "enabled": false },
"VoiceChatDoubleClick": { "enabled": false },
"VcNarrator": { "enabled": false },
"VencordToolbox": { "enabled": false },
"ViewIcons": { "enabled": false },
"ViewRaw": { "enabled": false },
"VoiceMessages": { "enabled": false },
"WebContextMenus": {
"enabled": true,
"addBack": true },
"WebKeybinds": { "enabled": true },
"WhoReacted": { "enabled": false },
"Wikisearch": { "enabled": false },
"XSOverlay": { "enabled": false }
},
"notifications": {
"timeout": 5000,
"position": "bottom-right",
"useNative": "not-focused",
"logLimit": 50
},
"cloud": {
"authenticated": false,
"url": "https://api.vencord.dev/",
"settingsSync": false,
"settingsSyncVersion": 1725386648445
}
}
'';
};
}

View File

@@ -51,10 +51,12 @@ lib.mkIf (user != "tv")
nf = "neofetch";
nxf = "nxfetch";
nn = "nano";
m = "micro";
hxx = "hx .";
p = "python";
ipy = "ipython";
c = "codium";
cc = "codium .";
code = "codium";
g = "git";
lzg = "lazygit";
# gst = "git status";
@@ -81,7 +83,6 @@ lib.mkIf (user != "tv")
dcmp = "docker compose";
nxsent = ''sent -c \${rice.color.foreground} -b \${rice.color.background}'';
code = "codium";
# ya = "yazi"; # function
# nxfiglet = "figlet";
};

270
home-modules/foot.nix Normal file
View File

@@ -0,0 +1,270 @@
{ 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

@@ -2,9 +2,12 @@
{
home = {
packages = with pkgs; [
nixfmt # nix formater
nixfmt-classic # nix formater
nil # nix language server
python311Packages.python-lsp-server
ruff
ruff-lsp
pyright
lldb # debugger for llvm stuff
yaml-language-server # yaml
marksman # markdown
@@ -57,7 +60,14 @@
};
};
keys.normal = {
C-g = [":new" ":insert-output lazygit" ":buffer-close!" ":redraw"];
"C-g" = [":new" ":insert-output lazygit" ":buffer-close!" ":redraw"];
"A-`" = [ "no_op" ];
"`" = [ "no_op" ];
};
keys.normal."ö" = {
"s" = [ "switch_case" ];
"u" = [ "switch_to_uppercase" ];
"l" = [ "switch_to_lowercase" ];
};
};
languages = {
@@ -73,19 +83,66 @@
file-types = [ "md" "MD" ];
scope = "text.<name>";
}
# {
# name = "python";
# transport = "stdio";
# command = "python3";
# args = ["-m" "debugpy.adapter"];
# }
{
name = "python";
language-servers = [ "pyright" "ruff" ];
formatter = {
command = "ruff";
args = [
"format"
"--line-length"
"120"
"-"
];
};
debugger = {
name = "debugpy";
transport = "stdio";
command = "python";
args = [ "-m" "debugpy.adapter" ];
templates = [{
name = "source";
request = "launch";
completion = [{
name = "entrypoint";
completion = "filename";
default = ".";
}];
args = {
mode = "debug";
program = "{0}";
};
}];
};
}
];
language-server = {
"style-check" = {
command = lib.getExe pkgs.vale-ls;
};
"language-tool" = {
command = lib.getExe pkgs.ltex-ls;
command = "${pkgs.ltex-ls}/bin/ltex-ls";
};
"ruff" = {
command = "ruff-lsp";
config.settings.args = [
# Set line length
# "--line-length"
# "79"
# Enable some ruff rules
# "--select"
# (
# "F,W,E,I,N,D200,D201,D202,D203,D204,D205,D206,D207,D208,D209,D210,D211,"
# + "D212,D213,D214,D215,D300,D301,D400,D401,D402,D403,D404,D405,D406,"
# + "D407,D408,D409,D410,D411,D412,D413,D414,D415,D416,D417,D418,D419,"
# + "UP,YTT,TRIO,ASYNC,B,A,COM,C4,DTZ,T10,DJ,EXE,FA,ISC,ICN001,G010,"
# + "G101,G201,G202,INP,PIE,Q,RSE,RET,SLOT,SIM,TCH,INT,ARG,PTH,TD001,"
# + "TD004,TD005,TD006,TD007,PD,PL,TRY004,TRY200,TRY201,TRY302,TRY400,"
# + "TRY401,FLY,NPY,AIR,PERF,FURB,LOG,RUF"
# )
];
};
};
};

View File

@@ -55,6 +55,7 @@ lib.mkIf (user != "tv")
blueman-manager = "󰂯"
Alacritty = ""
zoom = "󰬡"
spotify = ""
[class_active]
"(?i)ExampleOneTerm" = "icon"
@@ -75,6 +76,9 @@ lib.mkIf (user != "tv")
[initial_title_in_class]
[initial_title]
"Spotify Premium" = ""
[initial_title_in_class_active]
[initial_title_in_initial_class]

View File

@@ -243,17 +243,15 @@ lib.mkIf (user != "tv")
};
exec-once = [
"hyprpm reload -n "
"waybar "
"hyprpaper -n "
"waybar"
"swww-daemon"
"= /home/nx2/scripts/swww-randomize.sh"
"hyprland-autoname-workspaces"
"/usr/lib/polkit-kde-authentication-agent-1 "
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"syncthing -no-browser"
"mako"
"ibus engine xkb:de::deu"
"fcitx5"
# "ibus engine xkb:de::deu"
"libinput-gestures"
# "hyprswitch --daemon"
];
@@ -335,7 +333,7 @@ lib.mkIf (user != "tv")
"SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate"
# "SUPER, F6,"
''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, hyprload,reload"
"SUPER, F9, exec, change_colors_json $(swww query | sed -n 2p | sed -e 's-.*image: --g') && kitty -e sh -c 'nh home switch'"
# "SUPER, F10, hyprload,update"
"SUPER, F11, exec, waybar"
"SUPER SHIFT, F11, exec, pkill waybar "
@@ -459,8 +457,8 @@ lib.mkIf (user != "tv")
## MEGA KEYS:
'' , Print, exec, grim -g "$(slurp)"''
"SUPER, Next, resizeactive, 100 -100"
"SUPER, Prior, resizeactive, -100 100"
# "SUPER, Next, resizeactive, 5% 5%" # binde
# "SUPER, Prior, resizeactive, -5% -5%" # binde
###########################################################################
## FN KEYS:
@@ -492,6 +490,8 @@ lib.mkIf (user != "tv")
];
binde = [
# "SUPER, TAB, exec, hyprswitch --daemon --do-initial-execute"
"SUPER, Next, resizeactive, 10% 10%"
"SUPER, Prior, resizeactive, -10% -10%"
];
};

37
home-modules/ollama.nix Normal file
View File

@@ -0,0 +1,37 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(writers.writePython3Bin "ooo" {
libraries = [ pkgs.python3Packages.ollama ];
flakeIgnore = [ "E501" "E305" "E701" "E704" "E302" "E114" "F841" "E121" ];
} /* python */ ''
import sys
import ollama
if len(sys.argv) < 2:
print("Usage: ./ooo.py <system_message>")
sys.exit(1)
system_message = sys.argv[1]
input_text = sys.stdin.read()
try:
response = ollama.chat(model='llama3.1:8b', messages=[
{
'role': 'system',
'content': "You are a text transformer. Follow the folling instruction:\n\n" + system_message + "\n\nOnly output the transformed text. Do not add any addidional conversation around the output. Just the result.",
},
{
'role': 'user',
'content': input_text,
},
])
print(response['message']['content'])
sys.exit(0)
except Exception as e:
print(f"An error occurred: {e}", file=sys.stderr)
sys.exit(1)
'')
];
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, system, user, host, allowed, secrets, ... }:
{ pkgs, lib, host, secrets, ... }:
lib.mkIf (host != "NxACE")
{
home.packages = [

View File

@@ -0,0 +1,152 @@
{ pkgs-unstable, ... }:
{
home.packages = with pkgs-unstable; [
(writers.writePython3Bin "change_colors_json" {
libraries = with python3Packages; [ numpy pillow scikit-learn ];
flakeIgnore = [ "E302" "E305" "E226" "E501" ];
} /*python */ ''
from colorsys import hls_to_rgb, rgb_to_hls
import json
import sys
from typing import Literal, cast
from numpy.typing import NDArray
from sklearn.cluster import KMeans
import numpy as np
from PIL import Image
def fc(c: int) -> str:
assert c < 256
s = str(hex(c))[2:]
if c < 16:
return "0" + s
elif len(s) == 1:
return s + s
else:
return s
class Color(object):
def __init__(self, rgb: tuple[int, ...], frequency: float):
assert len(rgb) == 3, "RGB values must be a tuple of length 3"
self.rgb = cast(tuple[int, int, int], rgb)
self.freq: float = frequency
def __lt__(self, other: "Color") -> bool:
return self.freq < other.freq
@property
def hls(self) -> tuple[float, float, float]:
return rgb_to_hls(r=self.rgb[0] / 255, g=self.rgb[1] / 255, b=self.rgb[2] / 255)
@property
def luminance(self) -> float:
return np.dot(np.array([0.2126, 0.7152, 0.0722]), self.rgb)
def k_means_extraction(arr: NDArray[float], height: int, width: int, palette_size: int) -> list[Color]:
arr = np.reshape(arr, (width * height, -1))
model = KMeans(n_clusters=palette_size, n_init="auto", init="k-means++", random_state=2024)
labels = model.fit_predict(arr)
palette = np.array(model.cluster_centers_, dtype=int)
color_count = np.bincount(labels)
color_frequency = color_count / float(np.sum(color_count))
colors = []
for color, freq in zip(palette, color_frequency):
colors.append(Color(color, freq))
return colors
class Palette:
def __init__(self, colors: list[Color]):
self.colors = colors
self.frequencies = [c.freq for c in colors]
def __getitem__(self, item: int) -> Color:
return self.colors[item]
def __len__(self) -> int:
return self.number_of_colors
def ensure_color(c: Color, alter_sat: bool) -> list[int]:
hue, lum, sat = c.hls
if alter_sat:
new_sat = min(max(sat, 0.6) + 0.3, 1)
else:
new_sat = sat
new_lum = max(lum, 0.5)
r, g, b = hls_to_rgb(h=hue, l=new_lum, s=new_sat)
return [int(r*255), int(g*255), int(b*255)]
def list_to_hex(ilist: list[int]) -> str:
return f"#{fc(ilist[0])}{fc(ilist[1])}{fc(ilist[2])}"
def alter_hue(ilist: list[int], hue: int) -> list[int]:
assert hue >= 0 and hue <= 360
r, g, b = ilist
h, l, s = rgb_to_hls((r/255), (g/255), (b/255))
new_hue = (((h*360) + hue) % 360) / 360
r, g, b = hls_to_rgb(h=new_hue, l=l, s=s)
return [int(r*255), int(g*255), int(b*255)]
def alter_l(ilist: list[int], l_in_1_0: float) -> list[int]:
assert l_in_1_0 >= 0 and l_in_1_0 <= 1
r, g, b = ilist
h, _, s = rgb_to_hls((r/255), (g/255), (b/255))
r, g, b = hls_to_rgb(h=h, l=l_in_1_0, s=s)
return [int(r*255), int(g*255), int(b*255)]
def extract_colors(
image: str,
palette_size: int = 5,
resize: bool = True,
sort_mode: Literal["luminance", "frequency"] | None = None,
) -> Palette:
img = Image.open(image).convert("RGB")
# open the image
img = img.resize((256, 256))
width, height = img.size
arr = np.asarray(img)
colors = k_means_extraction(arr, height, width, palette_size)
if sort_mode == "luminance":
colors.sort(key=lambda c: c.luminance, reverse=False)
else:
colors.sort(reverse=True)
return Palette(colors)
if __name__ == "__main__":
try:
img = sys.argv[1]
except IndexError:
img = "/home/nx2/Pictures/wallpapers/absolute-cinema-acid.png"
palette = extract_colors(image=img, palette_size=3)
accent = ensure_color(c=palette[0], alter_sat=False)
secondary = ensure_color(c=palette[1], alter_sat=True)
tertiary = ensure_color(c=palette[2], alter_sat=False)
weird = alter_hue(ilist=secondary, hue=180)
special = alter_hue(ilist=accent, hue=180)
foreground = alter_l(accent, 0.9)
background = alter_l(accent, 0.1)
d = {
"base": {
"foreground": list_to_hex(foreground),
"background": list_to_hex(background)
},
"to_alter": {
"accent": list_to_hex(accent),
"secondary": list_to_hex(secondary),
"tertiary": list_to_hex(tertiary),
"special": list_to_hex(special),
"weird": list_to_hex(weird)
}
}
with open("/home/nx2/nix-dots/flake-modules/colors.json", "w") as f:
f.write(json.dumps(d, indent=4))
'')
];
}

View File

@@ -43,7 +43,7 @@ lib.mkIf (user != "tv")
image = [
{ run = ''imv "$@"''; desc = "imv";}
{ run = ''gimp "$@"''; desc = "gimp";}
{ run = ''swww img "$@"''; desc = "swww wallpaper";}
{ run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$@"''; desc = "swww wallpaper";}
];
font = [
{ run = ''fontpreview "$@"''; desc = "fontpreview"; }

124
home.nix
View File

@@ -1,76 +1,58 @@
{ config, pkgs, pkgs-unstable, lib, system, nvidia, host, user, rice, allowed, secrets, ... }:
{ pkgs, pkgs-unstable, lib, host, user, inputs, ... }:
{
imports = [
./home-modules/vscode.nix
./home-modules/nvidia.nix
# ./home-modules/firefox.nix
./home-modules/discord.nix
./home-modules/matrix.nix
./home-modules/chatterino.nix
./home-modules/email.nix
./home-modules/bitwarden.nix
./home-modules/virt-manager.nix
./home-modules/office.nix
./home-modules/obs.nix
./home-modules/sent.nix
./home-modules/gestures.nix
./home-modules/pnx.nix
./home-modules/hyprland.nix
./home-modules/hyprland-autoname-workspaces.nix
./home-modules/waybar.nix
./home-modules/nx-gcal-event.nix
./home-modules/wlogout.nix
./home-modules/rofi.nix
./home-modules/games.nix
./home-modules/kitty.nix
./home-modules/fish.nix
./home-modules/auto-mount.nix
./home-modules/bash.nix
./home-modules/starship.nix
# ./home-modules/nvim.nix
./home-modules/helix.nix
./home-modules/vale.nix
./home-modules/yazi.nix
./home-modules/zoxide.nix
./home-modules/nh.nix
./home-modules/ssh.nix
./home-modules/gpg.nix
./home-modules/sops.nix
./home-modules/git.nix
./home-modules/mako.nix
./home-modules/gtk.nix
./home-modules/qt.nix
./home-modules/latex.nix
./home-modules/pandoc.nix
./home-modules/programming/python.nix
./home-modules/programming/c.nix
./home-modules/programming/node.nix
./home-modules/programming/gleam.nix
./home-modules/bitwarden.nix
./home-modules/chatterino.nix
./home-modules/color-pallete.nix
];
./home-modules/direnv.nix
./home-modules/discord.nix
./home-modules/email.nix
# ./home-modules/firefox.nix
./home-modules/fish.nix
# ./home-modules/foot.nix
./home-modules/games.nix
./home-modules/gestures.nix
./home-modules/git.nix
./home-modules/gpg.nix
./home-modules/gtk.nix
./home-modules/helix.nix
./home-modules/hyprland-autoname-workspaces.nix
./home-modules/hyprland.nix
./home-modules/kitty.nix
./home-modules/latex.nix
./home-modules/mako.nix
./home-modules/matrix.nix
./home-modules/nh.nix
./home-modules/nvidia.nix
./home-modules/nx-gcal-event.nix
./home-modules/obs.nix
./home-modules/office.nix
./home-modules/ollama.nix
./home-modules/pandoc.nix
./home-modules/pnx.nix
./home-modules/programming/c.nix
./home-modules/programming/gleam.nix
./home-modules/programming/node.nix
./home-modules/programming/python.nix
./home-modules/qt.nix
./home-modules/rofi.nix
./home-modules/sent.nix
./home-modules/sops.nix
./home-modules/ssh.nix
./home-modules/starship.nix
./home-modules/vale.nix
./home-modules/virt-manager.nix
./home-modules/vscode.nix
./home-modules/wallpaper-to-colors.nix
./home-modules/waybar.nix
./home-modules/wlogout.nix
./home-modules/yazi.nix
./home-modules/zoxide.nix ];
home.username = user;
home.homeDirectory = "/home/${user}";
home.stateVersion = "24.05";
nixpkgs.config = {
allowUnfree = true;
# allowUnfreePredicate = (pkg: true);
# allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) allowed.unfree-packages;
permittedInsecurePackages = allowed.inecure-packages;
# cudaSupport = nvidia.enable;
# enableParallelBuildingByDefault = true;
};
home.packages = with pkgs; [
chromium
@@ -91,6 +73,7 @@
piper-tts
sssnake pipes
dig
screen
gnumake
cmake
@@ -102,16 +85,19 @@
wl-clipboard
xclip
xournal
inputs.zen-browser.packages."${system}".default
] ++ (with pkgs-unstable; [
obsidian
firefox
]) ++ (if host != "NxACE" then (with pkgs; [
signal-desktop
obsidian
zoom-us
gimp
inkscape
]) else (with pkgs; [
]) else (with pkgs-unstable; [
]));
xdg = {

View File

@@ -1,4 +1,4 @@
{ lib, ... }:
lib:
let
# takes in "ff0044" (no hash!) and returns { r = "ff", g = "00", b = "44" }
slice-hex = hex: with builtins; { r = substring 0 2 hex; g = substring 2 2 hex; b = substring 4 2 hex; };

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
{ ... }:
{
services.udisks2.enable = true;
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, host, inputs, ... }:
{ config, pkgs, pkgs-unstable, lib, host, inputs, ... }:
let
grub-theme-ascii-diana = (pkgs.fetchFromGitea {
domain = "git.nx2.site";
@@ -76,7 +76,7 @@ in
# '';
# };
};
# kernelPackages = pkgs.linuxPackages_latest;
kernelPackages = pkgs-unstable.linuxPackages_zen;
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
kernelModules = [ "v4l2loopback" ];
extraModprobeConfig = ''options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1'';

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, user, allowed, secrets, ... }:
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
@@ -43,4 +43,4 @@
davmail.enableKerberos = false;
};
};
}
}

28
system-modules/fcitx5.nix Normal file
View File

@@ -0,0 +1,28 @@
{ pkgs-unstable, ... }:
{
i18n.inputMethod = {
enabled = "fcitx5";
# type = "fcitx5"; # for later than 24.05
# enable = true;
fcitx5 = {
waylandFrontend = true;
addons = with pkgs-unstable; [
rime-data
fcitx5-rime
fcitx5-gtk
fcitx5-chinese-addons
fcitx5-catppuccin
];
};
};
services.xserver.desktopManager.runXdgAutostartIfNone = true;
environment.variables = {
GLFW_IM_MODULE = "fcitx";
GTK_IM_MODULE = "fcitx";
INPUT_METHOD = "fcitx";
XMODIFIERS = "@im=fcitx";
IMSETTINGS_MODULE = "fcitx";
QT_IM_MODULE = "fcitx";
SDL_IM_MODULE = "fcitx";
};
}

View File

@@ -4,12 +4,9 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
environment.systemPackages = if host == "NxNORTH" then with pkgs; [
environment.systemPackages = with pkgs; [
ntfs3g
btrfs-progs
] else if host == "NxXPS" then with pkgs; [
ntfs3g
] else [];
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
# boot.initrd.kernelModules = [ ];
@@ -19,7 +16,7 @@
fileSystems = if host != "NxACE" then {
"/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
"/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; };
"/home/${user}/shared" = { device = "/dev/disk/by-label/shared"; fsType = if host == "NxXPS" then "ntfs" else "btrfs"; };
"/home/${user}/shared" = { device = "/dev/disk/by-label/shared"; fsType = "ntfs"; options = [ "uid:1000" "gid:100" ]; };
} else {
"/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
"/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; };

View File

@@ -1,5 +1,4 @@
{ pkgs, lib, host, secrets, ... }:
lib.mkIf (host != "NxACE")
{
environment.systemPackages = with pkgs; [
strongswanNM
@@ -38,19 +37,19 @@ lib.mkIf (host != "NxACE")
};
connections = {
hsmw = {
keyexchange = "ikev2";
left = "%defaultroute";
leftid = "%any";
leftauth = "eap";
eap_identity = "${secrets.email.hsmw.un}@hs-mittweida.de";
leftsourceip = "%config";
leftdns = "%config4";
leftfirewall = "no";
right = "141.55.128.84";
rightid = "@vpn4.hs-mittweida.de";
rightsubnet = "0.0.0.0/0";
rightauth = "pubkey";
auto = "add";
keyexchange = "ikev2";
left = "%defaultroute";
leftid = "%any";
leftauth = "eap";
eap_identity = "${secrets.email.hsmw.un}@hs-mittweida.de";
leftsourceip = "%config";
leftdns = "%config4"; # Ensure that DNS resolution works as expected
leftfirewall = "no"; # Keep firewall disabled, but manually check rules
right = "141.55.128.84";
rightid = "@vpn4.hs-mittweida.de";
rightsubnet = "141.55.128.0/16"; # Split tunneling: Only route traffic for the VPN subnet
rightauth = "pubkey";
auto = "add";
};
};
managePlugins = true;

16
system-modules/kanata.nix Normal file
View File

@@ -0,0 +1,16 @@
{ pkgs, ... }:
{
services.kanata = {
enable = true;
package = pkgs.kanata;
keyboards.default.config = ''
(defsrc
caps
)
(deflayer default
esc
)
'';
};
}

View File

@@ -3,12 +3,16 @@
let
in
{
networking.nameservers = [
"1.1.1.1"
"8.8.8.8"
];
networking.hostName = host;
networking.networkmanager = {
enable = true;
};
networking.enableIPv6 = true;
networking.enableIPv6 = false;
}

View File

@@ -1,69 +1,68 @@
{ config, pkgs, pkgs-unstable, lib, nvidia, ... }:
{ config, pkgs, lib, nvidia, ... }:
lib.mkIf nvidia.enable
{
config = lib.mkIf nvidia.enable {
environment.systemPackages = with pkgs; [
lshw
glxinfo
(pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'')
] ++ [
# pkgs-unstable.nvtopPackages.intel
# pkgs-unstable.nvtopPackages.nvidia
];
environment.systemPackages = with pkgs; [
lshw
glxinfo
(pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'')
# ] ++ [
# pkgs-unstable.nvtopPackages.intel
# pkgs-unstable.nvtopPackages.nvidia
];
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = [ "nvidia" ];
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
nvidia = {
prime = lib.mkIf nvidia.prime {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
offload = {
enable = true;
enableOffloadCmd = true;
};
hardware = {
nvidia = {
prime = lib.mkIf nvidia.prime {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
offload = {
enable = true;
enableOffloadCmd = true;
};
modesetting.enable = true;
# Modesetting is required.
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = true;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
modesetting.enable = true;
# Modesetting is required.
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = nvidia.prime;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
}

View File

@@ -1,5 +1,8 @@
{ config, pkgs, lib, user, host, ... }:
# lib.mkIf false
lib.mkIf (host == "NxACE")
# ((import ./nx2site/proxy.nix { inherit config pkgs lib user; }) //
(
{
sops.secrets = {
"nx2site/namecheap.pw" = { };
@@ -14,18 +17,15 @@ lib.mkIf (host == "NxACE")
Unit = "namecheap-dynamic-dns.service";
};
};
services."namecheap-dynamic-dns" =
let
services."namecheap-dynamic-dns" = let
u = let
domain = "nx2.site";
passord-file-path = config.sops.secrets."nx2site/namecheap.pw".path;
# passord-file-path = config.sops.secrets."nx2site/namecheap.pw".path;
log-file-path = "/var/log/update_namecheap.log";
count-file-path = "/var/log/update_namecheap-count.txt";
in
pkgs.writers.writePython3Bin "update_namecheap" {
libraries = with pkgs.python311Packages; [
requests
];
in pkgs.writers.writePython3Bin "update_namecheap" {
libraries = with pkgs.python311Packages; [ requests ];
flakeIgnore = [ "E501" "E305" "E701" "E704" "E302" "E114" "F841" ];
} ''
import requests
@@ -58,7 +58,7 @@ lib.mkIf (host == "NxACE")
# Perform DNS updates
resp_base = requests.get(f"https://dynamicdns.park-your-domain.com/update?host=@&domain=${domain}&password={pw}&ip={my_ip}")
resp_subd = requests.get(f"https://dynamicdns.park-your-domain.com/update?host=*&domain=${domain}&password={pw}&ip={my_ip}")
# Reset the count file
with open("${count-file-path}", 'w') as f: f.write('0')
@@ -71,19 +71,51 @@ lib.mkIf (host == "NxACE")
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--force', action='store_true', help='Force update')
args = parser.parse_args()
main(args.force)
'';
in
{
in {
script = ''
set -eu
${u}/bin/update_namecheap
'';
serviceConfig = {
Type = "oneshot";
# User = "nx2";
};
};
};
}
# 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'
"172.1.2.1" = [ "staticweb.docker" ];
"172.1.3.1" = [ "matrix.docker" ];
# "172.1.0.9" = [ "matrixdb.docker" ];
"172.1.4.1" = [ "matrix-ss.docker" ];
# "172.1.0.7" = [ "matrix-ssdb.docker" ];
"172.1.5.1" = [ "pw.docker" ];
"172.1.6.1" = [ "git.docker" ];
# "172.1.0.10" = [ "gitdb.docker" ];
"172.1.7.1" = [ "nn.docker" ];
"172.1.8.1" = [ "llm.docker" ];
# "172.1.9.1" = [ "proxy.docker" ];
"172.1.10.1" = [ "share.docker" ];
"172.1.11.1" = [ "odq.docker" ];
};
})

View File

@@ -0,0 +1,180 @@
{ config, pkgs, lib, user }:
lib.mkIf false
{
sops.secrets = {
"nx2site/sslCertificate.pem" = { owner = config.services.nginx.user; };
"nx2site/sslCertificateKey.pem" = { owner = config.services.nginx.user; };
"nx2site/dhparams.pem" = { owner = config.services.nginx.user; };
};
services.nginx = {
enable = true;
additionalModules = [];
# appendConfig = '''';
clientMaxBodySize = "20m";
defaultHTTPListenPort = 80;
defaultListenAddresses = [ "0.0.0.0" ] ++ lib.optional config.networking.enableIPv6 "[::0]";
defaultListen = [ {
addr = "0.0.0.0";
ssl = true;
port = 443;
proxyProtocol = true;
}];
defaultMimeTypes = "${pkgs.mailcap}/etc/nginx/mime.types";
defaultSSLListenPort = 443;
enableQuicBPF = true;
enableReload = true;
# eventsConfig = '''';
# logError = ;
# mapHashBucketSize = ;
# mapHashMaxSize = ;
package = pkgs.nginxQuic;
# preStart = true;
proxyResolveWhileRunning = false;
proxyTimeout = "20s";
recommendedBrotliSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedZstdSettings = true;
serverTokens = false;
# sslCiphers = true;
sslDhparam = config.sops.secrets."nx2site/dhparams.pem".path;
sslProtocols = "TLSv1.2 TLSv1.3";
statusPage = false;
streamConfig = ""; # udp config
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
sslCertificate = config.sops.secrets."nx2site/sslCertificate.pem".path;
sslCertificateKey = config.sops.secrets."nx2site/sslCertificateKey.pem".path;
kTLS = true; http2 = true; http3 = true; http3_hq = true; quic = true;
in
{
"nx2.site" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
locations = {
"/" = {
proxyPass = "http://staticweb";
# extraConfig = [ ''add_header Alt-Svc 'h3=":443"; ma=86400';'' ''add_header Cache-Control "public";'' ] ++ common-location-conf;
};
"/.well-known/matrix/client" = {
return = ''200 '{"m.homeserver": {"base_url": "https://matrix.nx2.site"}, "org.matrix.msc3575.proxy": {"url": "https://matrix-ss.nx2.site"}}' '';
extraConfig = [ "default_type application/json;" "add_header Access-Control-Allow-Origin *;" ];
};
"/.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.nx2.site" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
listen = [
{ addr = "0.0.0.0"; port = 443; ssl = true; }
{ addr = "0.0.0.0"; port = 8448; ssl = true; }
];
locations = {
"/" = {
proxyPass = "http://matrix";
# extraConfig = [ ''add_header Alt-Svc 'h3=":443"; ma=86400';'' ''add_header Cache-Control "public";'' ] ++ common-location-conf;
};
};
};
"matrix-ss.nx2.site" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
# "resolver 1.1.1.1;"
# "client_max_body_size 500M;"
# ];
locations = {
"/" = { proxyPass = "http://pw"; };
};
};
# "dev.nx2.site" = {
# inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
# 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"; };
};
};
"share.nx2.site" = {
inherit sslCertificate sslCertificateKey kTLS http2 http3 http3_hq quic;
# listen = [ { addr = "0.0.0.0"; port = 443; ssl = true; } ];
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"; };
};
};
};
};
}

View File

@@ -1,47 +1,22 @@
{ pkgs, pkgs-unstable, lib, host, nvidia, ... }:
{
environment.systemPackages = with pkgs-unstable; [
ollama
];
{ pkgs, pkgs-unstable, pkgs-latest, lib, host, nvidia, ... }:
let
p = pkgs-latest.ollama;
# p = pkgs-unstable.ollama.overrideAttrs (oldAttrs: rec {
# inherit (oldAttrs) pname;
# version = "0.3.0";
# src = pkgs.fetchFromGitHub {
# owner = "ollama";
# repo = "ollama";
# rev = "v${version}";
# hash = "sha256-69CpRAggx6a1NJq+CA9QliXuUbDgC1ERRuA3y17KVAM=";
# fetchSubmodules = true;
# };
# });
in {
environment.systemPackages = [ p ];
# services.ollama.environmentVariables = {
# OLLAMA_ORIGINS = "*";
# };
# systemd.services.ollama = {
# environment.OLLAMA_ORIGINS = "*";
# description = "Ollama Service";
# after = [ "network-online.target" "ollama-doesnt-respect-xdg-data-home.service" ];
# serviceConfig = {
# Type = "simple";
# # Environment = "\"XDG_DATA_HOME=/run/current-system/sw/share\"";
# ExecStart = "${pkgs.ollama}/bin/ollama serve";
# User = "ollama";
# Group = "ollama";
# Restart = "always";
# RestartSec = "3";
# };
# wantedBy = [ "default.target" ];
# };
# users.users.ollama = {
# isSystemUser = true;
# home = "/usr/share/ollama";
# shell = "/bin/false";
# group = "ollama";
# };
# users.groups.ollama = {};
# systemd.services.ollama-doesnt-respect-xdg-data-home = {
# wantedBy = ["multi-user.target"];
# script = ''
# mkdir -p /usr/share/ollama/.ollama
# chown ollama:ollama -R /usr/share/ollama
# '';
# };
services.ollama = {
# package = pkgs-unstable.ollama;
package = p;
enable = true;
acceleration = lib.mkIf nvidia.enable "cuda";
listenAddress = if host == "NxACE" then "0.0.0.0:11434" else "127.0.0.1:11434";

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, system, user, allowed, secrets, ... }:
{ config, pkgs, lib, ... }:
{
services.pipewire = {
@@ -9,4 +9,4 @@
# If you want to use JACK applications, uncomment this
jack.enable = true;
};
}
}

View File

@@ -17,7 +17,12 @@ let
};
dirs = {
default = { name = "sync"; path = "/home/${user}/sync"; };
default = { name = "sync"; path = "/home/${user}/sync"; };
s21u-dcim = { name = "s21u-dcim"; path = "/vault/Pictures/Lennart"; };
diane-dcim = { name = "diane-dcim"; path = "/vault/Pictures/Diane"; };
dianesd-dcim = { name = "dianesd-dcim"; path = "/vault/Pictures/Diane-SD"; };
daniel-dcim = { name = "daniel-dcim"; path = "/vault/Pictures/Daniel"; };
tessa-dcim = { name = "tessa-dcim"; path = "/vault/Pictures/Tessa"; };
};
in
lib.mkIf (user != "tv")
@@ -45,8 +50,7 @@ lib.mkIf (user != "tv")
) else if (host == "NxNORTH") then (
xps // ace // s21u
) else (
# north // xps // s21u // diane // daniel // tessa // georg
north // xps // s21u
north // xps // s21u // diane // daniel // tessa // georg
);
folders = with dirs; if (host == "NxXPS") then {
"${default.name}" = {
@@ -58,11 +62,31 @@ lib.mkIf (user != "tv")
path = default.path;
devices = with devices; (justname [ xps ace s21u ]);
};
} else {
} else { # NxACE
"${default.name}" = {
path = default.path;
devices = with devices; (justname [ xps north s21u ]);
};
"${s21u-dcim.name}" = {
path = s21u-dcim.path;
devices = with devices; (justname [ s21u ]);
};
"${diane-dcim.name}" = {
path = diane-dcim.path;
devices = with devices; (justname [ diane ]);
};
"${dianesd-dcim.name}" = {
path = dianesd-dcim.path;
devices = with devices; (justname [ diane ]);
};
"${daniel-dcim.name}" = {
path = daniel-dcim.path;
devices = with devices; (justname [ daniel ]);
};
"${tessa-dcim.name}" = {
path = tessa-dcim.path;
devices = with devices; (justname [ tessa ]);
};
};
gui = {
theme = "black";

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, system, host, user, allowed, secrets, ... }:
{ pkgs, lib, host, user, ... }:
{
users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish
@@ -10,13 +10,11 @@
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID1RPCcS8DtIf75a2FEW4d8X6WTVeLlmretoLqppvZlJ" # From [A] GPG Sub Key
];
packages = with pkgs; []; # all in home.nix
};
users.users.tv = lib.mkIf (host == "NxACE") {
isNormalUser = true;
extraGroups = [ "networkmanager" "audio" "video" "uinput" ];
useDefaultShell = true;
packages = with pkgs; []; # all in home.nix
};