From b7006e904d12ef77e781bde8a7c2ed1f264c7867 Mon Sep 17 00:00:00 2001 From: wayne <...> Date: Fri, 1 Nov 2024 09:04:24 -0700 Subject: [PATCH] Containers and Refinements Oh my --- configuration.nix | 89 ++++++---- environment.nix | 37 +++- flake.lock | 132 ++++++++++++-- flake.nix | 10 +- flakes/calxyos/shell.nix | 5 + hardware-configuration.nix | 18 +- hm/home.nix | 109 +++++------- hm/hypr.nix | 92 ---------- hm/modules/hypr.nix | 273 +++++++++++++++++++++++++++++ hm/modules/theme.nix | 53 ++++++ hm/{ => modules}/wayland.nix | 14 +- hm/modules/xdg.nix | 18 ++ hm/pkgs/creative-packages.nix | 9 + hm/pkgs/default.nix | 11 ++ hm/pkgs/gramming-packages.nix | 9 + hm/pkgs/inet-packages.nix | 30 ++++ hm/pkgs/llm-packages.nix | 6 + hm/pkgs/rescue-packages.nix | 5 + hm/pkgs/theme-packages.nix | 21 +++ hm/pkgs/wm-packages.nix | 16 ++ hm/unused/catppuccin.nix | 39 +++++ hm/unused/catppuccin_functions.nix | 56 ++++++ hm/xdg.nix | 18 -- modules/containers.nix | 259 +++++++++++++++++++++++++++ modules/display.nix | 16 +- modules/hypr.nix | 4 - modules/network.nix | 112 ++++++++---- modules/qt.nix | 8 + modules/security.nix | 16 ++ modules/users.nix | 5 +- modules/wm.nix | 57 ++++-- nix/nix.conf | 4 +- pkgs/app/terminal/kitty.nix | 7 +- pkgs/app/terminal/tmux.nix | 29 +-- pkgs/shell/bash.nix | 29 +++ pkgs/shell/stow.nix | 5 +- pkgs/wm/hyprland/hyprland.nix | 115 ++++++------ pkgs/wm/mako/mako.nix | 4 +- pkgs/wm/waybar/default.json | 37 ++-- pkgs/wm/waybar/waybar.nix | 19 +- secrets/nextcloud.age | 20 +++ secrets/onlyoffice-jwt.age | Bin 0 -> 1547 bytes secrets/secrets.nix | 14 ++ secrets/whayes.age | 17 ++ testBuild.sh | 14 ++ 45 files changed, 1454 insertions(+), 407 deletions(-) create mode 100644 flakes/calxyos/shell.nix delete mode 100644 hm/hypr.nix create mode 100644 hm/modules/hypr.nix create mode 100644 hm/modules/theme.nix rename hm/{ => modules}/wayland.nix (91%) create mode 100644 hm/modules/xdg.nix create mode 100644 hm/pkgs/creative-packages.nix create mode 100644 hm/pkgs/default.nix create mode 100644 hm/pkgs/gramming-packages.nix create mode 100644 hm/pkgs/inet-packages.nix create mode 100644 hm/pkgs/llm-packages.nix create mode 100644 hm/pkgs/rescue-packages.nix create mode 100644 hm/pkgs/theme-packages.nix create mode 100644 hm/pkgs/wm-packages.nix create mode 100644 hm/unused/catppuccin.nix create mode 100644 hm/unused/catppuccin_functions.nix delete mode 100644 hm/xdg.nix create mode 100644 modules/containers.nix delete mode 100644 modules/hypr.nix create mode 100644 modules/qt.nix create mode 100644 pkgs/shell/bash.nix create mode 100644 secrets/nextcloud.age create mode 100644 secrets/onlyoffice-jwt.age create mode 100644 secrets/secrets.nix create mode 100644 secrets/whayes.age create mode 100755 testBuild.sh diff --git a/configuration.nix b/configuration.nix index cf771a6..05270c1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,5 @@ -{ lib, config, pkgs, zen-browser, hyprland, inputs, ... }: +# NixOS's declarative configuration calculates which software packages need to be installed and then soft-links the storage paths of these packages in the Nix Store to /run/current-system, and by modifying environment variables like PATH +{ lib, config, pkgs, zen-browser, hyprland, inputs, agenix, ... }: let unstable = import { overlays = pkgs.overlays; @@ -10,11 +11,13 @@ in ./environment.nix ./hardware-configuration.nix + ./modules/containers.nix ./modules/display.nix ./modules/files.nix ./modules/fonts.nix ./modules/network.nix ./modules/nix.nix + # ./modules/qt.nix ./modules/security.nix ./modules/users.nix ./modules/wm.nix @@ -42,33 +45,33 @@ in # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - systemd.services.StartInputRemapperDaemonAtLogin = { - enable = false; - description = "Start input-remapper daemon after login"; - unitConfig = { - Type = "simple"; - }; - script = lib.getExe(pkgs.writeShellApplication { - name = "start-input-mapper-daemon"; - runtimeInputs = with pkgs; [input-remapper procps su]; - text = '' - until pgrep -u wayne; do - sleep 1 - done - sleep 2 - until [ $(pgrep -c -u root "input-remapper") -eq 4 ]; do - input-remapper-service& - sleep 1 - input-remapper-helper& - sleep 1 - done - su wayne -c "input-remapper-control --command stop-all" - su wayne -c "input-remapper-control --command autoload" - sleep infinity - ''; - }); - wantedBy = [ "default.target" ]; - }; + # systemd.services.StartInputRemapperDaemonAtLogin = { + # enable = false; + # description = "Start input-remapper daemon after login"; + # unitConfig = { + # Type = "simple"; + # }; + # script = lib.getExe(pkgs.writeShellApplication { + # name = "start-input-mapper-daemon"; + # runtimeInputs = with pkgs; [input-remapper procps su]; + # text = '' + # until pgrep -u wayne; do + # sleep 1 + # done + # sleep 2 + # until [ $(pgrep -c -u root "input-remapper") -eq 4 ]; do + # input-remapper-service& + # sleep 1 + # input-remapper-helper& + # sleep 1 + # done + # su wayne -c "input-remapper-control --command stop-all" + # su wayne -c "input-remapper-control --command autoload" + # sleep infinity + # ''; + # }); + # wantedBy = [ "default.target" ]; + # }; # Possible weird bug # systemd.services.ReloadInputRemapperAfterSleep = { @@ -107,7 +110,8 @@ in # ]; virtualisation.docker = { - enable = true; + enable = false; + enableNvidia = true; rootless = { enable = true; setSocketVariable = true; @@ -155,7 +159,7 @@ in # }; # }; # }; - avahi = { + avahi = { # Printing enable = true; nssmdns4 = true; openFirewall = true; @@ -172,33 +176,54 @@ in # no need to redefine it in your config for now) #media-session.enable = true; }; + hardware.openrgb = { + enable = true; + package = pkgs.openrgb-with-all-plugins; + motherboard = "intel"; + server.port = 6742; + }; }; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ + (pkgs.catppuccin-sddm.override { + flavor = "mocha"; + font = "Noto Sans"; + fontSize = "9"; + background = "${/home/wayne/Pictures/marvin.png}"; + loginBackground = true; + # clockEnabled = true; + }) vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget git sshfs pciutils zsh - cryptsetup + cryptsetup agenix.packages.x86_64-linux.default home-manager wpa_supplicant lynx nix-index nix-prefetch-scripts nix-prefetch docker_27 docker-compose - direnv nix-direnv + # direnv nix-direnv # xdg-desktop-portal-hyprland clinfo glxinfo vulkan-tools wayland-utils wl-clipboard kdePackages.kdeplasma-addons kdePackages.qtstyleplugin-kvantum kdePackages.full kdePackages.qtwebengine kdePackages.qtpositioning kdePackages.qtlocation kdePackages.ark plasma5Packages.kwallet-pam kdePackages.dolphin kdePackages.kwallet kdePackages.kwalletmanager kdePackages.konsole evtest input-remapper dbus uwsm # keyd + egl-wayland cudaPackages.cudatoolkit # cudaPackages.cuda-samples cifs-utils mesa libGL udiskie + libsForQt5.qtstyleplugin-kvantum + catppuccin-sddm-corners # steam-run + lxqt.pavucontrol-qt + + openrgb-with-all-plugins i2c-tools + android-udev-rules ]; system.stateVersion = "24.05"; # Did you read the comment? } diff --git a/environment.nix b/environment.nix index 3db3798..fc5830c 100644 --- a/environment.nix +++ b/environment.nix @@ -18,6 +18,37 @@ LC_TIME = "en_US.UTF-8"; }; - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - environment.sessionVariables.SDDM_INITIAL_VT = "VT 7"; -} \ No newline at end of file + environment.pathsToLink = [ "/share/bash-completion" ]; + environment.sessionVariables = rec { + NIXOS_OZONE_WL = "1"; + # SDDM_INITIAL_VT = "VT 7"; + + # https://discourse.nixos.org/t/guide-to-installing-qt-theme/35523/3 + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_DESKTOP = "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + XDG_DATA_HOME = "$HOME/.local/share"; + GDK_BACKEND = "wayland"; + + GTK_USE_PORTAL = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor"; + + MOZ_ENABLE_WAYLAND = "1"; + + OZONE_PLATFORM = "wayland"; + ELECTRON_OZONE_PLATFORM_HINT = "wayland"; + APPIMAGELAUNCHER_DISABLE ="1"; + CLUTTER_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; + LIBVA_DRIVER_NAME = "nvidia"; + + # Replaces EGLStreams + GBM_BACKEND = "nvidia-drm"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + + # QT_LOGGING_RULES="*.debug=true"; + }; +} diff --git a/flake.lock b/flake.lock index 0a98cbb..fa6dd26 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "owner": "ryantm", + "repo": "agenix", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -50,6 +71,28 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -68,7 +111,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1726560853, @@ -101,6 +144,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -157,16 +221,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728740863, - "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", - "owner": "nixos", + "lastModified": 1703013332, + "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", + "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-24.05", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -204,11 +268,27 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1727348695, - "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "lastModified": 1728740863, + "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1730200266, + "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", "type": "github" }, "original": { @@ -220,14 +300,15 @@ }, "root": { "inputs": { + "agenix": "agenix", "base16": "base16", "base16-vim": "base16-vim", "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "home-manager": "home-manager", + "home-manager": "home-manager_2", "legacy": "legacy", "nix-colors": "nix-colors", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "tt-schemes": "tt-schemes", "zen-browser": "zen-browser" @@ -248,6 +329,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tt-schemes": { "flake": false, "locked": { @@ -266,18 +362,18 @@ }, "zen-browser": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1728598925, - "narHash": "sha256-WW8VBIsNd4ABwe0sOWAfEttFm9j4Bzq/Eu+CsYT5pKU=", - "owner": "mastermines1", + "lastModified": 1730444716, + "narHash": "sha256-WtqSpYQyG5ad+GK7B0ViDSl0NolHp7yM24TacUslBXE=", + "owner": "ch4og", "repo": "zen-browser-flake", - "rev": "b4290ee06022931de610817c13f324b82b9f2afc", + "rev": "d3c639ee7bff20f799f443e18fffa6331a71cd3a", "type": "github" }, "original": { - "owner": "mastermines1", + "owner": "ch4og", "repo": "zen-browser-flake", "type": "github" } diff --git a/flake.nix b/flake.nix index 5dcf35c..fadf09d 100644 --- a/flake.nix +++ b/flake.nix @@ -31,7 +31,8 @@ # Zen Browser # zen-browser.url = "github:MarceColl/zen-browser-flake"; - zen-browser.url = "github:mastermines1/zen-browser-flake"; + # zen-browser.url = "github:mastermines1/zen-browser-flake"; + zen-browser.url = "github:ch4og/zen-browser-flake"; # hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; # hyprland.url = "github:hyprwm/Hyprland"; @@ -42,9 +43,10 @@ # url = "git+https://github.com/kmonad/kmonad?submodules=1&dir=nix"; # inputs.nixpkgs.follows = "nixpkgs"; # }; + agenix.url = "github:ryantm/agenix"; }; - outputs = { self, nixpkgs, legacy, home-manager, flake-utils, flake-compat, zen-browser, nix-colors, base16, ... } @ inputs: + outputs = { self, nixpkgs, legacy, home-manager, flake-utils, flake-compat, zen-browser, nix-colors, base16, agenix, ... } @ inputs: let inherit (self) outputs; lib = nixpkgs.lib; # Import lib here explicitly from nixpkgs @@ -79,10 +81,11 @@ nixosConfigurations = { launchpad = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs systemSettings userSettings lib ;}; + specialArgs = {inherit inputs outputs systemSettings userSettings lib agenix ;}; modules = [ # kmonad.nixosModules.default ./configuration.nix + agenix.nixosModules.default ]; }; }; @@ -99,6 +102,7 @@ # import `theming.nix`, we will write it in the next, final, step # ./theming.nix ./hm/home.nix + ]; }; }; diff --git a/flakes/calxyos/shell.nix b/flakes/calxyos/shell.nix new file mode 100644 index 0000000..2e287ec --- /dev/null +++ b/flakes/calxyos/shell.nix @@ -0,0 +1,5 @@ +{ pkgs ? import {} }: + +(pkgs.buildFHSUserEnv { + name = "calyxos-device-flashing"; +}).env \ No newline at end of file diff --git a/hardware-configuration.nix b/hardware-configuration.nix index f17a869..2e561f9 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -9,11 +9,23 @@ ]; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + # boot.loader.systemd-boot.enable = true; Disabled for Grub + boot.loader = { + efi.canTouchEfiVariables = true; + grub = { + enable = true; + devices = [ "nodev" ]; + efiSupport = true; + useOSProber = true; + # extraConfig = '' + # set gfxmode=3840x2160 + # set gfxpayload=keep + # ''; + }; + }; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.kernelModules = [ "i2c-dev" "i2c-piix4" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; diff --git a/hm/home.nix b/hm/home.nix index 45d691b..86feacf 100644 --- a/hm/home.nix +++ b/hm/home.nix @@ -1,6 +1,9 @@ # Last stable generation 359 10/13/24 +# home-manager works by soft-linking the software packages configured by the user to /etc/profiles/per-user/your-username and modifying environment variables like PATH to point to this path, thus installing user software packages. { inputs, outputs, lib, config, pkgs, systemSettings, userSettings, zen-browser, hyprland, nix-colors, ... }: let + system = "x86_64-linux"; + myAliases = { # Sysadmin ll = "ls -alF"; @@ -12,6 +15,10 @@ let update = "sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y"; listServices = "systemctl list-units --all --type=service --no-pager"; listUserServices = "systemctl list-units --all --type=service --no-pager --user"; + listGenerations = "sudo nix-env -p /nix/var/nix/profiles/system --list-generations"; + switchGenerations = "nix-env --switch-generation $1"; + nixClean = "nix-env -e '*'"; + takeOutTrash = "nix-collect-garbage --delete-older-than $1"; ls = "eza --icons -l -T -L=1"; cat = "bat"; @@ -27,7 +34,10 @@ let updateChannel="nix-channel --update nixos"; nixOptimize="nix-store --optimise"; mkhome="cd ~/system && home-manager switch --flake ."; - buildsys="cd ~/system && sudo nixos-rebuild switch --flake '.#'"; + buildsys="cd ~/system && sudo nixos-rebuild switch --flake \\'.#\\'"; + get256="nix-prefetch-url --type sha256 $1"; + + remapKeys="input-remapper-control --command autoload"; # Zoxide # cd="z"; @@ -74,31 +84,40 @@ let # propogateBuildInputs = with pkgs.python311Packages; []; # }; - polycat = pkgs.callPackage ../pkgs/derivations/polycat {}; - + unstablePkgs = import ( + fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"; + sha256 = "0p3ry8x72cl572fs1c47h9y3s045p4aq71wpblzdi4dfqx3z2i7m"; + }) + { + # config = config.nixpkgs.config; + inherit system; + }; in { imports = [ - ./hypr.nix - ./xdg.nix - ./wayland.nix + (import ./modules/hypr.nix { inherit pkgs config lib; }) + (import ./modules/theme.nix { inherit pkgs unstablePkgs; }) + ./modules/wayland.nix + ./modules/xdg.nix - (import ../pkgs/shell/stow.nix { pkgs = pkgs; lib = lib; config = config; }) - (import ../pkgs/shell/cli-collection.nix { pkgs = pkgs; }) - (import ../pkgs/shell/sh.nix { inherit myAliases; pkgs = pkgs;}) - (import ../pkgs/shell/zsh.nix { inherit myAliases; pkgs = pkgs;}) - (import ../pkgs/git/git.nix { inherit userSettings; pkgs = pkgs; }) - (import ../pkgs/app/terminal/tmux.nix { pkgs = pkgs; lib = lib; config = config; }) - (import ../pkgs/app/terminal/kitty.nix { pkgs = pkgs; lib = lib; nix-colors = nix-colors; config = config; }) + (import ../pkgs/shell/stow.nix { inherit pkgs lib config; }) + (import ../pkgs/shell/cli-collection.nix { inherit pkgs; }) + (import ../pkgs/shell/bash.nix { inherit pkgs config myAliases; }) + (import ../pkgs/shell/sh.nix { inherit myAliases pkgs;}) + (import ../pkgs/shell/zsh.nix { inherit myAliases pkgs;}) + (import ../pkgs/git/git.nix { inherit userSettings pkgs; }) + (import ../pkgs/app/terminal/tmux.nix { inherit pkgs lib config; }) + (import ../pkgs/app/terminal/kitty.nix { inherit pkgs lib nix-colors config; }) # (import ../pkgs/app/terminal/starship.nix { pkgs = pkgs; }) - (import ../pkgs/app/terminal/parrot-starship.nix { pkgs = pkgs; }) - (import ../pkgs/app/terminal/yazi.nix { pkgs = pkgs; }) - (import ../pkgs/lang/cc/cc.nix { pkgs = pkgs; }) + (import ../pkgs/app/terminal/parrot-starship.nix { inherit pkgs; }) + (import ../pkgs/app/terminal/yazi.nix { inherit pkgs; }) + (import ../pkgs/lang/cc/cc.nix { inherit pkgs; }) # (import ../pkgs/lang/python/python.nix { pkgs = pkgs; }) # (import ../pkgs/lang/python/python-packages.nix { pkgs = pkgs; }) # (import ../pkgs/app/editor/nvim.nix { pkgs = pkgs; }) # (import ../pkgs/app/terminal/alacritty.nix { pkgs = pkgs; }) - (import ../pkgs/app/audio/mopidy.nix { pkgs = pkgs; }) + (import ../pkgs/app/audio/mopidy.nix { inherit pkgs; }) ]; nixpkgs = { @@ -113,6 +132,8 @@ in username = "${userSettings.username}"; homeDirectory = "/home/${userSettings.username}"; sessionVariables = { + EDITOR = userSettings.editor; + TERM = userSettings.term; PYTHONPATH = "${pkgs.mopidy}/lib/python3.11/site-packages:${pkgs.mopidy-tidal}/lib/python3.11/site-packages:${pkgs.mopidy-musicbox-webclient}/lib/python3.11/site-packages"; }; }; @@ -120,62 +141,21 @@ in # colorScheme = nix-colors.colorSchemes.nord; home.packages = with pkgs; [ - (python3.withPackages (ps: with ps; [ - pip pynvim # mopidy-tidal # Mopidy-WebSettings - ])) - # mopidy mopidy-tidal mopidy-musicbox-webclient gst_all_1.gstreamer gst_all_1.gst-plugins-bad - # Core zsh bash git stow tmux tmuxPlugins.tmux-fzf - vim neovim lunarvim # vimPlugins.vim-kitty-navigator zoxide # vimPlugins.telescope-zoxide vimPlugins.zoxide-vim bottom htop jq - # Lunarvim Dependencies - gnumake42 nodejs_22 cargo ripgrep cmake starship - yazi mapscii tidal-dl - - # IDE's - sublime3 vscode # vscode.languages.web vscode.languages.python vscode.languages.nix vscode.languages.bash - typora obsidian obsidian-export # vimPlugins.obsidian-nvim + yazi appimage-run - - # studio - krita inkscape blender gimp-with-plugins - reaper - - # System/Rescue - ddrescue gparted nerdfonts ubuntu_font_family - # openrgb-with-all-plugins - - # Cloud/Remote - restic - nextcloud-client - keepassxc git-credential-keepassxc keybase-gui keybase kbfs - remmina - - # Browsers - firefox-devedition w3m ungoogled-chromium librewolf - # https://github.com/MarceColl/zen-browser-flake/tree/master - zen-browser.packages."${system}".default - - mailspring betterbird doublecmd + doublecmd # pentablet-flake - libreoffice + bottles-unwrapped + ] ++ (import ./pkgs { inherit unstablePkgs pkgs system zen-browser; }); - wdisplays - waybar hyprpaper hyprlock hypridle wlogout rofi-wayland wev clipman cliphist wl-clip-persist wl-clipboard - polycat qt5.qtwayland qt6.qtwayland qt5ct qt6ct hyprshot hyprpicker dconf wayland-utils wayland-protocols qalculate-qt - blueman networkmanagerapplet swayosd wlr-randr - base16-schemes base16-shell-preview - - # hyprcursor nordzy-icon-theme - # LLM's - # lmstudio - ]; programs = { home-manager.enable = true; @@ -210,11 +190,6 @@ in }; }; - home.sessionVariables = { - EDITOR = userSettings.editor; - TERM = userSettings.term; - }; - news.display = "silent"; systemd.user.startServices = "sd-switch"; diff --git a/hm/hypr.nix b/hm/hypr.nix deleted file mode 100644 index 635867a..0000000 --- a/hm/hypr.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ pkgs, config, lib, ... }: -{ - programs.hyprlock.enable = true; - services.hypridle = { - enable = true; - settings = { - # $lock_cmd = pidof hyprlock || hyprlock - # $suspend_cmd = pidof steam || systemctl suspend || loginctl suspend # fuck nvidia - - general = { - lock_cmd = "pidof hyprlock || hyprlock"; - before_sleep_cmd = "loginctl lock-session"; - }; - - listener = [ - { - timeout = 5400; - on-timeout = "loginctl lock-session"; - } - - { - timeout = 7200; - on-timeout = "hyprctl dispatch dpms off"; - on-resume = "hyprctl dispatch dpms on"; - } - - { - timeout = 10800; - on-timeout = "pidof steam || systemctl suspend || loginctl suspend"; - } - ]; - }; - }; - programs.wlogout = { - enable = true; - layout = [ - { - label = "lock"; - action = "loginctl lock-session"; - text = "Lock"; - keybind = "l"; - circular = false; - } - { - label = "hibernate"; - action = "systemctl hibernate"; - text = "Hibernate"; - keybind = "h"; - circular = false; - } - { - label = "logout"; - action = "hyprctl dispatch exit"; - text = "Logout"; - keybind = "e"; - circular = false; - } - { - label = "shutdown"; - action = "systemctl poweroff"; - text = "Shutdown"; - keybind = "s"; - circular = false; - } - { - label = "suspend"; - action = "systemctl suspend"; - text = "Suspend"; - keybind = "u"; - circular = false; - } - { - label = "reboot"; - action = "systemctl reboot"; - text = "Reboot"; - keybind = "r"; - circular = false; - } - ]; - }; - services.swayosd = { - enable = true; - display = "DP-4"; - }; - services.mako.enable = true; - - imports = [ - (import ../pkgs/wm/hyprland/hyprland.nix { pkgs = pkgs; }) - (import ../pkgs/wm/waybar/waybar.nix { inherit config; pkgs = pkgs; }) - (import ../pkgs/wm/mako/mako.nix { config = config; pkgs = pkgs; lib=lib; }) - ]; -} \ No newline at end of file diff --git a/hm/modules/hypr.nix b/hm/modules/hypr.nix new file mode 100644 index 0000000..0731399 --- /dev/null +++ b/hm/modules/hypr.nix @@ -0,0 +1,273 @@ +{ pkgs, config, lib, ... }: +{ + programs.hyprlock = { + enable = true; + # settings = { + # text_color = "rgba(FFFFFFFF)"; + # entry_background_color = "rgba(33333311)"; + # entry_border_color = "rgba(3B3B3B55)"; + # entry_color = "rgba(FFFFFFFF)"; + # font_family = "Rubik Light"; + # font_family_clock = "Rubik Light"; + # font_material_symbols = "Material Symbols Rounded"; + + # background = { + # # color = r"gba(0D0D17FF)"; + # color = "rgba(000000FF)"; + # # path = "{{ SWWW_WALL }}"; + # path = "${config.home.homeDirectory}/.local/share/wallpapers/northern-lights-arctic-circle-norway-07.jpg"; + # blur_size = 5; + # blur_passes = 4; + # }; + + # input-field = { + # monitor = ""; + # size = "250, 50"; + # outline_thickness = 2; + # dots_size = 0.1; + # dots_spacing = 0.3; + # outer_color = "${entry_border_color}"; + # inner_color = "${entry_background_color}"; + # font_color = "${entry_color}"; + # # fade_on_empty = true,\; + + # position = "0, 20"; + # halign = "center"; + # valign = "center"; + # }; + + # label = { # Clock + # monitor = ""; + # text = "${TIME12}"; + # shadow_passes = 1; + # shadow_boost = 0.5; + # color = "${text_color}"; + # font_size = 65; + # font_family = "${font_family_clock}"; + + # position = "0, 300"; + # halign = "center"; + # valign = "center"; + # }; + + # label = { # Greeting + # monitor = ""; + # text = "hi $USER !!!"; + # shadow_passes = 1; + # shadow_boost = 0.5; + # color = "$[text_color]"; + # font_size = 20; + # font_family = "${font_family}"; + + # position = "0, 240"; + # halign = "center"; + # valign = "center"; + # }; + + # label = { # lock icon + # monitor = ""; + # text = "lock"; + # shadow_passes = 1; + # shadow_boost = 0.5; + # color = "${text_color}"; + # font_size = 21; + # font_family = "${font_material_symbols}"; + + # position = "0, 65"; + # halign = "center"; + # valign = "bottom"; + # }; + + # label = { # "locked" text + # monitor = ""; + # text = "locked"; + # shadow_passes = 1; + # shadow_boost = 0.5; + # color = "${text_color}"; + # font_size = 14; + # font_family = "${font_family}"; + + # position = "0, 45"; + # halign = "center"; + # valign = "bottom"; + # }; + + # label = { # Status + # monitor = ""; + # text = ""; + # shadow_passes = 1; + # shadow_boost = 0.5; + # color = "${text_color}"; + # font_size = 14; + # font_family = "${font_family}"; + + # position = "30, -30"; + # halign = "left"; + # valign = "top"; + # }; + # }; + }; + + services.hypridle = { + enable = true; + settings = { + # $lock_cmd = pidof hyprlock || hyprlock + # $suspend_cmd = pidof steam || systemctl suspend || loginctl suspend # fuck nvidia + + general = { + lock_cmd = "pidof hyprlock || hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + }; + + listener = [ + { + timeout = 5400; + on-timeout = "loginctl lock-session"; + } + + { + timeout = 7200; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + + { + timeout = 10800; + on-timeout = "pidof steam || systemctl suspend || loginctl suspend"; + } + ]; + }; + }; + services.hyprpaper = { + enable = true; + settings = { + splash = true; + preload = [ + "${config.home.homeDirectory}/Pictures/bg-left.png" + "${config.home.homeDirectory}/Pictures/bg-center.png" + "${config.home.homeDirectory}/Pictures/bg-right.png" + "${config.home.homeDirectory}/.local/share/wallpapers/Nordic-mountain-wallpaper.jpg" + "${config.home.homeDirectory}/.local/share/wallpapers/Nordic-mountain.jpg" + "${config.home.homeDirectory}/.local/share/wallpapers/northern-lights-arctic-circle-norway-07.jpg" + "${config.home.homeDirectory}/.local/share/wallpapers/canoe-3840x2160-scandinavia-europe-5k-18949.jpg" + ]; + + wallpaper = [ + "DP-3,~/.local/share/wallpapers/Nordic-mountain-wallpaper.jpg" + "DP-5,~/.local/share/wallpapers/northern-lights-arctic-circle-norway-07.jpg" + "DP-6,~/.local/share/wallpapers/canoe-3840x2160-scandinavia-europe-5k-18949.jpg" + ]; + }; + }; + programs.wlogout = { + enable = true; + layout = [ + { + label = "lock"; + action = "pkill hyprlock && loginctl lock-session"; + text = "Lock"; + keybind = "l"; + circular = false; + } + { + label = "hibernate"; + action = "systemctl hibernate"; + text = "Hibernate"; + keybind = "h"; + circular = false; + } + { + label = "logout"; + action = "loginctl terminate-user $USER"; + text = "Logout"; + keybind = "e"; + circular = false; + } + { + label = "shutdown"; + action = "systemctl poweroff"; + text = "Shutdown"; + keybind = "s"; + circular = false; + } + { + label = "suspend"; + action = "systemctl suspend"; + text = "Suspend"; + keybind = "u"; + circular = false; + } + { + label = "reboot"; + action = "systemctl reboot"; + text = "Reboot"; + keybind = "r"; + circular = false; + } + ]; + style = '' + * { + background-image: none; + } + + window { + background: #4C566A; + } + + button { + color: #D8DEE9; + font-size: 16px; + background-color: #81A1C1; + border-style: none; + background-repeat: no-repeat; + background-position: center; + background-size: 35%; + border-radius:30px; + margin: 182px 5px; + text-shadow: 0px 0px; + box-shadow: 0px 0px; + } + + button:focus, button:active, button:hover { + color: #ECEFF4; + background-color: #5E81AC; + outline-style: none; + } + + #lock { + background-image: image(url("${config.home.homeDirectory}/.local/share/wlogout/lock.svg")); + } + + #logout { + background-image: image(url("${config.home.homeDirectory}/.local/share/wlogout/logout.svg")); + } + + #suspend { + background-image: image(url("${config.home.homeDirectory}/.local/share/wlogout/suspend.svg")); + } + + #hibernate { + background-image: image(url("${config.home.homeDirectory}/.local/share/wlogout/hibernate.svg")); + } + + #shutdown { + background-image: image(url("${config.home.homeDirectory}/.local/share/wlogout/shutdown.svg")); + } + + #reboot { + background-image: image(url("${config.home.homeDirectory}/.local/share/wlogout/reboot.svg")); + } + ''; + }; + services.swayosd = { + enable = true; + display = "DP-4"; + }; + services.mako.enable = true; + + imports = [ + (import ../../pkgs/wm/hyprland/hyprland.nix { inherit pkgs config; }) + (import ../../pkgs/wm/waybar/waybar.nix { inherit config; pkgs = pkgs; }) + (import ../../pkgs/wm/mako/mako.nix { config = config; pkgs = pkgs; lib=lib; }) + ]; +} \ No newline at end of file diff --git a/hm/modules/theme.nix b/hm/modules/theme.nix new file mode 100644 index 0000000..5078d25 --- /dev/null +++ b/hm/modules/theme.nix @@ -0,0 +1,53 @@ +{ pkgs, unstablePkgs, ... }: + +{ + xdg.configFile = { + "Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.kvconfig".source = "${unstablePkgs.catppuccin-kvantum}/share/Kvantum/Catppuccin-Macchiato-Blue/Cattpuccin-Macchiato-Blue.kvconfig"; + "Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.svg".source = "${unstablePkgs.catppuccin-kvantum}/share/Kvantum/Catppuccin-Macchiato-Blue/Cattpuccin-Macchiato-Blue.svg"; + }; + qt = { + enable = true; + platformTheme.name = "gtk"; + style = { + name = "gtk2"; + package = pkgs.libsForQt5.breeze-qt5; + }; + }; + + gtk = { + enable = true; + theme = { + name = "Breeze-Dark"; + package = pkgs.libsForQt5.breeze-gtk; + }; + iconTheme = { + name = "nordzy-icon-theme"; + package = pkgs.nordzy-icon-theme; + # package = pkgs.catppuccin-papirus-folders.override { + # flavor = "mocha"; + # accent = "sky"; + # }; + }; + cursorTheme = { + name = "Nordzy-cursors"; + package = pkgs.nordzy-cursor-theme; + }; + gtk3 = { + extraConfig.gtk-application-prefer-dark-theme = true; + }; + }; + + home.pointerCursor = { + gtk.enable = true; + name = "Nordzy-cursors"; + package = pkgs.nordzy-cursor-theme; + size = 24; + }; + + dconf.settings = { + "org/gnome/desktop/interface" = { + gtk-theme = "Breeze-Dark"; + color-scheme = "prefer-dark"; + }; + }; +} \ No newline at end of file diff --git a/hm/wayland.nix b/hm/modules/wayland.nix similarity index 91% rename from hm/wayland.nix rename to hm/modules/wayland.nix index 18cf064..2592ffa 100644 --- a/hm/wayland.nix +++ b/hm/modules/wayland.nix @@ -4,14 +4,14 @@ wayland.windowManager = { hyprland = { - enable = true; - systemd ={ enable = true; - enableXdgAutostart = true; - variables = [ "--all" ]; - }; - package = pkgs.hyprland; - xwayland.enable = true; + systemd ={ + enable = true; + enableXdgAutostart = true; + variables = [ "--all" ]; + }; + package = pkgs.hyprland; + xwayland.enable = true; }; }; # systemd.user.services.keybase-kwallet = { diff --git a/hm/modules/xdg.nix b/hm/modules/xdg.nix new file mode 100644 index 0000000..4218fd1 --- /dev/null +++ b/hm/modules/xdg.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: +{ + xdg = { + enable = true; + userDirs = { + enable = true; + # createDirectories = false; + documents = "${config.home.homeDirectory}/Documents"; + music = "${config.home.homeDirectory}/Music"; + videos = "${config.home.homeDirectory}/Videos"; + desktop = "${config.home.homeDirectory}/Desktop"; + download = "${config.home.homeDirectory}/Downloads"; + pictures = "${config.home.homeDirectory}/Pictures"; + templates = "${config.home.homeDirectory}/Templates"; + publicShare = "${config.home.homeDirectory}/Public"; + }; + }; +} \ No newline at end of file diff --git a/hm/pkgs/creative-packages.nix b/hm/pkgs/creative-packages.nix new file mode 100644 index 0000000..57de320 --- /dev/null +++ b/hm/pkgs/creative-packages.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +with pkgs; +[ + krita + inkscape + blender + gimp-with-plugins + reaper +] \ No newline at end of file diff --git a/hm/pkgs/default.nix b/hm/pkgs/default.nix new file mode 100644 index 0000000..303f643 --- /dev/null +++ b/hm/pkgs/default.nix @@ -0,0 +1,11 @@ +{ pkgs, unstablePkgs, system, zen-browser, ... }: +builtins.concatLists +[ + (import ./creative-packages.nix { inherit pkgs; }) + (import ./gramming-packages.nix { inherit pkgs; }) + (import ./inet-packages.nix { inherit pkgs system zen-browser; }) + (import ./llm-packages.nix { inherit pkgs; }) + (import ./theme-packages.nix { inherit pkgs unstablePkgs; }) + (import ./wm-packages.nix { inherit pkgs; }) + (import ./rescue-packages.nix { inherit pkgs; }) +] \ No newline at end of file diff --git a/hm/pkgs/gramming-packages.nix b/hm/pkgs/gramming-packages.nix new file mode 100644 index 0000000..c2f4acb --- /dev/null +++ b/hm/pkgs/gramming-packages.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +with pkgs; +[ + # IDE's + sublime3 vscode # vscode.languages.web vscode.languages.python vscode.languages.nix vscode.languages.bash + typora obsidian obsidian-export # vimPlugins.obsidian-nvim + # Lunarvim Dependencies + gnumake42 nodejs_22 cargo ripgrep cmake +] \ No newline at end of file diff --git a/hm/pkgs/inet-packages.nix b/hm/pkgs/inet-packages.nix new file mode 100644 index 0000000..142cf18 --- /dev/null +++ b/hm/pkgs/inet-packages.nix @@ -0,0 +1,30 @@ +{ pkgs, system, zen-browser, ... }: +with pkgs; +[ + (python3.withPackages (ps: with ps; [ + pip pynvim # mopidy-tidal # Mopidy-WebSettings + ])) + + # mopidy mopidy-tidal mopidy-musicbox-webclient gst_all_1.gstreamer gst_all_1.gst-plugins-bad + + # Browsers + firefox-devedition + w3m + ungoogled-chromium + librewolf + # https://github.com/MarceColl/zen-browser-flake/tree/master + zen-browser.packages."${system}".default + + # Mail + mailspring + betterbird + + # Cloud/Remote + restic + nextcloud-client + keepassxc git-credential-keepassxc keybase-gui keybase kbfs + remmina + + mapscii + tidal-dl +] \ No newline at end of file diff --git a/hm/pkgs/llm-packages.nix b/hm/pkgs/llm-packages.nix new file mode 100644 index 0000000..6fb4180 --- /dev/null +++ b/hm/pkgs/llm-packages.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +with pkgs; +[ + # LLM's + # lmstudio +] \ No newline at end of file diff --git a/hm/pkgs/rescue-packages.nix b/hm/pkgs/rescue-packages.nix new file mode 100644 index 0000000..8689923 --- /dev/null +++ b/hm/pkgs/rescue-packages.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: +with pkgs; +[ + ddrescue gparted +] \ No newline at end of file diff --git a/hm/pkgs/theme-packages.nix b/hm/pkgs/theme-packages.nix new file mode 100644 index 0000000..e619c11 --- /dev/null +++ b/hm/pkgs/theme-packages.nix @@ -0,0 +1,21 @@ +{ pkgs, unstablePkgs, ... }: +with pkgs; +[ + (unstablePkgs.catppuccin-kvantum.override { + accent = "Blue"; + variant = "Macchiato"; + }) + + qt5.qtwayland qt6.qtwayland + qt6ct + libsForQt5.qtstyleplugin-kvantum + libsForQt5.qt5ct + + base16-schemes base16-shell-preview + papirus-folders + themechanger + + nordzy-icon-theme nordzy-cursor-theme + # hyprcursor nordzy-icon-theme + nordic +] \ No newline at end of file diff --git a/hm/pkgs/wm-packages.nix b/hm/pkgs/wm-packages.nix new file mode 100644 index 0000000..fbf4840 --- /dev/null +++ b/hm/pkgs/wm-packages.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +let + polycat = pkgs.callPackage ../../pkgs/derivations/polycat {}; +in +with pkgs; +[ + wdisplays waybar wlogout wayland-utils wayland-protocols + hyprpaper hyprlock hypridle hyprshot hyprpicker hyprcursor + pyprland + rofi-wayland wev clipman cliphist wl-clip-persist wl-clipboard + blueman networkmanagerapplet swayosd + qalculate-qt + xorg.xrandr + dconf + polycat +] \ No newline at end of file diff --git a/hm/unused/catppuccin.nix b/hm/unused/catppuccin.nix new file mode 100644 index 0000000..d221638 --- /dev/null +++ b/hm/unused/catppuccin.nix @@ -0,0 +1,39 @@ +{ ... }: +{ + catppuccin = { + enable = true; + accent = "blue"; # “blue”, “flamingo”, “green”, “lavender”, “maroon”, “mauve”, “peach”, “pink”, “red”, “rosewater”, “sapphire”, “sky”, “teal”, “yellow” + flavor = "mocha"; # “latte”, “frappe”, “macchiato”, “mocha” + pointerCursor = { + enable = true; + accent = "light"; + flavor = "mocha"; + }; + }; + + gtk = { + catppuccin = { + enable = true; + accent = "blue"; + flavor = "mocha"; + icon = { + enable = true; + accent = "light"; + flavor = "mocha"; + }; + size = "standard"; # “standard”, “compact” + tweaks = []; # one of “black”, “rimless”, “normal”, “float” + }; + }; + + qt = { + style = { + catppuccin = { + enable = true; + accent = "blue"; + apply = true; + flavor = "mocha"; + }; + }; + }; +} \ No newline at end of file diff --git a/hm/unused/catppuccin_functions.nix b/hm/unused/catppuccin_functions.nix new file mode 100644 index 0000000..b7eeb32 --- /dev/null +++ b/hm/unused/catppuccin_functions.nix @@ -0,0 +1,56 @@ +# Add to flake.nix + # catppuccin.url = "github:catppuccin/nix"; +# Define output + catppuccin, +# Add to Home Manager Modules +catppuccin.homeManagerModules.catppuccin + +# Add to let in home.nix +# Define your list of programs to be themed + themedPrograms = [ "bat" "bottom" "btop" "cava" "fish" "fzf" "hyprlock" "kitty" "laztgit" "neovim" "rofi" "starship" "tmux" "waybar" "yazi" ]; + + # Define constants for `enable` and `flavor` + themeEnabled = true; + themeFlavor = "mocha"; # or any other Catppuccin flavor + + # Recursive function to apply the theme settings + applyTheme = programs: + if programs == [] then {} + else let + program = builtins.head programs; + in + # Merge the settings for the current program with the results of the next + { + programs.${program} = lib.mkIf true { + catppuccin.enable = themeEnabled; + catppuccin.flavor = themeFlavor; + }; + } // applyTheme (builtins.tail programs); # Recurse to the next item + + themedServices = [ "mako" ]; + themeService = services: + if services == [] then {} + else let + service = builtins.head services; + in + { + services.${service} = lib.mkIf true { + catppuccin.enable = themeEnabled; + catppuccin.flavor = themeFlavor; + }; + } // themeService (builtins.tail services); # Recurse to the next item + + +# Add last home.nix +# Theme with a loop. + // applyTheme themedPrograms + // themeService themedServices + + # add to hm/wayland.nix + wayland.windowManager = { + hyprland = { + catppuccin = { + enable = true; + accent = "blue"; + }; + }; \ No newline at end of file diff --git a/hm/xdg.nix b/hm/xdg.nix deleted file mode 100644 index 16252d3..0000000 --- a/hm/xdg.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: -{ - xdg = { - enable = true; - # userDirs = { - # enable = true; - # createDirectories = false; - # documents = "${config.home.homeDirectory}/Documents"; - # music = "${config.home.homeDirectory}/Music"; - # videos = "${config.home.homeDirectory}/Videos"; - # desktop = "${config.home.homeDirectory}/Desktop"; - # download = "${config.home.homeDirectory}/Downloads"; - # pictures = "${config.home.homeDirectory}/Pictures"; - # templates = "${config.home.homeDirectory}/Templates"; - # publicShare = "${config.home.homeDirectory}/Public"; - # }; - }; -} \ No newline at end of file diff --git a/modules/containers.nix b/modules/containers.nix new file mode 100644 index 0000000..f3877d6 --- /dev/null +++ b/modules/containers.nix @@ -0,0 +1,259 @@ +# ssh-keygen -f /etc/ssh/ssh_host_ed25519_key +# ssh-keygen -f ~/.ssh/.containers +# edit secrets file +# agenix -e secret.age + +{ inputs, config, lib, pkgs, ... }: + +{ + containers = { + nextcloud = { + privateNetwork = true; + # hostAddress = "192.168.12.40"; + localAddress = "192.168.12.71/24"; + hostBridge = "br0"; + autoStart = true; + bindMounts = { + "/etc/ssh/ssh_host_ed25519_key".isReadOnly = true; + }; + + config = { config, pkgs, ... }: + { + networking.firewall.allowedTCPPorts = [ 80 ]; + + imports = [ inputs.agenix.nixosModules.default ]; + + age = { + identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + secrets."nextcloud" = { + file = ../secrets/nextcloud.age; + mode = "770"; + owner = "nextcloud"; + group = "nextcloud"; + }; + }; + + services.openssh = { + enable = true; + ports = [ 22 ]; + settings = { + PasswordAuthentication = true; + AllowUsers = [ "wayne" ]; # Allows all users by default. Can be [ "user1" "user2" ] + UseDns = true; + X11Forwarding = false; + PermitRootLogin = "no"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no" + }; + }; + + services.nextcloud = { + enable = true; + package = pkgs.nextcloud30; + hostName = "nextcloud"; + https = false; + database.createLocally = true; + configureRedis = true; + autoUpdateApps.enable = true; + maxUploadSize = "16G"; + extraAppsEnable = true; + appstoreEnable = true; + extraApps = with config.services.nextcloud.package.packages.apps; { + # List of apps we want to install and are already packaged in + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/nextcloud/packages/nextcloud-apps.json + inherit calendar contacts mail notes onlyoffice tasks qownnotesapi; + + # Custom app installation example. + # cookbook = pkgs.fetchNextcloudApp rec { + # url = + # "https://github.com/nextcloud/cookbook/releases/download/v0.10.2/Cookbook-0.10.2.tar.gz"; + # sha256 = "sha256-XgBwUr26qW6wvqhrnhhhhcN4wkI+eXDHnNSm1HDbP6M="; + # }; + }; + enableImagemagick = true; + + settings = { + default_phone_region = "US"; + trusted_domains = [ "localhost" "launchpad" "192.168.12.40" "192.168.12.71" ]; + }; + + config = { + dbtype = "pgsql"; + adminuser = "nextcloud"; + adminpassFile = config.age.secrets.nextcloud.path; + }; + }; + + system.stateVersion = "24.05"; + }; + }; + + livebook = { + autoStart = true; + privateNetwork = true; + hostBridge = "br0"; + localAddress = "192.168.12.72/24"; + bindMounts = { + "/etc/ssh/ssh_host_ed25519_key".isReadOnly = true; + }; + + config = { config, pkgs, ... }: + { + networking.firewall.allowedTCPPorts = [ 80 ]; + + imports = [ inputs.agenix.nixosModules.default ]; + + age = { + identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + secrets."whayes" = { + file = ../secrets/whayes.age; + mode = "770"; + owner = "wayne"; + group = "wayne"; + }; + }; + + services.livebook = { + enableUserService = true; + environment = { + LIVEBOOK_PORT = 20123; + LIVEBOOK_PASSWORD = config.age.secrets.whayes.path; + }; + # See note below about security + environmentFile = "/var/lib/livebook.env"; + extraPackages = with pkgs; [ gcc gnumake ]; + }; + + system.stateVersion = "24.05"; + }; + }; + + grocy = { + autoStart = true; + privateNetwork = true; + hostBridge = "br0"; + localAddress = "192.168.12.73/24"; + bindMounts = { + "/etc/ssh/ssh_host_ed25519_key".isReadOnly = true; + }; + + config = { config, pkgs, ... }: + { + networking.firewall.allowedTCPPorts = [ 80 ]; + + imports = [ inputs.agenix.nixosModules.default ]; + + age = { + identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + secrets."whayes" = { + file = ../secrets/whayes.age; + mode = "770"; + owner = "wayne"; + group = "wayne"; + }; + }; + + services.grocy = { + enable = true; + hostName = "grocy"; + settings = { + currency = "USD"; + culture = "en"; + }; + nginx = { + enableSSL = false; + }; + phpfpm = { + settings = { + catch_workers_output = true; + "listen.owner" = "nginx"; + "php_admin_flag[log_errors]" = true; + "php_admin_value[error_log]" = "stderr"; + pm = "dynamic"; + "pm.max_children" = "32"; + "pm.max_requests" = "500"; + "pm.max_spare_servers" = "4"; + "pm.min_spare_servers" = "2"; + "pm.start_servers" = "2"; + }; + }; + }; + + system.stateVersion = "24.05"; + }; + }; + + onlyoffice = { + autoStart = true; + privateNetwork = true; + hostBridge = "br0"; + localAddress = "192.168.12.74/24"; + bindMounts = { + "/etc/ssh/ssh_host_ed25519_key".isReadOnly = true; + }; + + config = { config, lib, pkgs, ... }: + { + networking.firewall.allowedTCPPorts = [ 80 ]; + nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ "corefonts" ]; + + fonts.packages = with pkgs; [ + corefonts + ]; + imports = [ inputs.agenix.nixosModules.default ]; + + age = { + identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + secrets."onlyoffice" = { + file = ../secrets/onlyoffice-jwt.age; + mode = "770"; + owner = "onlyoffice"; + group = "onlyoffice"; + }; + }; + + services.onlyoffice = { + enable = true; + port = 8000; + hostname = "onlyoffice"; + package = pkgs.onlyoffice-documentserver; + jwtSecretFile = config.age.secrets.onlyoffice.path; + enableExampleServer = true; + examplePort = 8001; + }; + + system.stateVersion = "24.05"; + }; + }; + + # template = { + # autoStart = true; + # privateNetwork = true; + # hostBridge = "br0"; + # localAddress = "192.168.12.73/24"; + # bindMounts = { + # "/etc/ssh/ssh_host_ed25519_key".isReadOnly = true; + # }; + + # config = { config, pkgs, ... }: + # { + # networking.firewall.allowedTCPPorts = [ 80 ]; + # imports = [ inputs.agenix.nixosModules.default ]; + + # age = { + # identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + # secrets."whayes" = { + # file = ../secrets/whayes.age; + # mode = "770"; + # owner = "wayne"; + # group = "wayne"; + # }; + # }; + + # services.name = { ... }; + + # system.stateVersion = "24.05"; + # }; + # }; + }; +} \ No newline at end of file diff --git a/modules/display.nix b/modules/display.nix index 2ea6055..6fcf68a 100644 --- a/modules/display.nix +++ b/modules/display.nix @@ -1,11 +1,11 @@ { pkgs, config, ... }: { - hardware.opengl = { # Renamed hardware.graphics - enable = true; # Renamed - package = pkgs.mesa.drivers; # Renamed - # 32bit Support - driSupport32Bit = true; # Renamed - # package32 = pkgsi686Linux.mesa.drivers; + hardware.opengl = { # Renamed hardware.graphics + enable = true; # Renamed + package = pkgs.mesa.drivers; # Renamed + # 32bit Support + driSupport32Bit = true; # Renamed + # package32 = pkgsi686Linux.mesa.drivers; }; # hardware.graphics = { # Only in unstable # enable = true; @@ -41,6 +41,6 @@ nvidiaSettings = true; # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.stable; + package = config.boot.kernelPackages.nvidiaPackages.stable; # 550.78 }; -} \ No newline at end of file +} diff --git a/modules/hypr.nix b/modules/hypr.nix deleted file mode 100644 index 3defac5..0000000 --- a/modules/hypr.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... } -{ - -} \ No newline at end of file diff --git a/modules/network.nix b/modules/network.nix index c300a8d..546e616 100644 --- a/modules/network.nix +++ b/modules/network.nix @@ -1,38 +1,88 @@ { pkgs, ... }: { - networking.hostName = "launchpad"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking = { + hostName = "launchpad"; + useDHCP = false; + enableIPv6 = false; + extraHosts = '' + 192.168.12.20 router.local + 192.168.12.21 switch.local + 192.168.12.25 dhcpd.local - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - networking.extraHosts = '' - 192.168.12.20 router.local - 192.168.12.21 switch.local - 192.168.12.25 dhcpd.local - 192.168.12.40 launchpad.local - 192.168.12.41 xeon.local - 192.168.12.80 robo.local - 192.168.12.81 nas.local - 192.168.12.83 homeassistant.local - 192.168.12.60 toons.local + 192.168.12.30 canon.local - 45.58.52.52 www - 172.245.111.249 est - 216.189.156.74 mail - ''; + 192.168.12.40 launchpad.local + 192.168.12.41 xeon.local - networking.interfaces.enp4s0.ipv4.addresses = [ { - address = "192.168.12.40"; - prefixLength = 24; - } ]; - networking.defaultGateway = "192.168.12.20"; - networking.nameservers = [ "192.168.12.25" ]; - networking.firewall = { - allowedTCPPortRanges = [ { from = 35000; to = 36000; } { from = 5000; to = 6000; } { from = 8000; to = 9000; } ]; - extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns''; + 192.168.12.50 wayne-s-pixel-5 + + 192.168.12.60 toons.local + 192.168.12.61 tv.local + + 192.168.12.80 robo.local + 192.168.12.81 nas.local + 192.168.12.83 homeassistant.local + + # containers + 192.168.12.71 nextcloud + 192.168.12.72 livebook + 192.168.12.73 grocy + 192.168.12.74 openoffice + + 45.58.52.52 www + 172.245.111.249 est + 216.189.156.74 mail + ''; + interfaces = { + # enp4s0.ipv4.addresses = [ { + # address = "192.168.12.40"; + # prefixLength = 24; + # } ]; + br0 = { + useDHCP = false; + ipv4 = { + addresses = [ + { + address = "192.168.12.40"; + prefixLength = 24; + } + ]; + }; + }; + }; + defaultGateway = "192.168.12.20"; + nameservers = [ "192.168.12.25" ]; + firewall = { + enable = true; + # { from = 5000; to = 6000; } + allowedTCPPorts = [ 80 443 ]; + allowedTCPPortRanges = [ { from = 35000; to = 36000; } { from = 8000; to = 9000; } ]; + extraCommands = '' + iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns + ''; + }; + bridges = { + br0 = { + interfaces = [ "enp4s0" ]; + }; + }; + # Required to access containers + nat = { + enable = true; + internalInterfaces = [ "eth0" "enp4s0" "ve-+" "vb-+" ]; + externalInterface = "br0"; + enableIPv6 = false; + }; + # Dissable to prevent from managing containers + networkmanager = { + enable = true; + unmanaged = [ "eth0" "interface-name:ve-*" "interface-name:vb-*" ]; + }; + + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; }; - - # Enable networking - networking.networkmanager.enable = true; } \ No newline at end of file diff --git a/modules/qt.nix b/modules/qt.nix new file mode 100644 index 0000000..d603e57 --- /dev/null +++ b/modules/qt.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + qt = { + enable = true; + style = "kvantum"; + # platformTheme = "qt5ct"; + }; +} diff --git a/modules/security.nix b/modules/security.nix index c136942..3e63256 100644 --- a/modules/security.nix +++ b/modules/security.nix @@ -69,6 +69,8 @@ extraConfig = '' %wheel ALL=(ALL) NOPASSWD: ${pkgs.input-remapper}/bin/input-remapper-service %wheel ALL=(ALL) NOPASSWD: ${pkgs.input-remapper}/bin/input-remapper-control + %wheel ALL=(ALL) NOPASSWD: /run/wrappers/bin/systemctl restart display-manager + ''; }; @@ -79,4 +81,18 @@ # enable = true; # enableSSHSupport = true; # }; + + age = { + secrets = { + nextcloud = { + file = ../secrets/nextcloud.age; + }; + wayne = { + file = ../secrets/whayes.age; + }; + onlyoffice = { + file = ../secrets/onlyoffice-jwt.age; + }; + }; + }; } \ No newline at end of file diff --git a/modules/users.nix b/modules/users.nix index 1f056cb..c13f63b 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -8,13 +8,14 @@ dialout = {}; plugdev = {}; uinput = {}; + www-data = {}; }; users = { wayne = { isNormalUser = true; description = "Wayne Hayes"; - extraGroups = [ "networkmanager" "wheel" "docker" "wayne" "vmail" "uinput" "storage" ]; - openssh.authorizedKeys.keys = []; + extraGroups = [ "networkmanager" "wheel" "docker" "wayne" "vmail" "uinput" "storage" "www-data" ]; + openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6q75AXShVjzWerPFU3l0YXIKViNF4eyragL+RQIRwdNDMzW34GgxFhtyLsmRB2jsykf4gx76zSyJoii0K4uhS761w5oDXz9mqHnBzJutDTyltLyfgLsFKY8V2sOtSracWx4y6QrtmBR3MKV642kg5mufVEmCMVxBU9oVpIOJUSW+XNYBawaSkl5SjDMLI7flj0v9Hb2dZqjQigDM1+UHxTzcMoZnR6hAzoZpPNMGyZXtrgEotNywNdpxCqRV9T/KvKHSIVYc1umiDXc+5fyRo9v7CzvYY3MvRKWbgUfTVQRmR2kqwsGAsV5W+PEUb8qqmTjPVXusKxKlpGgYfsvIZOv0LgOvQMemga8psFIS9F4YQ1xuc092bKi1LteC+ZlabMLRMux6Wbhjci+v9wnLfTyBQc6wr3wDFJoELKyaLnI7Cn0KHn0k+BiYCCr2TjKrz9XztL490vprYtvVumNFZ3rxewGnZSn/2czaFfQgnXt+9xQGWWo9TJGE5jq1jThnsIbH3G9JIQ1WhomMq6DDRhGMX2ZKDk/M9/fk0XN5nvQyJNmbiHy5srW/VANx8R9jjsVkvX29MXeK6dzpR4ImywXggpYMeHB6moy06cJUu5WoR8aLS/rO5LbZM2j14AMQ2ZK79QfUJSdloA1/HHlmnx7YtzZOebD6BCR7xgasGRw== wayne"]; packages = with pkgs; [ kdePackages.kate ]; diff --git a/modules/wm.nix b/modules/wm.nix index a474c03..5e63930 100644 --- a/modules/wm.nix +++ b/modules/wm.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { services.desktopManager.plasma6.enable = false; @@ -9,26 +9,47 @@ variant = ""; }; videoDrivers = [ "nvidia" ]; + # xrandrHeads = { + # DP-6= { + # monitorConfig = '' + # DisplaySize 1920x1080 + # ''; + # }; + # DP-3 = { + # monitorConfig = '' + # DisplaySize 1920x1080 + # ''; + # }; + # DP-5 = { + # primary = true; + # monitorConfig = '' + # DisplaySize 3840x216 + # ''; + # }; + # }; }; - services.xserver.displayManager.setupCommands = '' - wlr-randr --output DP-4 --auto --primary - wlr-randr --output DP-3 --left-of DP-4 - wlr-randr --output DP-1 --right-of DP-4 --rotate left --noprimary - ''; + # services.xserver.displayManager.setupCommands = '' + # xrandr --output DP-4 --auto --primary + # ''; - services.displayManager.sddm = { - enable = true; - autoNumlock = true; - enableHidpi = true; - settings = { - X11 = { - MinimumVT = 7; - DisplayCommand="/etc/sddm/Xsetup"; - }; - }; - wayland = { + services.displayManager = { + defaultSession = "hyprland"; + sddm = { enable = true; + autoNumlock = true; + enableHidpi = true; + settings = { + # X11 = { + # # MinimumVT = 7; + # DisplayCommand="/etc/sddm/Xsetup"; + # }; + }; + wayland = { + enable = true; + }; + theme = "catppuccin-mocha"; + package = pkgs.kdePackages.sddm; }; }; -} \ No newline at end of file +} diff --git a/nix/nix.conf b/nix/nix.conf index d8adb96..01a754b 100644 --- a/nix/nix.conf +++ b/nix/nix.conf @@ -5,7 +5,7 @@ access-tokens = nas.local/git=PAT:glpat-bfbAJxv_4tmgySBZcPSZ allowed-users = * auto-optimise-store = true builders = -cores = 0 +cores = 12 experimental-features = nix-command flakes max-jobs = 12 require-sigs = true @@ -15,6 +15,6 @@ substituters = https://cache.nixos.org/ system-features = nixos-test benchmark big-parallel kvm trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= trusted-substituters = -trusted-users = root +trusted-users = root wayne extra-sandbox-paths = diff --git a/pkgs/app/terminal/kitty.nix b/pkgs/app/terminal/kitty.nix index 0a3fafb..c5a10eb 100644 --- a/pkgs/app/terminal/kitty.nix +++ b/pkgs/app/terminal/kitty.nix @@ -18,6 +18,7 @@ in package = pkgs.nerdfonts; }; settings = { + themeFile = "Nord"; enable_audio_bell = true; # foreground = "#${config.colorScheme.palette.base05}"; # background = "#${config.colorScheme.palette.base00}"; @@ -26,7 +27,7 @@ in background_image = "../../Pictures/marvin.png"; background_image_layout = "cscaled"; background_tint = "0.95"; - dynamic_background_opacity = "yes"; + dynamic_background_opacity = true; modify_font = "cell_width 90%"; scrollback_lines = 10000; copy_on_select = "clipboard"; # Ensures text is copied when selected @@ -40,7 +41,9 @@ in enableBashIntegration = true; enableZshIntegration = true; }; - keybindings = {}; + keybindings = { + "ctrl+c" = "copy_or_interrupt"; + }; extraConfig = '' wayland_titlebar_color ${base16-scheme.base13}; background ${base16-scheme.base00} diff --git a/pkgs/app/terminal/tmux.nix b/pkgs/app/terminal/tmux.nix index 24c87cf..9e944f7 100644 --- a/pkgs/app/terminal/tmux.nix +++ b/pkgs/app/terminal/tmux.nix @@ -6,6 +6,7 @@ ]; programs.tmux = { enable = true; + prefix = "C-s"; shortcut = "a"; # aggressiveResize = true; -- Disabled to be iTerm-friendly baseIndex = 1; @@ -14,23 +15,27 @@ escapeTime = 0; # Force tmux to use /tmp for sockets (WSL2 compat) secureSocket = false; + mouse = true; + keyMode = "vi"; + terminal = "xterm-256color"; + plugins = with pkgs; [ tmuxPlugins.better-mouse-mode ]; - extraConfig = '' - set -g default-terminal "xterm-256color" - set -ga terminal-overrides ",*256col*:Tc" - set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' - set-environment -g COLORTERM "truecolor" + # extraConfig = '' + # # # set -g default-terminal "xterm-256color" + # # # set -ga terminal-overrides ",*256col*:Tc" + # # # set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' + # # # set-environment -g COLORTERM "truecolor" - # Mouse works as expected - set-option -g mouse on - # easy-to-remember split pane commands - bind | split-window -h -c "#{pane_current_path}" - bind - split-window -v -c "#{pane_current_path}" - bind c new-window -c "#{pane_current_path}" - ''; + # # Mouse works as expected + # set-option -g mouse on + # # easy-to-remember split pane commands + # bind | split-window -h -c "#{pane_current_path}" + # bind - split-window -v -c "#{pane_current_path}" + # bind c new-window -c "#{pane_current_path}" + # ''; }; } \ No newline at end of file diff --git a/pkgs/shell/bash.nix b/pkgs/shell/bash.nix new file mode 100644 index 0000000..e945d42 --- /dev/null +++ b/pkgs/shell/bash.nix @@ -0,0 +1,29 @@ +{ pkgs, myAliases, ...}: +{ + # To copy the Oh My Zsh configuration file to your home directory, run the following command: + # $ cp -v $(nix-env -q –out-path oh-my-zsh | cut -d’ ’ -f3)/share/oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc + + home.packages = with pkgs; [ + bashInteractive + ]; + + programs.bash = { + enable = true; + # package = pkgs.bashInteractive; + enableCompletion = true; + historySize = 10000; + shellOptions = []; + shellAliases = myAliases; + historyIgnore = [ "exit" "clear" "sl" "pwd" ]; + historyControl = [ "ignoredups" ]; + historyFileSize = 20000; + sessionVariables = { + EDITOR = "lvim"; + PATH = "$HOME/bin:$HOME/.local/bin:$PATH"; + }; + initExtra = " + # make less more friendly for non-text input files, see lesspipe(1) + [ -x /usr/bin/lesspipe ] && eval $(SHELL=/bin/sh lesspipe) + "; + }; +} \ No newline at end of file diff --git a/pkgs/shell/stow.nix b/pkgs/shell/stow.nix index f87b350..ba4f9b5 100644 --- a/pkgs/shell/stow.nix +++ b/pkgs/shell/stow.nix @@ -9,7 +9,7 @@ let # Path to the directory within the dotfiles repository that contains home directory dotfiles homeStowPath = "${dotfilesPath}/home"; -in +in { # Ensure that stow and git are installed home.packages = with pkgs; [ @@ -37,7 +37,8 @@ in echo "Running stow to manage dotfiles" export PATH=${pkgs.stow}/bin:$PATH cd ${dotfilesPath}/home - stow --adopt -t ${config.home.homeDirectory} bash bin config profile screen ssh tmux zsh # Specify the packages to stow + # stow --adopt -t ${config.home.homeDirectory} bash bin config profile screen ssh tmux zsh # Specify the packages to stow + stow --adopt -t ${config.home.homeDirectory} bin config screen ssh tmux zsh # Specify the packages to stow ''; # if [ ! -d "${dotfilesPath}" ]; then # git clone ${dotfilesRepo} ${dotfilesPath} diff --git a/pkgs/wm/hyprland/hyprland.nix b/pkgs/wm/hyprland/hyprland.nix index 9c50112..d0f0338 100644 --- a/pkgs/wm/hyprland/hyprland.nix +++ b/pkgs/wm/hyprland/hyprland.nix @@ -1,12 +1,12 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { wayland.windowManager.hyprland = { # enable = true; # package = pkgs.hyprland; - # package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + # package = hyprland.packages.stdenv.hostPlatform.system}.hyprland; # xwayland.enable = true; - # systemd.enable = true; - # systemd.variables = ["--all"]; + systemd.enable = true; + systemd.variables = ["--all"]; # device { # name = "hanvon-ugee-shortcut-remote key bindings" @@ -22,35 +22,34 @@ "MOZ_ENABLE_WAYLAND,1" # "ANKI_WAYLAND,1" - "QT_AUTO_SCREEN_SCALE_FACTOR,1" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - "QT_QPA_PLATFORM=wayland,xcb" # removed ,xcb CGPT + # "QT_AUTO_SCREEN_SCALE_FACTOR,1" + # "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + # "QT_QPA_PLATFORM=wayland,xcb" # removed ,xcb CGPT # "QT_QPA_PLATFORMTHEME,qt6ct" - "GDK_SCALE,1" - "GDK_BACKEND,wayland,x11,*" + # "GDK_SCALE,1" + # "GDK_BACKEND,wayland,x11,*" - "GTK_THEME,FlatColor:dark" - "GTK2_RC_FILES,/home/hadi/.local/share/themes/FlatColor/gtk-2.0/gtkrc" + # "GTK_THEME,FlatColor:dark" + # "GTK2_RC_FILES,/home/hadi/.local/share/themes/FlatColor/gtk-2.0/gtkrc" - "DISABLE_QT5_COMPAT,0" - # "XCURSOR_SIZE,24" - "NIXOS_OZONE_WL,1" - "ELECTRON_OZONE_PLATFORM_HINT,auto" - "__GL_GSYNC_ALLOWED,0" - "__GL_VRR_ALLOWED,0" + # "DISABLE_QT5_COMPAT,0" + # "NIXOS_OZONE_WL,1" + # "ELECTRON_OZONE_PLATFORM_HINT,auto" + # "__GL_GSYNC_ALLOWED,0" + # "__GL_VRR_ALLOWED,0" "__GLX_VENDOR_LIBRARY_NAME,nvidia" - "DIRENV_LOG_FORMAT," + # "DIRENV_LOG_FORMAT," # "WLR_DRM_NO_ATOMIC,1" # "WLR_BACKEND,vulkan" # "WLR_RENDERER,vulkan" # "WLR_NO_HARDWARE_CURSORS,1" - "APPIMAGELAUNCHER_DISABLE,1" - "OZONE_PLATFORM,wayland" - "SDL_VIDEODRIVER,wayland" - "CLUTTER_BACKEND,wayland" + # "APPIMAGELAUNCHER_DISABLE,1" + # "OZONE_PLATFORM,wayland" + # "SDL_VIDEODRIVER,wayland" + # "CLUTTER_BACKEND,wayland" "GBM_BACKEND,nvidia-drm" "LIBVA_DRIVER_NAME,nvidia" # "AQ_DRM_DEVICES,/dev/dri/card2/" # CHANGEME: Related to the GPU @@ -58,8 +57,16 @@ # THEMING # "HYPRCURSOR_THEME,~/.icons/Nordic-cursors" # "HYPRCURSOR_SIZE,24x" + "HYPRCURSOR_THEME,Nordzy-cursors" + "HYPRCURSOR_SIZE,24" + "XCURSOR_THEME,Nordzy-cursors" + "XCURSOR_SIZE,24" "HYPRLAND_TRACE=1" + + # "QT_STYLE_OVERRIDE=kvantum" + "QT_QPA_PLATFORMTHEME = qt6ct" # qt5ct no display + ]; input = { kb_layout = "us"; @@ -125,6 +132,7 @@ "$mod, F, exec, firefox" "$mod, Z, exec, zen" "$mod, k, exec, kitty" + "$mod+SHIFT_R, k, exec, pypr toggle term" "ALTSHIFT, K, exec, konsole" "$mod, S, exec, subl" # "CTRLSHIFT, K&B, exec, hyprctl dispatch exec keybase-gui %u" @@ -190,32 +198,33 @@ cursor = { # no_hardware_cursors = true; - default_monitor = "DP-4"; + default_monitor = "DP-5"; }; dwindle = { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true; # you probably want this + special_scale_factor = 0.60; # Fix for floaters }; monitor = [ "DP-3, 1920x1080, 0x616, 1" - "DP-4, 3840x2160, 1920x0, 1" - "DP-1, 1080x1920, 5760x266, 1, transform, 3" # or 3 - # "gravity,center" + "DP-5, 3840x2160, 1920x0, 1" + "DP-6, 1920x1080, 5760x266, 1, transform, 3" # or 3 ]; workspace = [ - "1,monitor:DP-4,default:true,decorate:true" - "2,monitor:DP-4,persistent:true" - "3,monitor:DP-4,persistent:true" - "4,monitor:DP-3,default:true" "5,monitor:DP-3,persistent:true" "6,monitor:DP-3,persistent:true" - "7,monitor:DP-1,default:true,gapsin:2" - "8,monitor:DP-1,persistent:true" - "9,monitor:DP-1,persistent:true" + "1,monitor:DP-5,default:true,decorate:true" + "2,monitor:DP-5,persistent:true" + "3,monitor:DP-5,persistent:true" + "10,monitor:DP-5,persistent:true" + + "7,monitor:DP-6,default:true,gapsin:2" + "8,monitor:DP-6,persistent:true" + "9,monitor:DP-6,persistent:true" ]; exec-once = [ @@ -223,25 +232,25 @@ "dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus" "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" "systemctl --user start plasma-polkit-agent" - "/nix/store/fj1n850329w79nfvqz22cm36vk4x1ypc-kwallet-pam-6.0.5/libexec/pam_kwallet_init --no-startup-id" - "" + "/nix/store/fj1n850329w79nfvqz22cm36vk4x1ypc-kwallet-pam-6.0.5/libexec/pam_kwallet_init --no-startup-id" "waybar &" - "hyprpaper &" + # "hyprpaper &" "hypridle &" "swayosd &" "udiskie &" "wl-paste --type text --watch cliphist store" "wl-paste --type image --watch cliphist store" - "/home/wayne/.config/hypr/scripts/start-in-tray.sh" + # "${config.home.homeDirectory}/.config/hypr/scripts/start-in-tray.sh" + "${config.home.homeDirectory}/.config/hypr/scripts/start-keybase-gui.sh" - "[workspace 4 silent] remmina -c rdp://wayne@xeon.local" - "[workspace 5 silent] keepassxc" + # "[workspace 4 silent] remmina -c rdp://wayne@xeon.local" + "[workspace 5 silentl] keepassxc" "[workspace 5 silent] /home/wayne/.nix-profile/bin/nextcloud --background" "[workspace 5 silent] /nix/store/104jb5a21d1d338zkl1f07si6brsmrk2-keybase-gui-6.2.4/bin/keybase-gui %u &" - "[workspace 7 silent] subl" + "[workspace 7 silent] sublime3" - "/home/wayne/.config/hypr/scripts/start-keybase-gui.sh" + # "/nix/store/r3fdp5rlxcihmqhpcgy91sj918wnrmrc-pyprland-2.3.4/bin/pypr --debug ~/tmp/pypr.log" ]; general = { @@ -280,26 +289,28 @@ # "unset, rofi" # "ignorezero, rofi" "blurpopups, notifications" + "blur, waybar" ]; windowrule = [ "opacity 0.9 override 0.5 override 0.8 override, ^(.*)$" # set opacity to 1.0 active, 0.5 inactive and 0.8 fullscreen for kitty + "opacity 1 override 0.9 override 0.9 override, ^(zen-alpha)$" # set opacity to 1.0 active, 0.5 inactive and 0.8 fullscreen for kitty # "opacity 1.0 override 0.5 override 0.8 override, ^(kitty)$" # set opacity to 1.0 active, 0.5 inactive and 0.8 fullscreen for kitty "move -50% -50%, float, ^(org.keepassxc.KeePassXC)$" "move -50% -50%, float, ^(Nextcloud)$" # common modals - "center,title:^(Open)$" - "center,title:^(Choose Files)$" - "center,title:^(Save As)$" - "center,title:^(Confirm to replace files)$" - "center,title:^(File Operation Progress)$" + "center,title:^(Open).*$" + # "center,title:^(Choose Files)$" + "center,title:^(Save).*$" + # "center,title:^(Confirm to replace files)$" + # "center,title:^(File Operation Progress)$" ]; windowrulev2 = [ - "workspace 7,class:dropdown_menu_class" - "workspace 8,class:dropdown_menu_class" - "workspace 9,class:dropdown_menu_class" + # "workspace 7,class:dropdown_menu_class" + # "workspace 8,class:dropdown_menu_class" + # "workspace 9,class:dropdown_menu_class" # "move cursor 5px 15px, class:sublime_text" "minsize 1 1, class:sublime_text" @@ -317,12 +328,14 @@ # "nofocus, class:REAPER" # "fullscreen, title:^(File|Edit|View|Options|Help)$, class:REAPER" - "float,class:^(google-chrome)$,title:^(Open Files)$" - "float,class:^(google-chrome)$,title:^(Open File)$" + # "float,class:^(google-chrome)$,title:^(Open Files)$" + # "float,class:^(google-chrome)$,title:^(Open File)$" + "float,class:^(Typora)$,title:^(Open File)$" "float,class:com.nextcloud.desktopclient.nextcloud" "float,class:Keybase" "float,class:org.kde.kwalletmanager5" "float,class:org.keepassxc.KeePassXC" + "float,class:Typora" "workspace special:magic, class:^my-app-class$" ]; diff --git a/pkgs/wm/mako/mako.nix b/pkgs/wm/mako/mako.nix index f56ff10..3ce5f62 100644 --- a/pkgs/wm/mako/mako.nix +++ b/pkgs/wm/mako/mako.nix @@ -12,12 +12,12 @@ width = 350; height = 200; output = "DP-4"; - backgroundColor = "#00000080"; + # backgroundColor = "#00000080"; margin = "20"; # outerMargin = "10"; markup = true; borderSize = 2; - borderColor = "#ffffff"; + # borderColor = "#ffffff"; borderRadius = 15; icons = true; layer = "top"; diff --git a/pkgs/wm/waybar/default.json b/pkgs/wm/waybar/default.json index a54bea1..752c0b7 100644 --- a/pkgs/wm/waybar/default.json +++ b/pkgs/wm/waybar/default.json @@ -13,12 +13,6 @@ }, }, - // "cpu": { - // "interval": 5, - // "format": " {usage}%", - // "max-length": 10, - // }, - "cpu": { "format": "{usage}% 󰍛", "interval": 1, @@ -53,8 +47,10 @@ }, "network": { + "format": "{ifname}", + "interface": "Ethernet", "format-wifi": " {icon}", - "format-ethernet": "  ", + "format-ethernet": "{ipaddr} up: {bandwidthUpBytyes} bps / down: {bandwidthDownByte} bps  ", "format-disconnected": "󰌙", "format-icons": [ "󰤯 ", @@ -83,12 +79,13 @@ }, "temperature": { - "hwmon-path-abs": "/sys/devices/platform/coretemp.0/hwmon", - "input-filename": "temp2_input", + "hwmon-path": "/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_input", + // "input-filename": "temp2_input", "critical-threshold": 75, - "tooltip": false, - "format-critical": "({temperatureC}°C)", - "format": "({temperatureC}°C)", + "tooltip": true, + "format-critical": "{temperatureC}°C ", + "format": "{temperatureC}°C ", + "interval": 10, }, "hyprland/workspaces": { @@ -98,13 +95,6 @@ "on-scroll-up": "hyprctl dispatch workspace e+1", "on-scroll-down": "hyprctl dispatch workspace e-1", }, - - // "hyprland/workspaces": { - // "icon-size": 32, - // "spacing": 16, - // "on-scroll-up": "hyprctl dispatch workspace r+1", - // "on-scroll-down": "hyprctl dispatch workspace r-1", - // }, // ROMAN Numerals style "hyprland/workspaces#roman": { "active-only":false, @@ -130,11 +120,16 @@ "8": "VIII", "9": "IX", "10": "X", - + "11": "XI", + "12": "XII", }, }, + "tray": { + "icon-size": 31, + "spacing": 10 + }, "custom/polycat": { - "execr": "/home/wayne/bin/polycat.sh", + "exec": "/home/wayne/bin/polycat.sh", "interval": 2, "return-type": "json", "on-click": "polycat --config-path /home/wayne/.config/polycat-config.json", diff --git a/pkgs/wm/waybar/waybar.nix b/pkgs/wm/waybar/waybar.nix index 9ff1b1c..63da26a 100644 --- a/pkgs/wm/waybar/waybar.nix +++ b/pkgs/wm/waybar/waybar.nix @@ -8,16 +8,17 @@ layer = "top"; position = "top"; height = 58; - spacing = 6; + spacing = 0; fixed-center = true; margin-left = 8; - margin-right = 8; + margin-right = 25; + padding-right = 25; output = [ - "DP-4" + "DP-5" ]; - include = "~/Flakes/user/wm/waybar/default.json"; + include = "~/system/pkgs/wm/waybar/default.json"; modules-left = [ "custom/os_button" "hyprland/workspaces#roman" ]; - modules-center = [ "hyprland/window" "custom/polycat" "wlr/taskbar" ]; # replace wlr/taskbar + modules-center = [ "hyprland/window" "wlr/taskbar" ]; # replace wlr/taskbar modules-right = [ "cpu" "temperature" "disk" "tray" "clock" "custom/exit" ]; "custom/os_button" = { @@ -32,11 +33,11 @@ position = "bottom"; height = 39; output = "DP-3"; - spacing = 6; + spacing = 0; fixed-center = true; margin-left = 8; margin-right = 8; - include = "~/Flakes/user/wm/waybar/default.json"; + include = "~/system/pkgs/wm/waybar/default.json"; modules-left = [ "memory" "hyprland/workspaces#roman" ]; modules-center = [ "wlr/taskbar" ]; modules-right = [ ]; @@ -45,8 +46,8 @@ layer = "top"; position = "bottom"; height = 47; - output = "DP-1"; - include = "~/Flakes/user/wm/waybar/default.json"; + output = "DP-6"; + include = "~/system/pkgs/wm/waybar/default.json"; modules-left = [ ]; modules-center = [ "wlr/taskbar" ]; modules-right = [ "hyprland/workspaces#roman" "network" ]; diff --git a/secrets/nextcloud.age b/secrets/nextcloud.age new file mode 100644 index 0000000..47455c5 --- /dev/null +++ b/secrets/nextcloud.age @@ -0,0 +1,20 @@ +age-encryption.org/v1 +-> ssh-ed25519 ecR1kg EMgSo+Sesqv1kBeF3zBU7weq3nhj9rCp3rvLUxBG8l4 +bNTssiqcfr04W7+INqxNPI+k9EfFe1SdjXGtxbZWYvw +-> ssh-rsa 28puQg +nAZoX9Ttjs+dZSS851YzldbsAk/tFp70dd1ABorwgNudwsp2QfnX7lTmNYHroNVB +bStN8yGm4YA1SZmz7f67maT9OpDQRYSN8SlpRrhd7zF9FjF14p9uhgvRVOFtJO+5 +342ytJG3FVrysUObKj5Cjly2i/sRUGerAz/MYIr+wBnXJy0yHwf4lnJXBnuxNNcq +cqFvrP5qw00/64VnjrXLQvj/TyXnb7ztDAIESu8gRB1rC+cMFbEot7dsUQ5m7H4D +4RJ4AnX9ZaAa8DJDhj5j6Xy90/QjHShFM8A3ZjZ6nWT1gyvvkFwlvn0Xe/655AsK +AyebAFvyEf2JO/u8R18HYDIyGuVECsDZQOHv5NlmPxYbXVnry3e7gafZU5HScZ3H +fnUrBkkFmRr+aYrxkaiIkmT8wpTtcLk9qdyb0Ndd7ND7k76v/yNOc1TPaoj7Jfvf +qrt0UDZzapmUDTdVixJxPZGYqo8dC4X720Z2OqxiYaMNH7pbwKtY9b3VpkDyZ189 +Yr2yS53gOOqO8aHQbTmE31GiHeZFHtStfOQhoCWwj6WNO5nkWaiAPyip612//mf3 +yXjUMynqFa9Ks5fgdZRXJ/H02rtxorluqZ0LiCxV6KdlTW//OFnGDrhIxGCryp2u +G9+P9cDcOi8kMq7dmj5NtqQL4520aMXowO6SGlvLEmk +-> ssh-ed25519 rxYdLA ElMhyghLYbn7DIUzoYlIfjjFtQ+pzYityCirej0/tFA +96DSltOuKXJo1qDSHTIeKwqCPUga4oooHIdaVfB8Pdk +--- NW2k58ys9cYMl9m25jnNs8879hl2N6mx2ism/yxHd8w +og~sݻcAg +P"{Pćڞhwer)23~{G%snI zwr~Pd6cyfiqC>zvcj~-DnCL{&+neZf;_md_c$-sBxkGSlx}DrjVS7$x^B4Yt&kvu^ zN6~5{HLL3M?M}08t!+CR*oA_K0{(&=IHv zCJ-@*pvin28I5pABQ4eqT!sEgt)4n$qwk2)l|yi1}b6wBA*E*c)S*&D_}%t7zQf( zv`Q(JB4mdfjDp2jm(2q$s3f>;FkUr$(kviEpY3Q;!L79fIF`u8A)GV9O*cgK6Q*Bo z8y-l6Da)1#9Ot!sP>Tbk7jN=i*s_x8#2^_}Vch9<9BR?cu$l1`zWbx|7wq7K9NOkWRLS%hn5laQnqs=8p&sZu^Eft8L}Yq zkESs<9l=Ca>v3ow7VTgi2;;R_msLo!*oQq+E^09zYAN5_PvZSJ665$RD!~TYA9XES z&(!U#oFLtSrqv)eSn?_e(9X~x4E6?0sU@Wt#pnq901Rfq3gwA;Jc1^OyxyvTu8LBE zMmZ43!La2)F;VilT1W{4oS8&BZcSFz9x1@ZL7C!m&2GNMi)9S-ptu>%8k$0NQYd_> z<4e~#Jz32s0+mo4CsHm!V0_laD_phNrZZM4m4RwgbDICwWI8uvYo*ztgo0y1WdaDhLjEn?wK1auWxRf=*QCn?9zZdC}JT13+ zJ-y_3vR2QvKt0_Bb-L51-q0aqh!+H$0`@;5^Zf!nrRdEeM=t9M`h;G7dD$M0PD z<^t{fEB^qa26cSJ7VMdW;#HOB*G?UH*g9_( z@aje70i%5Eb*Vo*=b7%7_mOvxeNvd$KZ~pjooWrgF@E2MCBv2LR<8d-KKByPxIFjR z*Kh4c3XAu>GkJK^H9I2c{U_gGpPE?B&blDUcw^0hD;@$bZaaHsFbNK=5FX!Qt^0h# z!mlo;p_~4?M{O3eduC>a?rr~TJ6%~O-F@JOyN_JA$h_Tu@5j*Q?a8#jm|gce6cmK9N7K8N1?+gF}&PFHtpTM>c5{Q z7l`EahB1E4AOHF96T$HxnoB<1w&2^b-_>uNS?qqW=qLW6jfZCqoTtCtuyOLW`6c;< zMXTSQ{CVU2v7i2ZboTrHi9O`hChy?*-!_Xo$L_NKbN|bur^fe99M|cc#))Tlt$n5U z(7voM??3#_9g7~haJ2gNyv@H&y%< ssh-rsa 28puQg +nUKwWoxRO6V/OU2iyN6L1y4jKh/5cWfqvbQrCsHzsoYwTvxdZNPx/TfPyW8m4Ozy +e7WN6zhlqt6VQ8QSneqCS9NkQShvDKlPaReXBatmpULRy65oJMl3g3ADS+u27d1Y +qTWzyUKSMWhMUYcjnJklRMtmhEmQ07B6pB9KCe5uQ1Td5zjCzDbqZUA4zxKBb8DR +TIFiIw/fGp6riFepaoX9zSyM02qPg+t3JAqJ8+IvxJK9z6dnCHuCqNsIatnG7HaZ +WOIyRquSQeVsBrtcCwCjC/yW8fr7+gz1naBuTVmS/zffkCRXufjhA4Z+FhKxXTQc +lYg6r0Ej6UjyXhv8GUwfI4dHdrSqE2cJWv/LjT3ulGBs7kSV6udJSHMZQ/EJC/XX +P4NDbw7SA87rdnYzMTShzIvfR5zcJjKT0P9b123ORLB5fswT0Sl3HtaUHYEv3Qsy +5jQY8h2MZwv5lqGjlbdGwMCWUjNdQXgRzHqycu6EOI2Y/wDeubu+nMV8qXIvTvgm +qZB6HfCLMai9JGYxbHpW4ue8EzneRXsDSJ14sE7aiLcI3ErRnMT9J1tMctOW9MyW +sLE/CzsBaGvf4Vd2yvCyApYz3e7fUNKYBuVQSWgkegOXJfk7UW+MEGL6GVBr/MiJ +cC89vHy4Ns+Rkdxyzi9Jj+0/LbOnD2kF93DgOsv5PiY +-> ssh-ed25519 rxYdLA T1XsWxbEWodhpA8Bfq4/GPT/KyMOmzjIEcahKnw0qR4 +NJrSZOxMbY4cbp/oO63+ly9rwabTlnwMs7wqucu/lDc +--- eGMQEqys85GcJRgD+SacKpG4bDdTII8yO2Ycdav7f/Y +"vp G 3{d]'WQf}K2Pf \ No newline at end of file diff --git a/testBuild.sh b/testBuild.sh new file mode 100755 index 0000000..f947336 --- /dev/null +++ b/testBuild.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Script to test config files before compile +cd ~/system +echo "Testing ~/system ..." +echo "running nixos-rebuild dry-build switch --flake '.#'" +if nixos-rebuild dry-build --flake '.#'; then + echo "running home-manager -n switch --flake" + home-manager -n switch --flake . + echo "If all went well proceede with buildsys and mkhome" +else + echo "nixos-rebuild --dry-run failed, exiting script." + exit 1 +fi