diff --git a/flake.lock b/flake.lock index 4eb23a1..319d786 100644 --- a/flake.lock +++ b/flake.lock @@ -370,11 +370,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1712947921, - "narHash": "sha256-tDnNWtr4y22Qoyneg0TKcIncaeZ/5v1V90gPrLIQd3A=", + "lastModified": 1712969717, + "narHash": "sha256-vAtfM8lHOLjuHh/CTzSFUaCJp0qlAWttWimin3KoDXM=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "dd6fdf49d9deebfe792ab5cd0332432249922fa9", + "rev": "582d6233c802327fea45a14d146e7cbab5fe4b1e", "type": "github" }, "original": { diff --git a/hosts/default.nix b/hosts/default.nix index 79af885..bc46ddb 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -37,4 +37,15 @@ in { inputs.agenix.nixosModules.default ]; }; + + flocke = lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit lib inputs self; }; + modules = [ + ./dragyx/flocke + ../modules + inputs.home-manager.nixosModules.home-manager + inputs.agenix.nixosModules.default + ]; + }; } diff --git a/hosts/dragyx/common/packages.nix b/hosts/dragyx/common/packages.nix new file mode 100644 index 0000000..6289173 --- /dev/null +++ b/hosts/dragyx/common/packages.nix @@ -0,0 +1,65 @@ +# which default packages to use for the system +{ inputs, outputs, profile-config, pkgs, ...}: + +let + python-packages = ps: with ps; [ + pandas + numpy + opencv4 + ipython + ]; +in +{ + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + (python3.withPackages python-packages) + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + neovim + eza # exa is unmaintained + hwinfo + zsh + git + broot + unzip + rsync + # neofetch + # fastfetch has the option to set a timeout for + # for each module, which makes it dramatically faster + # as counting the number of packages takes over 800 (!!!) ms, + # which makes it very unpleasant to use as default thing + # to display when starting a terminal + fastfetch + alacritty + wget + gnumake + zoxide + python3 + nodejs + gcc + cargo + rustc + rust-analyzer + clippy + lsof + htop + okular + smartmontools + networkmanager + pkg-config + sof-firmware # audio + nix-index + # --------- optional + gnome.eog + sherlock + xfce.thunar + + plocate + alsa-utils + + # partition management + parted + gnufdisk + lapce + ]; +} diff --git a/hosts/dragyx/flocke/configuration.nix b/hosts/dragyx/flocke/configuration.nix new file mode 100644 index 0000000..c626128 --- /dev/null +++ b/hosts/dragyx/flocke/configuration.nix @@ -0,0 +1,166 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ../../../options/common/pin-registry.nix + ../../../options/common/preserve-system.nix + ../../../options/desktop/fonts.nix + ./packages.nix + ]; + + + nixpkgs.config.allowUnfree = true; + time.timeZone = "Europe/Zurich"; + security.sudo.package = pkgs.sudo.override { withInsults = true; }; + + services.displayManager = { + sessionPackages = [ pkgs.hyprland ]; # pkgs.gnome.gnome-session.sessions ]; + defaultSession = "hyprland"; + sddm = { + enable = true; + wayland.enable = true; + }; + }; + + + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + hardware.opengl.driSupport = true; + hardware.opengl.driSupport32Bit = true; + hardware.opengl.enable = true; + + services.logrotate.checkConfig = false; + + networking.hostName = "flocke"; # Define your hostname. + networking.hostId = "adf23c31"; + networking.interfaces.wlp1s0.useDHCP = true; + networking.networkmanager.enable = true; + environment.systemPackages = with pkgs; [ networkmanager ]; # cli tool for managing connections + + boot = { + kernelParams = [ ]; + initrd.supportedFilesystems = [ "ext4" ]; + supportedFilesystems = [ "ext4" ]; + loader = { + efi.efiSysMountPoint = "/boot"; + efi.canTouchEfiVariables = true; + grub = { + enable = true; + device = "nodev"; + efiSupport = true; + enableCryptodisk = true; + }; + }; + initrd.luks.devices = { + cryptroot = { + device = "/dev/disk/by-uuid/ec5ff3a1-9b39-4ba5-aa0f-19e898b4f6e8"; + preLVM = true; + }; + }; + }; + + # see https://nixos.wiki/wiki/AMD_GPU + services.xserver.videoDrivers = [ "amdgpu" ]; + systemd.tmpfiles.rules = [ + "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" + ]; + hardware.opengl.extraPackages = with pkgs; [ + rocmPackages.clr.icd + ]; + + services.power-profiles-daemon.enable = false; + + # stock nixos power management + powerManagement.enable = true; + + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 20; + + #Optional helps save long term battery health + START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge + STOP_CHARGE_THRESH_BAT0 = 85; # 80 and above it stops charging + + }; +}; + + swapDevices = [ { + device = "/var/lib/swapfile"; + size = 32*1024; + } ]; + + + # be nice to your ssds + services.fstrim.enable = true; + # services.xserver.enable = pkgs.lib.mkForce false; + + security.polkit.enable = true; + + modules = { + other = { + system = rec { + hostname = "flocke"; + username = "dragyx"; + gitPath = "/home/${username}/repos/nichts"; + monitors = [ + { + name = "LaptopMain"; + device = "eDP-1"; + resolution = { + x = 2256; + y = 1504; + }; + scale = 1.175; + refresh_rate = 60; + } + ]; + }; + home-manager = { + enable = true; + enableDirenv = true; + }; + }; + programs = { + vesktop.enable = true; + btop.enable = true; + mpv.enable = true; + schizofox.enable = true; + obs.enable = true; + # neovim.enable = true; + git = { + enable = true; + userName = "Dragyx"; + userEmail = "66752602+Dragyx@users.noreply.github.com"; + defaultBranch = "main"; + }; + starship.enable = true; + zsh = { + enable = true; + profiling = false; + }; + # badneovim.enable = true; + }; + services = { + pipewire.enable = true; + }; + WM.hyprland.enable = true; + }; + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.11"; # Did you read the comment? +} diff --git a/hosts/dragyx/flocke/default.nix b/hosts/dragyx/flocke/default.nix new file mode 100644 index 0000000..8401175 --- /dev/null +++ b/hosts/dragyx/flocke/default.nix @@ -0,0 +1,8 @@ +_: { + imports = [ + ../../../options/desktop/monitors.nix + ./configuration.nix + ./hardware-configuration.nix + # ./packages.nix + ]; +} diff --git a/hosts/dragyx/flocke/hardware-configuration.nix b/hosts/dragyx/flocke/hardware-configuration.nix new file mode 100644 index 0000000..f4e236c --- /dev/null +++ b/hosts/dragyx/flocke/hardware-configuration.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2aaba0f2-e8dc-4583-a81e-2d35cc238e79"; + fsType = "ext4"; + }; + + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9D34-36F8"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/dragyx/flocke/packages.nix b/hosts/dragyx/flocke/packages.nix new file mode 100644 index 0000000..4c43613 --- /dev/null +++ b/hosts/dragyx/flocke/packages.nix @@ -0,0 +1,56 @@ +# which default packages to use for the system +{ inputs, outputs, profile-config, pkgs, ...}: + +let + python-packages = ps: with ps; [ + pandas + numpy + opencv4 + ipython + ]; +in +{ + + imports = [ + ../common/packages.nix + ]; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + + # security audits + lynis + element-desktop + jetbrains.idea-community + baobab + amdvlk + texlive.combined.scheme-full + android-tools + signal-desktop + nextcloud-client + # etcher + vlc + audacity + thunderbird + eclipses.eclipse-java + openjdk + firefox + # pkgs.nordvpn # nur.repos.LuisChDev.nordvpn + material-icons + material-design-icons + libreoffice + gimp + spotify + okular + # minecraft + prismlauncher-unwrapped + glfw-wayland-minecraft + glxinfo + # window manager + flameshot + feh + # Animeeeeee! + ani-cli # The stable version is very outdated + ]; + +} diff --git a/hosts/lars/default.nix b/hosts/lars/default.nix index 4d9dc8f..da685ac 100644 --- a/hosts/lars/default.nix +++ b/hosts/lars/default.nix @@ -5,7 +5,7 @@ security.sudo.package = pkgs.sudo.override { withInsults = true; }; security.polkit.enable = true; programs.kdeconnect.enable = true; - myOptions = { + modules = { other = { system = { gitPath = "/home/lars/nichts"; diff --git a/hosts/lars/dyonisos/configuration.nix b/hosts/lars/dyonisos/configuration.nix index 1bc5392..95cb45a 100644 --- a/hosts/lars/dyonisos/configuration.nix +++ b/hosts/lars/dyonisos/configuration.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: { - myOptions = { + modules = { other = { system = { hostname = "dyonisos"; diff --git a/hosts/lars/dyonisos/programs.nix b/hosts/lars/dyonisos/programs.nix index 89e5314..631e805 100644 --- a/hosts/lars/dyonisos/programs.nix +++ b/hosts/lars/dyonisos/programs.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { home-manager.users.${username} = { home.packages = let diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 1404c6d..f9178a7 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -1,15 +1,15 @@ { config, lib, inputs, pkgs, ... }: with lib; let - username = config.myOptions.other.system.username; - cfg = config.myOptions.hyprland; + username = config.modules.other.system.username; + cfg = config.modules.hyprland; in { - options.myOptions.hyprland.nvidia.enable = mkEnableOption "nvidia"; - options.myOptions.hyprland = { + options.modules.hyprland.nvidia.enable = mkEnableOption "nvidia"; + options.modules.hyprland = { enable = mkEnableOption "hyprland"; monitor = mkOption { description = "hyprland monitor config"; default = ",preferred,auto,1"; - type = types.listof(types.str); + type = types.listOf(types.str); }; }; @@ -41,6 +41,9 @@ in { wayland.windowManager.hyprland = { enable = true; settings = { + # Monitor config + monitor = cfg.monitor; + "$mod" = "SUPER"; input = { @@ -51,6 +54,10 @@ in { "$mod, Q, killactive" "$mod, return, exec, alacritty" "$mod SHIFT, return, exec, firefox" + "$mod SHIFT, m, exit" + + # Application + "$mod SHIFT, c, exec, code --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu" # Monitor management "$mod SHIFT, k, movecurrentworkspacetomonitor, DP-2" diff --git a/hosts/lars/kronos/configuration.nix b/hosts/lars/kronos/configuration.nix index 3cc0d21..0189d05 100644 --- a/hosts/lars/kronos/configuration.nix +++ b/hosts/lars/kronos/configuration.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: { - myOptions = { + modules = { other = { system = { hostname = "kronos"; diff --git a/hosts/lars/kronos/programs.nix b/hosts/lars/kronos/programs.nix index 89e5314..631e805 100644 --- a/hosts/lars/kronos/programs.nix +++ b/hosts/lars/kronos/programs.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { home-manager.users.${username} = { home.packages = let diff --git a/hosts/lars/programs.nix b/hosts/lars/programs.nix index 46cac30..af563c0 100644 --- a/hosts/lars/programs.nix +++ b/hosts/lars/programs.nix @@ -1,6 +1,6 @@ { config, inputs, pkgs, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { home-manager.users.${username} = { home.packages = let @@ -48,6 +48,8 @@ in { tmux firefox kitty + nextcloud-client + vscode grim slurp wl-clipboard diff --git a/hosts/vali/mars/awesome.nix b/hosts/vali/mars/awesome.nix index fdf180c..ad418a0 100644 --- a/hosts/vali/mars/awesome.nix +++ b/hosts/vali/mars/awesome.nix @@ -1,8 +1,8 @@ { pkgs, lib, config, ... }: with lib; let - cfg = config.myOptions.programs.awesome; + cfg = config.modules.programs.awesome; in { - options.myOptions.programs.awesome.enable = mkEnableOption "awesome"; + options.modules.programs.awesome.enable = mkEnableOption "awesome"; config = mkIf cfg.enable { services.xserver = { diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/mars/configuration.nix index b03723d..ada9ab0 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/mars/configuration.nix @@ -34,7 +34,7 @@ } ''; }; - myOptions = { + modules = { other = { system = { hostname = "mars"; diff --git a/hosts/vali/mars/hypr/land.nix b/hosts/vali/mars/hypr/land.nix index 475d78c..9816796 100644 --- a/hosts/vali/mars/hypr/land.nix +++ b/hosts/vali/mars/hypr/land.nix @@ -2,8 +2,8 @@ with lib; let - cfg = config.myOptions.programs.hypr.land; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.hypr.land; + username = config.modules.other.system.username; hmCfg = config.home-manager.users.${username}; smwPresent = elem inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces cfg.extraPlugins; @@ -13,7 +13,7 @@ with lib; let inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; inherit (inputs.hyprlock.packages.${pkgs.system}) hyprlock; in { - options.myOptions.programs.hypr.land = { + options.modules.programs.hypr.land = { enable = mkEnableOption "huperland"; startupSound = mkOption { type = with types; nullOr path; @@ -359,7 +359,7 @@ in { "[workspace special:rog silent;tile] ${config.services.asusd.package}/bin/rog-control-center") "[workspace special:keepassxc silent;tile] ${pkgs.keepassxc}/bin/keepassxc" - (if config.myOptions.programs.foot.server then "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service" else ";") + (if config.modules.programs.foot.server then "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service" else ";") "${hyprland}/bin/hyprctl setcursor Bibata-Modern-Classic 24" diff --git a/hosts/vali/mars/hypr/lock.nix b/hosts/vali/mars/hypr/lock.nix index d622ef8..25c65ca 100644 --- a/hosts/vali/mars/hypr/lock.nix +++ b/hosts/vali/mars/hypr/lock.nix @@ -5,12 +5,12 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.hypr.lock; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.hypr.lock; + username = config.modules.other.system.username; text_color = "rgba(eae0e4FF)"; in { - options.myOptions.programs.hypr.lock = { + options.modules.programs.hypr.lock = { enable = mkEnableOption "hiper zamek"; extraSettings = mkOption { type = types.attrs; diff --git a/hosts/vali/mars/i3/i3.nix b/hosts/vali/mars/i3/i3.nix index 378bf2f..a3242ee 100644 --- a/hosts/vali/mars/i3/i3.nix +++ b/hosts/vali/mars/i3/i3.nix @@ -1,9 +1,9 @@ { pkgs, lib, config, callPackage, ... }: with lib; let - cfg = config.myOptions.programs.i3; username = config.myOptions.other.system.username; + cfg = config.modules.programs.i3; in { - options.myOptions.programs.i3.enable = mkEnableOption "i3"; + options.modules.programs.i3.enable = mkEnableOption "i3"; config = mkIf cfg.enable { home-manager.users.${username}.xdg.configFile."i3/config".source = ./config; diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index 2afb568..9c9fb41 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -1,6 +1,7 @@ { config, inputs, pkgs, ... }: let fenix = inputs.fenix.packages.${pkgs.system}; + username = config.modules.other.system.username; in { environment.systemPackages = with pkgs; [ alacritty diff --git a/hosts/vali/mars/temp b/hosts/vali/mars/temp new file mode 100644 index 0000000..e2d9650 --- /dev/null +++ b/hosts/vali/mars/temp @@ -0,0 +1,78 @@ +{ config, inputs, pkgs, ... }: +let + username = config.myOptions.other.system.username; +in { + home-manager.users.${username} = { + home.packages = let + fenix = inputs.fenix.packages.${pkgs.system}; + + in with pkgs; [ + alacritty + alsa-utils + asciinema + betterbird + bibata-cursors + dig + easyeffects + element-desktop + eza + fastfetch + (fenix.complete.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + ]) + ffmpeg_6-full + flameshot + foot + gcc + gdb + grimblast + git + httpie + imagemagick + keepassxc + krita + lazygit + libreoffice-fresh + neofetch + neovim + networkmanagerapplet + nextcloud-client + pamixer + pavucontrol + pcmanfm + pfetch + playerctl + polkit + python3 + qbittorrent + ripgrep + rustdesk + rofi + scc + sherlock + signal-desktop-beta + smartmontools + st + steam + strawberry.strawberry-wrapped + telegram-desktop + texliveFull + thunderbird + tor-browser-bundle-bin + trash-cli + tree + unzip + ventoy-full + vesktop + vlc + xclip + yt-dlp + zathura + zip + ]; + }; +} diff --git a/modules/cli/default.nix b/modules/cli/default.nix index 1e43012..117462f 100644 --- a/modules/cli/default.nix +++ b/modules/cli/default.nix @@ -3,5 +3,6 @@ _: { ./git.nix ./starship.nix ./zsh.nix + ./neovim.nix ]; } diff --git a/modules/cli/git.nix b/modules/cli/git.nix index f9d4429..6d65c2c 100644 --- a/modules/cli/git.nix +++ b/modules/cli/git.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.git; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.git; + username = config.modules.other.system.username; in { - options.myOptions.programs.git = { + options.modules.programs.git = { enable = mkEnableOption "git"; userName = mkOption { type = types.str; diff --git a/modules/cli/neovim.nix b/modules/cli/neovim.nix new file mode 100644 index 0000000..1b4b503 --- /dev/null +++ b/modules/cli/neovim.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +let + lazyvim-config = pkgs.fetchFromGitHub { + owner = "Dragyx"; + repo = "lazyvim-config"; + rev = "d799724f48199d81ca6c8abb5951860fbf8fa0df"; + hash = "sha256-NF92CweRFQ1qZS8NXoTUEljazRGXgXS2AuDt5IWmwBc="; + }; + cfg = config.modules.programs.neovim-old; + username = config.modules.other.system.username; +in +{ + options.modules.programs.neovim-old.enable = lib.mkEnableOption "neovim-old"; + + config = lib.mkIf cfg.enable { + home-manager.users.${username} = { + home.packages = with pkgs; [ lazygit ripgrep fd gcc xclip rust-analyzer ]; + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; + + xdg.configFile."nvim" = { + enable = true; + source = lazyvim-config; + recursive = true; + }; + }; + + + }; +} diff --git a/modules/cli/starship.nix b/modules/cli/starship.nix index 09ae8af..60acfdc 100644 --- a/modules/cli/starship.nix +++ b/modules/cli/starship.nix @@ -3,16 +3,16 @@ lib, ... }: with lib; let - cfg = config.myOptions.programs.starship; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.starship; + username = config.modules.other.system.username; in { - options.myOptions.programs.starship.enable = mkEnableOption "starship"; + options.modules.programs.starship.enable = mkEnableOption "starship"; config = mkIf cfg.enable { home-manager.users.${username} = { programs.starship = { enable = true; - enableZshIntegration = config.myOptions.programs.zsh.enable; + enableZshIntegration = config.modules.programs.zsh.enable; settings = { add_newline = false; command_timeout = 1000; diff --git a/modules/cli/zsh.nix b/modules/cli/zsh.nix index 93f0910..cb02c19 100644 --- a/modules/cli/zsh.nix +++ b/modules/cli/zsh.nix @@ -1,11 +1,11 @@ { config, lib, pkgs, ... }: with lib; let - cfg = config.myOptions.programs.zsh; - username = config.myOptions.other.system.username; - hostname = config.myOptions.other.system.hostname; - gitPath = config.myOptions.other.system.gitPath; + cfg = config.modules.programs.zsh; + username = config.modules.other.system.username; + hostname = config.modules.other.system.hostname; + gitPath = config.modules.other.system.gitPath; in { - options.myOptions.programs.zsh = { + options.modules.programs.zsh = { enable = mkEnableOption "zsh"; extraAliases = mkOption { type = types.attrs; diff --git a/modules/gui/WM/default.nix b/modules/gui/WM/default.nix new file mode 100644 index 0000000..90f980b --- /dev/null +++ b/modules/gui/WM/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./hyprland.nix + ]; +} diff --git a/modules/gui/WM/hyprland.nix b/modules/gui/WM/hyprland.nix new file mode 100644 index 0000000..a3a45ae --- /dev/null +++ b/modules/gui/WM/hyprland.nix @@ -0,0 +1,179 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.WM.hyprland; + username = config.modules.other.system.username; + monitors = config.modules.other.system.monitors; +in +{ + options.modules.WM.hyprland = { + enable = mkEnableOption "hyprland"; + gnome-keyring = mkEnableOption "gnome-keyring"; + }; + + + config = mkIf cfg.enable { + programs.xwayland.enable = true; + programs.hyprland = { + enable = true; + }; + services.gnome.gnome-keyring.enable = mkDefault cfg.gnome-keyring; + systemd.user.services.polkit-gnome-authentication-agent-1 = mkIf cfg.gnome-keyring { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + + home-manager.users.${username} = { + home.packages = with pkgs; [ + rofi + waybar + hyprpaper + hyprlock + hyprland + hyprshade + lxqt.lxqt-openssh-askpass + + dunst + # wireplumber + xwayland + pciutils # lspci is needed by hyprland + dunst + swww + flameshot + bluetuith + brightnessctl + # needed for wayland copy / paste support in neovim + wl-clipboard + ]; + + wayland.windowManager.hyprland = { + enable = true; + systemd.enable = true; + xwayland.enable = true; + settings = { + exec-once = [ + "waybar" + ] ++ (if cfg.gnome-keyring then ["${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"] + else []); + monitor = map ( + m: "${m.device},${builtins.toString m.resolution.x}x${builtins.toString m.resolution.y}@${builtins.toString m.refresh_rate},${builtins.toString m.position.x}x${builtins.toString m.position.y},${builtins.toString m.scale},transform,${builtins.toString m.transform}" + ) monitors; #TODO: default value + input = { + kb_layout = "us"; + natural_scroll = true; + sensitivity = 0; + }; + general = { + gaps_in = 2; + gaps_out = 1; + border_size = 1; + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + layout = "dwindle"; + }; + decoration.rounding = 5; + misc.disable_hyprland_logo = true; + animations = { + enabled = true; + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = ["myBezier, 0.05, 0.9, 0.1, 1.05"]; + + animation = [ + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + "windows, 1, 7, myBezier" + ]; + }; + gestures.workspace_swipe = true; + debug.enable_stdout_logs = true; + bind = [ + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + "SUPER, RETURN, exec, alacritty" + "SUPER SHIFT, RETURN, exec, rofi -show drun" + "SUPER SHIFT, Q, killactive," + "SUPER, M, exit, " + "SUPER, B, exec, firefox" + "SUPER, f, fullscreen" + "SUPER, E, exec, nautilus --new-window " + "SUPER, V, togglefloating, " + "SUPER, P, pseudo, # dwindle" + "SUPER, S, togglesplit, # dwindle" + "SUPER, C, exec, /home/vali/.config/wallpaper/colorscheme-setter" + ",PRINT, exec, flameshot" + + + # Move focus with mainMod + arrow keys" + "SUPER, h, movefocus, l" + "SUPER, l, movefocus, r" + "SUPER, k, movefocus, u" + "SUPER, j, movefocus, d" + + # move window to next / previous workspace" + "SUPER CTRL, h, movetoworkspace, -1" + "SUPER CTRL, l, movetoworkspace, +1" + + # move to next / previous workspace" + "SUPER CTRL, h, workspace, -1" + "SUPER CTRL, l, workspace, +1" + + + # Switch workspaces with mainMod + [0-9]" + "SUPER, 1, workspace, 1" + "SUPER, 2, workspace, 2" + "SUPER, 3, workspace, 3" + "SUPER, 4, workspace, 4" + "SUPER, 5, workspace, 5" + "SUPER, 6, workspace, 6" + "SUPER, 7, workspace, 7" + "SUPER, 8, workspace, 8" + "SUPER, 9, workspace, 9" + "SUPER, 0, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9]" + "SUPER SHIFT, 1, movetoworkspace, 1" + "SUPER SHIFT, 2, movetoworkspace, 2" + "SUPER SHIFT, 3, movetoworkspace, 3" + "SUPER SHIFT, 4, movetoworkspace, 4" + "SUPER SHIFT, 5, movetoworkspace, 5" + "SUPER SHIFT, 6, movetoworkspace, 6" + "SUPER SHIFT, 7, movetoworkspace, 7" + "SUPER SHIFT, 8, movetoworkspace, 8" + "SUPER SHIFT, 9, movetoworkspace, 9" + "SUPER SHIFT, 0, movetoworkspace, 10" + + # Scroll through existing workspaces with mainMod + scroll" + "SUPER, mouse_down, workspace, e+1" + "SUPER, mouse_up, workspace, e-1" + + # Move/resize windows with mainMod + LMB/RMB and dragging + "SUPER, mouse:272, movewindow" + # "bindm = SUPER, mouse:273, resizewindow" + ]; + binde = [ + ",XF86MonBrightnessUp, exec, brightnessctl set 10%+" + ",XF86MonBrightnessDown, exec, brightnessctl set 10%-" + # Example volume button that allows press and hold, volume limited to 150%" + ",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + # Example volume button that will activate even while an input inhibitor is active" + ",XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-" + ",XF86AudioMute, exec, $ wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ]; + }; + }; + }; + }; +} diff --git a/modules/gui/cursor.nix b/modules/gui/cursor.nix index 6b3a454..1f39448 100644 --- a/modules/gui/cursor.nix +++ b/modules/gui/cursor.nix @@ -3,10 +3,10 @@ lib, ... }: with lib; let - cfg = config.myOptions.themes.cursor; - username = config.myOptions.other.system.username; + cfg = config.modules.themes.cursor; + username = config.modules.other.system.username; in { - options.myOptions.themes.cursor = { + options.modules.themes.cursor = { enable = mkEnableOption "cursor theming"; package = mkOption { description = "cursor theme package"; diff --git a/modules/gui/default.nix b/modules/gui/default.nix index 0821731..d4cd205 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -10,5 +10,6 @@ _: { ./obs.nix ./foot.nix # ./vivado.nix + ./WM ]; } diff --git a/modules/gui/foot.nix b/modules/gui/foot.nix index d94b898..6d72aab 100644 --- a/modules/gui/foot.nix +++ b/modules/gui/foot.nix @@ -5,10 +5,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.foot; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.foot; + username = config.modules.other.system.username; in { - options.myOptions.programs.foot = { + options.modules.programs.foot = { enable = mkEnableOption "foot"; server = mkEnableOption "foot server mode"; }; diff --git a/modules/gui/gtk.nix b/modules/gui/gtk.nix index df5b0db..a8f9a7e 100644 --- a/modules/gui/gtk.nix +++ b/modules/gui/gtk.nix @@ -3,11 +3,11 @@ lib, ... }: with lib; let - cfg = config.myOptions.themes.gtk; - username = config.myOptions.other.system.username; + cfg = config.modules.themes.gtk; + username = config.modules.other.system.username; hmCfg = config.home-manager.users.${username}; in { - options.myOptions.themes.gtk = { + options.modules.themes.gtk = { enable = mkEnableOption "gtk theming"; name = mkOption { description = "gtk theme name"; diff --git a/modules/gui/mpv.nix b/modules/gui/mpv.nix index 0e3ba5d..cbe606e 100644 --- a/modules/gui/mpv.nix +++ b/modules/gui/mpv.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.mpv; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.mpv; + username = config.modules.other.system.username; in { - options.myOptions.programs.mpv.enable = mkEnableOption "mpv"; + options.modules.programs.mpv.enable = mkEnableOption "mpv"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/gui/obs.nix b/modules/gui/obs.nix index d5c7bcf..f979cfb 100644 --- a/modules/gui/obs.nix +++ b/modules/gui/obs.nix @@ -1,9 +1,9 @@ { config, lib, pkgs, ... }: with lib; let - cfg = config.myOptions.programs.obs; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.obs; + username = config.modules.other.system.username; in { - options.myOptions.programs.obs.enable = mkEnableOption "obs"; + options.modules.programs.obs.enable = mkEnableOption "obs"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/gui/qt.nix b/modules/gui/qt.nix index 3509a3b..40f14e1 100644 --- a/modules/gui/qt.nix +++ b/modules/gui/qt.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.themes.qt; - username = config.myOptions.other.system.username; + cfg = config.modules.themes.qt; + username = config.modules.other.system.username; in { - options.myOptions.themes.qt = { + options.modules.themes.qt = { enable = mkEnableOption "qt theming"; name = mkOption { description = "qt theme name"; diff --git a/modules/gui/rofi.nix b/modules/gui/rofi.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/gui/schizofox.nix b/modules/gui/schizofox.nix index 9591915..63cb67d 100644 --- a/modules/gui/schizofox.nix +++ b/modules/gui/schizofox.nix @@ -1,13 +1,9 @@ -{ - config, - inputs, - lib, - ... -}: with lib; let - cfg = config.myOptions.programs.schizofox; - username = config.myOptions.other.system.username; +{ config, inputs, lib, ... }: +with lib; let + cfg = config.modules.programs.schizofox; + username = config.modules.other.system.username; in { - options.myOptions.programs.schizofox = { + options.modules.programs.schizofox = { enable = mkEnableOption "schizofox"; }; diff --git a/modules/gui/vesktop.nix b/modules/gui/vesktop.nix index ab8eb18..a209062 100644 --- a/modules/gui/vesktop.nix +++ b/modules/gui/vesktop.nix @@ -4,15 +4,16 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.vesktop; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.vesktop; + username = config.modules.other.system.username; in { - options.myOptions.programs.vesktop = { + options.modules.programs.vesktop = { enable = mkEnableOption "vesktop"; }; config = mkIf cfg.enable { home-manager.users.${username} = { + home.packages = with pkgs; [ vesktop ]; xdg.configFile."vesktop/settings.json".text = builtins.toJSON { discordBranch = "ptb"; firstLaunch = false; diff --git a/modules/gui/vivado2.nix b/modules/gui/vivado2.nix index c73846f..0e5417e 100644 --- a/modules/gui/vivado2.nix +++ b/modules/gui/vivado2.nix @@ -6,11 +6,11 @@ let desktopName = "Vivado"; exec = "${pkgs.nur.repos.lschuermann.vivado-2022_2}/bin/vivado"; }; - cfg = with lib; [ config.myOptions.programs.vivado ]; - username = with lib; [ config.myOptions.other.system.username ]; + cfg = with lib; [ config.modules.programs.vivado ]; + username = with lib; [ config.modules.other.system.username ]; in { - options.myOptions.programs.vivado.enable = mkEnableOption "vivado"; + options.modules.programs.vivado.enable = mkEnableOption "vivado"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/gui/zathura.nix b/modules/gui/zathura.nix index 74082fb..26c67aa 100644 --- a/modules/gui/zathura.nix +++ b/modules/gui/zathura.nix @@ -4,10 +4,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.zathura; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.zathura; + username = config.modules.other.system.username; in { - options.myOptions.programs.zathura.enable = mkEnableOption "zathura"; + options.modules.programs.zathura.enable = mkEnableOption "zathura"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/other/displaymanager.nix b/modules/other/displaymanager.nix index a3caa8e..02f3ffe 100644 --- a/modules/other/displaymanager.nix +++ b/modules/other/displaymanager.nix @@ -1,8 +1,8 @@ {pkgs, lib, config, ...}: with lib; let - cfg = config.myOptions.programs.displaymanager; + cfg = config.modules.programs.displaymanager; in { - options.myOptions.programs.displaymanager.enable = mkEnableOption "displaymanager"; + options.modules.programs.displaymanager.enable = mkEnableOption "displaymanager"; config = mkIf cfg.enable { services.xserver.displayManager = { diff --git a/modules/other/home-manager.nix b/modules/other/home-manager.nix index 78f2cdb..ef5de08 100644 --- a/modules/other/home-manager.nix +++ b/modules/other/home-manager.nix @@ -5,10 +5,10 @@ self, ... }: with lib; let - cfg = config.myOptions.other.home-manager; - username = config.myOptions.other.system.username; + cfg = config.modules.other.home-manager; + username = config.modules.other.system.username; in { - options.myOptions.other.home-manager = { + options.modules.other.home-manager = { enable = mkEnableOption "home-manager"; enableDirenv = mkEnableOption "direnv"; }; diff --git a/modules/other/system.nix b/modules/other/system.nix index e4d1328..ab21d91 100644 --- a/modules/other/system.nix +++ b/modules/other/system.nix @@ -3,9 +3,9 @@ lib, ... }: with lib; let - cfg = config.myOptions.other.system; + cfg = config.modules.other.system; in { - options.myOptions.other.system = { + options.modules.other.system = { hostname = mkOption { description = "hostname for this system"; type = types.str; diff --git a/modules/other/xdg.nix b/modules/other/xdg.nix index 6e2e0f2..36a32b8 100644 --- a/modules/other/xdg.nix +++ b/modules/other/xdg.nix @@ -2,7 +2,7 @@ config, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; hmCfg = config.home-manager.users.${username}; primary_browser = "schizofox.desktop"; @@ -30,7 +30,7 @@ in { XAUTHORITY = "\$XDG_RUNTIME_DIR/Xauthority"; }; */ - myOptions.programs.zsh.extraAliases = { + modules.programs.zsh.extraAliases = { gdb = "gdb -n -x ${hmCfg.xdg.configHome}/gdb/init"; pidgin = "pidgin --config=${hmCfg.xdg.dataHome}/purple"; svn = "svn --config-dir ${hmCfg.xdg.configHome}/subversion"; diff --git a/modules/services/pipewire.nix b/modules/services/pipewire.nix index c3845c7..3de50d7 100644 --- a/modules/services/pipewire.nix +++ b/modules/services/pipewire.nix @@ -1,8 +1,8 @@ { config, lib, ... }: with lib; let - cfg = config.myOptions.services.pipewire; + cfg = config.modules.services.pipewire; in { - options.myOptions.services.pipewire.enable = mkEnableOption "pipewire"; + options.modules.services.pipewire.enable = mkEnableOption "pipewire"; config = mkIf cfg.enable { hardware.pulseaudio.enable = false; diff --git a/modules/tui/btop.nix b/modules/tui/btop.nix index 332d0f7..105b008 100644 --- a/modules/tui/btop.nix +++ b/modules/tui/btop.nix @@ -1,9 +1,9 @@ { config, lib, ... }: with lib; let - cfg = config.myOptions.programs.btop; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.btop; + username = config.modules.other.system.username; in { - options.myOptions.programs.btop.enable = mkEnableOption "btop"; + options.modules.programs.btop.enable = mkEnableOption "btop"; config = mkIf cfg.enable { home-manager.users.${username} = { diff --git a/modules/tui/neovim.nix b/modules/tui/neovim.nix index d3b81fe..b19c255 100644 --- a/modules/tui/neovim.nix +++ b/modules/tui/neovim.nix @@ -5,10 +5,10 @@ pkgs, ... }: with lib; let - cfg = config.myOptions.programs.neovim; - username = config.myOptions.other.system.username; + cfg = config.modules.programs.neovim; + username = config.modules.other.system.username; in { - options.myOptions.programs.neovim.enable = mkEnableOption "neovim"; + options.modules.programs.neovim.enable = mkEnableOption "neovim"; config = mkIf cfg.enable { nixpkgs.overlays = [ inputs.neovim-nightly-overlay.overlay ]; diff --git a/options/common/networking.nix b/options/common/networking.nix index b1601cd..3c8d6d7 100644 --- a/options/common/networking.nix +++ b/options/common/networking.nix @@ -1,6 +1,6 @@ { config, lib, ... }: let - username = config.myOptions.other.system.username; + username = config.modules.other.system.username; in { networking = { networkmanager = { diff --git a/options/desktop/monitors.nix b/options/desktop/monitors.nix new file mode 100644 index 0000000..42f40b5 --- /dev/null +++ b/options/desktop/monitors.nix @@ -0,0 +1,75 @@ +{ config, lib, ... }: + +with lib; +{ + options.modules.other.system.monitors = mkOption { + description = " + List of monitors to use + "; + default = []; + type = with types; types.listOf (submodule { + options = { + name = mkOption { + type = types.str; + description = "Give your monitor a cute name"; + default = "monitor0(I am lazy)"; + }; + device = mkOption { + type = types.str; + description = "The actual device name of the monitor"; + }; + resolution = mkOption { + type = types.submodule { + options = { + x = mkOption { + type = types.int; + description = "monitor width"; + default = "1920"; + }; + y = mkOption { + type = types.int; + description = "monitor height"; + default = "1080"; + }; + }; + }; + }; + scale = mkOption { + type = types.number; + description = "monitor scale"; + default = 1.0; + }; + refresh_rate = mkOption { + type = types.int; + description = "monitor refresh rate (in Hz)"; + default = 60; + }; + position = mkOption { + type = types.submodule { + options = { + x = mkOption { + type = types.int; + default = 0; + }; + y = mkOption { + type = types.int; + default = 0; + }; + }; + }; + description = "absolute monitor posititon"; + default = { + x = 0; + y = 0; + }; + }; + transform = mkOption { + type = types.ints.between 0 3; + description = "Rotation of the monitor counterclockwise"; + default = 0; + }; + }; + }); + }; + +}