diff --git a/README.md b/README.md index ab456d7..d9ceba6 100644 --- a/README.md +++ b/README.md @@ -191,22 +191,35 @@ git add . - `waybarChoice` - system top bar style. - `animChoice` - system animation style. -### 5. Copy the ready `hardware-configuration.nix` to host folder: +### 5. Review module activation options +Open the module files for your host and adjust the `enable` options for the services you need: + +```bash +# Home‑modules (enable/disable home-scoped applications) +nano hosts//home-modules.nix + +# System‑modules (enable/disable system‑wide services) +nano hosts//system-modules.nix +``` + +Set the options to `true` for the components you want active and `false` for those you don’t need. + +### 6. Copy the ready `hardware-configuration.nix` to host folder: ```bash sudo cp /etc/nixos/hardware-configuration.nix hosts//hardware.nix ``` -### 6. Enable `Flake` functionality in your system. +### 7. Enable `Flake` functionality in your system. ```bash NIX_CONFIG="experimental-features = nix-command flakes" ``` -### 7. Build system (provide your hostname) +### 8. Build system (provide your hostname) ```bash sudo nixos-rebuild switch --flake .#your-system-hostname ``` -### 8. After system rebuild you can use the following aliases instead of repeating the previous command +### 9. After system rebuild you can use the following aliases instead of repeating the previous command - `pullos` - pull latest commits from my repository. - `upd` - rebuild system. diff --git a/flake.lock b/flake.lock index 5931d02..75f4773 100644 --- a/flake.lock +++ b/flake.lock @@ -143,11 +143,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1763784262, - "narHash": "sha256-bg+MOwWA4GgsHQ2QZQHCixIs0ouPHvN1EVAzMTELPiQ=", + "lastModified": 1763929296, + "narHash": "sha256-mFTtmYp1gs1y8O9GKGsMWoMCXL5RLejUivBSRbRO34Y=", "owner": "rycee", "repo": "nur-expressions", - "rev": "a717a95e58c8dfdb3d07797b97fdedc97697d65c", + "rev": "84c6e18e927e4d3281a9afd70bcc0e4cafd8720d", "type": "gitlab" }, "original": { @@ -324,11 +324,11 @@ ] }, "locked": { - "lastModified": 1763845215, - "narHash": "sha256-8W4YByiS3zxwcdDR2sABm1nUCSOEXJwdY/XddRTVjWM=", + "lastModified": 1763906693, + "narHash": "sha256-inm7paa3myo8gE4TzjM8OPvsEg8xocWreIZBgBPEKgo=", "owner": "nix-community", "repo": "home-manager", - "rev": "9a5042a88caea9b729a1d3bc981069159de4fc49", + "rev": "3d6c1c8fa0bea3a1a7ba23d6fa5993116766073b", "type": "github" }, "original": { diff --git a/hosts/Garand-Desktop/default.nix b/hosts/Garand-Desktop/default.nix index 14fa2e5..a62bf1f 100644 --- a/hosts/Garand-Desktop/default.nix +++ b/hosts/Garand-Desktop/default.nix @@ -2,5 +2,6 @@ _: { imports = [ ./hardware.nix ./host-packages.nix + ./system-modules.nix ]; } diff --git a/hosts/Garand-Desktop/home-modules.nix b/hosts/Garand-Desktop/home-modules.nix new file mode 100644 index 0000000..6c95e1f --- /dev/null +++ b/hosts/Garand-Desktop/home-modules.nix @@ -0,0 +1,66 @@ +_: { + /* + Development editors and IDEs + */ + # VSCodium: a free and open-source "demicrosofted" VSCode + vscodium.enable = false; + # Zed Editor: a modern, high‑performance code editor + zed-editor = { + # Enable Zed Editor + enable = true; + # Remote Server: enable remote editing capabilities + remote-server = true; + }; + + /* + Web browsers + */ + # Librewolf: a privacy-focused Firefox fork + librewolf.enable = true; + # Ungoogled Chromium: a privacy-focused Chromium fork + ungoogled-chromium.enable = true; + + /* + System utilities + */ + # Btop: a resource monitor for the terminal + btop.enable = true; + # Cava: terminal audio visualizer + cava.enable = false; + # Fastfetch: a fast system information tool + fastfetch.enable = true; + + /* + Communication and synchronization + */ + # KDE Connect: integrate your phone and desktop + kdeconnect.enable = false; + # Nextcloud Client: sync files with a Nextcloud server + nextcloud-client.enable = true; + # Vesktop: a community‑driven Discord client + vesktop.enable = true; + + /* + Gaming + */ + # Lutris: an open gaming platform + lutris.enable = false; + + /* + Media recording and streaming + */ + # OBS Studio: streaming and recording software + obs-studio.enable = false; + + /* + Office suite + */ + # OnlyOffice: an office suite compatible with Microsoft formats + onlyoffice.enable = true; + + /* + Learning tools + */ + # Anki: spaced‑repetition flashcard program + anki.enable = true; +} diff --git a/hosts/Garand-Desktop/system-modules.nix b/hosts/Garand-Desktop/system-modules.nix new file mode 100644 index 0000000..b97ee5d --- /dev/null +++ b/hosts/Garand-Desktop/system-modules.nix @@ -0,0 +1,87 @@ +_: { + /* + Container & Packaging + */ + # Docker: container runtime and management + docker.enable = true; + # Distrobox: containerized development environments + distrobox.enable = false; + # Flatpak: universal packaging system for Linux + flatpak.enable = true; + # Lazydocker: simple TUI for Docker + lazydocker.enable = false; + + /* + Gaming + */ + # GameMode: optimizes system performance for gaming + gamemode.enable = true; + # Gamescope: micro-compositor for games + gamescope.enable = false; + # Prism Launcher: Minecraft modded launcher + prismlauncher.enable = false; + # Steam: platform for buying and playing games + steam.enable = true; + # SpaceCadet Pinball: classic pinball game + spaceCadetPinball.enable = true; + # TTY Solitaire: terminal based solitaire game + ttySolitaire.enable = true; + + /* + Development Tools + */ + # Exercism: coding practice platform + exercism.enable = true; + # Gedit: GNOME text editor + gedit.enable = false; + # Lazygit: simple TUI for git + lazygit.enable = false; + # OpenCode: tools for coding and development + opencode.enable = true; + + /* + Communication & Collaboration + */ + # Mattermost: open-source Slack alternative + mattermost.enable = true; + # Slack: team communication and collaboration tool + slack.enable = true; + # Tutanota: secure email client + tutanota.enable = true; + + /* + Productivity / Knowledge Management + */ + # Bitwarden: password manager (desktop) + bitwarden.enable = false; + # Iotas: lightweight notes manager + iotas.enable = true; + # Logseq: knowledge base and outliner + logseq.enable = false; + + /* + Media & Graphics + */ + # Affinity: professional graphics suite + affinity.enable = false; + # Eye of GNOME: image viewer + eyeOfGnome.enable = true; + # FreeTube: privacy‑friendly YouTube client + freetube.enable = false; + # GIMP: gnu image manipulation program + gimp.enable = false; + # Kdenlive: video editing software + kdenlive.enable = false; + # Plex: media player and server client + plex.enable = true; + + /* + Utilities / Misc + */ + # Eddie AirVPN: VPN client + eddieAirVPN.enable = true; + # Galculator: simple calculator + galculator.enable = true; + # Winboat: Windows remote desktop via RDP + winboat.enable = false; +} diff --git a/hosts/Garand-Laptop/default.nix b/hosts/Garand-Laptop/default.nix index 14fa2e5..a62bf1f 100644 --- a/hosts/Garand-Laptop/default.nix +++ b/hosts/Garand-Laptop/default.nix @@ -2,5 +2,6 @@ _: { imports = [ ./hardware.nix ./host-packages.nix + ./system-modules.nix ]; } diff --git a/hosts/Garand-Laptop/home-modules.nix b/hosts/Garand-Laptop/home-modules.nix new file mode 100644 index 0000000..6c95e1f --- /dev/null +++ b/hosts/Garand-Laptop/home-modules.nix @@ -0,0 +1,66 @@ +_: { + /* + Development editors and IDEs + */ + # VSCodium: a free and open-source "demicrosofted" VSCode + vscodium.enable = false; + # Zed Editor: a modern, high‑performance code editor + zed-editor = { + # Enable Zed Editor + enable = true; + # Remote Server: enable remote editing capabilities + remote-server = true; + }; + + /* + Web browsers + */ + # Librewolf: a privacy-focused Firefox fork + librewolf.enable = true; + # Ungoogled Chromium: a privacy-focused Chromium fork + ungoogled-chromium.enable = true; + + /* + System utilities + */ + # Btop: a resource monitor for the terminal + btop.enable = true; + # Cava: terminal audio visualizer + cava.enable = false; + # Fastfetch: a fast system information tool + fastfetch.enable = true; + + /* + Communication and synchronization + */ + # KDE Connect: integrate your phone and desktop + kdeconnect.enable = false; + # Nextcloud Client: sync files with a Nextcloud server + nextcloud-client.enable = true; + # Vesktop: a community‑driven Discord client + vesktop.enable = true; + + /* + Gaming + */ + # Lutris: an open gaming platform + lutris.enable = false; + + /* + Media recording and streaming + */ + # OBS Studio: streaming and recording software + obs-studio.enable = false; + + /* + Office suite + */ + # OnlyOffice: an office suite compatible with Microsoft formats + onlyoffice.enable = true; + + /* + Learning tools + */ + # Anki: spaced‑repetition flashcard program + anki.enable = true; +} diff --git a/hosts/Garand-Laptop/system-modules.nix b/hosts/Garand-Laptop/system-modules.nix new file mode 100644 index 0000000..b97ee5d --- /dev/null +++ b/hosts/Garand-Laptop/system-modules.nix @@ -0,0 +1,87 @@ +_: { + /* + Container & Packaging + */ + # Docker: container runtime and management + docker.enable = true; + # Distrobox: containerized development environments + distrobox.enable = false; + # Flatpak: universal packaging system for Linux + flatpak.enable = true; + # Lazydocker: simple TUI for Docker + lazydocker.enable = false; + + /* + Gaming + */ + # GameMode: optimizes system performance for gaming + gamemode.enable = true; + # Gamescope: micro-compositor for games + gamescope.enable = false; + # Prism Launcher: Minecraft modded launcher + prismlauncher.enable = false; + # Steam: platform for buying and playing games + steam.enable = true; + # SpaceCadet Pinball: classic pinball game + spaceCadetPinball.enable = true; + # TTY Solitaire: terminal based solitaire game + ttySolitaire.enable = true; + + /* + Development Tools + */ + # Exercism: coding practice platform + exercism.enable = true; + # Gedit: GNOME text editor + gedit.enable = false; + # Lazygit: simple TUI for git + lazygit.enable = false; + # OpenCode: tools for coding and development + opencode.enable = true; + + /* + Communication & Collaboration + */ + # Mattermost: open-source Slack alternative + mattermost.enable = true; + # Slack: team communication and collaboration tool + slack.enable = true; + # Tutanota: secure email client + tutanota.enable = true; + + /* + Productivity / Knowledge Management + */ + # Bitwarden: password manager (desktop) + bitwarden.enable = false; + # Iotas: lightweight notes manager + iotas.enable = true; + # Logseq: knowledge base and outliner + logseq.enable = false; + + /* + Media & Graphics + */ + # Affinity: professional graphics suite + affinity.enable = false; + # Eye of GNOME: image viewer + eyeOfGnome.enable = true; + # FreeTube: privacy‑friendly YouTube client + freetube.enable = false; + # GIMP: gnu image manipulation program + gimp.enable = false; + # Kdenlive: video editing software + kdenlive.enable = false; + # Plex: media player and server client + plex.enable = true; + + /* + Utilities / Misc + */ + # Eddie AirVPN: VPN client + eddieAirVPN.enable = true; + # Galculator: simple calculator + galculator.enable = true; + # Winboat: Windows remote desktop via RDP + winboat.enable = false; +} diff --git a/hosts/default/default.nix b/hosts/default/default.nix index 14fa2e5..a62bf1f 100644 --- a/hosts/default/default.nix +++ b/hosts/default/default.nix @@ -2,5 +2,6 @@ _: { imports = [ ./hardware.nix ./host-packages.nix + ./system-modules.nix ]; } diff --git a/hosts/default/home-modules.nix b/hosts/default/home-modules.nix new file mode 100644 index 0000000..6c95e1f --- /dev/null +++ b/hosts/default/home-modules.nix @@ -0,0 +1,66 @@ +_: { + /* + Development editors and IDEs + */ + # VSCodium: a free and open-source "demicrosofted" VSCode + vscodium.enable = false; + # Zed Editor: a modern, high‑performance code editor + zed-editor = { + # Enable Zed Editor + enable = true; + # Remote Server: enable remote editing capabilities + remote-server = true; + }; + + /* + Web browsers + */ + # Librewolf: a privacy-focused Firefox fork + librewolf.enable = true; + # Ungoogled Chromium: a privacy-focused Chromium fork + ungoogled-chromium.enable = true; + + /* + System utilities + */ + # Btop: a resource monitor for the terminal + btop.enable = true; + # Cava: terminal audio visualizer + cava.enable = false; + # Fastfetch: a fast system information tool + fastfetch.enable = true; + + /* + Communication and synchronization + */ + # KDE Connect: integrate your phone and desktop + kdeconnect.enable = false; + # Nextcloud Client: sync files with a Nextcloud server + nextcloud-client.enable = true; + # Vesktop: a community‑driven Discord client + vesktop.enable = true; + + /* + Gaming + */ + # Lutris: an open gaming platform + lutris.enable = false; + + /* + Media recording and streaming + */ + # OBS Studio: streaming and recording software + obs-studio.enable = false; + + /* + Office suite + */ + # OnlyOffice: an office suite compatible with Microsoft formats + onlyoffice.enable = true; + + /* + Learning tools + */ + # Anki: spaced‑repetition flashcard program + anki.enable = true; +} diff --git a/hosts/default/system-modules.nix b/hosts/default/system-modules.nix new file mode 100644 index 0000000..b97ee5d --- /dev/null +++ b/hosts/default/system-modules.nix @@ -0,0 +1,87 @@ +_: { + /* + Container & Packaging + */ + # Docker: container runtime and management + docker.enable = true; + # Distrobox: containerized development environments + distrobox.enable = false; + # Flatpak: universal packaging system for Linux + flatpak.enable = true; + # Lazydocker: simple TUI for Docker + lazydocker.enable = false; + + /* + Gaming + */ + # GameMode: optimizes system performance for gaming + gamemode.enable = true; + # Gamescope: micro-compositor for games + gamescope.enable = false; + # Prism Launcher: Minecraft modded launcher + prismlauncher.enable = false; + # Steam: platform for buying and playing games + steam.enable = true; + # SpaceCadet Pinball: classic pinball game + spaceCadetPinball.enable = true; + # TTY Solitaire: terminal based solitaire game + ttySolitaire.enable = true; + + /* + Development Tools + */ + # Exercism: coding practice platform + exercism.enable = true; + # Gedit: GNOME text editor + gedit.enable = false; + # Lazygit: simple TUI for git + lazygit.enable = false; + # OpenCode: tools for coding and development + opencode.enable = true; + + /* + Communication & Collaboration + */ + # Mattermost: open-source Slack alternative + mattermost.enable = true; + # Slack: team communication and collaboration tool + slack.enable = true; + # Tutanota: secure email client + tutanota.enable = true; + + /* + Productivity / Knowledge Management + */ + # Bitwarden: password manager (desktop) + bitwarden.enable = false; + # Iotas: lightweight notes manager + iotas.enable = true; + # Logseq: knowledge base and outliner + logseq.enable = false; + + /* + Media & Graphics + */ + # Affinity: professional graphics suite + affinity.enable = false; + # Eye of GNOME: image viewer + eyeOfGnome.enable = true; + # FreeTube: privacy‑friendly YouTube client + freetube.enable = false; + # GIMP: gnu image manipulation program + gimp.enable = false; + # Kdenlive: video editing software + kdenlive.enable = false; + # Plex: media player and server client + plex.enable = true; + + /* + Utilities / Misc + */ + # Eddie AirVPN: VPN client + eddieAirVPN.enable = true; + # Galculator: simple calculator + galculator.enable = true; + # Winboat: Windows remote desktop via RDP + winboat.enable = false; +} diff --git a/modules/core/default.nix b/modules/core/default.nix index ca80549..5f8f437 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -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 diff --git a/modules/core/docker.nix b/modules/core/docker.nix new file mode 100644 index 0000000..d123149 --- /dev/null +++ b/modules/core/docker.nix @@ -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"]; + }; +} diff --git a/modules/core/flatpak.nix b/modules/core/flatpak.nix index b8e83d2..5c7a7df 100644 --- a/modules/core/flatpak.nix +++ b/modules/core/flatpak.nix @@ -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" + ]; }; } diff --git a/modules/core/packages/clients.nix b/modules/core/packages/clients.nix deleted file mode 100644 index 37eb968..0000000 --- a/modules/core/packages/clients.nix +++ /dev/null @@ -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 - ]; -} diff --git a/modules/core/packages/default.nix b/modules/core/packages/default.nix index 26acb4d..4f0182c 100644 --- a/modules/core/packages/default.nix +++ b/modules/core/packages/default.nix @@ -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 ]; } diff --git a/modules/core/packages/development.nix b/modules/core/packages/development.nix deleted file mode 100644 index 942f061..0000000 --- a/modules/core/packages/development.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - # Learning & practice - exercism - # AI coding - opencode - ]; -} diff --git a/modules/core/packages/tools.nix b/modules/core/packages/essentials.nix similarity index 90% rename from modules/core/packages/tools.nix rename to modules/core/packages/essentials.nix index eae0eed..28487aa 100644 --- a/modules/core/packages/tools.nix +++ b/modules/core/packages/essentials.nix @@ -1,5 +1,12 @@ {pkgs, ...}: { environment.systemPackages = with pkgs; [ + mpv + pavucontrol + playerctl + cmatrix + cowsay + sl + fortune # File management trash-cli file-roller diff --git a/modules/core/packages/gaming.nix b/modules/core/packages/gaming.nix deleted file mode 100644 index f5d4149..0000000 --- a/modules/core/packages/gaming.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - pkgs, - # inputs, - # system, - ... -}: { - environment.systemPackages = with pkgs; [ - # inputs.prismlauncher-cracked.packages.${system}.default - space-cadet-pinball - tty-solitaire - ]; -} diff --git a/modules/core/packages/multimedia.nix b/modules/core/packages/multimedia.nix deleted file mode 100644 index 3e1694d..0000000 --- a/modules/core/packages/multimedia.nix +++ /dev/null @@ -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 - ]; -} diff --git a/modules/core/packages/packages.nix b/modules/core/packages/packages.nix new file mode 100644 index 0000000..f78aa94 --- /dev/null +++ b/modules/core/packages/packages.nix @@ -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); +} diff --git a/modules/core/packages/terminal.nix b/modules/core/packages/terminal.nix deleted file mode 100644 index 68b839a..0000000 --- a/modules/core/packages/terminal.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - cmatrix - cowsay - sl - fortune - lolcat - eza - ]; -} diff --git a/modules/core/packages/virtualization.nix b/modules/core/packages/virtualization.nix deleted file mode 100644 index 2219840..0000000 --- a/modules/core/packages/virtualization.nix +++ /dev/null @@ -1,11 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - virt-viewer - # lazydocker - docker-client - # distrobox - # boxbuddy - # freerdp - # winboat - ]; -} diff --git a/modules/core/steam.nix b/modules/core/steam.nix index f6dfd3a..ce3baae 100644 --- a/modules/core/steam.nix +++ b/modules/core/steam.nix @@ -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; + }; }; } diff --git a/modules/core/thunar.nix b/modules/core/thunar.nix index fc52274..c90b8b8 100644 --- a/modules/core/thunar.nix +++ b/modules/core/thunar.nix @@ -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 + ]; }; } diff --git a/modules/core/user.nix b/modules/core/user.nix index 9c1e158..d68c920 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -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}"]; } diff --git a/modules/core/virtualisation.nix b/modules/core/virtualisation.nix deleted file mode 100644 index 4d887f7..0000000 --- a/modules/core/virtualisation.nix +++ /dev/null @@ -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; -} diff --git a/modules/core/xdg.nix b/modules/core/xdg.nix index 3fb824c..ff9eead 100644 --- a/modules/core/xdg.nix +++ b/modules/core/xdg.nix @@ -7,5 +7,6 @@ xdg-desktop-portal-gtk ]; configPackages = [pkgs.hyprland]; + xdgOpenUsePortal = true; }; } diff --git a/modules/home/anki.nix b/modules/home/anki.nix index a1b0b5d..a36ccd5 100644 --- a/modules/home/anki.nix +++ b/modules/home/anki.nix @@ -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"; diff --git a/modules/home/btop.nix b/modules/home/btop.nix index 37204e8..ae8e4f7 100644 --- a/modules/home/btop.nix +++ b/modules/home/btop.nix @@ -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; diff --git a/modules/home/cava.nix b/modules/home/cava.nix index 1feaadf..b226846 100644 --- a/modules/home/cava.nix +++ b/modules/home/cava.nix @@ -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; diff --git a/modules/home/chromium/default.nix b/modules/home/chromium/default.nix index 8b24eec..501e41c 100644 --- a/modules/home/chromium/default.nix +++ b/modules/home/chromium/default.nix @@ -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 = [ ]; diff --git a/modules/home/fastfetch/default.nix b/modules/home/fastfetch/default.nix index 84a8ac3..091b42b 100644 --- a/modules/home/fastfetch/default.nix +++ b/modules/home/fastfetch/default.nix @@ -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 + ]; } diff --git a/modules/home/fastfetch/settings/default.nix b/modules/home/fastfetch/settings/default.nix new file mode 100644 index 0000000..bfce4d1 --- /dev/null +++ b/modules/home/fastfetch/settings/default.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./display.nix + ./logo.nix + ./modules.nix + ]; +} diff --git a/modules/home/fastfetch/settings/display.nix b/modules/home/fastfetch/settings/display.nix new file mode 100644 index 0000000..892a5ca --- /dev/null +++ b/modules/home/fastfetch/settings/display.nix @@ -0,0 +1,9 @@ +_: { + programs.fastfetch.settings.display = { + color = { + keys = "35"; + output = "90"; + }; + separator = " ➜ "; + }; +} diff --git a/modules/home/fastfetch/settings/logo.nix b/modules/home/fastfetch/settings/logo.nix new file mode 100644 index 0000000..631138e --- /dev/null +++ b/modules/home/fastfetch/settings/logo.nix @@ -0,0 +1,12 @@ +_: { + programs.fastfetch.settings.logo = { + source = ../garandos.png; + type = "kitty-direct"; + height = 15; + width = 30; + padding = { + top = 3; + left = 3; + }; + }; +} diff --git a/modules/home/fastfetch/settings/modules.nix b/modules/home/fastfetch/settings/modules.nix new file mode 100644 index 0000000..3ee25fb --- /dev/null +++ b/modules/home/fastfetch/settings/modules.nix @@ -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" + ]; +} diff --git a/modules/home/hyprland/binds.nix b/modules/home/hyprland/binds.nix index 6529b8d..f6a6a5a 100644 --- a/modules/home/hyprland/binds.nix +++ b/modules/home/hyprland/binds.nix @@ -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," diff --git a/modules/home/hyprland/windowrules.nix b/modules/home/hyprland/windowrules.nix index 7da1ce0..ecbde18 100644 --- a/modules/home/hyprland/windowrules.nix +++ b/modules/home/hyprland/windowrules.nix @@ -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)$" diff --git a/modules/home/kdeConnect.nix b/modules/home/kdeConnect.nix index 800e86f..2d1276c 100644 --- a/modules/home/kdeConnect.nix +++ b/modules/home/kdeConnect.nix @@ -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; diff --git a/modules/home/librewolf/default.nix b/modules/home/librewolf/default.nix index cab8177..f70aa98 100644 --- a/modules/home/librewolf/default.nix +++ b/modules/home/librewolf/default.nix @@ -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) }; }; diff --git a/modules/home/lutris.nix b/modules/home/lutris.nix index 339968d..ca02b24 100644 --- a/modules/home/lutris.nix +++ b/modules/home/lutris.nix @@ -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; }; } diff --git a/modules/home/nextcloud.nix b/modules/home/nextcloud.nix index 393b09a..c4c4cca 100644 --- a/modules/home/nextcloud.nix +++ b/modules/home/nextcloud.nix @@ -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; diff --git a/modules/home/obs-studio.nix b/modules/home/obs-studio.nix index 9c6c27a..abab300 100644 --- a/modules/home/obs-studio.nix +++ b/modules/home/obs-studio.nix @@ -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 diff --git a/modules/home/onlyoffice.nix b/modules/home/onlyoffice.nix index 0492e33..2db5960 100644 --- a/modules/home/onlyoffice.nix +++ b/modules/home/onlyoffice.nix @@ -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 = { diff --git a/modules/home/vesktop.nix b/modules/home/vesktop.nix index 9e6b2cb..235406c 100644 --- a/modules/home/vesktop.nix +++ b/modules/home/vesktop.nix @@ -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; }; diff --git a/modules/home/vscodium/default.nix b/modules/home/vscodium/default.nix index 4c0c97e..d29901f 100644 --- a/modules/home/vscodium/default.nix +++ b/modules/home/vscodium/default.nix @@ -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 = [ diff --git a/modules/home/zed/default.nix b/modules/home/zed/default.nix index 0853e68..62b7152 100644 --- a/modules/home/zed/default.nix +++ b/modules/home/zed/default.nix @@ -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