From b54f3d54f16aa551c5e17f0273136f2cb46ba56d Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Tue, 4 Jun 2024 12:18:23 +0200 Subject: [PATCH] format everything --- common/colors.nix | 80 +++--- common/discord/discord.nix | 36 +-- common/nvim/nvim.nix | 32 +-- common/spotify.nix | 20 +- hosts/default/hardware-configuration.nix | 18 +- hosts/default/home.nix | 296 ++++++++++----------- hosts/default/root.nix | 160 ++++++------ hosts/server/configuration.nix | 285 ++++++++++---------- hosts/server/hardware-configuration.nix | 3 +- hosts/server/home.nix | 162 ++++++------ hosts/server/root.nix | 124 ++++----- modules/applications/default.nix | 42 +-- modules/applications/firefox.nix | 22 +- modules/applications/git.nix | 54 ++-- modules/applications/kitty.nix | 28 +- modules/applications/zsh.nix | 66 ++--- modules/automapaper/default.nix | 319 ++++++++++++----------- modules/dunst.nix | 18 +- modules/games/default.nix | 22 +- modules/games/minecraft.nix | 12 +- modules/games/steam.nix | 58 ++--- modules/hyprland.nix | 233 +++++++++-------- modules/waybar/allmodules.nix | 8 +- modules/waybar/clock.nix | 2 +- modules/waybar/cpu.nix | 2 +- modules/waybar/default.nix | 6 +- modules/waybar/memory.nix | 2 +- modules/waybar/namedmodules.nix | 6 +- modules/waybar/network.nix | 2 +- modules/waybar/power.nix | 2 +- modules/waybar/temperature.nix | 4 +- modules/waybar/tray.nix | 2 +- modules/waybar/vpn.nix | 2 +- modules/waybar/window.nix | 2 +- modules/waybar/wireplumber.nix | 4 +- modules/waybar/workspaces.nix | 2 +- modules/wofi.nix | 222 ++++++++-------- 37 files changed, 1185 insertions(+), 1173 deletions(-) diff --git a/common/colors.nix b/common/colors.nix index a66507c..2c6fd94 100644 --- a/common/colors.nix +++ b/common/colors.nix @@ -1,47 +1,47 @@ { config, pkgs, nix-colors, ... }: { - imports = [ - nix-colors.homeManagerModules.default - ]; + imports = [ + nix-colors.homeManagerModules.default + ]; - # colorScheme = nix-colors.colorSchemes.catppuccin-macchiato; + # colorScheme = nix-colors.colorSchemes.catppuccin-macchiato; - colorScheme = { - slug = "test"; - name = "TestScheme"; - author = "Noa"; - palette = { - base00 = "#000000"; - base01 = "#0000FF"; - base02 = "#00FF00"; - base03 = "#00FFFF"; - base04 = "#FF0000"; - base05 = "#FF00FF"; - base06 = "#FFFF00"; - base07 = "#FFFFFF"; - base08 = "#777777"; - base09 = "#7777FF"; - base0A = "#77FF77"; - base0B = "#77FFFF"; - base0C = "#FF7777"; - base0D = "#FF77FF"; - base0E = "#FFFF77"; - base0F = "#AAAAAA"; - text = "#222222"; - textInverted = "#DDDDDD"; - textMuted = "#DDDDDD"; - background = "#FFD2D2"; - backgroundMuted = "#CCCCCC"; - warn = "#FF0000"; - highlight = "#FBAF44"; - danger = "#F53C3C"; - succes = "#5BBD63"; - spotifyGreen = "#39A04A"; - border = "#5F5F5F"; - info = "#2CB6AF"; - ok = "#38B148"; - }; - }; + colorScheme = { + slug = "test"; + name = "TestScheme"; + author = "Noa"; + palette = { + base00 = "#000000"; + base01 = "#0000FF"; + base02 = "#00FF00"; + base03 = "#00FFFF"; + base04 = "#FF0000"; + base05 = "#FF00FF"; + base06 = "#FFFF00"; + base07 = "#FFFFFF"; + base08 = "#777777"; + base09 = "#7777FF"; + base0A = "#77FF77"; + base0B = "#77FFFF"; + base0C = "#FF7777"; + base0D = "#FF77FF"; + base0E = "#FFFF77"; + base0F = "#AAAAAA"; + text = "#222222"; + textInverted = "#DDDDDD"; + textMuted = "#DDDDDD"; + background = "#FFD2D2"; + backgroundMuted = "#CCCCCC"; + warn = "#FF0000"; + highlight = "#FBAF44"; + danger = "#F53C3C"; + succes = "#5BBD63"; + spotifyGreen = "#39A04A"; + border = "#5F5F5F"; + info = "#2CB6AF"; + ok = "#38B148"; + }; + }; } diff --git a/common/discord/discord.nix b/common/discord/discord.nix index 95329bf..e40fdcb 100644 --- a/common/discord/discord.nix +++ b/common/discord/discord.nix @@ -1,22 +1,22 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - # (symlinkJoin { - # name = "discord"; - # paths = [ - # (writeShellScriptBin "discord" ''${discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland'') - # (writeShellScriptBin "Discord" ''${discord}/bin/Discord --enable-features=UseOzonePlatform --ozone-platform=wayland'') - # discord - # ]; - # }) - (symlinkJoin { - name = "vesktop"; - paths = [ - (writeShellScriptBin "vesktop" ''${vesktop}/bin/vesktop --enable-features=UseOzonePlatform --ozone-platform=wayland'') - (writeShellScriptBin "Vesktop" ''${vesktop}/bin/Vesktop --enable-features=UseOzonePlatform --ozone-platform=wayland'') - vesktop - ]; - }) - ]; + home.packages = with pkgs; [ + # (symlinkJoin { + # name = "discord"; + # paths = [ + # (writeShellScriptBin "discord" ''${discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland'') + # (writeShellScriptBin "Discord" ''${discord}/bin/Discord --enable-features=UseOzonePlatform --ozone-platform=wayland'') + # discord + # ]; + # }) + (symlinkJoin { + name = "vesktop"; + paths = [ + (writeShellScriptBin "vesktop" ''${vesktop}/bin/vesktop --enable-features=UseOzonePlatform --ozone-platform=wayland'') + (writeShellScriptBin "Vesktop" ''${vesktop}/bin/Vesktop --enable-features=UseOzonePlatform --ozone-platform=wayland'') + vesktop + ]; + }) + ]; } diff --git a/common/nvim/nvim.nix b/common/nvim/nvim.nix index 2318ce7..6fdd8ac 100644 --- a/common/nvim/nvim.nix +++ b/common/nvim/nvim.nix @@ -1,21 +1,21 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, ... }: { - home.packages = with pkgs; [ - # needed for the nvim config, neovim itself is a system package already - ripgrep + home.packages = with pkgs; [ + # needed for the nvim config, neovim itself is a system package already + ripgrep - # TODO: find how I can make this build dependencies only - gnumake - rustc - python3 - ]; - programs.neovim = { - enable = true; - defaultEditor = true; - viAlias = true; - vimAlias = true; + # TODO: find how I can make this build dependencies only + gnumake + rustc + python3 + ]; + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; - extraLuaConfig = lib.fileContents ./init.lua; - }; + extraLuaConfig = lib.fileContents ./init.lua; + }; } diff --git a/common/spotify.nix b/common/spotify.nix index dff60b7..a98e479 100644 --- a/common/spotify.nix +++ b/common/spotify.nix @@ -1,14 +1,14 @@ { config, pkgs, inputs, ... }: { - services.spotifyd.enable = true; - home.packages = with pkgs; [ - (symlinkJoin { - name = "spotify"; - paths = [ - (writeShellScriptBin "spotify" ''${spotify}/bin/spotify --enable-features=UseOzonePlatform --ozone-platform=wayland'') - spotify - ]; - }) - ]; + services.spotifyd.enable = true; + home.packages = with pkgs; [ + (symlinkJoin { + name = "spotify"; + paths = [ + (writeShellScriptBin "spotify" ''${spotify}/bin/spotify --enable-features=UseOzonePlatform --ozone-platform=wayland'') + spotify + ]; + }) + ]; } diff --git a/hosts/default/hardware-configuration.nix b/hosts/default/hardware-configuration.nix index 0ea374a..7dc9230 100644 --- a/hosts/default/hardware-configuration.nix +++ b/hosts/default/hardware-configuration.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; @@ -14,19 +15,22 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/263716dd-52cb-4a91-ba0b-e39e492ed0e5"; + { + device = "/dev/disk/by-uuid/263716dd-52cb-4a91-ba0b-e39e492ed0e5"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/B08E-916D"; + { + device = "/dev/disk/by-uuid/B08E-916D"; fsType = "vfat"; }; - fileSystems."/home/noa/Sync" = - { device = "/dev/disk/by-uuid/93a74173-8719-4be2-86b3-dc80588b9cf8"; - fsType = "ext4"; - }; + fileSystems."/home/noa/Sync" = + { + device = "/dev/disk/by-uuid/93a74173-8719-4be2-86b3-dc80588b9cf8"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/hosts/default/home.nix b/hosts/default/home.nix index 2aabb3a..41546b8 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -1,178 +1,178 @@ { config, pkgs, inputs, lib, ... }: { - imports = - [ - ../../modules/hyprland.nix - ../../modules/games - ../../modules/applications - ../../common/nvim/nvim.nix - ../../common/discord/discord.nix - ../../common/spotify.nix - ]; - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "noa"; - home.homeDirectory = "/home/noa"; + imports = + [ + ../../modules/hyprland.nix + ../../modules/games + ../../modules/applications + ../../common/nvim/nvim.nix + ../../common/discord/discord.nix + ../../common/spotify.nix + ]; + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "noa"; + home.homeDirectory = "/home/noa"; - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; - modules = { - hyprland.enable = true; - games.enable = true; - apps = { - enable = true; - git = { - name = "Noa Aarts"; - email = "itepastra@gmail.com"; - }; - }; - }; + modules = { + hyprland.enable = true; + games.enable = true; + apps = { + enable = true; + git = { + name = "Noa Aarts"; + email = "itepastra@gmail.com"; + }; + }; + }; - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = with pkgs; [ - file - unzip - zip + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + file + unzip + zip - dig - mtr + dig + mtr - obs-studio - wayvnc + obs-studio + wayvnc - signal-desktop + signal-desktop - btop + btop - dconf - pipewire - lsd + dconf + pipewire + lsd - lm_sensors + lm_sensors - # Programming langs - go - nodejs - opam - stack - cargo - gcc + # Programming langs + go + nodejs + opam + stack + cargo + gcc - bend + bend - localsend - ]; + localsend + ]; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh - # + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. If you don't want to manage your shell through Home + # Manager then you have to manually source 'hm-session-vars.sh' located at + # either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh + # - home.sessionVariables = { - EDITOR = "nvim"; - TERM = "kitty"; - GDK_BACKEND = "wayland,x11"; - QT_QPA_PLATFORM = "wayland;xcb"; - CLUTTER_BACKEND = "wayland"; - XDG_CURRENT_DESKTOP = "Hyprland"; - XDG_SESSION_TYPE = "wayland"; - XDG_SESSION_DESKTOP = "Hyprland"; - WLR_NO_HARDWARE_CURSORS = "1"; - }; + home.sessionVariables = { + EDITOR = "nvim"; + TERM = "kitty"; + GDK_BACKEND = "wayland,x11"; + QT_QPA_PLATFORM = "wayland;xcb"; + CLUTTER_BACKEND = "wayland"; + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + XDG_SESSION_DESKTOP = "Hyprland"; + WLR_NO_HARDWARE_CURSORS = "1"; + }; - xdg = { - enable = true; - userDirs = { - enable = true; - createDirectories = true; - }; - portal = { - enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; - }; - }; + xdg = { + enable = true; + userDirs = { + enable = true; + createDirectories = true; + }; + portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; + }; + }; - dconf = { - enable = true; - settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - }; - }; - }; + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + }; + }; + }; - gtk = { - enable = true; - theme = { - name = "Adwaita-dark"; - package = pkgs.gnome.gnome-themes-extra; - }; - }; + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome.gnome-themes-extra; + }; + }; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - programs.zsh.shellAliases.bzzt = ''nix-shell -p mpv --command "mpv ~/Videos/BZZZM.mp4"''; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + programs.zsh.shellAliases.bzzt = ''nix-shell -p mpv --command "mpv ~/Videos/BZZZM.mp4"''; - home.pointerCursor = - let - getFrom = url: hash: name: { - gtk.enable = true; - x11.enable = true; - name = name; - size = 32; - package = - pkgs.runCommand "moveUp" {} '' - mkdir -p $out/share/icons - ln -s ${pkgs.fetchzip { - url = url; - hash = hash; - }} $out/share/icons/${name} - ''; - }; - in - getFrom - "https://github.com/ful1e5/Bibata_Cursor_Rainbow/releases/download/v1.1.2/Bibata-Rainbow-Modern.tar.gz" - "sha256-Ps+IKPwQoRwO9Mqxwc/1nHhdBT2R25IoeHLKe48uHB8=" - "Bibata-Rainbow-Modern"; + home.pointerCursor = + let + getFrom = url: hash: name: { + gtk.enable = true; + x11.enable = true; + name = name; + size = 32; + package = + pkgs.runCommand "moveUp" { } '' + mkdir -p $out/share/icons + ln -s ${pkgs.fetchzip { + url = url; + hash = hash; + }} $out/share/icons/${name} + ''; + }; + in + getFrom + "https://github.com/ful1e5/Bibata_Cursor_Rainbow/releases/download/v1.1.2/Bibata-Rainbow-Modern.tar.gz" + "sha256-Ps+IKPwQoRwO9Mqxwc/1nHhdBT2R25IoeHLKe48uHB8=" + "Bibata-Rainbow-Modern"; } diff --git a/hosts/default/root.nix b/hosts/default/root.nix index 37c71bb..9692fb1 100644 --- a/hosts/default/root.nix +++ b/hosts/default/root.nix @@ -1,97 +1,97 @@ { config, pkgs, inputs, ... }: { - imports = [ - ../../modules/applications - ]; - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "root"; - home.homeDirectory = "/root"; + imports = [ + ../../modules/applications + ]; + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "root"; + home.homeDirectory = "/root"; - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = with pkgs; [ - file - unzip - zip + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + file + unzip + zip - dig - mtr + dig + mtr - kitty - lsd - ]; + kitty + lsd + ]; - modules = { - apps = { - enable = true; - git = { - name = "Noa Auto"; - email = "itepastra@gmail.com"; - }; - }; - }; + modules = { + apps = { + enable = true; + git = { + name = "Noa Auto"; + email = "itepastra@gmail.com"; + }; + }; + }; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - EDITOR = "nvim"; - TERM = "kitty"; - }; + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. If you don't want to manage your shell through Home + # Manager then you have to manually source 'hm-session-vars.sh' located at + # either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + TERM = "kitty"; + }; - xdg.userDirs.enable = true; - xdg.userDirs.createDirectories = true; + xdg.userDirs.enable = true; + xdg.userDirs.createDirectories = true; - dconf = { - enable = true; - settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - }; - }; - }; + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + }; + }; + }; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; } diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 82cc399..66a8a63 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -5,165 +5,166 @@ { modulesPath, pkgs, inputs, lib, nix-colors, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - inputs.home-manager.nixosModules.default - ./disk-config.nix - (modulesPath + "/installer/scan/not-detected.nix") - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.home-manager.nixosModules.default + ./disk-config.nix + (modulesPath + "/installer/scan/not-detected.nix") + (modulesPath + "/profiles/qemu-guest.nix") + ]; - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; - # LOVE me some blob - hardware.enableRedistributableFirmware = true; - hardware.enableAllFirmware = true; + # LOVE me some blob + hardware.enableRedistributableFirmware = true; + hardware.enableAllFirmware = true; - networking = { - hostName = "NoasServer"; # Define your hostname. - networkmanager.enable = true; # Easiest to use and most distros use this by default. - }; - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking = { + hostName = "NoasServer"; # Define your hostname. + networkmanager.enable = true; # Easiest to use and most distros use this by default. + }; + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - nix = { - settings = { - # auto optimise every so often - auto-optimise-store = true; - experimental-features = ["nix-command" "flakes"]; - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; - }; - gc.automatic = false; - }; + nix = { + settings = { + # auto optimise every so often + auto-optimise-store = true; + experimental-features = [ "nix-command" "flakes" ]; + substituters = [ "https://hyprland.cachix.org" ]; + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + }; + gc.automatic = false; + }; - # Set your time zone. - time.timeZone = "Europe/Amsterdam"; + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "nl_NL.UTF-8"; - LC_IDENTIFICATION = "nl_NL.UTF-8"; - LC_MEASUREMENT = "nl_NL.UTF-8"; - LC_MONETARY = "nl_NL.UTF-8"; - LC_NAME = "nl_NL.UTF-8"; - LC_NUMERIC = "nl_NL.UTF-8"; - LC_PAPER = "nl_NL.UTF-8"; - LC_TELEPHONE = "nl_NL.UTF-8"; - LC_TIME = "nl_NL.UTF-8"; - }; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "nl_NL.UTF-8"; + LC_IDENTIFICATION = "nl_NL.UTF-8"; + LC_MEASUREMENT = "nl_NL.UTF-8"; + LC_MONETARY = "nl_NL.UTF-8"; + LC_NAME = "nl_NL.UTF-8"; + LC_NUMERIC = "nl_NL.UTF-8"; + LC_PAPER = "nl_NL.UTF-8"; + LC_TELEPHONE = "nl_NL.UTF-8"; + LC_TIME = "nl_NL.UTF-8"; + }; + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.defaultUserShell = pkgs.zsh; - users.users = { - root = { - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINWtje7dGqyrBY7PLq6DANvUR6yfungQNsXGkTO6PP6/ noa@NoasPCArch" - ]; - }; - noa = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - firefox - tree - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINWtje7dGqyrBY7PLq6DANvUR6yfungQNsXGkTO6PP6/ noa@NoasPCArch" - ]; - hashedPassword = "$6$rounds=512400$g/s4dcRttXi4ux6c$Z6pKnhJXcWxv0TBSMtvJu5.piETdUBSgBVN7oDPKiQV.lbTYz1r.0XQLwMYxzcvaaX0DL6Iw/SEUTiC2M50wC/"; - }; - }; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.defaultUserShell = pkgs.zsh; + users.users = { + root = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINWtje7dGqyrBY7PLq6DANvUR6yfungQNsXGkTO6PP6/ noa@NoasPCArch" + ]; + }; + noa = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + firefox + tree + ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINWtje7dGqyrBY7PLq6DANvUR6yfungQNsXGkTO6PP6/ noa@NoasPCArch" + ]; + hashedPassword = "$6$rounds=512400$g/s4dcRttXi4ux6c$Z6pKnhJXcWxv0TBSMtvJu5.piETdUBSgBVN7oDPKiQV.lbTYz1r.0XQLwMYxzcvaaX0DL6Iw/SEUTiC2M50wC/"; + }; + }; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; + # Allow unfree packages + nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - sddm - git - zsh - ]; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + sddm + git + zsh + ]; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; - # Enable the OpenSSH daemon. - services.openssh.enable = true; - programs.zsh.enable = true; + # Enable the OpenSSH daemon. + services.openssh.enable = true; + programs.zsh.enable = true; - home-manager = { - extraSpecialArgs = { - inherit inputs; - inherit nix-colors; - }; - users = { - "noa" = import ./home.nix; - "root" = import ./root.nix; - }; - }; + home-manager = { + extraSpecialArgs = { + inherit inputs; + inherit nix-colors; + }; + users = { + "noa" = import ./home.nix; + "root" = import ./root.nix; + }; + }; - systemd.timers."update-from-flake" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "daily"; - Persistent = true; - }; - }; + systemd.timers."update-from-flake" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + }; + }; - systemd.services."update-from-flake" = { - path = with pkgs; [ - nixos-rebuild - ]; - script = ''nixos-rebuild switch --flake github:itepastra/nixconf''; - serviceConfig = { - Type = "oneshot"; - User = "root"; - }; - }; + systemd.services."update-from-flake" = { + path = with pkgs; [ + nixos-rebuild + ]; + script = ''nixos-rebuild switch --flake github:itepastra/nixconf''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how - # to actually do that. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "24.05"; # Did you read the comment? + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "24.05"; # Did you read the comment? } diff --git a/hosts/server/hardware-configuration.nix b/hosts/server/hardware-configuration.nix index 59d59c2..8befc5e 100644 --- a/hosts/server/hardware-configuration.nix +++ b/hosts/server/hardware-configuration.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" ]; diff --git a/hosts/server/home.nix b/hosts/server/home.nix index 2306f29..518cdfc 100644 --- a/hosts/server/home.nix +++ b/hosts/server/home.nix @@ -1,105 +1,105 @@ { config, pkgs, mineflake, inputs, ... }: { - imports = - [ - ../../modules/applications - ../../common/nvim/nvim.nix - ]; - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "noa"; - home.homeDirectory = "/home/noa"; + imports = + [ + ../../modules/applications + ../../common/nvim/nvim.nix + ]; + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "noa"; + home.homeDirectory = "/home/noa"; - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = with pkgs; [ - file - unzip - zip + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + file + unzip + zip - dig - mtr + dig + mtr - btop - lsd + btop + lsd - lm_sensors + lm_sensors - # Programming langs - go - nodejs - ]; + # Programming langs + go + nodejs + ]; - modules = { - apps.git = { - enable = true; - name = "Noa Aarts"; - email = "itepastra@gmail.com"; - }; - apps.zsh.enable = true; - }; + modules = { + apps.git = { + enable = true; + name = "Noa Aarts"; + email = "itepastra@gmail.com"; + }; + apps.zsh.enable = true; + }; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh - # + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. If you don't want to manage your shell through Home + # Manager then you have to manually source 'hm-session-vars.sh' located at + # either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh + # - home.sessionVariables = { - EDITOR = "nvim"; - }; + home.sessionVariables = { + EDITOR = "nvim"; + }; - xdg = { - enable = true; - }; + xdg = { + enable = true; + }; - xdg.userDirs = { - enable = true; - createDirectories = true; - }; + xdg.userDirs = { + enable = true; + createDirectories = true; + }; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; } diff --git a/hosts/server/root.nix b/hosts/server/root.nix index 4ab83b4..adc2a43 100644 --- a/hosts/server/root.nix +++ b/hosts/server/root.nix @@ -1,77 +1,77 @@ { config, pkgs, inputs, ... }: { - imports = - [ - ../../common/nvim/nvim.nix - ]; - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "root"; - home.homeDirectory = "/root"; + imports = + [ + ../../common/nvim/nvim.nix + ]; + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "root"; + home.homeDirectory = "/root"; - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = with pkgs; [ - file - unzip - zip + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + file + unzip + zip - dig - mtr + dig + mtr - lsd - ]; + lsd + ]; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - EDITOR = "nvim"; - }; + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. If you don't want to manage your shell through Home + # Manager then you have to manually source 'hm-session-vars.sh' located at + # either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + }; - xdg.userDirs.enable = true; - xdg.userDirs.createDirectories = true; + xdg.userDirs.enable = true; + xdg.userDirs.createDirectories = true; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; } diff --git a/modules/applications/default.nix b/modules/applications/default.nix index 959de8f..15eed1b 100644 --- a/modules/applications/default.nix +++ b/modules/applications/default.nix @@ -1,28 +1,28 @@ { lib, config, pkgs, ... }: let - cfg = config.modules.apps; + cfg = config.modules.apps; in { - options.modules.apps = { - enable = lib.mkEnableOption "enable desktop applications"; - }; + options.modules.apps = { + enable = lib.mkEnableOption "enable desktop applications"; + }; - imports = [ - ./firefox.nix - ./git.nix - ./kitty.nix - ./zsh.nix - ]; + imports = [ + ./firefox.nix + ./git.nix + ./kitty.nix + ./zsh.nix + ]; - config = lib.mkIf cfg.enable { - modules.apps = { - firefox.enable = true; - git.enable = true; - kitty.enable = true; - zsh = { - enable = true; - enableAliases = true; - }; - }; - }; + config = lib.mkIf cfg.enable { + modules.apps = { + firefox.enable = true; + git.enable = true; + kitty.enable = true; + zsh = { + enable = true; + enableAliases = true; + }; + }; + }; } diff --git a/modules/applications/firefox.nix b/modules/applications/firefox.nix index 705d72e..e8614fb 100644 --- a/modules/applications/firefox.nix +++ b/modules/applications/firefox.nix @@ -1,17 +1,17 @@ { lib, config, pkgs, ... }: -let - cfg = config.modules.apps.firefox; +let + cfg = config.modules.apps.firefox; in { - options.modules.apps.firefox = { - enable = lib.mkEnableOption "enable firefox"; - }; + options.modules.apps.firefox = { + enable = lib.mkEnableOption "enable firefox"; + }; - config = lib.mkIf cfg.enable { - programs.firefox = { - enable = true; - # TODO: add some default firefox settings - }; - }; + config = lib.mkIf cfg.enable { + programs.firefox = { + enable = true; + # TODO: add some default firefox settings + }; + }; } diff --git a/modules/applications/git.nix b/modules/applications/git.nix index 190494f..2a5a798 100644 --- a/modules/applications/git.nix +++ b/modules/applications/git.nix @@ -1,34 +1,34 @@ { lib, config, pkgs, ... }: -let - cfg = config.modules.apps.git; +let + cfg = config.modules.apps.git; in { - options.modules.apps.git = { - enable = lib.mkEnableOption "enable git"; - name = lib.mkOption { - example = "Jill Doe"; - description = "the git user Name"; - type = lib.types.str; - }; - email = lib.mkOption { - example = "jilldoe@test.local"; - description = "the git user Name"; - type = lib.types.str; - }; - }; + options.modules.apps.git = { + enable = lib.mkEnableOption "enable git"; + name = lib.mkOption { + example = "Jill Doe"; + description = "the git user Name"; + type = lib.types.str; + }; + email = lib.mkOption { + example = "jilldoe@test.local"; + description = "the git user Name"; + type = lib.types.str; + }; + }; - config = lib.mkIf cfg.enable { - programs.git = { - enable = true; - userName = cfg.name; - userEmail = cfg.email; - extraConfig = { - init = { defaultBranch = "main"; }; - safe.directory = "/etc/nixos"; - pull.rebase = false; - }; - }; - }; + config = lib.mkIf cfg.enable { + programs.git = { + enable = true; + userName = cfg.name; + userEmail = cfg.email; + extraConfig = { + init = { defaultBranch = "main"; }; + safe.directory = "/etc/nixos"; + pull.rebase = false; + }; + }; + }; } diff --git a/modules/applications/kitty.nix b/modules/applications/kitty.nix index 90f5906..3ff0cb4 100644 --- a/modules/applications/kitty.nix +++ b/modules/applications/kitty.nix @@ -1,19 +1,19 @@ { lib, config, pkgs, ... }: -let - cfg = config.modules.apps.kitty; +let + cfg = config.modules.apps.kitty; in { - options.modules.apps.kitty = { - enable = lib.mkEnableOption "enable the kitty terminal emulator"; - }; + options.modules.apps.kitty = { + enable = lib.mkEnableOption "enable the kitty terminal emulator"; + }; - config = lib.mkIf cfg.enable { - programs.kitty = { - enable = true; - settings = { - confirm_os_window_close = 0; - }; - shellIntegration.enableZshIntegration = true; - }; - }; + config = lib.mkIf cfg.enable { + programs.kitty = { + enable = true; + settings = { + confirm_os_window_close = 0; + }; + shellIntegration.enableZshIntegration = true; + }; + }; } diff --git a/modules/applications/zsh.nix b/modules/applications/zsh.nix index 3cad395..b429b69 100644 --- a/modules/applications/zsh.nix +++ b/modules/applications/zsh.nix @@ -1,39 +1,39 @@ { lib, config, pkgs, ... }: -let - cfg = config.modules.apps.zsh; +let + cfg = config.modules.apps.zsh; in { - options.modules.apps.zsh = { - enable = lib.mkEnableOption "enable zsh with oh-my-zsh"; - enableAliases = lib.mkEnableOption "whether to enable shellAliases"; - }; + options.modules.apps.zsh = { + enable = lib.mkEnableOption "enable zsh with oh-my-zsh"; + enableAliases = lib.mkEnableOption "whether to enable shellAliases"; + }; - config = lib.mkIf cfg.enable { - programs.direnv = { - enable=true; - enableZshIntegration=true; - nix-direnv.enable=true; - }; - programs.zsh = { - enable=true; - shellAliases = lib.mkIf cfg.enableAliases { - ll = "lsd -l"; - lt = "lsd -l --tree"; - update = "nix flake update --commit-lock-file $HOME/nixos && sudo nixos-rebuild switch --flake $HOME/nixos"; - }; - initExtra = '' - [[ ! -r /home/noa/.opam/opam-init/init.zsh ]] || source /home/noa/.opam/opam-init/init.zsh > /dev/null 2> /dev/null - ''; - history = { - path = "${config.xdg.dataHome}/zsh/history"; - size = 10000; - }; - oh-my-zsh = { - enable = true; - plugins = [ "git" ]; - theme = "frisk"; - }; - }; - }; + config = lib.mkIf cfg.enable { + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; + programs.zsh = { + enable = true; + shellAliases = lib.mkIf cfg.enableAliases { + ll = "lsd -l"; + lt = "lsd -l --tree"; + update = "nix flake update --commit-lock-file $HOME/nixos && sudo nixos-rebuild switch --flake $HOME/nixos"; + }; + initExtra = '' + [[ ! -r /home/noa/.opam/opam-init/init.zsh ]] || source /home/noa/.opam/opam-init/init.zsh > /dev/null 2> /dev/null + ''; + history = { + path = "${config.xdg.dataHome}/zsh/history"; + size = 10000; + }; + oh-my-zsh = { + enable = true; + plugins = [ "git" ]; + theme = "frisk"; + }; + }; + }; } diff --git a/modules/automapaper/default.nix b/modules/automapaper/default.nix index d4bd16f..500ef3b 100644 --- a/modules/automapaper/default.nix +++ b/modules/automapaper/default.nix @@ -1,185 +1,190 @@ { lib, config, pkgs, inputs, ... }: -let - cfg = config.modules.automapaper; +let + cfg = config.modules.automapaper; in { - options.modules.automapaper = { - enable = lib.mkEnableOption "enable automapaper"; - hyprland = lib.mkEnableOption "enable hyprland exec-once integration"; - configurations = lib.mkOption { - description = "automapaper configurations per monitor"; - type = with lib.types; attrsOf (submodule { - options = { - init = lib.mkOption { - type = str; - description = "the shader executed to get the state for the initialisation, and re-initialisation steps"; - }; - state = lib.mkOption { - type = str; # TODO: make filepath possible as well - description = "the shader executed to increment the state to the next generation"; - }; - display = lib.mkOption { - type = str; # TODO: make filepath possible as well - description = "the shader executed to display the state to the monitor"; - }; - horizontal = lib.mkOption { - type = int; # TODO: make filepath possible as well - description = "the amount of horizontal cells in the state"; - }; - vertical = lib.mkOption { - type = int; - description = "the amount of vertical cells in the state"; - }; - tps = lib.mkOption { - type = int; - description = "the target amount of ticks to simulate each second"; - }; - cycles = lib.mkOption { - type = int; - description = "the amount of state increments before the init shader is called again"; - }; - frames_per_tick = lib.mkOption { - type = int; - description = "the amount of times to call the display shader for each iteration of the state shader"; - }; - }; - }); - }; - }; + options.modules.automapaper = { + enable = lib.mkEnableOption "enable automapaper"; + hyprland = lib.mkEnableOption "enable hyprland exec-once integration"; + configurations = lib.mkOption { + description = "automapaper configurations per monitor"; + type = with lib.types; attrsOf (submodule { + options = { + init = lib.mkOption { + type = str; + description = "the shader executed to get the state for the initialisation, and re-initialisation steps"; + }; + state = lib.mkOption { + type = str; # TODO: make filepath possible as well + description = "the shader executed to increment the state to the next generation"; + }; + display = lib.mkOption { + type = str; # TODO: make filepath possible as well + description = "the shader executed to display the state to the monitor"; + }; + horizontal = lib.mkOption { + type = int; # TODO: make filepath possible as well + description = "the amount of horizontal cells in the state"; + }; + vertical = lib.mkOption { + type = int; + description = "the amount of vertical cells in the state"; + }; + tps = lib.mkOption { + type = int; + description = "the target amount of ticks to simulate each second"; + }; + cycles = lib.mkOption { + type = int; + description = "the amount of state increments before the init shader is called again"; + }; + frames_per_tick = lib.mkOption { + type = int; + description = "the amount of times to call the display shader for each iteration of the state shader"; + }; + }; + }); + }; + }; - config = lib.mkIf cfg.enable ( - let - displays = lib.attrsets.mapAttrs (displayName: displayConfig: - let - init = builtins.toFile "init.frag" displayConfig.init; - state = builtins.toFile "state.frag" displayConfig.state; - display = builtins.toFile "display.frag" displayConfig.display; - in - '' - [display] - name="${displayName}" - horizontal=${builtins.toString displayConfig.horizontal} - vertical=${builtins.toString displayConfig.vertical} - tps=${builtins.toString displayConfig.tps} - state_frag="${state}" - init_frag="${init}" - display_frag="${display}" - cycles=${builtins.toString displayConfig.cycles} - frames_per_tick=${builtins.toString displayConfig.frames_per_tick} - '' - ) cfg.configurations; - in { - modules.automapaper.configurations = - let - conf = { - horizontal = 256; - vertical = 144; - tps = 30; - init = '' - #version 310 es - precision highp float; + config = lib.mkIf cfg.enable ( + let + displays = lib.attrsets.mapAttrs + (displayName: displayConfig: + let + init = builtins.toFile "init.frag" displayConfig.init; + state = builtins.toFile "state.frag" displayConfig.state; + display = builtins.toFile "display.frag" displayConfig.display; + in + '' + [display] + name="${displayName}" + horizontal=${builtins.toString displayConfig.horizontal} + vertical=${builtins.toString displayConfig.vertical} + tps=${builtins.toString displayConfig.tps} + state_frag="${state}" + init_frag="${init}" + display_frag="${display}" + cycles=${builtins.toString displayConfig.cycles} + frames_per_tick=${builtins.toString displayConfig.frames_per_tick} + '' + ) + cfg.configurations; + in + { + modules.automapaper.configurations = + let + conf = { + horizontal = 256; + vertical = 144; + tps = 30; + init = '' + #version 310 es + precision highp float; - uniform float time; - uniform vec2 resolution; + uniform float time; + uniform vec2 resolution; - out vec4 stateColor; + out vec4 stateColor; - float PHI = 1.61803398874989484820459; // Φ = Golden Ratio + float PHI = 1.61803398874989484820459; // Φ = Golden Ratio - float gold_noise(in vec2 xy, in float seed){ - return fract(tan(distance(xy*PHI, xy)*seed)*xy.x); - } + float gold_noise(in vec2 xy, in float seed){ + return fract(tan(distance(xy*PHI, xy)*seed)*xy.x); + } - void main( void ) { + void main( void ) { - vec2 position = gl_FragCoord.xy; - float color = gold_noise(position.xy, fract(time)); + vec2 position = gl_FragCoord.xy; + float color = gold_noise(position.xy, fract(time)); - stateColor = vec4(step(0.3, color), 0,0,step(0.3, color)); - }''; - state= '' - #version 310 es - precision highp float; + stateColor = vec4(step(0.3, color), 0,0,step(0.3, color)); + }''; + state = '' + #version 310 es + precision highp float; - uniform sampler2D state; - uniform vec2 scale; + uniform sampler2D state; + uniform vec2 scale; - out vec4 stateColor; + out vec4 stateColor; - vec4 get(int x, int y) { - return texture(state, (gl_FragCoord.xy + vec2(x, y)) / scale); - } + vec4 get(int x, int y) { + return texture(state, (gl_FragCoord.xy + vec2(x, y)) / scale); + } - void main() { - int sum = int(get(-1, -1).r + - get(-1, 0).r + - get(-1, 1).r + - get( 0, -1).r + - get( 0, 1).r + - get( 1, -1).r + - get( 1, 0).r + - get( 1, 1).r); - vec4 current = get(0,0); - if (sum == 3) { - stateColor.r = 1.0; - stateColor.g = 1.0; - } else if (sum == 2) { - stateColor = current; - if (current.r == 0.0) { - stateColor.g = max(current.g - 0.01, 0.0); - } - } else { - stateColor = vec4(0.0, max(current.g - 0.01, 0.0), 0.0, 1.0); - } + void main() { + int sum = int(get(-1, -1).r + + get(-1, 0).r + + get(-1, 1).r + + get( 0, -1).r + + get( 0, 1).r + + get( 1, -1).r + + get( 1, 0).r + + get( 1, 1).r); + vec4 current = get(0,0); + if (sum == 3) { + stateColor.r = 1.0; + stateColor.g = 1.0; + } else if (sum == 2) { + stateColor = current; + if (current.r == 0.0) { + stateColor.g = max(current.g - 0.01, 0.0); + } + } else { + stateColor = vec4(0.0, max(current.g - 0.01, 0.0), 0.0, 1.0); + } - }''; - display = '' - #version 310 es - precision highp float; + }''; + display = '' + #version 310 es + precision highp float; - uniform sampler2D tex2D; - uniform sampler2D old2D; - uniform ivec2 resolution; - uniform float frame_part; + uniform sampler2D tex2D; + uniform sampler2D old2D; + uniform ivec2 resolution; + uniform float frame_part; - in highp vec2 texCoords; - out vec4 stateColor; + in highp vec2 texCoords; + out vec4 stateColor; - const vec4 bgColor = vec4(38.0/255.0, 5.0/255.0, 46.0/255.0, 1.0); // #26052e - const vec4 fgColor = vec4(148.0/255.0, 15.0/255.0, 173.0/255.0, 1.0); // #950fad + const vec4 bgColor = vec4(38.0/255.0, 5.0/255.0, 46.0/255.0, 1.0); // #26052e + const vec4 fgColor = vec4(148.0/255.0, 15.0/255.0, 173.0/255.0, 1.0); // #950fad - void main() { - vec2 canvasSize = vec2(textureSize(tex2D, 0)); - vec4 state = texture(tex2D, texCoords); - vec4 ostate = texture(old2D, texCoords); + void main() { + vec2 canvasSize = vec2(textureSize(tex2D, 0)); + vec4 state = texture(tex2D, texCoords); + vec4 ostate = texture(old2D, texCoords); - vec2 localCoords = fract(gl_FragCoord.xy / vec2(resolution) * canvasSize); - localCoords = localCoords - 0.5; - float dist = sqrt(dot(localCoords, localCoords)); + vec2 localCoords = fract(gl_FragCoord.xy / vec2(resolution) * canvasSize); + localCoords = localCoords - 0.5; + float dist = sqrt(dot(localCoords, localCoords)); - float size = smoothstep(0.0, 1.0, pow(mix(ostate.g,state.g, frame_part), 3.0)) * 0.35; - float mask = 1.0 - step(size, dist); + float size = smoothstep(0.0, 1.0, pow(mix(ostate.g,state.g, frame_part), 3.0)) * 0.35; + float mask = 1.0 - step(size, dist); - float brightness = mix(ostate.r,state.r, frame_part) + 0.2 * pow(mix(ostate.g,state.g, frame_part), 3.0); - stateColor = mix(bgColor, fgColor, brightness * mask); - }''; - cycles = 2500; - frames_per_tick = 1; - }; - in - { - "DP-3" = conf; - "DP-2" = conf; - }; - wayland.windowManager.hyprland.settings.exec-once = lib.mkIf cfg.hyprland ( - lib.mapAttrsToList (name: config: - "${ + float brightness = mix(ostate.r,state.r, frame_part) + 0.2 * pow(mix(ostate.g,state.g, frame_part), 3.0); + stateColor = mix(bgColor, fgColor, brightness * mask); + }''; + cycles = 2500; + frames_per_tick = 1; + }; + in + { + "DP-3" = conf; + "DP-2" = conf; + }; + wayland.windowManager.hyprland.settings.exec-once = lib.mkIf cfg.hyprland ( + lib.mapAttrsToList + (name: config: + "${ inputs.automapaper.packages.${pkgs.system}.default }/bin/automapaper -C ${ builtins.toFile "${name}.toml" config - }") displays - ); - } - ); + }") + displays + ); + } + ); } diff --git a/modules/dunst.nix b/modules/dunst.nix index 052f450..3a8d1ef 100644 --- a/modules/dunst.nix +++ b/modules/dunst.nix @@ -1,14 +1,14 @@ { config, lib, pkgs, inputs, ... }: let - cfg = config.modules.dunst; + cfg = config.modules.dunst; in { - options.modules.dunst = { - enable = lib.mkEnableOption "enable dunst for notifications"; - }; - config = lib.mkIf cfg.enable { - services.dunst = { - enable = true; - }; - }; + options.modules.dunst = { + enable = lib.mkEnableOption "enable dunst for notifications"; + }; + config = lib.mkIf cfg.enable { + services.dunst = { + enable = true; + }; + }; } diff --git a/modules/games/default.nix b/modules/games/default.nix index d137bb0..c3c6e09 100644 --- a/modules/games/default.nix +++ b/modules/games/default.nix @@ -1,18 +1,18 @@ { lib, config, pkgs, ... }: let - cfg = config.modules.games; + cfg = config.modules.games; in { - options.modules.games = { - enable = lib.mkEnableOption "enable gaming services"; - minecraft.enable = lib.mkEnableOption "enable minecraft"; - }; + options.modules.games = { + enable = lib.mkEnableOption "enable gaming services"; + minecraft.enable = lib.mkEnableOption "enable minecraft"; + }; - imports = [ - ./minecraft.nix - ]; + imports = [ + ./minecraft.nix + ]; - config = lib.mkIf cfg.enable { - modules.games.minecraft.enable = true; - }; + config = lib.mkIf cfg.enable { + modules.games.minecraft.enable = true; + }; } diff --git a/modules/games/minecraft.nix b/modules/games/minecraft.nix index 91e9770..e94c2a2 100644 --- a/modules/games/minecraft.nix +++ b/modules/games/minecraft.nix @@ -1,11 +1,11 @@ { lib, config, pkgs, ... }: let - cfg = config.modules.games.minecraft; + cfg = config.modules.games.minecraft; in { - config = lib.mkIf cfg.enable { - home.packages = [ - (pkgs.prismlauncher.override{withWaylandGLFW=true;}) - ]; - }; + config = lib.mkIf cfg.enable { + home.packages = [ + (pkgs.prismlauncher.override { withWaylandGLFW = true; }) + ]; + }; } diff --git a/modules/games/steam.nix b/modules/games/steam.nix index 96cc8c5..cc8d164 100644 --- a/modules/games/steam.nix +++ b/modules/games/steam.nix @@ -1,33 +1,33 @@ { lib, config, pkgs, ... }: { - options.modules.games.steam = { - enable = lib.mkEnableOption "enable steam"; - }; - config = lib.mkIf config.modules.games.steam.enable { - programs = { - steam = { - enable = true; - remotePlay.openFirewall = true; - gamescopeSession.enable = true; - dedicatedServer.openFirewall = true; - - package = pkgs.steam.override { - extraPkgs = pkgs: with pkgs; [ - xorg.libXcursor - xorg.libXi - xorg.libXinerama - xorg.libXScrnSaver - libpng - libpulseaudio - libvorbis - stdenv.cc.cc.lib - libkrb5 - keyutils - ]; - }; - }; + options.modules.games.steam = { + enable = lib.mkEnableOption "enable steam"; + }; + config = lib.mkIf config.modules.games.steam.enable { + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; + gamescopeSession.enable = true; + dedicatedServer.openFirewall = true; - gamemode.enable = true; - }; - }; + package = pkgs.steam.override { + extraPkgs = pkgs: with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + ]; + }; + }; + + gamemode.enable = true; + }; + }; } diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 9e0cf9b..88fe647 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -1,5 +1,5 @@ { config, lib, pkgs, inputs, ... }: -let +let cfg = config.modules.hyprland; in { @@ -30,127 +30,130 @@ in config = lib.mkIf cfg.enable { modules = { automapaper = { - enable = lib.mkDefault true; - hyprland = cfg.enable; + enable = lib.mkDefault true; + hyprland = cfg.enable; }; waybar = { - modules = { - left = [ "hyprland/workspaces" "tray" "hyprland/window" ]; - center = [ "clock" ]; + modules = { + left = [ "hyprland/workspaces" "tray" "hyprland/window" ]; + center = [ "clock" ]; right = [ "custom/vpn" "wireplumber" "network" "cpu" "memory" "custom/poweroff" ]; - }; - enable = lib.mkDefault true; - }; - wofi.enable = lib.mkDefault true; - dunst.enable = lib.mkDefault true; - }; - # these are necessary for the config to function correctly - home.packages = with pkgs; [ - # I always want these with hyprland anyways - libnotify # to enable the notify-send command - wl-clipboard # wl-copy and wl-paste + }; + enable = lib.mkDefault true; + }; + wofi.enable = lib.mkDefault true; + dunst.enable = lib.mkDefault true; + }; + # these are necessary for the config to function correctly + home.packages = with pkgs; [ + # I always want these with hyprland anyways + libnotify # to enable the notify-send command + wl-clipboard # wl-copy and wl-paste - playerctl - ]; + playerctl + ]; - xdg.portal.configPackages = [ cfg.package ]; + xdg.portal.configPackages = [ cfg.package ]; - services.playerctld.enable = true; - wayland.windowManager.hyprland = { - enable = true; - package = cfg.package; - settings = { - monitor = [ - "DP-3,2560x1440@360,2560x0,1" - "DP-2,2560x1440@144,0x0,1" - ]; - windowrulev2 = [ - "opacity 1.0 0.6,class:^(kitty)$" - "stayfocused,class:^(wofi)$" - ]; - env = [ - "WLR_NO_HARDWARE_CURSORS,1" - ]; - exec-once = [ - "${pkgs.waybar}/bin/waybar" - "${pkgs.dunst}/bin/dunst" - "${cfg.package}/bin/hyprctl dispatcher focusmonitor 1" - "${pkgs.hypridle}/bin/hypridle" - ]; - general = { - sensitivity = "1.2"; - gaps_in = "2"; - gaps_out = "3"; - border_size = "3"; - "col.active_border"="0xff950fad"; - "col.inactive_border"="0xff26052e"; - }; - misc = { - key_press_enables_dpms = true; - }; - decoration = { - rounding = "6"; - active_opacity = "1"; - inactive_opacity = "1"; - }; - workspace = [ - "DP-3,1" - "DP-2,2" - ]; - animations = { - enabled = "1"; - animation = [ - "windows,1,2,default" - "border,1,10,default" - "fade,0,5,default" - "workspaces,1,4,default" - ]; - }; - "$mod" = "SUPER"; - bind = [ - "$mod,Return,exec,${cfg.terminal}/bin/${cfg.terminal.pname}" - "$mod,tab,cyclenext" - "SUPERSHIFT,Q,killactive" - "$mod,SPACE,exec,wofi-launch" - "$mod,P,exec,wofi-power" - "SUPERSHIFT,m,exit" - "$mod,H,movefocus,l" - "$mod,J,movefocus,u" - "$mod,K,movefocus,d" - "$mod,L,movefocus,r" - "SUPERSHIFT,H,movewindow,l" - "SUPERSHIFT,J,movewindow,u" - "SUPERSHIFT,K,movewindow,d" - "SUPERSHIFT,L,movewindow,r" - "$mod,F,togglefloating" - "$mod,X,togglespecialworkspace" - "SUPERSHIFT,X,movetoworkspace,special" - "SUPERSHIFT,S,exec,${pkgs.hyprshot}/bin/hyprshot -m region --clipboard-only" - "$mod,f11,fullscreen,0" - ",XF86AudioLowerVolume,exec,${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 1%-" - ",XF86AudioRaiseVolume,exec,${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 1%+" - ",XF86AudioMute,exec,${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_SINK@ toggle" - ",XF86AudioPlay,exec,${pkgs.playerctl}/bin/playerctl play-pause" - ",XF86AudioPrev,exec,${pkgs.playerctl}/bin/playerctl previous" - ",XF86AudioNext,exec,${pkgs.playerctl}/bin/playerctl next" - ] - ++ ( - builtins.concatLists (builtins.genList ( - x: let - ws = builtins.toString (x); - in [ - "$mod,${ws},workspace,${ws}" - "ALT,${ws},movetoworkspace,${ws}" - ] - ) - 10) - ); - bindm = [ - "$mod,mouse:272,movewindow" - "$mod,mouse:273,resizewindow" - ]; - }; + services.playerctld.enable = true; + wayland.windowManager.hyprland = { + enable = true; + package = cfg.package; + settings = { + monitor = [ + "DP-3,2560x1440@360,2560x0,1" + "DP-2,2560x1440@144,0x0,1" + ]; + windowrulev2 = [ + "opacity 1.0 0.6,class:^(kitty)$" + "stayfocused,class:^(wofi)$" + ]; + env = [ + "WLR_NO_HARDWARE_CURSORS,1" + ]; + exec-once = [ + "${pkgs.waybar}/bin/waybar" + "${pkgs.dunst}/bin/dunst" + "${cfg.package}/bin/hyprctl dispatcher focusmonitor 1" + "${pkgs.hypridle}/bin/hypridle" + ]; + general = { + sensitivity = "1.2"; + gaps_in = "2"; + gaps_out = "3"; + border_size = "3"; + "col.active_border" = "0xff950fad"; + "col.inactive_border" = "0xff26052e"; + }; + misc = { + key_press_enables_dpms = true; + }; + decoration = { + rounding = "6"; + active_opacity = "1"; + inactive_opacity = "1"; + }; + workspace = [ + "DP-3,1" + "DP-2,2" + ]; + animations = { + enabled = "1"; + animation = [ + "windows,1,2,default" + "border,1,10,default" + "fade,0,5,default" + "workspaces,1,4,default" + ]; + }; + "$mod" = "SUPER"; + bind = [ + "$mod,Return,exec,${cfg.terminal}/bin/${cfg.terminal.pname}" + "$mod,tab,cyclenext" + "SUPERSHIFT,Q,killactive" + "$mod,SPACE,exec,wofi-launch" + "$mod,P,exec,wofi-power" + "SUPERSHIFT,m,exit" + "$mod,H,movefocus,l" + "$mod,J,movefocus,u" + "$mod,K,movefocus,d" + "$mod,L,movefocus,r" + "SUPERSHIFT,H,movewindow,l" + "SUPERSHIFT,J,movewindow,u" + "SUPERSHIFT,K,movewindow,d" + "SUPERSHIFT,L,movewindow,r" + "$mod,F,togglefloating" + "$mod,X,togglespecialworkspace" + "SUPERSHIFT,X,movetoworkspace,special" + "SUPERSHIFT,S,exec,${pkgs.hyprshot}/bin/hyprshot -m region --clipboard-only" + "$mod,f11,fullscreen,0" + ",XF86AudioLowerVolume,exec,${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 1%-" + ",XF86AudioRaiseVolume,exec,${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 1%+" + ",XF86AudioMute,exec,${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_SINK@ toggle" + ",XF86AudioPlay,exec,${pkgs.playerctl}/bin/playerctl play-pause" + ",XF86AudioPrev,exec,${pkgs.playerctl}/bin/playerctl previous" + ",XF86AudioNext,exec,${pkgs.playerctl}/bin/playerctl next" + ] + ++ ( + builtins.concatLists (builtins.genList + ( + x: + let + ws = builtins.toString (x); + in + [ + "$mod,${ws},workspace,${ws}" + "ALT,${ws},movetoworkspace,${ws}" + ] + ) + 10) + ); + bindm = [ + "$mod,mouse:272,movewindow" + "$mod,mouse:273,resizewindow" + ]; + }; }; }; } diff --git a/modules/waybar/allmodules.nix b/modules/waybar/allmodules.nix index ebe8b5a..e16be41 100644 --- a/modules/waybar/allmodules.nix +++ b/modules/waybar/allmodules.nix @@ -1,4 +1,4 @@ -config: - [ "hyprland/workspaces" "tray" "hyprland/window" ] ++ - [ "clock" ] ++ - [ "custom/vpn" "wireplumber" "network" "cpu" "memory" "custom/poweroff" ] +config: +[ "hyprland/workspaces" "tray" "hyprland/window" ] ++ +[ "clock" ] ++ +[ "custom/vpn" "wireplumber" "network" "cpu" "memory" "custom/poweroff" ] diff --git a/modules/waybar/clock.nix b/modules/waybar/clock.nix index 157c320..f6d6607 100644 --- a/modules/waybar/clock.nix +++ b/modules/waybar/clock.nix @@ -1,5 +1,5 @@ { lib, config, pkgs, ... }: -let +let name = "clock"; in { diff --git a/modules/waybar/cpu.nix b/modules/waybar/cpu.nix index cf20ba2..18c3b37 100644 --- a/modules/waybar/cpu.nix +++ b/modules/waybar/cpu.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "cpu"; in { diff --git a/modules/waybar/default.nix b/modules/waybar/default.nix index 757f380..2c30d83 100644 --- a/modules/waybar/default.nix +++ b/modules/waybar/default.nix @@ -12,15 +12,15 @@ in modules = { left = lib.mkOption { type = with lib.types; listOf (enum [ ]); - default = []; + default = [ ]; }; center = lib.mkOption { type = with lib.types; listOf (enum [ ]); - default = []; + default = [ ]; }; right = lib.mkOption { type = with lib.types; listOf (enum [ ]); - default = []; + default = [ ]; }; }; }; diff --git a/modules/waybar/memory.nix b/modules/waybar/memory.nix index e5171bc..ca98ede 100644 --- a/modules/waybar/memory.nix +++ b/modules/waybar/memory.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "memory"; in { diff --git a/modules/waybar/namedmodules.nix b/modules/waybar/namedmodules.nix index 6d8b7fa..c43ab15 100644 --- a/modules/waybar/namedmodules.nix +++ b/modules/waybar/namedmodules.nix @@ -1,4 +1,4 @@ config: - builtins.map - (n: {name = n; value = {enable = true;}; }) - (import ./allmodules.nix config) +builtins.map + (n: { name = n; value = { enable = true; }; }) + (import ./allmodules.nix config) diff --git a/modules/waybar/network.nix b/modules/waybar/network.nix index 1c10421..e042e2e 100644 --- a/modules/waybar/network.nix +++ b/modules/waybar/network.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "network"; in { diff --git a/modules/waybar/power.nix b/modules/waybar/power.nix index 67d571e..2093ca0 100644 --- a/modules/waybar/power.nix +++ b/modules/waybar/power.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "custom/poweroff"; in { diff --git a/modules/waybar/temperature.nix b/modules/waybar/temperature.nix index 0534414..740680a 100644 --- a/modules/waybar/temperature.nix +++ b/modules/waybar/temperature.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "temperature"; in { @@ -13,7 +13,7 @@ in hwmon-path = "/sys/class/hwmon/hwmon3/temp1_input"; critical-threshold = 80; format = "{temperatureC}°C {icon}"; - format-icons = ["" "" ""]; + format-icons = [ "" "" "" ]; }; }; } diff --git a/modules/waybar/tray.nix b/modules/waybar/tray.nix index f87c976..6483693 100644 --- a/modules/waybar/tray.nix +++ b/modules/waybar/tray.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "tray"; in { diff --git a/modules/waybar/vpn.nix b/modules/waybar/vpn.nix index 3991fd3..1173634 100644 --- a/modules/waybar/vpn.nix +++ b/modules/waybar/vpn.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "custom/vpn"; in { diff --git a/modules/waybar/window.nix b/modules/waybar/window.nix index 86c3e49..d131b9b 100644 --- a/modules/waybar/window.nix +++ b/modules/waybar/window.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "hyprland/window"; in { diff --git a/modules/waybar/wireplumber.nix b/modules/waybar/wireplumber.nix index 4c6e1bc..4343c3a 100644 --- a/modules/waybar/wireplumber.nix +++ b/modules/waybar/wireplumber.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "wireplumber"; in { @@ -12,7 +12,7 @@ in format = "{volume}% {icon}"; format-muted = ""; on-click = "helvum"; - format-icons = ["" "" ""]; + format-icons = [ "" "" "" ]; }; }; } diff --git a/modules/waybar/workspaces.nix b/modules/waybar/workspaces.nix index 8901bcc..6a5f05f 100644 --- a/modules/waybar/workspaces.nix +++ b/modules/waybar/workspaces.nix @@ -1,5 +1,5 @@ { lib, config, ... }: -let +let name = "hyprland/workspaces"; in { diff --git a/modules/wofi.nix b/modules/wofi.nix index 42a5247..160dbc1 100644 --- a/modules/wofi.nix +++ b/modules/wofi.nix @@ -1,126 +1,124 @@ { lib, config, pkgs, inputs, ... }: let - cfg = config.modules.wofi; + cfg = config.modules.wofi; in { - options.modules.wofi = { - enable = lib.mkEnableOption "enable wofi app launcher"; - }; - imports = [ - ../common/colors.nix - ]; - config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ - (writeShellScriptBin "wofi-launch" '' - ${wofi}/bin/wofi --show drun - '') - (writeShellScriptBin "wofi-power" '' - lock="Lock" - poweroff="Poweroff" - reboot="Reboot" - sleep="Suspend" - - selected_option=$(echo -e "$lock\n$sleep\n$reboot\n$poweroff" | wofi --dmenu -i -p "Powermenu") + options.modules.wofi = { + enable = lib.mkEnableOption "enable wofi app launcher"; + }; + imports = [ + ../common/colors.nix + ]; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + (writeShellScriptBin "wofi-launch" '' + ${wofi}/bin/wofi --show drun + '') + (writeShellScriptBin "wofi-power" '' + lock="Lock" + poweroff="Poweroff" + reboot="Reboot" + sleep="Suspend" + + selected_option=$(echo -e "$lock\n$sleep\n$reboot\n$poweroff" | wofi --dmenu -i -p "Powermenu") - if [ "$selected_option" == "$lock" ] - then - echo "lock" - swaylock - elif [ "$selected_option" == "$poweroff" ] - then - echo "poweroff" - poweroff - elif [ "$selected_option" == "$reboot" ] - then - echo "reboot" - reboot - elif [ "$selected_option" == "$sleep" ] - then - echo "sleep" - suspend - else - echo "No match" - fi - '') - ]; - programs.wofi = { - enable = true; - settings = { - - }; - style = '' - * { - outline: none; - outline-style: none; - } + if [ "$selected_option" == "$lock" ] + then + echo "lock" + swaylock + elif [ "$selected_option" == "$poweroff" ] + then + echo "poweroff" + poweroff + elif [ "$selected_option" == "$reboot" ] + then + echo "reboot" + reboot + elif [ "$selected_option" == "$sleep" ] + then + echo "sleep" + suspend + else + echo "No match" + fi + '') + ]; + programs.wofi = { + enable = true; + settings = { }; + style = '' + * { + outline: none; + outline-style: none; + } - #window { - margin: 10px; - border: none; - background-color: #${config.colorScheme.palette.background}; - border-radius: 10px; - font-family: - JetBrains Mono NF, - monospace; - font-weight: bold; - font-size: 14px; - } + #window { + margin: 10px; + border: none; + background-color: #${config.colorScheme.palette.background}; + border-radius: 10px; + font-family: + JetBrains Mono NF, + monospace; + font-weight: bold; + font-size: 14px; + } - #outer-box { - margin: 10px; - border: 2px #${config.colorScheme.palette.backgroundMuted}; - border-radius: 10px; - background-color: transparent; - } + #outer-box { + margin: 10px; + border: 2px #${config.colorScheme.palette.backgroundMuted}; + border-radius: 10px; + background-color: transparent; + } - #input { - border: none; - border-radius: 10px; - margin-left: 2px; - color: #${config.colorScheme.palette.info}; - outline-style: none; - background-color: #${config.colorScheme.palette.background}; - } + #input { + border: none; + border-radius: 10px; + margin-left: 2px; + color: #${config.colorScheme.palette.info}; + outline-style: none; + background-color: #${config.colorScheme.palette.background}; + } - #scroll { - border: 10px solid #${config.colorScheme.palette.border}; - border-radius: 10px; - /*padding-right: 10px;*/ - outline: none; - background-color: #${config.colorScheme.palette.background}; - } + #scroll { + border: 10px solid #${config.colorScheme.palette.border}; + border-radius: 10px; + /*padding-right: 10px;*/ + outline: none; + background-color: #${config.colorScheme.palette.background}; + } - #inner-box { - border: none; - border-radius: 10px; - background-color: transparent; - } + #inner-box { + border: none; + border-radius: 10px; + background-color: transparent; + } - #entry { - border: none; - /*border-radius: 10px; - margin-right: 15px; - margin-left: 15px;*/ - padding-right: 10px; - padding-left: 10px; - color: #${config.colorScheme.palette.text}; - background-color: #${config.colorScheme.palette.background}; - } - #entry:selected { - border: none; - background-color: #${config.colorScheme.palette.info}; - } + #entry { + border: none; + /*border-radius: 10px; + margin-right: 15px; + margin-left: 15px;*/ + padding-right: 10px; + padding-left: 10px; + color: #${config.colorScheme.palette.text}; + background-color: #${config.colorScheme.palette.background}; + } + #entry:selected { + border: none; + background-color: #${config.colorScheme.palette.info}; + } - #text:selected { - border: none; - color: #${config.colorScheme.palette.textMuted}; - } + #text:selected { + border: none; + color: #${config.colorScheme.palette.textMuted}; + } - #img { - background-color: transparent; - margin-right: 6px; - } - ''; - }; - }; + #img { + background-color: transparent; + margin-right: 6px; + } + ''; + }; + }; }