Add host modules and home options; update README

This commit is contained in:
2025-11-24 01:38:45 +01:00
parent 196db56791
commit d951277cec
48 changed files with 982 additions and 404 deletions

View File

@@ -3,6 +3,7 @@
./packages
./auto-cpufreq.nix
./boot.nix
./docker.nix
./flatpak.nix
./fonts.nix
./hardware.nix
@@ -19,7 +20,6 @@
./system.nix
./thunar.nix
./user.nix
./virtualisation.nix
./xdg.nix
./xserver.nix
inputs.stylix.nixosModules.stylix

14
modules/core/docker.nix Normal file
View File

@@ -0,0 +1,14 @@
{
pkgs,
lib,
config,
...
}: {
options.docker.enable = lib.mkEnableOption "Docker";
config.virtualisation.docker = lib.mkIf config.docker.enable {
enable = true;
package = pkgs.docker;
daemon.settings.dns = ["9.9.9.11" "149.112.112.11"];
};
}

View File

@@ -1,13 +1,17 @@
_: {
services = {
flatpak = {
enable = true;
packages = [
# "org.vinegarhq.Sober"
"io.github.flattool.Warehouse"
"com.github.tchx84.Flatseal"
];
update.onActivation = true;
};
{
lib,
config,
...
}: {
options.flatpak.enable = lib.mkEnableOption "Flatpak";
config.services.flatpak = lib.mkIf config.flatpak.enable {
enable = true;
update.onActivation = true;
packages = [
# "org.vinegarhq.Sober"
"io.github.flattool.Warehouse"
"com.github.tchx84.Flatseal"
];
};
}

View File

@@ -1,17 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
# Communication
slack
mattermost-desktop
# Productivity & Office
# bitwarden-desktop
tutanota-desktop
iotas
# logseq
# Utilities
galculator
gedit
eddie
gnome-text-editor
];
}

View File

@@ -1,13 +1,8 @@
_: {
nixpkgs.config.allowUnfree = true;
imports = [
./essentials.nix
./packages.nix
./programs.nix
./clients.nix
./development.nix
./gaming.nix
./multimedia.nix
./terminal.nix
./tools.nix
./virtualization.nix
];
}

View File

@@ -1,8 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
# Learning & practice
exercism
# AI coding
opencode
];
}

View File

@@ -1,5 +1,12 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
mpv
pavucontrol
playerctl
cmatrix
cowsay
sl
fortune
# File management
trash-cli
file-roller

View File

@@ -1,12 +0,0 @@
{
pkgs,
# inputs,
# system,
...
}: {
environment.systemPackages = with pkgs; [
# inputs.prismlauncher-cracked.packages.${system}.default
space-cadet-pinball
tty-solitaire
];
}

View File

@@ -1,26 +0,0 @@
{
pkgs,
# inputs,
# system,
...
}: {
environment.systemPackages = with pkgs; [
# Video & image processing
ffmpeg
ffmpegthumbnailer
mpv
# gimp3
# inputs.affinity-nix.packages.${system}.v3
eog
# kdePackages.kdenlive
# Audio
rhythmbox
plexamp
picard
pavucontrol
playerctl
# Media downloaders & clients
# freetube
# ytmdl
];
}

View File

@@ -0,0 +1,47 @@
{
pkgs,
lib,
config,
inputs,
system,
...
}: let
mkPackage = name: pkgsOrList: {
options.${name}.enable = lib.mkEnableOption name;
config.environment.systemPackages =
lib.mkIf config.${name}.enable
(lib.toList pkgsOrList);
};
packages = with pkgs; {
bitwarden = bitwarden-desktop;
eddieAirVPN = eddie;
galculator = galculator;
gedit = gedit;
iotas = iotas;
logseq = logseq;
mattermost = mattermost-desktop;
slack = slack;
tutanota = tutanota-desktop;
exercism = exercism;
opencode = opencode;
lazygit = lazygit;
prismlauncher = inputs.prismlauncher-cracked.packages.${system}.default;
spaceCadetPinball = space-cadet-pinball;
ttySolitaire = tty-solitaire;
gimp = gimp;
affinity = inputs.affinity-nix.packages.${system}.v3;
eyeOfGnome = eog;
kdenlive = kdePackages.kdenlive;
plex = [
(plex-desktop.override {extraEnv = {QT_QPA_PLATFORM = "xcb";};})
plexamp
];
freetube = freetube;
lazydocker = lazydocker;
distrobox = [distrobox pkgs.boxbuddy];
winboat = [winboat freerdp];
};
in {
imports = builtins.attrValues (builtins.mapAttrs mkPackage packages);
}

View File

@@ -1,10 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
cmatrix
cowsay
sl
fortune
lolcat
eza
];
}

View File

@@ -1,11 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
virt-viewer
# lazydocker
docker-client
# distrobox
# boxbuddy
# freerdp
# winboat
];
}

View File

@@ -1,20 +1,43 @@
{pkgs, ...}: {
programs = {
steam = {
{
pkgs,
lib,
config,
...
}: {
options = {
steam.enable = lib.mkEnableOption "Steam";
gamescope.enable = lib.mkEnableOption "Gamescope";
gamemode.enable = lib.mkEnableOption "Gamemode";
};
config.programs = {
steam = lib.mkIf config.steam.enable {
enable = true;
package = pkgs.steam;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
gamescopeSession.enable = true;
gamescopeSession = lib.mkIf config.gamescope.enable {
enable = true;
args = [
"--rt"
"--expose-wayland"
];
};
extraCompatPackages = [pkgs.proton-ge-bin];
};
# gamescope = {
# enable = true;
# capSysNice = true;
# args = [
# "--rt"
# "--expose-wayland"
# ];
# };
gamemode.enable = true;
gamescope = lib.mkIf config.gamescope.enable {
enable = true;
capSysNice = true;
args = [
"--rt"
"--expose-wayland"
];
};
gamemode = lib.mkIf config.gamemode.enable {
enable = true;
enableRenice = true;
};
};
}

View File

@@ -1,11 +1,9 @@
{pkgs, ...}: {
programs = {
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
}

View File

@@ -24,7 +24,7 @@ in {
;
};
users.${username} = {
imports = [./../home];
imports = [./../home ../../hosts/${host}/home-modules.nix];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
@@ -32,23 +32,26 @@ in {
};
};
};
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
description = "${gitUsername}";
extraGroups = [
"adbusers"
"docker" # access to docker as non-root
"libvirtd" # Virt manager/QEMU access
"lp"
"networkmanager"
"scanner"
"wheel" # sudo access
"vboxusers" # Virtual Box
"gamemode"
];
shell = pkgs.bash;
ignoreShellProgramCheck = true;
users = {
mutableUsers = true;
users.${username} = {
isNormalUser = true;
description = "${gitUsername}";
extraGroups = [
"adbusers"
"docker" # access to docker as non-root
"libvirtd" # Virt manager/QEMU access
"lp"
"networkmanager"
"scanner"
"wheel" # sudo access
"vboxusers" # Virtual Box
"gamemode"
];
shell = pkgs.bash;
ignoreShellProgramCheck = true;
linger = true;
};
};
nix.settings.allowed-users = ["${username}"];
}

View File

@@ -1,15 +0,0 @@
_: {
# Only enable either docker or podman -- Not both
virtualisation = {
docker.enable = true;
podman.enable = false;
libvirtd.enable = true;
virtualbox.host = {
enable = false;
enableExtensionPack = true;
};
};
programs.virt-manager.enable = false;
}

View File

@@ -7,5 +7,6 @@
xdg-desktop-portal-gtk
];
configPackages = [pkgs.hyprland];
xdgOpenUsePortal = true;
};
}

View File

@@ -1,9 +1,13 @@
{
pkgs,
username,
lib,
config,
...
}: {
programs.anki = {
options.anki.enable = lib.mkEnableOption "Anki";
config.programs.anki = lib.mkIf config.anki.enable {
enable = true;
package = pkgs.anki;
language = "pl_PL";

View File

@@ -1,5 +1,12 @@
{pkgs, ...}: {
programs.btop = {
{
pkgs,
lib,
config,
...
}: {
options.btop.enable = lib.mkEnableOption "Btop";
config.programs.btop = lib.mkIf config.btop.enable {
enable = true;
package = pkgs.btop.override {
rocmSupport = true;

View File

@@ -1,6 +1,12 @@
_: {
programs.cava = {
enable = false;
{
lib,
config,
...
}: {
options.cava.enable = lib.mkEnableOption "Cava";
config.programs.cava = lib.mkIf config.cava.enable {
enable = true;
settings = {
general = {
bar_spacing = 1;

View File

@@ -1,5 +1,12 @@
{pkgs, ...}: {
programs.chromium = {
{
pkgs,
lib,
config,
...
}: {
options.ungoogled-chromium.enable = lib.mkEnableOption "Ungoogled Chromium";
config.programs.chromium = lib.mkIf config.ungoogled-chromium.enable {
enable = true;
package = pkgs.ungoogled-chromium;
# commandLineArgs = [ ];

View File

@@ -1,184 +1,17 @@
{
programs.fastfetch = {
pkgs,
lib,
config,
...
}: {
options.fastfetch.enable = lib.mkEnableOption "FastFetch";
config.programs.fastfetch = lib.mkIf config.fastfetch.enable {
enable = true;
settings = {
display = {
color = {
keys = "35";
output = "90";
};
separator = " ";
};
logo = {
source = ./garandos.png;
type = "kitty-direct";
height = 15;
width = 30;
padding = {
top = 3;
left = 3;
};
};
modules = [
"break"
{
type = "custom";
format = "Hardware";
}
{
type = "host";
format = "{5} {1} Type {2}";
key = " PC";
keyColor = "33";
}
{
type = "cpu";
format = "{1} ({3}) @ {7} GHz";
key = " ";
keyColor = "33";
}
{
type = "gpu";
format = "{1} {2} @ {12} GHz";
key = " ";
keyColor = "33";
}
{
type = "memory";
key = " 󰑭 ";
keyColor = "33";
}
{
type = "swap";
key = " ";
keyColor = "33";
}
{
type = "disk";
key = " 󰋊 ";
keyColor = "33";
}
{
type = "monitor";
key = " ";
keyColor = "33";
}
{
type = "custom";
format = "";
}
"break"
{
type = "custom";
format = "Software";
}
{
type = "os";
key = " OS";
keyColor = "31";
}
{
type = "command";
key = " ";
keyColor = "31";
text = "echo GarandOS v$" + "{GARANDOS_VERSION}";
}
{
type = "kernel";
key = " ";
keyColor = "31";
}
{
type = "packages";
key = " 󰏖 ";
keyColor = "31";
}
{
type = "shell";
key = " ";
keyColor = "31";
}
{
type = "wm";
key = " WM";
keyColor = "32";
}
{
type = "wmtheme";
key = " 󰉼 ";
keyColor = "32";
}
{
type = "icons";
key = " 󰀻 ";
keyColor = "32";
}
{
type = "cursor";
key = " ";
keyColor = "32";
}
{
type = "terminal";
key = " ";
keyColor = "32";
}
{
type = "terminalfont";
key = " ";
keyColor = "32";
}
{
type = "custom";
format = "";
}
"break"
{
type = "custom";
format = "Age / Uptime";
}
{
type = "command";
key = " IN";
text =
#bash
''
birth_install=$(stat -c %W /)
if [ "$birth_install" -gt 0 ]; then
echo "Installed $(date -d @"$birth_install" +"%Y-%m-%d")"
else
echo "Installation date unknown"
fi
'';
}
{
type = "command";
key = " ";
text =
#bash
''
birth_install=$(stat -c %W /)
current=$(date +%s)
delta=$((current - birth_install))
delta_days=$((delta / 86400))
echo $delta_days days
'';
}
{
type = "uptime";
key = " ";
}
{
type = "custom";
format = "";
}
"break"
];
};
package = pkgs.fastfetch;
};
imports = [
./settings
];
}

View File

@@ -0,0 +1,7 @@
_: {
imports = [
./display.nix
./logo.nix
./modules.nix
];
}

View File

@@ -0,0 +1,9 @@
_: {
programs.fastfetch.settings.display = {
color = {
keys = "35";
output = "90";
};
separator = " ";
};
}

View File

@@ -0,0 +1,12 @@
_: {
programs.fastfetch.settings.logo = {
source = ../garandos.png;
type = "kitty-direct";
height = 15;
width = 30;
padding = {
top = 3;
left = 3;
};
};
}

View File

@@ -0,0 +1,159 @@
_: {
programs.fastfetch.settings.modules = [
"break"
{
type = "custom";
format = "Hardware";
}
{
type = "host";
format = "{5} {1} Type {2}";
key = " PC";
keyColor = "33";
}
{
type = "cpu";
format = "{1} ({3}) @ {7} GHz";
key = " ";
keyColor = "33";
}
{
type = "gpu";
format = "{1} {2} @ {12} GHz";
key = " ";
keyColor = "33";
}
{
type = "memory";
key = " 󰑭 ";
keyColor = "33";
}
{
type = "swap";
key = " ";
keyColor = "33";
}
{
type = "disk";
key = " 󰋊 ";
keyColor = "33";
}
{
type = "monitor";
key = " ";
keyColor = "33";
}
{
type = "custom";
format = "";
}
"break"
{
type = "custom";
format = "Software";
}
{
type = "os";
key = " OS";
keyColor = "31";
}
{
type = "command";
key = " ";
keyColor = "31";
text = "echo GarandOS v$" + "{GARANDOS_VERSION}";
}
{
type = "kernel";
key = " ";
keyColor = "31";
}
{
type = "packages";
key = " 󰏖 ";
keyColor = "31";
}
{
type = "shell";
key = " ";
keyColor = "31";
}
{
type = "wm";
key = " WM";
keyColor = "32";
}
{
type = "wmtheme";
key = " 󰉼 ";
keyColor = "32";
}
{
type = "icons";
key = " 󰀻 ";
keyColor = "32";
}
{
type = "cursor";
key = " ";
keyColor = "32";
}
{
type = "terminal";
key = " ";
keyColor = "32";
}
{
type = "terminalfont";
key = " ";
keyColor = "32";
}
{
type = "custom";
format = "";
}
"break"
{
type = "custom";
format = "Age / Uptime";
}
{
type = "command";
key = " IN";
text =
#bash
''
birth_install=$(stat -c %W /)
if [ "$birth_install" -gt 0 ]; then
echo "Installed $(date -d @"$birth_install" +"%Y-%m-%d")"
else
echo "Installation date unknown"
fi
'';
}
{
type = "command";
key = " ";
text =
#bash
''
birth_install=$(stat -c %W /)
current=$(date +%s)
delta=$((current - birth_install))
delta_days=$((delta / 86400))
echo $delta_days days
'';
}
{
type = "uptime";
key = " ";
}
{
type = "custom";
format = "";
}
"break"
];
}

View File

@@ -12,14 +12,19 @@ in {
# APLIKACJE - GŁÓWNE
# =============================================================================
"$modifier, A, exec, anki"
"$modifier, B, exec, bitwarden"
"$modifier, C, exec, chromium"
"$modifier, D, exec, vesktop"
"$modifier, G, exec, affinity-v3"
"$modifier, I, exec, iotas"
"$modifier, L, exec, logseq"
"$modifier, M, exec, plexamp"
"$modifier, N, exec, dex ${desktopEntriesPath}/garandcloud.desktop"
"$modifier, O, exec, obs"
"$modifier, Return, exec, ${terminal}"
"$modifier, S, exec, steam"
"$modifier, T, exec, thunar"
"$modifier, V, exec, codium"
"$modifier, W, exec, ${browser}"
"$modifier, Z, exec, zeditor"
@@ -42,11 +47,12 @@ in {
"$modifier ALT, G, exec, dex ${desktopEntriesPath}/glance.desktop"
"$modifier ALT, M, exec, dex ${desktopEntriesPath}/mastodon.desktop"
"$modifier ALT, S, exec, slack"
"$modifier ALT, T, exec, gnome-text-editor"
"$modifier ALT, T, exec, gedit"
# =============================================================================
# APLIKACJE - Z CONTROL
# =============================================================================
"$modifier CONTROL, G, exec, gimp"
"$modifier CONTROL, M, exec, mattermost-desktop"
# =============================================================================
@@ -142,12 +148,6 @@ in {
# =============================================================================
# NIEUŻYWANE KEYBINDY
# =============================================================================
# "$modifier, B, exec, bitwarden"
# "$modifier, G, exec, affinity-v3"
# "$modifier, L, exec, logseq"
# "$modifier, O, exec, obs"
# "$modifier, V, exec, codium"
# "$modifier SHIFT, N, exec, swaync-client -rs"
# "$modifier, P, pseudo,"
# "$modifier SHIFT,F, togglefloating,"

View File

@@ -54,7 +54,7 @@ _: {
"float, tag:settings*"
"float, class:^([Ff]erdium)$"
"float, title:^(Picture-in-Picture)$"
"float, class:^(mpv|com.github.rafostar.Clapper)$"
"float, class:^(mpv)$"
"float, title:^(Authentication Required)$"
"float, title:^(War in Tunnels)$"
"float, class:(codium|codium-url-handler|VSCodium), title:negative:(.*codium.*|.*VSCodium.*)"
@@ -71,6 +71,7 @@ _: {
"size 70% 60%, initialTitle:(Add Folder to Workspace)"
"size 70% 70%, tag:settings*"
"size 60% 70%, class:^([Ff]erdium)$"
"size 70% 70%, class:^(mpv)$"
# Tile rules
"tile, class:^(affinity.exe)$"

View File

@@ -1,5 +1,12 @@
{pkgs, ...}: {
services.kdeconnect = {
{
pkgs,
lib,
config,
...
}: {
options.kdeconnect.enable = lib.mkEnableOption "KDE Connect";
config.services.kdeconnect = lib.mkIf config.kdeconnect.enable {
enable = true;
indicator = true;
package = pkgs.kdePackages.kdeconnect-kde;

View File

@@ -1,22 +1,27 @@
{pkgs, ...}: {
programs = {
librewolf = {
enable = true;
package = pkgs.librewolf;
# nativeMessagingHosts = [pkgs.firefoxpwa];
languagePacks = [
"pl"
"en-US"
];
settings = {
# LibreWolf settings
"network.http.referer.XOriginPolicy" = 2;
"privacy.resistFingerprinting.letterboxing" = true;
"privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" = true;
};
policies = {
# Policies (about:policies#documentation)
};
{
pkgs,
lib,
config,
...
}: {
options.librewolf.enable = lib.mkEnableOption "LibreWolf";
config.programs.librewolf = lib.mkIf config.librewolf.enable {
enable = true;
package = pkgs.librewolf;
# nativeMessagingHosts = [pkgs.firefoxpwa];
languagePacks = [
"pl"
"en-US"
];
settings = {
# LibreWolf settings
"network.http.referer.XOriginPolicy" = 2;
"privacy.resistFingerprinting.letterboxing" = true;
"privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" = true;
};
policies = {
# Policies (about:policies#documentation)
};
};

View File

@@ -1,14 +1,17 @@
{
pkgs,
osConfig,
lib,
config,
...
}: {
programs.lutris = {
enable = false;
options.lutris.enable = lib.mkEnableOption "Lutris";
config.programs.lutris = lib.mkIf config.lutris.enable {
enable = true;
package = pkgs.lutris;
protonPackages = [pkgs.proton-ge-bin];
winePackages = [pkgs.wineWowPackages.waylandFull];
defaultWinePackage = pkgs.wineWowPackages.waylandFull;
steamPackage = osConfig.programs.steam.package;
steamPackage = pkgs.steam;
};
}

View File

@@ -1,5 +1,12 @@
{pkgs, ...}: {
services.nextcloud-client = {
{
pkgs,
lib,
config,
...
}: {
options.nextcloud-client.enable = lib.mkEnableOption "Nextcloud Client";
config.services.nextcloud-client = lib.mkIf config.nextcloud-client.enable {
enable = true;
startInBackground = true;
package = pkgs.nextcloud-client;

View File

@@ -1,6 +1,13 @@
{pkgs, ...}: {
programs.obs-studio = {
enable = false;
{
pkgs,
lib,
config,
...
}: {
options.obs-studio.enable = lib.mkEnableOption "OBS Studio";
config.programs.obs-studio = lib.mkIf config.obs-studio.enable {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-pipewire-audio-capture

View File

@@ -1,5 +1,12 @@
{pkgs, ...}: {
programs.onlyoffice = {
{
pkgs,
lib,
config,
...
}: {
options.onlyoffice.enable = lib.mkEnableOption "OnlyOffice";
config.programs.onlyoffice = lib.mkIf config.onlyoffice.enable {
enable = true;
package = pkgs.onlyoffice-desktopeditors;
settings = {

View File

@@ -1,5 +1,12 @@
{pkgs, ...}: {
programs.vesktop = {
{
pkgs,
lib,
config,
...
}: {
options.vesktop.enable = lib.mkEnableOption "Vesktop";
config.programs.vesktop = lib.mkIf config.vesktop.enable {
enable = true;
package = pkgs.vesktop;
};

View File

@@ -1,7 +1,18 @@
{pkgs, ...}: {
programs.vscode = {
enable = false;
package = pkgs.vscodium;
{
pkgs,
lib,
config,
...
}: {
options.vscodium.enable = lib.mkEnableOption "VsCodium";
config = {
nixpkgs.config.allowUnfree = true;
programs.vscode = lib.mkIf config.vscodium.enable {
enable = true;
package = pkgs.vscodium;
};
};
imports = [

View File

@@ -1,9 +1,20 @@
{pkgs, ...}: {
programs.zed-editor = {
{
pkgs,
lib,
config,
...
}: {
options.zed-editor = {
enable = lib.mkEnableOption "Zed Editor";
remote-server = lib.mkEnableOption "Zed Editor Remote Server";
};
config.programs.zed-editor = lib.mkIf config.zed-editor.enable {
enable = true;
package = pkgs.zed-editor;
installRemoteServer = true;
installRemoteServer = lib.mkIf config.zed-editor.remote-server true;
};
imports = [
./user-settings
./extensions.nix