options follow my.schema to avoid conflicts

This commit is contained in:
2024-04-19 23:19:21 -06:00
parent f1a1656155
commit 36f4b83c82
30 changed files with 1502 additions and 1657 deletions

View File

@@ -1,5 +1,6 @@
{ config, lib, pkgs, options, ... }: { { config, lib, pkgs, options, ... }: {
imports = [ ./modules/apps.nix ./modules/dev.nix ]; imports =
[ ./modules/apps.nix ./modules/dev.nix ./modules/services.nix ./jawz.nix ];
system = { system = {
copySystemConfiguration = true; copySystemConfiguration = true;
stateVersion = "23.11"; stateVersion = "23.11";

View File

@@ -24,7 +24,6 @@ in {
''download -u jawz -i "$(cat $LW | fzf --multi --exact -i)"''; ''download -u jawz -i "$(cat $LW | fzf --multi --exact -i)"'';
cp = "cp -i"; cp = "cp -i";
mv = "mv -i"; mv = "mv -i";
mkcd = ''mkdir -pv "$1" && cd "$1" || exit'';
mkdir = "mkdir -p"; mkdir = "mkdir -p";
rm = "trash"; rm = "trash";
".." = "cd .."; ".." = "cd ..";
@@ -50,12 +49,12 @@ in {
enableVteIntegration = true; enableVteIntegration = true;
initExtra = '' initExtra = ''
$HOME/.local/bin/pokemon-colorscripts -r --no-title $HOME/.local/bin/pokemon-colorscripts -r --no-title
# Lists
list_root="${config.xdg.configHome}"/jawz/lists/jawz list_root="${config.xdg.configHome}"/jawz/lists/jawz
export LW=$list_root/watch.txt export LW=$list_root/watch.txt
export LI=$list_root/instant.txt export LI=$list_root/instant.txt
export LC=$list_root/comic.txt export LC=$list_root/comic.txt
export command_timeout=30 export command_timeout=60
if command -v fzf-share >/dev/null; then if command -v fzf-share >/dev/null; then
source "$(fzf-share)/key-bindings.bash" source "$(fzf-share)/key-bindings.bash"
@@ -64,8 +63,9 @@ in {
nixos-reload () { nixos-reload () {
NIXOSDIR=/home/jawz/Development/NixOS NIXOSDIR=/home/jawz/Development/NixOS
nix-store --add-fixed sha256 $NIXOSDIR/scripts/PureRef-1.11.1_x64.Appimage nix-store --add-fixed sha256 \
nixfmt $NIXOSDIR/workstation/*.nix $NIXOSDIR/PureRef-1.11.1_x64.Appimage
fd --full-path $NIXOSDIR -e nix -x nixfmt \;
sudo unbuffer nixos-rebuild switch -I \ sudo unbuffer nixos-rebuild switch -I \
nixos-config="$NIXOSDIR/hosts/$HOSTNAME/configuration.nix" \ nixos-config="$NIXOSDIR/hosts/$HOSTNAME/configuration.nix" \
|& nom |& nom

View File

@@ -11,16 +11,15 @@ let
(builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") {
config = config.nixpkgs.config; config = config.nixpkgs.config;
}; };
jawzManageLibrary = pkgs.writeScriptBin jawzManageLibrary = pkgs.writeScriptBin "manage-library"
"manage-library" (builtins.readFile ../scripts/manage-library.sh); (builtins.readFile ../scripts/manage-library.sh);
jawzTasks = pkgs.writeScriptBin jawzTasks =
"tasks" (builtins.readFile ../scripts/tasks.sh); pkgs.writeScriptBin "tasks" (builtins.readFile ../scripts/tasks.sh);
jawzSubs = pkgs.writeScriptBin jawzSubs =
"sub-sync" (builtins.readFile ../scripts/sub-sync.sh); pkgs.writeScriptBin "sub-sync" (builtins.readFile ../scripts/sub-sync.sh);
jawzStream = pkgs.writeScriptBin jawzStream =
"stream-dl" (builtins.readFile ../scripts/stream-dl.sh); pkgs.writeScriptBin "stream-dl" (builtins.readFile ../scripts/stream-dl.sh);
in in { # Remember to close this bracket at the end of the document
{ # Remember to close this bracket at the end of the document
imports = [ imports = [
./fstab.nix ./fstab.nix
@@ -49,8 +48,7 @@ networking = {
2049 # nfs 2049 # nfs
]; ];
open_firewall_port_ranges = [ ]; open_firewall_port_ranges = [ ];
in in {
{
enable = true; enable = true;
allowPing = true; allowPing = true;
allowedTCPPorts = open_firewall_ports; allowedTCPPorts = open_firewall_ports;
@@ -63,9 +61,7 @@ networking = {
time.timeZone = "America/Mexico_City"; time.timeZone = "America/Mexico_City";
i18n = { i18n = {
defaultLocale = "en_CA.UTF-8"; defaultLocale = "en_CA.UTF-8";
extraLocaleSettings = { extraLocaleSettings = { LC_MONETARY = "es_MX.UTF-8"; };
LC_MONETARY = "es_MX.UTF-8";
};
}; };
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
@@ -77,7 +73,8 @@ system = {
copySystemConfiguration = true; copySystemConfiguration = true;
stateVersion = "${version}"; stateVersion = "${version}";
}; };
nix = let featuresList = [ nix = let
featuresList = [
"nixos-test" "nixos-test"
"benchmark" "benchmark"
"big-parallel" "big-parallel"
@@ -85,8 +82,7 @@ nix = let featuresList = [
"gccarch-${cpuArchitecture}" "gccarch-${cpuArchitecture}"
"gccarch-znver3" "gccarch-znver3"
]; ];
in in {
{
gc = { gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
@@ -142,9 +138,7 @@ nixpkgs = {
hostPlatform = lib.mkDefault "x86_64-linux"; hostPlatform = lib.mkDefault "x86_64-linux";
config = { config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [ permittedInsecurePackages = [ "openssl-1.1.1w" ];
"openssl-1.1.1w"
];
}; };
# localSystem = { # localSystem = {
# gcc.arch = cpuArchitecture; # gcc.arch = cpuArchitecture;
@@ -171,14 +165,21 @@ users = {
}; };
users.users.jawz = { users.users.jawz = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "docker" extraGroups = [
"scanner" "lp" "piracy" "kavita" "wheel"
"render" "video" "networkmanager"
"docker"
"scanner"
"lp"
"piracy"
"kavita"
"render"
"video"
]; ];
initialPassword = "password"; initialPassword = "password";
openssh = { openssh = {
authorizedKeys.keys = [ authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5GaQM4N+yGAByibOFQOBVMV/6TjOfaGIP+NunMiK76 gpodeacero\cdreyes@100CDREYES" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5GaQM4N+yGAByibOFQOBVMV/6TjOfaGIP+NunMiK76 gpodeacerocdreyes@100CDREYES"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkpeIV9G26W2/e9PsjBx3sNwPGoicJ807ExRGh4KjhW jawz@server" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkpeIV9G26W2/e9PsjBx3sNwPGoicJ807ExRGh4KjhW jawz@server"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2wtsaMvfEUm//2YnFHyrc16o+TOXXBfIGPJ9nL8RMp jawz@workstation" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2wtsaMvfEUm//2YnFHyrc16o+TOXXBfIGPJ9nL8RMp jawz@workstation"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBEblxSDhWPEo33crSjooeUg4W02ruENxHLmmBqCuIo jawz@galaxy" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBEblxSDhWPEo33crSjooeUg4W02ruENxHLmmBqCuIo jawz@galaxy"
@@ -211,12 +212,14 @@ jawzManageLibrary
jawzTasks jawzTasks
jawzSubs jawzSubs
jawzStream jawzStream
(writeScriptBin "ffmpeg4discord" (builtins.readFile ../scripts/ffmpeg4discord.py)) (writeScriptBin "ffmpeg4discord"
(builtins.readFile ../scripts/ffmpeg4discord.py))
(writeScriptBin "ffmpreg" (builtins.readFile ../scripts/ffmpreg.sh)) (writeScriptBin "ffmpreg" (builtins.readFile ../scripts/ffmpreg.sh))
(writeScriptBin "split-dir" (builtins.readFile ../scripts/split-dir.sh)) (writeScriptBin "split-dir" (builtins.readFile ../scripts/split-dir.sh))
(writeScriptBin "pika-list" (builtins.readFile ../scripts/pika-list.sh)) (writeScriptBin "pika-list" (builtins.readFile ../scripts/pika-list.sh))
(writeScriptBin "run" (builtins.readFile ../scripts/run.sh)) (writeScriptBin "run" (builtins.readFile ../scripts/run.sh))
(writeScriptBin "find-dup-episodes" (builtins.readFile ../scripts/find-dup-episodes.sh)) (writeScriptBin "find-dup-episodes"
(builtins.readFile ../scripts/find-dup-episodes.sh))
tldr # man for retards tldr # man for retards
@@ -233,7 +236,8 @@ nixfmt # linting
cachix # why spend time compiling? cachix # why spend time compiling?
# PYTHON. # PYTHON.
(python3.withPackages (ps: with ps; [ (python3.withPackages (ps:
with ps; [
flake8 # wraper for pyflakes, pycodestyle and mccabe flake8 # wraper for pyflakes, pycodestyle and mccabe
isort # sort Python imports isort # sort Python imports
nose # testing and running python scripts nose # testing and running python scripts
@@ -252,8 +256,7 @@ cachix # why spend time compiling?
src = ../scripts/download/.; src = ../scripts/download/.;
doCheck = false; doCheck = false;
buildInputs = [ setuptools ]; buildInputs = [ setuptools ];
propagatedBuildInputs = propagatedBuildInputs = [ pyyaml types-pyyaml ];
[ pyyaml types-pyyaml ];
}) })
(buildPythonApplication rec { (buildPythonApplication rec {
pname = "ffpb"; pname = "ffpb";
@@ -264,8 +267,7 @@ cachix # why spend time compiling?
}; };
doCheck = false; doCheck = false;
buildInputs = [ setuptools ]; buildInputs = [ setuptools ];
propagatedBuildInputs = propagatedBuildInputs = [ tqdm ];
[ tqdm ];
}) })
# (buildPythonApplication rec { # (buildPythonApplication rec {
# pname = "qbit_manage"; # pname = "qbit_manage";
@@ -292,7 +294,8 @@ cachix # why spend time compiling?
prettier # Linter prettier # Linter
pnpm # Package manager pnpm # Package manager
]); }; # <--- end of package list ]);
}; # <--- end of package list
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;
@@ -308,11 +311,12 @@ programs.bash = {
hh = "hstr"; hh = "hstr";
ls = "eza --icons --group-directories-first"; ls = "eza --icons --group-directories-first";
edit = "emacsclient -t"; edit = "emacsclient -t";
comic = "download -u jawz -i \"$(cat $LC | fzf --multi --exact -i)\""; comic = ''download -u jawz -i "$(cat $LC | fzf --multi --exact -i)"'';
gallery = "download -u jawz -i \"$(cat $LW | fzf --multi --exact -i)\""; gallery =
''download -u jawz -i "$(cat $LW | fzf --multi --exact -i)"'';
cp = "cp -i"; cp = "cp -i";
mv = "mv -i"; mv = "mv -i";
mkcd = "mkdir -pv \"$1\" && cd \"$1\" || exit"; mkcd = ''mkdir -pv "$1" && cd "$1" || exit'';
mkdir = "mkdir -p"; mkdir = "mkdir -p";
rm = "trash"; rm = "trash";
".." = "cd .."; ".." = "cd ..";
@@ -326,11 +330,13 @@ programs.bash = {
f = "fzf --multi --exact -i"; f = "fzf --multi --exact -i";
sc = "systemctl --user"; sc = "systemctl --user";
jc = "journalctl --user -xefu"; jc = "journalctl --user -xefu";
open-gallery = "cd /mnt/pool/scrapping/JawZ/gallery-dl && open-gallery = ''
xdg-open $(fd . ./ Husbands -tdirectory -d 1 | fzf -i)\""; cd /mnt/pool/scrapping/JawZ/gallery-dl &&
unique-extensions = "fd -tf | rev | cut -d. -f1 | rev | xdg-open $(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"'';
unique-extensions = ''
fd -tf | rev | cut -d. -f1 | rev |
tr '[:upper:]' '[:lower:]' | sort | tr '[:upper:]' '[:lower:]' | sort |
uniq --count | sort -rn"; uniq --count | sort -rn'';
}; };
enableVteIntegration = true; enableVteIntegration = true;
initExtra = '' initExtra = ''
@@ -369,7 +375,8 @@ xdg = {
}; };
configFile = { configFile = {
"wgetrc".source = ../dotfiles/wget/wgetrc; "wgetrc".source = ../dotfiles/wget/wgetrc;
"configstore/update-notifier-npm-check.json".source = ../dotfiles/npm/update-notifier-npm-check.json; "configstore/update-notifier-npm-check.json".source =
../dotfiles/npm/update-notifier-npm-check.json;
"npm/npmrc".source = ../dotfiles/npm/npmrc; "npm/npmrc".source = ../dotfiles/npm/npmrc;
"gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json; "gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json;
"htop/htoprc".source = ../dotfiles/htop/htoprc; "htop/htoprc".source = ../dotfiles/htop/htoprc;
@@ -379,9 +386,7 @@ xdg = {
}; };
programs = { programs = {
helix = { helix = { enable = true; };
enable = true;
};
hstr.enable = true; hstr.enable = true;
emacs.enable = true; emacs.enable = true;
direnv = { direnv = {
@@ -425,7 +430,8 @@ services = {
}; };
}; };
}; }; };
};
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
@@ -526,10 +532,7 @@ services = {
smartd.enable = true; smartd.enable = true;
btrfs.autoScrub = { btrfs.autoScrub = {
enable = true; enable = true;
fileSystems = [ fileSystems = [ "/" "/mnt/pool" ];
"/"
"/mnt/pool"
];
}; };
openssh = { openssh = {
enable = true; enable = true;
@@ -545,7 +548,8 @@ services = {
systemd = { systemd = {
packages = let packages = let
pkgs = import (builtins.fetchTarball { pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/9957cd48326fe8dbd52fdc50dd2502307f188b0d.tar.gz"; url =
"https://github.com/NixOS/nixpkgs/archive/9957cd48326fe8dbd52fdc50dd2502307f188b0d.tar.gz";
}) { }; }) { };
myPkg = pkgs.qbittorrent-nox; myPkg = pkgs.qbittorrent-nox;
@@ -557,18 +561,14 @@ in [ myPkg ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
}; };
}; };
timers = { timers = { };
};
user = { user = {
services = { services = {
"stream@" = { "stream@" = {
description = "monitors a stream channel for online streams."; description = "monitors a stream channel for online streams.";
restartIfChanged = true; restartIfChanged = true;
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ path = [ pkgs.nix jawzStream ];
pkgs.nix
jawzStream
];
serviceConfig = { serviceConfig = {
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 30; RestartSec = 30;
@@ -591,10 +591,7 @@ in [ myPkg ];
restartIfChanged = true; restartIfChanged = true;
description = "Run the manage library bash script"; description = "Run the manage library bash script";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ path = [ pkgs.nix jawzManageLibrary ];
pkgs.nix
jawzManageLibrary
];
serviceConfig = { serviceConfig = {
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 30; RestartSec = 30;
@@ -603,30 +600,27 @@ in [ myPkg ];
}; };
tasks = { tasks = {
restartIfChanged = true; restartIfChanged = true;
description = "Run a tasks script which keeps a lot of things organized"; description =
"Run a tasks script which keeps a lot of things organized";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ path = [ pkgs.nix jawzTasks ];
pkgs.nix
jawzTasks
];
serviceConfig = { serviceConfig = {
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 30; RestartSec = 30;
ExecStart = "${jawzTasks}/bin/tasks"; ExecStart = "${jawzTasks}/bin/tasks";
}; };
}; };
qbit_manage = let qbit_dir = "/home/jawz/Development/Git/qbit_manage"; in { qbit_manage = let qbit_dir = "/home/jawz/Development/Git/qbit_manage";
in {
restartIfChanged = true; restartIfChanged = true;
description = "Tidy up my torrents"; description = "Tidy up my torrents";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ path = [ pkgs.python3 pkgs.pipenv ];
pkgs.python3
pkgs.pipenv
];
serviceConfig = { serviceConfig = {
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 30; RestartSec = 30;
ExecStart = "${qbit_dir}/venv/bin/python3 ${qbit_dir}/qbit_manage.py -r -c ${qbit_dir}/config.yml"; ExecStart =
"${qbit_dir}/venv/bin/python3 ${qbit_dir}/qbit_manage.py -r -c ${qbit_dir}/config.yml";
}; };
}; };
}; };
@@ -649,27 +643,22 @@ in [ myPkg ];
"stream@tomayto\\x20picarto" = streamTimer // { }; "stream@tomayto\\x20picarto" = streamTimer // { };
tasks = { tasks = {
enable = true; enable = true;
description = "Run a tasks script which keeps a lot of things organized"; description =
"Run a tasks script which keeps a lot of things organized";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = { OnCalendar = "*:0/10"; };
OnCalendar = "*:0/10";
};
}; };
manage-library = { manage-library = {
enable = true; enable = true;
description = "Run the manage library bash script"; description = "Run the manage library bash script";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = { OnCalendar = "00:30"; };
OnCalendar = "00:30";
};
}; };
qbit_manage = { qbit_manage = {
enable = true; enable = true;
description = "Tidy up my torrents"; description = "Tidy up my torrents";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = { OnCalendar = "*:0/10"; };
OnCalendar = "*:0/10";
};
}; };
}; };
}; };

View File

@@ -11,16 +11,15 @@ let
(builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") {
config = config.nixpkgs.config; config = config.nixpkgs.config;
}; };
jawzManageLibrary = pkgs.writeScriptBin jawzManageLibrary = pkgs.writeScriptBin "manage-library"
"manage-library" (builtins.readFile ../scripts/manage-library.sh); (builtins.readFile ../scripts/manage-library.sh);
jawzTasks = pkgs.writeScriptBin jawzTasks =
"tasks" (builtins.readFile ../scripts/tasks.sh); pkgs.writeScriptBin "tasks" (builtins.readFile ../scripts/tasks.sh);
jawzSubs = pkgs.writeScriptBin jawzSubs =
"sub-sync" (builtins.readFile ../scripts/sub-sync.sh); pkgs.writeScriptBin "sub-sync" (builtins.readFile ../scripts/sub-sync.sh);
jawzStream = pkgs.writeScriptBin jawzStream =
"stream-dl" (builtins.readFile ../scripts/stream-dl.sh); pkgs.writeScriptBin "stream-dl" (builtins.readFile ../scripts/stream-dl.sh);
in in { # Remember to close this bracket at the end of the document
{ # Remember to close this bracket at the end of the document
imports = [ imports = [
./fstab.nix ./fstab.nix
@@ -50,8 +49,7 @@ networking = {
2049 # nfs 2049 # nfs
]; ];
open_firewall_port_ranges = [ ]; open_firewall_port_ranges = [ ];
in in {
{
enable = true; enable = true;
allowPing = true; allowPing = true;
allowedTCPPorts = open_firewall_ports; allowedTCPPorts = open_firewall_ports;
@@ -64,9 +62,7 @@ networking = {
time.timeZone = "America/Mexico_City"; time.timeZone = "America/Mexico_City";
i18n = { i18n = {
defaultLocale = "en_CA.UTF-8"; defaultLocale = "en_CA.UTF-8";
extraLocaleSettings = { extraLocaleSettings = { LC_MONETARY = "es_MX.UTF-8"; };
LC_MONETARY = "es_MX.UTF-8";
};
}; };
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
@@ -78,7 +74,8 @@ system = {
copySystemConfiguration = true; copySystemConfiguration = true;
stateVersion = "${version}"; stateVersion = "${version}";
}; };
nix = let featuresList = [ nix = let
featuresList = [
"nixos-test" "nixos-test"
"benchmark" "benchmark"
"big-parallel" "big-parallel"
@@ -86,8 +83,7 @@ nix = let featuresList = [
"gccarch-${cpuArchitecture}" "gccarch-${cpuArchitecture}"
"gccarch-znver3" "gccarch-znver3"
]; ];
in in {
{
gc = { gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
@@ -143,9 +139,7 @@ nixpkgs = {
hostPlatform = lib.mkDefault "x86_64-linux"; hostPlatform = lib.mkDefault "x86_64-linux";
config = { config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [ permittedInsecurePackages = [ "openssl-1.1.1w" ];
"openssl-1.1.1w"
];
}; };
# localSystem = { # localSystem = {
# gcc.arch = cpuArchitecture; # gcc.arch = cpuArchitecture;
@@ -171,14 +165,21 @@ users = {
}; };
users.users.jawz = { users.users.jawz = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "docker" extraGroups = [
"scanner" "lp" "piracy" "kavita" "wheel"
"render" "video" "networkmanager"
"docker"
"scanner"
"lp"
"piracy"
"kavita"
"render"
"video"
]; ];
initialPassword = "password"; initialPassword = "password";
openssh = { openssh = {
authorizedKeys.keys = [ authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5GaQM4N+yGAByibOFQOBVMV/6TjOfaGIP+NunMiK76 gpodeacero\cdreyes@100CDREYES" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5GaQM4N+yGAByibOFQOBVMV/6TjOfaGIP+NunMiK76 gpodeacerocdreyes@100CDREYES"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2wtsaMvfEUm//2YnFHyrc16o+TOXXBfIGPJ9nL8RMp jawz@workstation" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2wtsaMvfEUm//2YnFHyrc16o+TOXXBfIGPJ9nL8RMp jawz@workstation"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBEblxSDhWPEo33crSjooeUg4W02ruENxHLmmBqCuIo jawz@galaxy" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBEblxSDhWPEo33crSjooeUg4W02ruENxHLmmBqCuIo jawz@galaxy"
]; ];
@@ -209,12 +210,14 @@ jawzManageLibrary
jawzTasks jawzTasks
jawzSubs jawzSubs
jawzStream jawzStream
(writeScriptBin "ffmpeg4discord" (builtins.readFile ../scripts/ffmpeg4discord.py)) (writeScriptBin "ffmpeg4discord"
(builtins.readFile ../scripts/ffmpeg4discord.py))
(writeScriptBin "ffmpreg" (builtins.readFile ../scripts/ffmpreg.sh)) (writeScriptBin "ffmpreg" (builtins.readFile ../scripts/ffmpreg.sh))
(writeScriptBin "split-dir" (builtins.readFile ../scripts/split-dir.sh)) (writeScriptBin "split-dir" (builtins.readFile ../scripts/split-dir.sh))
(writeScriptBin "pika-list" (builtins.readFile ../scripts/pika-list.sh)) (writeScriptBin "pika-list" (builtins.readFile ../scripts/pika-list.sh))
(writeScriptBin "run" (builtins.readFile ../scripts/run.sh)) (writeScriptBin "run" (builtins.readFile ../scripts/run.sh))
(writeScriptBin "find-dup-episodes" (builtins.readFile ../scripts/find-dup-episodes.sh)) (writeScriptBin "find-dup-episodes"
(builtins.readFile ../scripts/find-dup-episodes.sh))
tldr # man for retards tldr # man for retards
@@ -231,7 +234,8 @@ nixfmt # linting
cachix # why spend time compiling? cachix # why spend time compiling?
# PYTHON. # PYTHON.
(python3.withPackages (ps: with ps; [ (python3.withPackages (ps:
with ps; [
flake8 # wraper for pyflakes, pycodestyle and mccabe flake8 # wraper for pyflakes, pycodestyle and mccabe
isort # sort Python imports isort # sort Python imports
nose # testing and running python scripts nose # testing and running python scripts
@@ -250,8 +254,7 @@ cachix # why spend time compiling?
src = ../scripts/download/.; src = ../scripts/download/.;
doCheck = false; doCheck = false;
buildInputs = [ setuptools ]; buildInputs = [ setuptools ];
propagatedBuildInputs = propagatedBuildInputs = [ pyyaml types-pyyaml ];
[ pyyaml types-pyyaml ];
}) })
(buildPythonApplication rec { (buildPythonApplication rec {
pname = "ffpb"; pname = "ffpb";
@@ -262,8 +265,7 @@ cachix # why spend time compiling?
}; };
doCheck = false; doCheck = false;
buildInputs = [ setuptools ]; buildInputs = [ setuptools ];
propagatedBuildInputs = propagatedBuildInputs = [ tqdm ];
[ tqdm ];
}) })
# (buildPythonApplication rec { # (buildPythonApplication rec {
# pname = "qbit_manage"; # pname = "qbit_manage";
@@ -290,7 +292,8 @@ cachix # why spend time compiling?
prettier # Linter prettier # Linter
pnpm # Package manager pnpm # Package manager
]); }; # <--- end of package list ]);
}; # <--- end of package list
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;
@@ -306,11 +309,12 @@ programs.bash = {
hh = "hstr"; hh = "hstr";
ls = "eza --icons --group-directories-first"; ls = "eza --icons --group-directories-first";
edit = "emacsclient -t"; edit = "emacsclient -t";
comic = "download -u jawz -i \"$(cat $LC | fzf --multi --exact -i)\""; comic = ''download -u jawz -i "$(cat $LC | fzf --multi --exact -i)"'';
gallery = "download -u jawz -i \"$(cat $LW | fzf --multi --exact -i)\""; gallery =
''download -u jawz -i "$(cat $LW | fzf --multi --exact -i)"'';
cp = "cp -i"; cp = "cp -i";
mv = "mv -i"; mv = "mv -i";
mkcd = "mkdir -pv \"$1\" && cd \"$1\" || exit"; mkcd = ''mkdir -pv "$1" && cd "$1" || exit'';
mkdir = "mkdir -p"; mkdir = "mkdir -p";
rm = "trash"; rm = "trash";
".." = "cd .."; ".." = "cd ..";
@@ -324,11 +328,13 @@ programs.bash = {
f = "fzf --multi --exact -i"; f = "fzf --multi --exact -i";
sc = "systemctl --user"; sc = "systemctl --user";
jc = "journalctl --user -xefu"; jc = "journalctl --user -xefu";
open-gallery = "cd /mnt/pool/scrapping/JawZ/gallery-dl && open-gallery = ''
xdg-open $(fd . ./ Husbands -tdirectory -d 1 | fzf -i)\""; cd /mnt/pool/scrapping/JawZ/gallery-dl &&
unique-extensions = "fd -tf | rev | cut -d. -f1 | rev | xdg-open $(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"'';
unique-extensions = ''
fd -tf | rev | cut -d. -f1 | rev |
tr '[:upper:]' '[:lower:]' | sort | tr '[:upper:]' '[:lower:]' | sort |
uniq --count | sort -rn"; uniq --count | sort -rn'';
}; };
enableVteIntegration = true; enableVteIntegration = true;
initExtra = '' initExtra = ''
@@ -367,7 +373,8 @@ xdg = {
}; };
configFile = { configFile = {
"wgetrc".source = ../dotfiles/wget/wgetrc; "wgetrc".source = ../dotfiles/wget/wgetrc;
"configstore/update-notifier-npm-check.json".source = ../dotfiles/npm/update-notifier-npm-check.json; "configstore/update-notifier-npm-check.json".source =
../dotfiles/npm/update-notifier-npm-check.json;
"npm/npmrc".source = ../dotfiles/npm/npmrc; "npm/npmrc".source = ../dotfiles/npm/npmrc;
"gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json; "gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json;
"htop/htoprc".source = ../dotfiles/htop/htoprc; "htop/htoprc".source = ../dotfiles/htop/htoprc;
@@ -376,9 +383,7 @@ xdg = {
}; };
programs = { programs = {
helix = { helix = { enable = true; };
enable = true;
};
hstr.enable = true; hstr.enable = true;
emacs.enable = true; emacs.enable = true;
direnv = { direnv = {
@@ -422,7 +427,8 @@ services = {
}; };
}; };
}; }; };
};
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
@@ -510,9 +516,7 @@ services = {
openFirewall = true; openFirewall = true;
settings = { settings = {
inotify = "yes"; inotify = "yes";
media_dir = [ media_dir = [ "/mnt/pool/glue" ];
"/mnt/pool/glue"
];
}; };
}; };
avahi = { avahi = {
@@ -523,10 +527,7 @@ services = {
smartd.enable = true; smartd.enable = true;
btrfs.autoScrub = { btrfs.autoScrub = {
enable = true; enable = true;
fileSystems = [ fileSystems = [ "/" "/mnt/pool" ];
"/"
"/mnt/pool"
];
}; };
openssh = { openssh = {
enable = true; enable = true;
@@ -542,7 +543,8 @@ services = {
systemd = { systemd = {
packages = let packages = let
pkgs = import (builtins.fetchTarball { pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/9957cd48326fe8dbd52fdc50dd2502307f188b0d.tar.gz"; url =
"https://github.com/NixOS/nixpkgs/archive/9957cd48326fe8dbd52fdc50dd2502307f188b0d.tar.gz";
}) { }; }) { };
myPkg = pkgs.qbittorrent-nox; myPkg = pkgs.qbittorrent-nox;
@@ -587,10 +589,7 @@ in [ myPkg ];
description = "monitors a stream channel for online streams."; description = "monitors a stream channel for online streams.";
restartIfChanged = true; restartIfChanged = true;
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
path = [ path = [ pkgs.nix jawzStream ];
pkgs.nix
jawzStream
];
serviceConfig = { serviceConfig = {
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 30; RestartSec = 30;

View File

@@ -10,17 +10,31 @@ in {
./hardware-configuration.nix ./hardware-configuration.nix
../../base.nix ../../base.nix
../../gnome.nix ../../gnome.nix
../../jawz.nix
../../home-manager/default.nix ../../home-manager/default.nix
../../services/network.nix # ../../services/systemd-user/tasks.nix
../../services/nvidia.nix
../../services/printing.nix
../../services/sound.nix
../../services/systemd-user/tasks.nix
../../modules/apps.nix
../../modules/dev.nix
]; ];
myGaming.enable = true; my = {
apps = {
art.enable = true;
dictionaries.enable = true;
fonts.enable = true;
gaming.enable = true;
internet.enable = true;
office.enable = true;
};
dev = {
haskell.enable = true;
nix.enable = true;
python.enable = true;
gameDev.enable = true;
};
services = {
network.enable = true;
nvidia.enable = true;
printing.enable = true;
sound.enable = true;
};
};
networking = { networking = {
hostName = "workstation"; hostName = "workstation";
@@ -66,7 +80,6 @@ in {
}; };
}; };
nixpkgs.overlays = [ (import ../../overlays/blanket.nix) ];
users = { users = {
groups.nixremote.gid = 555; groups.nixremote.gid = 555;
users = { users = {

View File

@@ -1,83 +0,0 @@
{ inputs }:
let
myLib = (import ./default.nix) { inherit inputs; };
outputs = inputs.self.outputs;
in rec {
pkgsFor = sys: inputs.nixpkgs.legacyPackages.${sys};
# ========================== Buildables ========================== #
mkSystem = config:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs myLib; };
modules = [ config outputs.nixosModules.default ];
};
mkHome = sys: config:
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor sys;
extraSpecialArgs = { inherit inputs myLib outputs; };
modules = [ config outputs.homeManagerModules.default ];
};
# =========================== Functions ============================ #
filesIn = dir:
(map (fileName: dir + "/${fileName}")
(builtins.attrNames (builtins.readDir dir)));
dirsIn = dir:
inputs.nixpkgs.lib.filterAttrs (name: value: value == "directory")
(builtins.readDir dir);
fileNameOf = path: (builtins.head (builtins.split "\\." (baseNameOf path)));
# ========================== Extenders =========================== #
# Evaluates nixos/home-manager module and extends it's options / config
extendModule = { path, ... }@args:
{ pkgs, ... }@margs:
let
eval = if (builtins.isString path) || (builtins.isPath path) then
import path margs
else
path margs;
evalNoImports = builtins.removeAttrs eval [ "imports" "options" ];
extra = if (builtins.hasAttr "extraOptions" args)
|| (builtins.hasAttr "extraConfig" args) then
[
({ ... }: {
options = args.extraOptions or { };
config = args.extraConfig or { };
})
]
else
[ ];
in {
imports = (eval.imports or [ ]) ++ extra;
options = if builtins.hasAttr "optionsExtension" args then
(args.optionsExtension (eval.options or { }))
else
(eval.options or { });
config = if builtins.hasAttr "configExtension" args then
(args.configExtension (eval.config or evalNoImports))
else
(eval.config or evalNoImports);
};
# Applies extendModules to all modules
# modules can be defined in the same way
# as regular imports, or taken from "filesIn"
extendModules = extension: modules:
map (f:
let name = fileNameOf f;
in (extendModule ((extension name) // { path = f; }))) modules;
# ============================ Shell ============================= #
forAllSystems = pkgs:
inputs.nixpkgs.lib.genAttrs [ "x86_64-linux" ]
(system: pkgs inputs.nixpkgs.legacyPackages.${system});
}

View File

@@ -9,11 +9,15 @@
./apps/internet.nix ./apps/internet.nix
./apps/office.nix ./apps/office.nix
]; ];
myArt.enable = lib.mkDefault false; my = {
myGameDev.enable = lib.mkDefault false; dev.gameDev.enable = lib.mkDefault false;
# myDictionaries.enable = lib.mkDefault false; apps = {
# myFonts.enable = lib.mkDefault false; art.enable = lib.mkDefault false;
myGaming.enable = lib.mkDefault false; dictionaries.enable = lib.mkDefault false;
# myInternet.enable = lib.mkDefault false; fonts.enable = lib.mkDefault false;
# myOffice.enable = lib.mkDefault false; gaming.enable = lib.mkDefault false;
internet.enable = lib.mkDefault false;
office.enable = lib.mkDefault false;
};
};
} }

View File

@@ -1,11 +1,15 @@
{ config, pkgs, lib, unstable, ... }: { config, pkgs, lib, unstable, ... }:
let
{ unstable = import
options = { (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") {
myArt.enable = lib.mkEnableOption "enable"; config = config.nixpkgs.config;
myGameDev.enable = lib.mkEnableOption "enable";
}; };
config = lib.mkIf config.myArt.enable { in {
options.my = {
apps.art.enable = lib.mkEnableOption "enable";
dev.gameDev.enable = lib.mkEnableOption "enable";
};
config = lib.mkIf config.my.apps.art.enable {
users.users.jawz.packages = with pkgs; users.users.jawz.packages = with pkgs;
([ ([
gimp # the coolest bestest art program to never exist gimp # the coolest bestest art program to never exist
@@ -16,7 +20,7 @@
# drawpile # arty party with friends!! # drawpile # arty party with friends!!
pureref # create inspiration/reference boards pureref # create inspiration/reference boards
blender # cgi animation and sculpting blender # cgi animation and sculpting
]) ++ (if config.myGameDev.enable then [ ]) ++ (if config.my.dev.gameDev.enable then [
godot_4 # game development godot_4 # game development
unstable.gdtoolkit # gdscript language server unstable.gdtoolkit # gdscript language server
] else ] else

View File

@@ -1,6 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, lib, unstable, ... }:
{ {
options.my.apps.dictionaries.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.apps.dictionaries.enable {
users.users.jawz.packages = with pkgs; ([ users.users.jawz.packages = with pkgs; ([
hunspell hunspell
hunspellDicts.it_IT hunspellDicts.it_IT
@@ -8,4 +10,5 @@
hunspellDicts.es_ES hunspellDicts.es_ES
hunspellDicts.en_CA-large hunspellDicts.en_CA-large
]); ]);
};
} }

View File

@@ -1,10 +1,13 @@
{ config, pkgs, ... }: { config, pkgs, lib, unstable, ... }:
{ {
options.my.apps.fonts.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.apps.fonts.enable {
users.users.jawz.packages = with pkgs; ([ users.users.jawz.packages = with pkgs; ([
(nerdfonts.override { (nerdfonts.override {
fonts = [ "CascadiaCode" "ComicShannsMono" "Iosevka" ]; fonts = [ "CascadiaCode" "ComicShannsMono" "Iosevka" ];
}) })
symbola symbola
]); ]);
};
} }

View File

@@ -1,15 +1,13 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
options = { myGaming.enable = lib.mkEnableOption "enable"; }; options.my.apps.gaming.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.myGaming.enable { config = lib.mkIf config.my.apps.gaming.enable {
programs = { programs.steam = {
steam = {
enable = true; enable = true;
remotePlay.openFirewall = true; remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true; dedicatedServer.openFirewall = true;
}; };
};
users.users.jawz.packages = with pkgs; ([ users.users.jawz.packages = with pkgs; ([
(lutris.override { (lutris.override {
extraPkgs = pkgs: [ extraPkgs = pkgs: [

View File

@@ -1,6 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, lib, unstable, ... }:
{ {
options.my.apps.internet.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.apps.internet.enable {
programs = { programs = {
geary.enable = true; geary.enable = true;
firefox = { firefox = {
@@ -24,4 +26,5 @@
}) })
# hugo # website engine # hugo # website engine
]); ]);
};
} }

View File

@@ -1,6 +1,8 @@
{ config, pkgs, ... }: { config, pkgs, lib, unstable, ... }:
{ {
options.my.apps.office.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.apps.office.enable {
users.users.jawz.packages = with pkgs; ([ users.users.jawz.packages = with pkgs; ([
libreoffice # office, but based libreoffice # office, but based
calibre # ugly af eBook library manager calibre # ugly af eBook library manager
@@ -10,4 +12,5 @@
# wike # gtk wikipedia wow! # wike # gtk wikipedia wow!
# denaro # manage your finances # denaro # manage your finances
]); ]);
};
} }

View File

@@ -1,55 +0,0 @@
{ lib, config, inputs, outputs, myLib, pkgs, ... }:
let cfg = config.myNixOS;
in {
options.myNixOS.home-users = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule {
options = {
userConfig = lib.mkOption {
default = ./../../home-manager/work.nix;
example = "DP-1";
};
userSettings = lib.mkOption {
default = { };
example = "{}";
};
};
});
default = { };
};
config = {
programs.zsh.enable = true;
programs.hyprland.enable = cfg.sharedSettings.hyprland.enable;
services.xserver = lib.mkIf cfg.sharedSettings.hyprland.enable {
displayManager = { defaultSession = "hyprland"; };
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit myLib;
outputs = inputs.self.outputs;
};
users = builtins.mapAttrs (name: user:
{ ... }: {
imports =
[ (import user.userConfig) outputs.homeManagerModules.default ];
}) (config.myNixOS.home-users);
};
users.users = builtins.mapAttrs (name: user:
{
isNormalUser = true;
initialPassword = "12345";
description = "";
shell = pkgs.zsh;
extraGroups = [ "libvirtd" "networkmanager" "wheel" ];
} // user.userSettings) (config.myNixOS.home-users);
};
}

View File

@@ -2,7 +2,9 @@
{ {
imports = [ ./dev/haskell.nix ./dev/nix.nix ./dev/python.nix ]; imports = [ ./dev/haskell.nix ./dev/nix.nix ./dev/python.nix ];
myHaskell.enable = lib.mkDefault false; my.dev = {
myNix.enable = lib.mkDefault true; haskell.enable = lib.mkDefault false;
myPython.enable = lib.mkDefault false; nix.enable = lib.mkDefault false;
python.enable = lib.mkDefault false;
};
} }

View File

@@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
options = { myHaskell.enable = lib.mkEnableOption "enable"; }; options.my.dev.haskell.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.myHaskell.enable { config = lib.mkIf config.my.dev.haskell.enable {
users.users.jawz.packages = with pkgs; ([ users.users.jawz.packages = with pkgs; ([
ghc # compiler ghc # compiler
haskell-language-server # lsp haskell-language-server # lsp

View File

@@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
options = { myNix.enable = lib.mkEnableOption "enable"; }; options.my.dev.nix.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.myNix.enable { config = lib.mkIf config.my.dev.nix.enable {
users.users.jawz.packages = with pkgs; ([ users.users.jawz.packages = with pkgs; ([
expect # keep color when nom'ing expect # keep color when nom'ing
nix-output-monitor # autistic nix builds nix-output-monitor # autistic nix builds

View File

@@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
options = { myPython.enable = lib.mkEnableOption "enable"; }; options.my.dev.python.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.myPython.enable { config = lib.mkIf config.my.dev.python.enable {
users.users.jawz.packages = with pkgs; ([ users.users.jawz.packages = with pkgs; ([
pipenv # python development workflow for humans pipenv # python development workflow for humans
(python3.withPackages (ps: (python3.withPackages (ps:

View File

@@ -1,18 +0,0 @@
{
nix.settings = {
substituters = [
"https://nix-gaming.cachix.org"
"https://nixpkgs-python.cachix.org"
"https://devenv.cachix.org"
"https://cuda-maintainers.cachix.org"
"https://ai.cachix.org"
];
trusted-public-keys = [
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU="
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
];
};
}

16
modules/services.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
{
imports = [
./services/network.nix
./services/nvidia.nix
./services/printing.nix
./services/sound.nix
];
my.services = {
network.enable = lib.mkDefault false;
nvidia.enable = lib.mkDefault false;
printing.enable = lib.mkDefault false;
sound.enable = lib.mkDefault false;
};
}

View File

@@ -1,47 +0,0 @@
{ config, pkgs, lib, ... }:
with lib; {
users.users.satisfactory = {
home = "/var/lib/satisfactory";
createHome = true;
isSystemUser = true;
group = "satisfactory";
};
users.groups.satisfactory = { };
# boot.kernel.sysctl."net.ipv6.conf.eth0.disable_ipv6" = true;
networking.enableIPv6 = false;
# nixpkgs.config.allowUnfree = true;
#
networking = {
firewall = {
allowedUDPPorts = [ 15777 15000 7777 27015 ];
allowedUDPPortRanges = [{
from = 27031;
to = 27036;
}];
allowedTCPPorts = [ 27015 27036 ];
};
};
# -beta experimental \
systemd.services.satisfactory = {
preStart = ''
${pkgs.steamcmd}/bin/steamcmd \
+force_install_dir /var/lib/satisfactory/SatisfactoryServer \
+login anonymous \
+app_update 1690800 \
validate \
+quit
'';
script = ''
${pkgs.steam-run}/bin/steam-run /var/lib/satisfactory/SatisfactoryServer/FactoryServer.sh -DisablePacketRouting
'';
serviceConfig = {
Nice = "-5";
Restart = "always";
User = "satisfactory";
WorkingDirectory = "/var/lib/satisfactory";
};
};
}

View File

@@ -0,0 +1,18 @@
{ config, pkgs, lib, ... }:
{
options.my.services.network.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.network.enable {
networking = {
useDHCP = lib.mkDefault true;
enableIPv6 = false;
networkmanager.enable = true;
extraHosts = ''
192.168.1.64 workstation
192.168.1.69 server
192.168.1.100 miniserver
'';
firewall = { enable = true; };
};
};
}

View File

@@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
{
options.my.services.nvidia.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
vaapiVdpau
libvdpau-va-gl
];
};
nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
};
};
};
}

View File

@@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
let printingDrivers = [ pkgs.hplip pkgs.hplipWithPlugin ];
in {
options.my.services.printing.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.printing.enable {
services.printing = {
enable = true;
drivers = printingDrivers;
};
hardware.sane = {
enable = true;
extraBackends = printingDrivers;
};
users.users.jawz.packages = [ pkgs.gnome.simple-scan ];
};
}

View File

@@ -0,0 +1,27 @@
{ config, pkgs, lib, ... }:
# let
# nixGaming = import (builtins.fetchTarball
# "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
# in
{
imports = [
# nixGaming.nixosModules.pipewireLowLatency
];
options.my.services.sound.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.services.sound.enable {
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
sound.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# lowLatency = {
# enable = true;
# quantum = 64;
# rate = 48000;
# };
};
};
}

View File

@@ -1,17 +0,0 @@
{ config, pkgs, lib, ... }:
{
networking = {
useDHCP = lib.mkDefault true;
enableIPv6 = false;
networkmanager.enable = true;
extraHosts = ''
192.168.1.64 workstation
192.168.1.69 server
192.168.1.100 miniserver
'';
firewall = {
enable = true;
};
};
}

View File

@@ -1,22 +0,0 @@
{ config, lib, pkgs, ... }:
{
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
vaapiVdpau
libvdpau-va-gl
];
};
nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
};
};
}

View File

@@ -1,13 +0,0 @@
{ config, lib, pkgs, ... }:
let printingDrivers = [ pkgs.hplip pkgs.hplipWithPlugin ];
in {
services.printing = {
enable = true;
drivers = printingDrivers;
};
hardware.sane = {
enable = true;
extraBackends = printingDrivers;
};
users.users.jawz.packages = [ pkgs.gnome.simple-scan ];
}

View File

@@ -1,24 +0,0 @@
{ config, lib, pkgs, ... }:
# let
# nixGaming = import (builtins.fetchTarball
# "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
# in
{
imports = [
# nixGaming.nixosModules.pipewireLowLatency
];
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
sound.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# lowLatency = {
# enable = true;
# quantum = 64;
# rate = 48000;
# };
};
}