From 9feca9517279b6aa40e50f553efba004b9e190a8 Mon Sep 17 00:00:00 2001 From: marduk Date: Wed, 17 Jul 2024 00:36:46 -0400 Subject: [PATCH] formatting... --- flake.nix | 114 +++++----- homes/x86_64-linux/mike@blade/default.nix | 97 +++++---- lib/module/default.nix | 18 +- modules/home/apps/alacritty/default.nix | 122 ++++++----- modules/home/apps/imv/default.nix | 59 ++--- modules/home/apps/kodi/default.nix | 66 +++--- modules/home/apps/mpv/default.nix | 67 +++--- modules/home/apps/rofi/default.nix | 70 +++--- modules/home/apps/spotify/default.nix | 74 ++++--- modules/home/cli/fish/default.nix | 120 +++++----- modules/home/cli/git/default.nix | 2 +- modules/home/cli/neovim/default.nix | 173 ++++++++------- modules/home/cli/neovim/keymaps.nix | 50 +++-- .../home/cli/neovim/plugins/colorschemes.nix | 27 +-- .../home/cli/neovim/plugins/completions.nix | 39 ++-- modules/home/cli/neovim/plugins/ibl.nix | 70 +++--- modules/home/cli/neovim/plugins/leap.nix | 8 +- modules/home/cli/neovim/plugins/lsp.nix | 88 ++++---- modules/home/cli/neovim/plugins/lualine.nix | 10 +- modules/home/cli/neovim/plugins/noice.nix | 14 +- modules/home/cli/neovim/plugins/telescope.nix | 8 +- modules/home/cli/neovim/plugins/template.nix | 5 +- .../home/cli/neovim/plugins/treesitter.nix | 8 +- modules/home/cli/tools/default.nix | 62 +++--- modules/home/services/swww/default.nix | 94 ++++---- modules/home/themes/fonts/default.nix | 86 ++++---- modules/home/themes/rosepine/default.nix | 5 +- modules/home/utility/mako/default.nix | 100 ++++----- modules/home/utility/waybar/default.nix | 121 ++++++----- .../home/utility/waybar/widgets/battery.nix | 8 +- .../utility/waybar/widgets/pulseaudio.nix | 5 +- .../home/utility/waybar/widgets/window.nix | 4 +- .../utility/waybar/widgets/workspaces.nix | 2 +- modules/home/wms/hyprland/binds.nix | 205 +++++++++--------- modules/home/wms/hyprland/default.nix | 146 +++++++------ modules/home/wms/hyprland/rules.nix | 46 ++-- modules/home/wms/hyprland/theme.nix | 101 ++++----- modules/nixos/apps/thunar/default.nix | 56 ++--- modules/nixos/cli/fish/default.nix | 66 +++--- modules/nixos/cli/git/default.nix | 36 ++- modules/nixos/dms/sddm/default.nix | 71 +++--- .../nixos/dms/sddm/where-is-my-sddm-theme.nix | 106 ++++----- modules/nixos/hw/audio/default.nix | 42 ++-- modules/nixos/hw/audio/pipewire.nix | 39 ++-- modules/nixos/hw/nvidia/default.nix | 144 ++++++------ modules/nixos/hw/razer/default.nix | 42 ++-- modules/nixos/system/locale/default.nix | 62 +++--- modules/nixos/system/nix/default.nix | 98 +++++---- modules/nixos/system/time/default.nix | 36 +-- modules/nixos/wms/hyprland/default.nix | 50 +++-- systems/x86_64-linux/blade/boot.nix | 28 +-- systems/x86_64-linux/blade/default.nix | 88 ++++---- systems/x86_64-linux/blade/disks.nix | 22 +- .../blade/hardware-configuration.nix | 50 +++-- 54 files changed, 1725 insertions(+), 1605 deletions(-) diff --git a/flake.nix b/flake.nix index 65e623b..a3ef5c5 100644 --- a/flake.nix +++ b/flake.nix @@ -1,21 +1,21 @@ { - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - # Home manager - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + # Home manager + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - # snowfall - snowfall-lib = { - url = "github:snowfallorg/lib"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + # snowfall + snowfall-lib = { + url = "github:snowfallorg/lib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - # hyprland - hyprland = { + # hyprland + hyprland = { type = "git"; url = "https://github.com/hyprwm/Hyprland"; submodules = true; @@ -25,60 +25,60 @@ inputs.hyprland.follows = "hyprland"; }; hyprland-contrib.url = "github:hyprwm/contrib"; - # TODO + # TODO - # spicetify + # spicetify spicetify-nix = { - url = "github:the-argus/spicetify-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + url = "github:the-argus/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; hardware.url = "github:nixos/nixos-hardware"; razer-laptop-control.url = "github:Razer-Linux/razer-laptop-control-no-dkms"; - nixvim.url = "github:nix-community/nixvim"; + nixvim.url = "github:nix-community/nixvim"; swww.url = "github:LGFae/swww"; nix-colors.url = "github:misterio77/nix-colors"; - }; + }; - outputs = inputs: - let - inherit (inputs) snowfall-lib; - lib = snowfall-lib.mkLib { - inherit inputs; - src = ./.; + outputs = + inputs: + let + inherit (inputs) snowfall-lib; + lib = snowfall-lib.mkLib { + inherit inputs; + src = ./.; - snowfall = { - namespace = "dotties"; - meta = { # for use with Frost - name = "dotties"; - title = "dotties"; - }; - }; - }; - in - lib.mkFlake { - channels-config = { - allowUnfree = true; - }; - homes.modules = with inputs; [ - nixvim.homeManagerModules.nixvim - spicetify-nix.homeManagerModules.default - nix-colors.homeManagerModules.default - ]; - - systems.modules.nixos = with inputs; [ - home-manager.nixosModules.home-manager + snowfall = { + namespace = "dotties"; + meta = { + # for use with Frost + name = "dotties"; + title = "dotties"; + }; + }; + }; + in + lib.mkFlake { + channels-config = { + allowUnfree = true; + }; + homes.modules = with inputs; [ + nixvim.homeManagerModules.nixvim + spicetify-nix.homeManagerModules.default + nix-colors.homeManagerModules.default ]; - systems.hosts.blade.modules = with inputs; [ - hardware.nixosModules.common-cpu-intel - hardware.nixosModules.common-pc-laptop - hardware.nixosModules.common-pc-laptop-ssd - razer-laptop-control.nixosModules.default - ]; + systems.modules.nixos = with inputs; [ home-manager.nixosModules.home-manager ]; - deploy = lib.mkDeploy { inherit (inputs) self; }; - outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; }; - }; + systems.hosts.blade.modules = with inputs; [ + hardware.nixosModules.common-cpu-intel + hardware.nixosModules.common-pc-laptop + hardware.nixosModules.common-pc-laptop-ssd + razer-laptop-control.nixosModules.default + ]; + + deploy = lib.mkDeploy { inherit (inputs) self; }; + outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; }; + }; } diff --git a/homes/x86_64-linux/mike@blade/default.nix b/homes/x86_64-linux/mike@blade/default.nix index 8569efd..60ac182 100644 --- a/homes/x86_64-linux/mike@blade/default.nix +++ b/homes/x86_64-linux/mike@blade/default.nix @@ -1,62 +1,63 @@ { - config, - lib, - namespace, - inputs, - pkgs, - ... + config, + lib, + namespace, + inputs, + pkgs, + ... }: let - inherit (lib.${namespace}) enabled; -in { - snowfallorg.user = { - name = "mike"; - enable = true; - }; - dotties = { - cli = { - neovim = enabled; - tools = enabled; - fish = enabled; - }; - apps = { - spotify = { - enable = true; - spicetify = true; - }; - alacritty = enabled; - imv = enabled; - mpv = enabled; - }; + inherit (lib.${namespace}) enabled; +in +{ + snowfallorg.user = { + name = "mike"; + enable = true; + }; + dotties = { + cli = { + neovim = enabled; + tools = enabled; + fish = enabled; + }; + apps = { + spotify = { + enable = true; + spicetify = true; + }; + alacritty = enabled; + imv = enabled; + mpv = enabled; + }; + + wms.hyprland = enabled; + }; - wms.hyprland = enabled; - }; - - home.packages = with pkgs; [ - vesktop - keepassxc + home.packages = with pkgs; [ + vesktop + keepassxc - firefox - thunderbird + firefox + thunderbird - playerctl + playerctl - ffmpeg # media management - yt-dlp - imagemagick + ffmpeg # media management + yt-dlp + imagemagick - zathura - viewnior - gobble + zathura + viewnior + gobble - libreoffice-fresh - godot_4 - ]; + libreoffice-fresh + godot_4 + ]; - services.syncthing.enable = true; + services.syncthing.enable = true; services.playerctld.enable = true; - services.ssh-agent.enable = true; + services.ssh-agent.enable = true; programs.ssh = { matchBlocks = { "github.com-mardukpill" = { @@ -67,5 +68,5 @@ in { }; }; - home.stateVersion = "23.05"; + home.stateVersion = "23.05"; } diff --git a/lib/module/default.nix b/lib/module/default.nix index aa0ad46..e762abd 100644 --- a/lib/module/default.nix +++ b/lib/module/default.nix @@ -1,7 +1,9 @@ -{lib, ...}: -with lib; rec { - mkOpt = type: default: description: - mkOption {inherit type default description;}; +{ lib, ... }: +with lib; +rec { + mkOpt = + type: default: description: + mkOption { inherit type default description; }; mkOpt' = type: default: mkOpt type default null; @@ -9,7 +11,11 @@ with lib; rec { mkBoolOpt' = mkOpt' types.bool; - enabled = {enable = true;}; + enabled = { + enable = true; + }; - disabled = {enable = false;}; + disabled = { + enable = false; + }; } diff --git a/modules/home/apps/alacritty/default.nix b/modules/home/apps/alacritty/default.nix index 4f2b2d0..825a624 100644 --- a/modules/home/apps/alacritty/default.nix +++ b/modules/home/apps/alacritty/default.nix @@ -1,72 +1,74 @@ { - pkgs, - lib, - config, - namespace, - ... -}: let - inherit (lib) mkEnableOption mkIf; + pkgs, + lib, + config, + namespace, + ... +}: +let + inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.apps.alacritty; -in { - options.${namespace}.apps.alacritty = { - enable = mkEnableOption "alacritty."; - }; + cfg = config.${namespace}.apps.alacritty; +in +{ + options.${namespace}.apps.alacritty = { + enable = mkEnableOption "alacritty."; + }; - config = mkIf cfg.enable { - programs.alacritty = { - enable = true; - settings = { - live_config_reload = true; + config = mkIf cfg.enable { + programs.alacritty = { + enable = true; + settings = { + live_config_reload = true; - window.decorations = "none"; - window.dynamic_title = true; - window.padding.x = 0; - window.padding.y = 0; - window.opacity = 0.8; + window.decorations = "none"; + window.dynamic_title = true; + window.padding.x = 0; + window.padding.y = 0; + window.opacity = 0.8; - cursor.style.blinking = "On"; - cursor.style.shape = "Block"; + cursor.style.blinking = "On"; + cursor.style.shape = "Block"; - colors = { - primary = { - background = "#1E2128"; - foreground = "#ABB2BF"; - }; + colors = { + primary = { + background = "#1E2128"; + foreground = "#ABB2BF"; + }; - normal = { - black = "#32363D"; - blue = "#62AEEF"; - cyan = "#55B6C2"; - green = "#98C379"; - magenta = "#C778DD"; - red = "#E06B74"; - white = "#ABB2BF"; - yellow = "#E5C07A"; - }; + normal = { + black = "#32363D"; + blue = "#62AEEF"; + cyan = "#55B6C2"; + green = "#98C379"; + magenta = "#C778DD"; + red = "#E06B74"; + white = "#ABB2BF"; + yellow = "#E5C07A"; + }; - bright = { - black = "#50545B"; - blue = "#6CB8F9"; - cyan = "#5FC0CC"; - green = "#A2CD83"; - magenta = "#D282E7"; - red = "#EA757E"; - white = "#B5BCC9"; - yellow = "#EFCA84"; - }; - }; + bright = { + black = "#50545B"; + blue = "#6CB8F9"; + cyan = "#5FC0CC"; + green = "#A2CD83"; + magenta = "#D282E7"; + red = "#EA757E"; + white = "#B5BCC9"; + yellow = "#EFCA84"; + }; + }; - font = { - size = 14; + font = { + size = 14; - normal.family = "JetBrainsMono Nerd Font"; - italic.family = "JetBrainsMono Nerd Font"; + normal.family = "JetBrainsMono Nerd Font"; + italic.family = "JetBrainsMono Nerd Font"; - bold.family = "JetBrainsMono Nerd Font"; - bold_italic.family = "JetBrainsMono Nerd Font"; - }; - }; - }; - }; + bold.family = "JetBrainsMono Nerd Font"; + bold_italic.family = "JetBrainsMono Nerd Font"; + }; + }; + }; + }; } diff --git a/modules/home/apps/imv/default.nix b/modules/home/apps/imv/default.nix index bdc8bc3..18f5bff 100644 --- a/modules/home/apps/imv/default.nix +++ b/modules/home/apps/imv/default.nix @@ -1,31 +1,38 @@ { - lib, - pkgs, - inputs, - namespace, - config, - ... -}: let - inherit (lib) mkIf mkOption mkEnableOption enabled; + lib, + pkgs, + inputs, + namespace, + config, + ... +}: +let + inherit (lib) + mkIf + mkOption + mkEnableOption + enabled + ; - cfg = config.${namespace}.apps.imv; -in { - options.${namespace}.apps.imv= { - enable = mkEnableOption "imv."; - }; + cfg = config.${namespace}.apps.imv; +in +{ + options.${namespace}.apps.imv = { + enable = mkEnableOption "imv."; + }; - config = mkIf cfg.enable { - programs.imv = { - enable = true; - }; + config = mkIf cfg.enable { + programs.imv = { + enable = true; + }; - xdg.mimeApps = lib.mkIf pkgs.stdenv.isLinux { - associations.added = { - "image/*" = ["imv.desktop"]; - }; - defaultApplications = { - "image/*" = ["imv.desktop"]; - }; - }; - }; + xdg.mimeApps = lib.mkIf pkgs.stdenv.isLinux { + associations.added = { + "image/*" = [ "imv.desktop" ]; + }; + defaultApplications = { + "image/*" = [ "imv.desktop" ]; + }; + }; + }; } diff --git a/modules/home/apps/kodi/default.nix b/modules/home/apps/kodi/default.nix index 4b33243..5b6710c 100644 --- a/modules/home/apps/kodi/default.nix +++ b/modules/home/apps/kodi/default.nix @@ -1,34 +1,36 @@ { - config, - lib, - namespace, - inputs, - ... -}: let - inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.apps.kodi; -in { - options.${namespace}.apps.kodi = { - enable = mkEnableOption "kodi."; - }; - - config = mkIf cfg.enable { - programs.kodi = { - enable = true; - sources = { - files = { - source = [ - { - name = "nixgates repository"; - path = "https://nixgates.github.io/packages/"; - } # http://bit.ly/a4kScrapers - { - name = "a4k openproject"; - path = "https://a4k-openproject.github.io/"; - } - ]; - }; - }; - }; - }; + config, + lib, + namespace, + inputs, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.apps.kodi; +in +{ + options.${namespace}.apps.kodi = { + enable = mkEnableOption "kodi."; + }; + + config = mkIf cfg.enable { + programs.kodi = { + enable = true; + sources = { + files = { + source = [ + { + name = "nixgates repository"; + path = "https://nixgates.github.io/packages/"; + } # http://bit.ly/a4kScrapers + { + name = "a4k openproject"; + path = "https://a4k-openproject.github.io/"; + } + ]; + }; + }; + }; + }; } diff --git a/modules/home/apps/mpv/default.nix b/modules/home/apps/mpv/default.nix index aca20ce..96da82b 100644 --- a/modules/home/apps/mpv/default.nix +++ b/modules/home/apps/mpv/default.nix @@ -1,35 +1,42 @@ { - lib, - pkgs, - inputs, - namespace, - config, - ... -}: let - inherit (lib) mkIf mkOption mkEnableOption enabled; + lib, + pkgs, + inputs, + namespace, + config, + ... +}: +let + inherit (lib) + mkIf + mkOption + mkEnableOption + enabled + ; - cfg = config.${namespace}.apps.mpv; -in { - options.${namespace}.apps.mpv = { - enable = mkEnableOption "mpv."; - }; + cfg = config.${namespace}.apps.mpv; +in +{ + options.${namespace}.apps.mpv = { + enable = mkEnableOption "mpv."; + }; - config = mkIf cfg.enable { - programs.mpv = { - enable = true; - config = { - vo = "gpu-next"; - hwdec = "auto"; - hwdec-codecs = "all"; - profile = "gpu-hq"; - scale = "ewa_lanczossharp"; - cscale = "ewa_lanczossharp"; - }; - }; + config = mkIf cfg.enable { + programs.mpv = { + enable = true; + config = { + vo = "gpu-next"; + hwdec = "auto"; + hwdec-codecs = "all"; + profile = "gpu-hq"; + scale = "ewa_lanczossharp"; + cscale = "ewa_lanczossharp"; + }; + }; - xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux { - "audio/*" = ["mpv.desktop"]; - "video/*" = ["mpv.desktop"]; - }; - }; + xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux { + "audio/*" = [ "mpv.desktop" ]; + "video/*" = [ "mpv.desktop" ]; + }; + }; } diff --git a/modules/home/apps/rofi/default.nix b/modules/home/apps/rofi/default.nix index 508c789..b266599 100644 --- a/modules/home/apps/rofi/default.nix +++ b/modules/home/apps/rofi/default.nix @@ -2,44 +2,44 @@ pkgs, lib, config, - namespace, + namespace, ... -}: let - inherit (lib) mkEnableOption mkIf mkOption; - cfg = config.${namespace}.apps.rofi; -in { - options.${namespace}.apps.rofi = { - enable = mkEnableOption "rofi."; - wayland = mkOption { - type = lib.types.bool; - default = false; - description = "whether to enable wayland support for rofi"; - }; - }; +}: +let + inherit (lib) mkEnableOption mkIf mkOption; + cfg = config.${namespace}.apps.rofi; +in +{ + options.${namespace}.apps.rofi = { + enable = mkEnableOption "rofi."; + wayland = mkOption { + type = lib.types.bool; + default = false; + description = "whether to enable wayland support for rofi"; + }; + }; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - wtype - ]; + config = mkIf cfg.enable { + home.packages = with pkgs; [ wtype ]; - programs.rofi = { - enable = true; - package = mkIf (cfg.wayland) pkgs.rofi-wayland; - theme = "${config.xdg.configHome}/rofi/rofi.rasi"; + programs.rofi = { + enable = true; + package = mkIf (cfg.wayland) pkgs.rofi-wayland; + theme = "${config.xdg.configHome}/rofi/rofi.rasi"; - plugins = with pkgs; [ - # FIXME: currently broken - rofi-calc - rofi-emoji - rofi-top - ]; - }; + plugins = with pkgs; [ + # FIXME: currently broken + rofi-calc + rofi-emoji + rofi-top + ]; + }; - xdg.configFile = { - rofi = { - source = lib.cleanSourceWith {src = lib.cleanSource ./config/.;}; - recursive = true; - }; - }; - }; + xdg.configFile = { + rofi = { + source = lib.cleanSourceWith { src = lib.cleanSource ./config/.; }; + recursive = true; + }; + }; + }; } diff --git a/modules/home/apps/spotify/default.nix b/modules/home/apps/spotify/default.nix index 1d7dcd9..3ff0271 100644 --- a/modules/home/apps/spotify/default.nix +++ b/modules/home/apps/spotify/default.nix @@ -1,39 +1,45 @@ { - lib, - pkgs, - inputs, - namespace, - config, - ... -}: let - inherit (lib) mkIf mkOption mkEnableOption enabled; - spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; + lib, + pkgs, + inputs, + namespace, + config, + ... +}: +let + inherit (lib) + mkIf + mkOption + mkEnableOption + enabled + ; + spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; - cfg = config.${namespace}.apps.spotify; -in { - options.${namespace}.apps.spotify = { - enable = mkEnableOption "spotify."; - spicetify = mkOption { - type = lib.types.bool; - default = false; - description = "Whether to enable spicetify ricing for spotify."; - }; - }; + cfg = config.${namespace}.apps.spotify; +in +{ + options.${namespace}.apps.spotify = { + enable = mkEnableOption "spotify."; + spicetify = mkOption { + type = lib.types.bool; + default = false; + description = "Whether to enable spicetify ricing for spotify."; + }; + }; - config = mkIf cfg.enable { - - home.packages = mkIf (!cfg.spicetify) [ pkgs.spotify ]; + config = mkIf cfg.enable { - programs.spicetify = mkIf cfg.spicetify { - enable = true; - theme = spicePkgs.themes.text; - colorScheme = "rosepine"; - enabledExtensions = with spicePkgs.extensions; [ - powerBar - fullAlbumDate - history - ]; - }; - }; -} + home.packages = mkIf (!cfg.spicetify) [ pkgs.spotify ]; + programs.spicetify = mkIf cfg.spicetify { + enable = true; + theme = spicePkgs.themes.text; + colorScheme = "rosepine"; + enabledExtensions = with spicePkgs.extensions; [ + powerBar + fullAlbumDate + history + ]; + }; + }; +} diff --git a/modules/home/cli/fish/default.nix b/modules/home/cli/fish/default.nix index 326378b..ce88e25 100644 --- a/modules/home/cli/fish/default.nix +++ b/modules/home/cli/fish/default.nix @@ -1,66 +1,68 @@ { - lib, - pkgs, - namespace, - system, - config, - ... -}: let - inherit (lib) mkIf mkEnableOption; + lib, + pkgs, + namespace, + system, + config, + ... +}: +let + inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.cli.fish; -in { - options.${namespace}.cli.fish = { - enable = mkEnableOption "fish."; - }; + cfg = config.${namespace}.cli.fish; +in +{ + options.${namespace}.cli.fish = { + enable = mkEnableOption "fish."; + }; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - ripgrep - bat - fzf - zoxide - ]; + config = mkIf cfg.enable { + home.packages = with pkgs; [ + ripgrep + bat + fzf + zoxide + ]; - programs.fish = { - enable = true; - shellInit = '' - set -g fish_greeting - zoxide init fish | source - if command -q nix-your-shell - nix-your-shell fish | source - end - ''; - plugins = [ - { - name = "fzf-fish"; - src = pkgs.fishPlugins.fzf-fish.src; - } - { - name = "fish-done"; - src = pkgs.fishPlugins.done.src; - } - ]; - functions = { - __fish_command_not_found_handler = { - body = "__fish_default_command_not_found_handler $argv[1]"; - onEvent = "fish_command_not_found"; - }; + programs.fish = { + enable = true; + shellInit = '' + set -g fish_greeting + zoxide init fish | source + if command -q nix-your-shell + nix-your-shell fish | source + end + ''; + plugins = [ + { + name = "fzf-fish"; + src = pkgs.fishPlugins.fzf-fish.src; + } + { + name = "fish-done"; + src = pkgs.fishPlugins.done.src; + } + ]; + functions = { + __fish_command_not_found_handler = { + body = "__fish_default_command_not_found_handler $argv[1]"; + onEvent = "fish_command_not_found"; + }; - nxsh = { - body = '' - if test (count $argv) -eq 1 - nix shell nixpkgs#$argv[1] - else - echo "Usage: nxsh " - end - ''; - }; + nxsh = { + body = '' + if test (count $argv) -eq 1 + nix shell nixpkgs#$argv[1] + else + echo "Usage: nxsh " + end + ''; + }; - }; - interactiveShellInit = '' - fish_vi_key_bindings - ''; - }; - }; + }; + interactiveShellInit = '' + fish_vi_key_bindings + ''; + }; + }; } diff --git a/modules/home/cli/git/default.nix b/modules/home/cli/git/default.nix index 0967ef4..ffcd441 100644 --- a/modules/home/cli/git/default.nix +++ b/modules/home/cli/git/default.nix @@ -1 +1 @@ -{} +{ } diff --git a/modules/home/cli/neovim/default.nix b/modules/home/cli/neovim/default.nix index 18c8abe..94b016b 100644 --- a/modules/home/cli/neovim/default.nix +++ b/modules/home/cli/neovim/default.nix @@ -1,95 +1,94 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # An instance of `pkgs` with your overlays and packages applied is also available. - pkgs, - # You also have access to your flake's inputs. - inputs, - - # Additional metadata is provided by Snowfall Lib. - namespace, # The namespace used for your flake, defaulting to "internal" if not set. - system, # The system architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). - format, # A normalized name for the system target (eg. `iso`). - virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. - systems, # An attribute map of your defined hosts. - - # All other arguments come from the module system. - config, - ... -}: let - inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.cli.neovim; - -in { - options.${namespace}.cli.neovim = { - enable = mkEnableOption "neovim."; - }; - - imports = [ - ./keymaps.nix - ] ++ lib.snowfall.fs.get-non-default-nix-files ./plugins; - - config = mkIf cfg.enable { - home.packages = with pkgs; [ - ripgrep - ]; - - programs.nixvim = { - enable = true; - defaultEditor = true; - - viAlias = true; - vimAlias = true; - - colorscheme = "challenger_deep"; - plugins.transparent.enable = true; - - opts = { - number = true; - relativenumber = true; + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, + + # Additional metadata is provided by Snowfall Lib. + namespace, # The namespace used for your flake, defaulting to "internal" if not set. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. + + # All other arguments come from the module system. + config, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.cli.neovim; + +in +{ + options.${namespace}.cli.neovim = { + enable = mkEnableOption "neovim."; + }; + + imports = [ ./keymaps.nix ] ++ lib.snowfall.fs.get-non-default-nix-files ./plugins; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ ripgrep ]; + + programs.nixvim = { + enable = true; + defaultEditor = true; + + viAlias = true; + vimAlias = true; + + colorscheme = "challenger_deep"; + plugins.transparent.enable = true; + + opts = { + number = true; + relativenumber = true; spell = true; spelllang = "en_us"; - expandtab = true; + expandtab = true; cursorline = true; undofile = true; mouse = ""; - shiftwidth = 2; - tabstop = 2; - }; - - plugins = { - oil = { - enable = true; - }; - - fidget = { - enable = true; - }; - - nvim-colorizer = { - enable = true; - }; - - nvim-tree = { - enable = true; - }; - - otter = { # TODO - enable = true; - }; - }; - - extraPlugins = with pkgs.vimPlugins; [ - # add regular vim plugins here - ]; - - extraConfigLuaPost = # lua - '' - require("otter").activate({ "python", "bash", "fish" }, true, true, nil) - ''; - }; - }; + shiftwidth = 2; + tabstop = 2; + }; + + plugins = { + oil = { + enable = true; + }; + + fidget = { + enable = true; + }; + + nvim-colorizer = { + enable = true; + }; + + nvim-tree = { + enable = true; + }; + + otter = { + # TODO + enable = true; + }; + }; + + extraPlugins = with pkgs.vimPlugins; [ + # add regular vim plugins here + ]; + + extraConfigLuaPost = # lua + '' + require("otter").activate({ "python", "bash", "fish" }, true, true, nil) + ''; + }; + }; } diff --git a/modules/home/cli/neovim/keymaps.nix b/modules/home/cli/neovim/keymaps.nix index 4af5a64..fd5cc5a 100644 --- a/modules/home/cli/neovim/keymaps.nix +++ b/modules/home/cli/neovim/keymaps.nix @@ -1,6 +1,8 @@ -{inputs, ...}: let - inherit (inputs) nixvim; -in { +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ programs.nixvim = { globals = { mapleader = " "; @@ -11,52 +13,52 @@ in { { action = "Telescope live_grep"; key = "sg"; - options.desc = "Telescope live grep"; + options.desc = "Telescope live grep"; } { action = "Telescope find_files"; key = "sf"; - options.desc = "Telescope find files"; + options.desc = "Telescope find files"; } { action = "Telescope buffers"; key = ""; - options.desc = "Telescope buffers"; + options.desc = "Telescope buffers"; } # nvim-tree { key = "bt"; action = ":NvimTreeToggle"; - options.desc = "NvimTreeToggle"; + options.desc = "NvimTreeToggle"; } { key = "br"; action = ":NvimTreeRefresh"; - options.desc = "NvimTreeRefresh"; + options.desc = "NvimTreeRefresh"; } { key = "bf"; action = ":NvimTreeFindFile"; - options.desc = "NvimTreeFindFile"; + options.desc = "NvimTreeFindFile"; } - # bindings that should be default + # bindings that should be default { key = "y"; action = "\"+y"; - options.desc = "Yank into clipboard"; - } - { - key = ""; # FIXME: binding does not work - action = ""; - mode = "i"; - options.desc = "Emergency exit for insert mode"; - } - { - key = ""; - mode = "t"; - action = ""; - options.desc = "Exit terminal mode"; - } + options.desc = "Yank into clipboard"; + } + { + key = ""; # FIXME: binding does not work + action = ""; + mode = "i"; + options.desc = "Emergency exit for insert mode"; + } + { + key = ""; + mode = "t"; + action = ""; + options.desc = "Exit terminal mode"; + } ]; }; } diff --git a/modules/home/cli/neovim/plugins/colorschemes.nix b/modules/home/cli/neovim/plugins/colorschemes.nix index ad0ad56..6d8b046 100644 --- a/modules/home/cli/neovim/plugins/colorschemes.nix +++ b/modules/home/cli/neovim/plugins/colorschemes.nix @@ -1,16 +1,17 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ programs.nixvim = { - extraPlugins = with pkgs.vimUtils; [ - (buildVimPlugin { - pname = "challenger-deep-theme"; - version = "25-apr-2022"; - src = pkgs.fetchFromGitHub { - owner = "challenger-deep-theme"; - repo = "vim"; - rev = "e3d5b7d9711c7ebbf12c63c2345116985656da0d"; - hash = "sha256-2lIPun5OjaoHSG2BdnX9ztw3k9whVlBa9eB2vS8Htbg="; - }; - }) - ]; + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "challenger-deep-theme"; + version = "25-apr-2022"; + src = pkgs.fetchFromGitHub { + owner = "challenger-deep-theme"; + repo = "vim"; + rev = "e3d5b7d9711c7ebbf12c63c2345116985656da0d"; + hash = "sha256-2lIPun5OjaoHSG2BdnX9ztw3k9whVlBa9eB2vS8Htbg="; + }; + }) + ]; }; } diff --git a/modules/home/cli/neovim/plugins/completions.nix b/modules/home/cli/neovim/plugins/completions.nix index 7dd9bf3..d248d38 100644 --- a/modules/home/cli/neovim/plugins/completions.nix +++ b/modules/home/cli/neovim/plugins/completions.nix @@ -1,20 +1,21 @@ -{ pkgs, ...}: { +{ pkgs, ... }: +{ programs.nixvim.plugins = { luasnip = { - enable = true; - extraConfig = { - enable_autosnippets = true; - store_selection_keys = ""; - }; - fromVscode = [ - { - lazyLoad = true; - paths = "${pkgs.vimPlugins.friendly-snippets}"; - } - ]; - }; + enable = true; + extraConfig = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + fromVscode = [ + { + lazyLoad = true; + paths = "${pkgs.vimPlugins.friendly-snippets}"; + } + ]; + }; - nvim-autopairs.enable = true; + nvim-autopairs.enable = true; cmp = { enable = true; @@ -22,11 +23,11 @@ snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; sources = [ - {name = "luasnip";} - {name = "path";} - {name = "buffer";} - {name = "nvim_lsp";} - {name = "otter";} + { name = "luasnip"; } + { name = "path"; } + { name = "buffer"; } + { name = "nvim_lsp"; } + { name = "otter"; } ]; mapping = { "" = diff --git a/modules/home/cli/neovim/plugins/ibl.nix b/modules/home/cli/neovim/plugins/ibl.nix index 15c53ce..0babcce 100644 --- a/modules/home/cli/neovim/plugins/ibl.nix +++ b/modules/home/cli/neovim/plugins/ibl.nix @@ -1,35 +1,37 @@ -{inputs, ...}: let -inherit (inputs) nixvim; -in { - programs.nixvim = { - plugins.indent-blankline = { - enable = true; - settings = { - exclude = { - buftypes = [ - "terminal" - "quickfix" - ]; - filetypes = [ - "" - "checkhealth" - "help" - "lspinfo" - "packer" - "TelescopePrompt" - "TelescopeResults" - "yaml" - ]; - }; - indent = { - char = "│"; - }; - scope = { - show_end = true; - show_exact_scope = true; - show_start = true; - }; - }; - }; - }; +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ + programs.nixvim = { + plugins.indent-blankline = { + enable = true; + settings = { + exclude = { + buftypes = [ + "terminal" + "quickfix" + ]; + filetypes = [ + "" + "checkhealth" + "help" + "lspinfo" + "packer" + "TelescopePrompt" + "TelescopeResults" + "yaml" + ]; + }; + indent = { + char = "│"; + }; + scope = { + show_end = true; + show_exact_scope = true; + show_start = true; + }; + }; + }; + }; } diff --git a/modules/home/cli/neovim/plugins/leap.nix b/modules/home/cli/neovim/plugins/leap.nix index 6a362ce..0e4d442 100644 --- a/modules/home/cli/neovim/plugins/leap.nix +++ b/modules/home/cli/neovim/plugins/leap.nix @@ -1,6 +1,8 @@ -{inputs, ...}: let - inherit (inputs) nixvim; -in { +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ programs.nixvim.plugins.leap = { enable = true; }; diff --git a/modules/home/cli/neovim/plugins/lsp.nix b/modules/home/cli/neovim/plugins/lsp.nix index 8cecf7c..c942fe0 100644 --- a/modules/home/cli/neovim/plugins/lsp.nix +++ b/modules/home/cli/neovim/plugins/lsp.nix @@ -1,47 +1,49 @@ -{inputs, ...}: let - inherit (inputs) nixvim; -in { +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ programs.nixvim.plugins = { - lsp-format = { - enable = true; - }; - lsp = { - enable = true; - servers = { - lua-ls = { - enable = true; - filetypes = ["lua"]; - settings = { - telemetry.enable = false; - }; - }; - nixd = { - enable = true; - filetypes = ["nix"]; - }; - }; - keymaps = { - silent = true; - diagnostic = { - "k" = "goto_prev"; - "j" = "goto_next"; - }; - lspBuf = { - "gd" = "definition"; - "gD" = "declaration"; - "gi" = "implementation"; - "gr" = "references"; - "gt" = "type_definition"; - "K" = "hover"; + lsp-format = { + enable = true; + }; + lsp = { + enable = true; + servers = { + lua-ls = { + enable = true; + filetypes = [ "lua" ]; + settings = { + telemetry.enable = false; + }; + }; + nixd = { + enable = true; + filetypes = [ "nix" ]; + }; + }; + keymaps = { + silent = true; + diagnostic = { + "k" = "goto_prev"; + "j" = "goto_next"; + }; + lspBuf = { + "gd" = "definition"; + "gD" = "declaration"; + "gi" = "implementation"; + "gr" = "references"; + "gt" = "type_definition"; + "K" = "hover"; - "" = "signature_help"; + "" = "signature_help"; - "ca" = "code_action"; - "rn" = "rename"; - "wa" = "add_workspace_folder"; - "wr" = "remove_workspace_folder"; - }; - }; - }; - }; + "ca" = "code_action"; + "rn" = "rename"; + "wa" = "add_workspace_folder"; + "wr" = "remove_workspace_folder"; + }; + }; + }; + }; } diff --git a/modules/home/cli/neovim/plugins/lualine.nix b/modules/home/cli/neovim/plugins/lualine.nix index 62a21a7..e7135b9 100644 --- a/modules/home/cli/neovim/plugins/lualine.nix +++ b/modules/home/cli/neovim/plugins/lualine.nix @@ -1,9 +1,11 @@ -{inputs, ...}: let - inherit (inputs) nixvim; -in { +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ programs.nixvim.plugins.lualine = { enable = true; iconsEnabled = true; - extensions = ["nvim-tree"]; + extensions = [ "nvim-tree" ]; }; } diff --git a/modules/home/cli/neovim/plugins/noice.nix b/modules/home/cli/neovim/plugins/noice.nix index c21513b..e47c91d 100644 --- a/modules/home/cli/neovim/plugins/noice.nix +++ b/modules/home/cli/neovim/plugins/noice.nix @@ -1,7 +1,9 @@ -{inputs, ...}: let - inherit (inputs) nixvim; -in { - programs.nixvim = { - plugins.noice.enable = true; - }; +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ + programs.nixvim = { + plugins.noice.enable = true; + }; } diff --git a/modules/home/cli/neovim/plugins/telescope.nix b/modules/home/cli/neovim/plugins/telescope.nix index a8e9b53..950209c 100644 --- a/modules/home/cli/neovim/plugins/telescope.nix +++ b/modules/home/cli/neovim/plugins/telescope.nix @@ -1,6 +1,8 @@ -{inputs, ...}: let - inherit (inputs) nixvim; -in { +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ programs.nixvim.plugins.telescope = { enable = true; }; diff --git a/modules/home/cli/neovim/plugins/template.nix b/modules/home/cli/neovim/plugins/template.nix index ada7df1..ce52a4d 100644 --- a/modules/home/cli/neovim/plugins/template.nix +++ b/modules/home/cli/neovim/plugins/template.nix @@ -1,4 +1 @@ -_: { - programs.nixvim.plugins = { - }; -} +_: { programs.nixvim.plugins = { }; } diff --git a/modules/home/cli/neovim/plugins/treesitter.nix b/modules/home/cli/neovim/plugins/treesitter.nix index e7213b7..def525e 100644 --- a/modules/home/cli/neovim/plugins/treesitter.nix +++ b/modules/home/cli/neovim/plugins/treesitter.nix @@ -1,6 +1,8 @@ -{inputs, ...}: let - inherit (inputs) nixvim; -in { +{ inputs, ... }: +let + inherit (inputs) nixvim; +in +{ programs.nixvim.plugins.treesitter = { enable = true; }; diff --git a/modules/home/cli/tools/default.nix b/modules/home/cli/tools/default.nix index 5e0aeda..d8f04b3 100644 --- a/modules/home/cli/tools/default.nix +++ b/modules/home/cli/tools/default.nix @@ -1,34 +1,36 @@ { - pkgs, - lib, - config, - namespace, - ... -}: let - inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.cli.tools; -in { - options.${namespace}.cli.tools = { - enable = mkEnableOption "cli tools bundle."; - }; + pkgs, + lib, + config, + namespace, + ... +}: +let + inherit (lib) mkIf mkEnableOption; + cfg = config.${namespace}.cli.tools; +in +{ + options.${namespace}.cli.tools = { + enable = mkEnableOption "cli tools bundle."; + }; - config = mkIf cfg.enable { - programs.zoxide = mkIf config.${namespace}.cli.fish.enable { - enable = true; - enableFishIntegration = true; - }; + config = mkIf cfg.enable { + programs.zoxide = mkIf config.${namespace}.cli.fish.enable { + enable = true; + enableFishIntegration = true; + }; - home.packages = with pkgs; [ - p7zip - tree - fd - tig - htop - curl - wget - unzip - fzf - zoxide - ]; - }; + home.packages = with pkgs; [ + p7zip + tree + fd + tig + htop + curl + wget + unzip + fzf + zoxide + ]; + }; } diff --git a/modules/home/services/swww/default.nix b/modules/home/services/swww/default.nix index 632e17e..ccc9eaf 100644 --- a/modules/home/services/swww/default.nix +++ b/modules/home/services/swww/default.nix @@ -1,52 +1,52 @@ { - namespace, - config, - pkgs, - lib, - ... -}: let - inherit (lib) mkIf mkOption mkEnableOption; - cfg = config.${namespace}.services.swww; -in { - options.${namespace}.services.swww = { - enable = mkEnableOption "swww services."; - wallpaperPath = mkOption { - type = lib.types.path; - default = ""; - }; - }; + namespace, + config, + pkgs, + lib, + ... +}: +let + inherit (lib) mkIf mkOption mkEnableOption; + cfg = config.${namespace}.services.swww; +in +{ + options.${namespace}.services.swww = { + enable = mkEnableOption "swww services."; + wallpaperPath = mkOption { + type = lib.types.path; + default = ""; + }; + }; - config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ - swww - ]; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ swww ]; - systemd.user.services.swww-daemon = { - Unit = { - Description = "swww daemon"; - }; - Install = { - WantedBy = ["hyprland-session.target"]; - }; - Service = { - Restart = "always"; - RestartSec = 5; - ExecStart = "${pkgs.swww}/bin/swww-daemon"; - }; - }; + systemd.user.services.swww-daemon = { + Unit = { + Description = "swww daemon"; + }; + Install = { + WantedBy = [ "hyprland-session.target" ]; + }; + Service = { + Restart = "always"; + RestartSec = 5; + ExecStart = "${pkgs.swww}/bin/swww-daemon"; + }; + }; - # TODO: make script to rotate through folder of wallpapers - systemd.user.services.swww-paper = mkIf (cfg.wallpaperPath != "") { - Unit = { - Description = "setting swww wallpaper"; - }; - Install = { - WantedBy = ["swww-daemon.service"]; - }; - Service = { - Type = "oneshot"; - ExecStart = "${pkgs.swww}/bin/swww img ${cfg.wallpaperPath}"; - }; - }; - }; + # TODO: make script to rotate through folder of wallpapers + systemd.user.services.swww-paper = mkIf (cfg.wallpaperPath != "") { + Unit = { + Description = "setting swww wallpaper"; + }; + Install = { + WantedBy = [ "swww-daemon.service" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = "${pkgs.swww}/bin/swww img ${cfg.wallpaperPath}"; + }; + }; + }; } diff --git a/modules/home/themes/fonts/default.nix b/modules/home/themes/fonts/default.nix index 26febb4..c559e3d 100644 --- a/modules/home/themes/fonts/default.nix +++ b/modules/home/themes/fonts/default.nix @@ -1,44 +1,46 @@ { - pkgs, - inputs, - config, - namespace, - lib, - ... -}: let - inherit (lib) mkIf; - inherit (lib.${namespace}) mkOpt; - - cfg = config.${namespace}.system.fonts; -in { - options.${namespace}.system.fonts = { - manage = mkOpt lib.types.bool true "whether to manage fonts."; - }; - - config = mkIf cfg.manage { - home.packages = with pkgs; [ - jetbrains-mono - nerdfonts - - material-icons - material-design-icons - vimPlugins.nvim-web-devicons - - corefonts - vistafonts - - noto-fonts - noto-fonts-extra - - noto-fonts-emoji - noto-fonts-color-emoji - twemoji-color-font - - font-awesome - roboto-mono - montserrat - ]; - - fonts.fontconfig.enable = true; - }; + pkgs, + inputs, + config, + namespace, + lib, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkOpt; + + cfg = config.${namespace}.system.fonts; +in +{ + options.${namespace}.system.fonts = { + manage = mkOpt lib.types.bool true "whether to manage fonts."; + }; + + config = mkIf cfg.manage { + home.packages = with pkgs; [ + jetbrains-mono + nerdfonts + + material-icons + material-design-icons + vimPlugins.nvim-web-devicons + + corefonts + vistafonts + + noto-fonts + noto-fonts-extra + + noto-fonts-emoji + noto-fonts-color-emoji + twemoji-color-font + + font-awesome + roboto-mono + montserrat + ]; + + fonts.fontconfig.enable = true; + }; } diff --git a/modules/home/themes/rosepine/default.nix b/modules/home/themes/rosepine/default.nix index e02d73c..7be7854 100644 --- a/modules/home/themes/rosepine/default.nix +++ b/modules/home/themes/rosepine/default.nix @@ -1,3 +1,4 @@ -{pkgs, inputs, ...}: { - colorScheme = inputs.nix-colors.colorSchemes.rose-pine; +{ pkgs, inputs, ... }: +{ + colorScheme = inputs.nix-colors.colorSchemes.rose-pine; } diff --git a/modules/home/utility/mako/default.nix b/modules/home/utility/mako/default.nix index 1a7f213..da19f78 100644 --- a/modules/home/utility/mako/default.nix +++ b/modules/home/utility/mako/default.nix @@ -1,56 +1,58 @@ { - pkgs, - config, - lib, - namespace, - ... -}: let - inherit (lib) mkEnableOption enabled mkIf; + pkgs, + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkEnableOption enabled mkIf; - cfg = config.${namespace}.utility.mako; -in { - options.${namespace}.utility.mako = { - enable = mkEnableOption "mako."; - }; + cfg = config.${namespace}.utility.mako; +in +{ + options.${namespace}.utility.mako = { + enable = mkEnableOption "mako."; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + libnotify + mako + ]; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - libnotify - mako - ]; + services.mako = { + enable = true; + icons = true; + defaultTimeout = 5000; + anchor = "bottom-right"; + font = "JetBrainsMono bold 14"; + height = 300; + width = 500; + padding = "10,15,20"; + layer = "overlay"; + borderColor = "#" + config.colorScheme.palette.base08; + borderSize = 3; + borderRadius = 5; + backgroundColor = "#" + config.colorScheme.palette.base00; + progressColor = "over #" + config.colorScheme.palette.base05 + "AA"; - services.mako = { - enable = true; - icons = true; - defaultTimeout = 5000; - anchor = "bottom-right"; - font = "JetBrainsMono bold 14"; - height = 300; - width = 500; - padding = "10,15,20"; - layer = "overlay"; - borderColor = "#"+config.colorScheme.palette.base08; - borderSize = 3; - borderRadius = 5; - backgroundColor = "#"+config.colorScheme.palette.base00; - progressColor = "over #"+config.colorScheme.palette.base05+"AA"; - - extraConfig = '' -outer-margin=25 + extraConfig = '' + outer-margin=25 -[app-name=Spotify] -border-color=#1DB954 -font=JetBrainsMono bold 18 -anchor=bottom-center -default-timeout=3000 -ignore-timeout=1 -padding=5,5,5 -outer-margin=25 -height=100 -width=900 -text-alignment=center -''; # TODO: can do more cool stuff here. - }; + [app-name=Spotify] + border-color=#1DB954 + font=JetBrainsMono bold 18 + anchor=bottom-center + default-timeout=3000 + ignore-timeout=1 + padding=5,5,5 + outer-margin=25 + height=100 + width=900 + text-alignment=center + ''; # TODO: can do more cool stuff here. + }; - }; + }; } diff --git a/modules/home/utility/waybar/default.nix b/modules/home/utility/waybar/default.nix index 3dfbe66..75c2a3e 100644 --- a/modules/home/utility/waybar/default.nix +++ b/modules/home/utility/waybar/default.nix @@ -1,62 +1,71 @@ { - namespace, - lib, - config, - ... -}: let - inherit (lib) mkEnableOption mkIf; + namespace, + lib, + config, + ... +}: +let + inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.utility.waybar; -in { - options.${namespace}.utility.waybar = { - enable = mkEnableOption "waybar"; - }; + cfg = config.${namespace}.utility.waybar; +in +{ + options.${namespace}.utility.waybar = { + enable = mkEnableOption "waybar"; + }; - imports = lib.snowfall.fs.get-non-default-nix-files ./widgets; + imports = lib.snowfall.fs.get-non-default-nix-files ./widgets; - config = mkIf cfg.enable { - programs.waybar = { - enable = true; - systemd = { - enable = true; - target = "hyprland-session.target"; - }; - style = - '' - @define-color background #${config.colorScheme.palette.base00}; - @define-color first #${config.colorScheme.palette.base01}; - @define-color second #${config.colorScheme.palette.base02}; - @define-color third #${config.colorScheme.palette.base03}; - @define-color fourth #${config.colorScheme.palette.base04}; - @define-color fifth #${config.colorScheme.palette.base05}; - @define-color sixth #${config.colorScheme.palette.base06}; - @define-color foregroundalt #${config.colorScheme.palette.base07}; - @define-color backgroundalt #${config.colorScheme.palette.base08}; - @define-color firstalt #${config.colorScheme.palette.base09}; - @define-color secondalt #${config.colorScheme.palette.base0A}; - @define-color thirdalt #${config.colorScheme.palette.base0B}; - @define-color fourthalt #${config.colorScheme.palette.base0C}; - @define-color fifthalt #${config.colorScheme.palette.base0D}; - @define-color sixthalt #${config.colorScheme.palette.base0E}; - @define-color foreground #${config.colorScheme.palette.base0F}; - '' - + builtins.readFile ./styles.css; # hacky way of getting the colorscheme into the css + config = mkIf cfg.enable { + programs.waybar = { + enable = true; + systemd = { + enable = true; + target = "hyprland-session.target"; + }; + style = + '' + @define-color background #${config.colorScheme.palette.base00}; + @define-color first #${config.colorScheme.palette.base01}; + @define-color second #${config.colorScheme.palette.base02}; + @define-color third #${config.colorScheme.palette.base03}; + @define-color fourth #${config.colorScheme.palette.base04}; + @define-color fifth #${config.colorScheme.palette.base05}; + @define-color sixth #${config.colorScheme.palette.base06}; + @define-color foregroundalt #${config.colorScheme.palette.base07}; + @define-color backgroundalt #${config.colorScheme.palette.base08}; + @define-color firstalt #${config.colorScheme.palette.base09}; + @define-color secondalt #${config.colorScheme.palette.base0A}; + @define-color thirdalt #${config.colorScheme.palette.base0B}; + @define-color fourthalt #${config.colorScheme.palette.base0C}; + @define-color fifthalt #${config.colorScheme.palette.base0D}; + @define-color sixthalt #${config.colorScheme.palette.base0E}; + @define-color foreground #${config.colorScheme.palette.base0F}; + '' + + builtins.readFile ./styles.css; # hacky way of getting the colorscheme into the css - settings = { - mainBar = { - layer = "bottom"; - position = "top"; - height = 45; - margin-left = 1; - margin-right = 1; - output = [ - "eDP-1" - ]; - modules-left = ["tray" "hyprland/workspaces"]; - modules-center = ["hyprland/window"]; - modules-right = ["network" "cpu" "pulseaudio" "battery" "clock"]; - }; - }; - }; - }; + settings = { + mainBar = { + layer = "bottom"; + position = "top"; + height = 45; + margin-left = 1; + margin-right = 1; + output = [ "eDP-1" ]; + modules-left = [ + "tray" + "hyprland/workspaces" + ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ + "network" + "cpu" + "pulseaudio" + "battery" + "clock" + ]; + }; + }; + }; + }; } diff --git a/modules/home/utility/waybar/widgets/battery.nix b/modules/home/utility/waybar/widgets/battery.nix index d68fca6..fb0d9d1 100644 --- a/modules/home/utility/waybar/widgets/battery.nix +++ b/modules/home/utility/waybar/widgets/battery.nix @@ -7,7 +7,13 @@ critical = 15; }; format = "{capacity}% {icon}"; - format-icons = ["" "" "" "" ""]; + format-icons = [ + "" + "" + "" + "" + "" + ]; max-length = 25; }; }; diff --git a/modules/home/utility/waybar/widgets/pulseaudio.nix b/modules/home/utility/waybar/widgets/pulseaudio.nix index 01ca7e2..17f0469 100644 --- a/modules/home/utility/waybar/widgets/pulseaudio.nix +++ b/modules/home/utility/waybar/widgets/pulseaudio.nix @@ -13,7 +13,10 @@ "phone-muted" = ""; "portable" = ""; "car" = ""; - "default" = ["" ""]; + "default" = [ + "" + "" + ]; }; scroll-step = 1; on-click = "pavucontrol"; diff --git a/modules/home/utility/waybar/widgets/window.nix b/modules/home/utility/waybar/widgets/window.nix index ef48176..63bc4b1 100644 --- a/modules/home/utility/waybar/widgets/window.nix +++ b/modules/home/utility/waybar/widgets/window.nix @@ -6,8 +6,8 @@ separate-outputs = true; rewrite = { "" = "  "; - "org.keepassxc.KeePassXC" = " 󰟵"; - "firefox" = "󰈹 firefox"; + "org.keepassxc.KeePassXC" = " 󰟵"; + "firefox" = "󰈹 firefox"; }; }; }; diff --git a/modules/home/utility/waybar/widgets/workspaces.nix b/modules/home/utility/waybar/widgets/workspaces.nix index 61a882f..1f1c180 100644 --- a/modules/home/utility/waybar/widgets/workspaces.nix +++ b/modules/home/utility/waybar/widgets/workspaces.nix @@ -30,7 +30,7 @@ "class" = "󰨞"; "code-url-handler" = "󰨞"; "class" = "󰙯"; - "class" = "󰙯"; + "class" = "󰙯"; "class" = ""; "class" = ""; "class" = ""; diff --git a/modules/home/wms/hyprland/binds.nix b/modules/home/wms/hyprland/binds.nix index d5910d3..3e1489c 100644 --- a/modules/home/wms/hyprland/binds.nix +++ b/modules/home/wms/hyprland/binds.nix @@ -3,122 +3,127 @@ lib, pkgs, namespace, - inputs, + inputs, ... }: let inherit (lib) mkIf; - grimblast = inputs.hyprland-contrib.packages.${pkgs.hostPlatform.system}.grimblast; - + grimblast = inputs.hyprland-contrib.packages.${pkgs.hostPlatform.system}.grimblast; cfg = config.${namespace}.wms.hyprland; in { - config = mkIf cfg.enable { - wayland.windowManager.hyprland = { - settings = { - "$mod" = "SUPER"; - "binds:scroll_event_delay" = 1; + config = mkIf cfg.enable { + wayland.windowManager.hyprland = { + settings = { + "$mod" = "SUPER"; + "binds:scroll_event_delay" = 1; + + # gestures + "gestures:workspace_swipe" = true; + "gestures:workspace_swipe_fingers" = 4; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + binde = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ", XF86MonBrightnessDown, exec, brillo -U 5 -u 100000" + ", XF86MonBrightnessUp, exec, brillo -A 5 -u 100000" + ]; + + bindl = [ + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ", XF86AudioNext, exec, playerctl next" + ]; + + bind = + [ + # "$mod,Tab, hyperexpo:expo, toggle" - # gestures - "gestures:workspace_swipe" = true; - "gestures:workspace_swipe_fingers" = 4; - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - - binde = [ - ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" - ", XF86MonBrightnessDown, exec, brillo -U 5 -u 100000" - ", XF86MonBrightnessUp, exec, brillo -A 5 -u 100000" - ]; - - bindl = [ - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPrev, exec, playerctl previous" - ", XF86AudioNext, exec, playerctl next" - ]; + # applications + "$mod, Return, exec, ${pkgs.alacritty}/bin/alacritty" + "$mod SHIFT, Return, exec, [floating] ${pkgs.alacritty}/bin/alacritty" + "$mod, E, exec, thunar" + "$mod SHIFT, E, exec, [floating] thunar" + "$mod SHIFT, F, exec, ${pkgs.firefox}/bin/firefox" - bind = [ - # "$mod,Tab, hyperexpo:expo, toggle" + # grimblast + ", Print, exec, grimblast --notify copy area" + "$mod SHIFT, S, exec, grimblast --notify edit area" + "$mod CONTROL_SHIFT, S, exec, grimblast --notify edit screen" - # applications - "$mod, Return, exec, ${pkgs.alacritty}/bin/alacritty" - "$mod SHIFT, Return, exec, [floating] ${pkgs.alacritty}/bin/alacritty" - "$mod, E, exec, thunar" - "$mod SHIFT, E, exec, [floating] thunar" - "$mod SHIFT, F, exec, ${pkgs.firefox}/bin/firefox" + # rofi + "$mod, D, exec, pkill rofi || ${pkgs.rofi-wayland}/bin/rofi -show drun" + "$mod, Period, exec, pkill rofi || ${pkgs.bemoji}/bin/bemoji" - # grimblast - ", Print, exec, grimblast --notify copy area" - "$mod SHIFT, S, exec, grimblast --notify edit area" - "$mod CONTROL_SHIFT, S, exec, grimblast --notify edit screen" - - # rofi - "$mod, D, exec, pkill rofi || ${pkgs.rofi-wayland}/bin/rofi -show drun" - "$mod, Period, exec, pkill rofi || ${pkgs.bemoji}/bin/bemoji" - - # client controls - "$mod, M, fullscreen, 1" - "$mod, F, fullscreen" - "$mod, Q, killactive," - "$mod, G, togglefloating," - "$mod, P, pin," + # client controls + "$mod, M, fullscreen, 1" + "$mod, F, fullscreen" + "$mod, Q, killactive," + "$mod, G, togglefloating," + "$mod, P, pin," - # hyprpicker - "$mod, C, exec, hyprpicker --autocopy --render-inactive" + # hyprpicker + "$mod, C, exec, hyprpicker --autocopy --render-inactive" - # hyprzoom - "$mod,mouse_down,exec, hyprzoom in" - "$mod,mouse_up,exec, hyprzoom out" + # hyprzoom + "$mod,mouse_down,exec, hyprzoom in" + "$mod,mouse_up,exec, hyprzoom out" - # hyprland - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - "$mod, H, movefocus, l" - "$mod, J, movefocus, d" - "$mod, K, movefocus, u" - "$mod, L, movefocus, r" + # hyprland + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "$mod, H, movefocus, l" + "$mod, J, movefocus, d" + "$mod, K, movefocus, u" + "$mod, L, movefocus, r" - "$mod SHIFT, left, movewindow, l" - "$mod SHIFT, right, movewindow, r" - "$mod SHIFT, up, movewindow, u" - "$mod SHIFT, down, movewindow, d" - "$mod SHIFT, H, movewindow, l" - "$mod SHIFT, J, movewindow, d" - "$mod SHIFT, K, movewindow, u" - "$mod SHIFT, L, movewindow, r" + "$mod SHIFT, left, movewindow, l" + "$mod SHIFT, right, movewindow, r" + "$mod SHIFT, up, movewindow, u" + "$mod SHIFT, down, movewindow, d" + "$mod SHIFT, H, movewindow, l" + "$mod SHIFT, J, movewindow, d" + "$mod SHIFT, K, movewindow, u" + "$mod SHIFT, L, movewindow, r" - "$mod, Space, togglegroup," - "$mod SHIFT, N, changegroupactive, f" - "$mod SHIFT, P, changegroupactive, b" + "$mod, Space, togglegroup," + "$mod SHIFT, N, changegroupactive, f" + "$mod SHIFT, P, changegroupactive, b" - "$mod SHIFT, Z, exec, hyprctl keyword cursor:zoom_factor 1" - ] ++ ( - # workspaces - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - builtins.concatLists (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in [ - "$mod, ${ws}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" - "$mod CTRL, ${ws}, workspace, ${toString ((x + 11))}" # FUCK IT, WHATS ANOTHER 10 WORKSPACES? - "$mod CONTROL_SHIFT, ${ws}, movetoworkspace, ${toString ((x + 11))}" - ] - ) - 10) - ); - }; - }; - }; + "$mod SHIFT, Z, exec, hyprctl keyword cursor:zoom_factor 1" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists ( + builtins.genList ( + x: + let + ws = + let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in + [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + "$mod CTRL, ${ws}, workspace, ${toString ((x + 11))}" # FUCK IT, WHATS ANOTHER 10 WORKSPACES? + "$mod CONTROL_SHIFT, ${ws}, movetoworkspace, ${toString ((x + 11))}" + ] + ) 10 + ) + ); + }; + }; + }; } diff --git a/modules/home/wms/hyprland/default.nix b/modules/home/wms/hyprland/default.nix index 9c6f771..cf6d247 100644 --- a/modules/home/wms/hyprland/default.nix +++ b/modules/home/wms/hyprland/default.nix @@ -1,89 +1,91 @@ { - # Snowfall Lib provides a customized `lib` instance with access to your flake's library - # as well as the libraries available from your flake's inputs. - lib, - # An instance of `pkgs` with your overlays and packages applied is also available. - pkgs, - # You also have access to your flake's inputs. - inputs, + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, - # Additional metadata is provided by Snowfall Lib. - namespace, # The namespace used for your flake, defaulting to "internal" if not set. - system, # The system architecture for this host (eg. `x86_64-linux`). - target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). - format, # A normalized name for the system target (eg. `iso`). - virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. - systems, # An attribute map of your defined hosts. + # Additional metadata is provided by Snowfall Lib. + namespace, # The namespace used for your flake, defaulting to "internal" if not set. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. - # All other arguments come from the module system. - config, - ... -}: let - inherit (lib) mkIf mkEnableOption; + # All other arguments come from the module system. + config, + ... +}: +let + inherit (lib) mkIf mkEnableOption; inherit (lib.${namespace}) enabled; - inherit (inputs) hyprland; - cfg = config.${namespace}.wms.hyprland; - grimblast = inputs.hyprland-contrib.packages.${pkgs.hostPlatform.system}.grimblast; + inherit (inputs) hyprland; + cfg = config.${namespace}.wms.hyprland; + grimblast = inputs.hyprland-contrib.packages.${pkgs.hostPlatform.system}.grimblast; -in { - options.${namespace}.wms.hyprland = { - enable = mkEnableOption "hyprland."; - }; +in +{ + options.${namespace}.wms.hyprland = { + enable = mkEnableOption "hyprland."; + }; + + imports = lib.snowfall.fs.get-non-default-nix-files ./.; - imports = lib.snowfall.fs.get-non-default-nix-files ./.; + config = mkIf cfg.enable { + dotties.apps.rofi = enabled; + dotties.utility.mako = enabled; + dotties.utility.waybar = enabled; + dotties.services.swww = { + enable = true; + wallpaperPath = "/media/shared/pictures/wallpapers/bay.JPG"; + }; - config = mkIf cfg.enable { - dotties.apps.rofi = enabled; - dotties.utility.mako = enabled; - dotties.utility.waybar = enabled; - dotties.services.swww = { - enable = true; - wallpaperPath = "/media/shared/pictures/wallpapers/bay.JPG"; - }; + home = { + packages = with pkgs; [ + wl-mirror + wl-clipboard + wlr-randr - home = { - packages = with pkgs; [ - wl-mirror - wl-clipboard - wlr-randr + hyprpicker - hyprpicker - - grimblast - # hyprzoom + grimblast + # hyprzoom - swappy - gtk-engine-murrine # TODO: move to dedicated file - # gnomes-themes-extra - ]; + swappy + gtk-engine-murrine # TODO: move to dedicated file + # gnomes-themes-extra + ]; - pointerCursor = { - name = "phinger-cursors-dark"; - package = pkgs.phinger-cursors; - gtk.enable = true; - size = 32; - }; + pointerCursor = { + name = "phinger-cursors-dark"; + package = pkgs.phinger-cursors; + gtk.enable = true; + size = 32; + }; - sessionVariables = { - MOZ_ENABLE_WAYLAND = 1; - QT_QPA_PLATFORM = "wayland"; - NIXOS_OZONE_WL = 1; - GRIMBLAST_EDITOR = "swappy --file"; - }; - }; + sessionVariables = { + MOZ_ENABLE_WAYLAND = 1; + QT_QPA_PLATFORM = "wayland"; + NIXOS_OZONE_WL = 1; + GRIMBLAST_EDITOR = "swappy --file"; + }; + }; - wayland.windowManager.hyprland = { - enable = true; - systemd = { - variables = ["--all"]; - enableXdgAutostart = true; - }; + wayland.windowManager.hyprland = { + enable = true; + systemd = { + variables = [ "--all" ]; + enableXdgAutostart = true; + }; - xwayland.enable = true; + xwayland.enable = true; - package = hyprland.packages.${system}.hyprland; + package = hyprland.packages.${system}.hyprland; - plugins = [ ]; # TODO - }; - }; + plugins = [ ]; # TODO + }; + }; } diff --git a/modules/home/wms/hyprland/rules.nix b/modules/home/wms/hyprland/rules.nix index 29a18e3..180a72b 100644 --- a/modules/home/wms/hyprland/rules.nix +++ b/modules/home/wms/hyprland/rules.nix @@ -3,39 +3,39 @@ lib, pkgs, namespace, - inputs, + inputs, ... }: let inherit (lib) mkIf; cfg = config.${namespace}.wms.hyprland; - externalDisplay = "HDMI-A-1"; # FIXME: this is really dumb + externalDisplay = "HDMI-A-1"; # FIXME: this is really dumb in { - config = mkIf cfg.enable { - wayland.windowManager.hyprland = { - settings = { - monitor = [ - "eDP-1,2560x1440@240,0x0,1" - "${externalDisplay},1920x1080@60,2560x0,1" - ]; + config = mkIf cfg.enable { + wayland.windowManager.hyprland = { + settings = { + monitor = [ + "eDP-1,2560x1440@240,0x0,1" + "${externalDisplay},1920x1080@60,2560x0,1" + ]; - windowrulev2 = [ - "float,class:float" - "pin, title:^(Picture-in-Picture)$" - "float, title:^(Picture-in-Picture)$" + windowrulev2 = [ + "float,class:float" + "pin, title:^(Picture-in-Picture)$" + "float, title:^(Picture-in-Picture)$" - "workspace 10 silent, class:KeePassXC" - "workspace 10 silent, class:^(gnome-connections)$" - ]; + "workspace 10 silent, class:KeePassXC" + "workspace 10 silent, class:^(gnome-connections)$" + ]; - workspace = [ - "10, on-created-empty:keepassxc" - "11, monitor:${externalDisplay}" - ]; + workspace = [ + "10, on-created-empty:keepassxc" + "11, monitor:${externalDisplay}" + ]; - }; - }; - }; + }; + }; + }; } diff --git a/modules/home/wms/hyprland/theme.nix b/modules/home/wms/hyprland/theme.nix index 51c88ef..fa09918 100644 --- a/modules/home/wms/hyprland/theme.nix +++ b/modules/home/wms/hyprland/theme.nix @@ -3,7 +3,7 @@ lib, pkgs, namespace, - inputs, + inputs, ... }: let @@ -12,58 +12,59 @@ let cfg = config.${namespace}.wms.hyprland; in { - config = mkIf cfg.enable { - gtk = { # TODO: make separate theme module - enable = true; - theme = { - name = "rose-pine"; - package = pkgs.rose-pine-gtk-theme; - }; + config = mkIf cfg.enable { + gtk = { + # TODO: make separate theme module + enable = true; + theme = { + name = "rose-pine"; + package = pkgs.rose-pine-gtk-theme; + }; - iconTheme = { - package = pkgs.rose-pine-icon-theme; - name = "Rose-Pine-Icon-Theme"; - }; + iconTheme = { + package = pkgs.rose-pine-icon-theme; + name = "Rose-Pine-Icon-Theme"; + }; - font = { - name = "Sans"; - size = 11; - }; - }; + font = { + name = "Sans"; + size = 11; + }; + }; - wayland.windowManager.hyprland = { - settings = { - "$dim" = "decoration:dim_inactive"; - - # decorations - "general:gaps_out" = 4; - "general:gaps_in" = 3; - "general:border_size" = 3; - "general:col.active_border" = "rgba(${config.colorScheme.palette.base08}AA)"; - "general:col.inactive_border" = "rgba(${config.colorScheme.palette.base00}FF)"; - "decoration:rounding" = 7; + wayland.windowManager.hyprland = { + settings = { + "$dim" = "decoration:dim_inactive"; - animations = { - enabled = "yes"; - first_launch_animation = true; - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - bezier = [ - "easein, 0.47, 0, 0.745, 0.715" - "myBezier, 0.05, 0.9, 0.1, 1.05" - "overshot, 0.13, 0.99, 0.29, 1.1" - "scurve, 0.98, 0.01, 0.02, 0.98" - ]; - animation = [ - "border, 1, 10, default" - "fade, 1, 10, default" - "windows, 1, 5, overshot, popin 10%" - "windowsOut, 1, 7, default, popin 10%" - "workspaces, 1, 6, overshot, slide" - ]; - }; + # decorations + "general:gaps_out" = 4; + "general:gaps_in" = 3; + "general:border_size" = 3; + "general:col.active_border" = "rgba(${config.colorScheme.palette.base08}AA)"; + "general:col.inactive_border" = "rgba(${config.colorScheme.palette.base00}FF)"; + "decoration:rounding" = 7; - }; - }; - }; + animations = { + enabled = "yes"; + first_launch_animation = true; + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + bezier = [ + "easein, 0.47, 0, 0.745, 0.715" + "myBezier, 0.05, 0.9, 0.1, 1.05" + "overshot, 0.13, 0.99, 0.29, 1.1" + "scurve, 0.98, 0.01, 0.02, 0.98" + ]; + animation = [ + "border, 1, 10, default" + "fade, 1, 10, default" + "windows, 1, 5, overshot, popin 10%" + "windowsOut, 1, 7, default, popin 10%" + "workspaces, 1, 6, overshot, slide" + ]; + }; + + }; + }; + }; } diff --git a/modules/nixos/apps/thunar/default.nix b/modules/nixos/apps/thunar/default.nix index 76794b9..c53da77 100644 --- a/modules/nixos/apps/thunar/default.nix +++ b/modules/nixos/apps/thunar/default.nix @@ -1,34 +1,34 @@ { - pkgs, - lib, - config, - namespace, - ... -}: let - inherit (lib) mkEnableOption mkIf; + pkgs, + lib, + config, + namespace, + ... +}: +let + inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.apps.thunar; + cfg = config.${namespace}.apps.thunar; -in { - options.${namespace}.apps.thunar = { - enable = mkEnableOption "thunar."; - }; - - config = mkIf cfg.enable { - programs.thunar = { - enable = true; - plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; - }; +in +{ + options.${namespace}.apps.thunar = { + enable = mkEnableOption "thunar."; + }; + + config = mkIf cfg.enable { + programs.thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; - services.gvfs.enable = true; - services.tumbler.enable = true; - programs.xfconf.enable = true; + services.gvfs.enable = true; + services.tumbler.enable = true; + programs.xfconf.enable = true; - environment.systemPackages = with pkgs; [ - ark - ]; - }; + environment.systemPackages = with pkgs; [ ark ]; + }; } diff --git a/modules/nixos/cli/fish/default.nix b/modules/nixos/cli/fish/default.nix index 928c0ef..e843014 100644 --- a/modules/nixos/cli/fish/default.nix +++ b/modules/nixos/cli/fish/default.nix @@ -1,39 +1,39 @@ { - pkgs, - system, - namespace, - lib, - config, - ... -}: let - inherit (lib) mkEnableOption enabled mkIf; + pkgs, + system, + namespace, + lib, + config, + ... +}: +let + inherit (lib) mkEnableOption enabled mkIf; - cfg = config.${namespace}.cli.fish; -in { - options.${namespace}.cli.fish = { - enable = mkEnableOption "fish shell."; - }; + cfg = config.${namespace}.cli.fish; +in +{ + options.${namespace}.cli.fish = { + enable = mkEnableOption "fish shell."; + }; - config = mkIf cfg.enable { - environment = { - systemPackages = with pkgs; [ - nix-your-shell - ]; - shells = [pkgs.fish]; - }; + config = mkIf cfg.enable { + environment = { + systemPackages = with pkgs; [ nix-your-shell ]; + shells = [ pkgs.fish ]; + }; - programs.fish = { - enable = true; - }; + programs.fish = { + enable = true; + }; - programs.bash = { - interactiveShellInit = '' - if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] - then - shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" - exec ${pkgs.fish}/bin/fish $LOGIN_OPTION - fi - ''; - }; - }; + programs.bash = { + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; + }; } diff --git a/modules/nixos/cli/git/default.nix b/modules/nixos/cli/git/default.nix index 9a8d6bf..fc4b73b 100644 --- a/modules/nixos/cli/git/default.nix +++ b/modules/nixos/cli/git/default.nix @@ -1,22 +1,20 @@ { - pkgs, - namespace, - lib, - config, - ... -}: let - inherit (lib) mkIf; - inherit (lib.${namespace}) mkOpt; + pkgs, + namespace, + lib, + config, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkOpt; - cfg = config.${namespace}.system.git; -in { - options.${namespace}.system.git = { - enable = mkOpt lib.types.bool true "whether to manage git configuration"; - }; - - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - git - ]; - }; + cfg = config.${namespace}.system.git; +in +{ + options.${namespace}.system.git = { + enable = mkOpt lib.types.bool true "whether to manage git configuration"; + }; + + config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ git ]; }; } diff --git a/modules/nixos/dms/sddm/default.nix b/modules/nixos/dms/sddm/default.nix index b34cdab..82c9f55 100644 --- a/modules/nixos/dms/sddm/default.nix +++ b/modules/nixos/dms/sddm/default.nix @@ -1,39 +1,44 @@ { - lib, - namespace, - config, - pkgs, - ... -}@attrs: let - inherit (lib) mkIf mkEnableOption mkOption types; + lib, + namespace, + config, + pkgs, + ... +}@attrs: +let + inherit (lib) + mkIf + mkEnableOption + mkOption + types + ; - cfg = config.${namespace}.dms.sddm; -in { - options.${namespace}.dms.sddm = { - enable = mkEnableOption "sddm"; - theme.style = mkOption { - type = types.enum [ "where-is-my-sddm-theme" ]; - default = "where-is-my-sddm-theme"; - description = "which sddm theme to use"; - }; - theme.background = mkOption { - type = types.nullOr types.path; - default = null; - description = "Path to the background of the sddm theme."; - }; - }; + cfg = config.${namespace}.dms.sddm; +in +{ + options.${namespace}.dms.sddm = { + enable = mkEnableOption "sddm"; + theme.style = mkOption { + type = types.enum [ "where-is-my-sddm-theme" ]; + default = "where-is-my-sddm-theme"; + description = "which sddm theme to use"; + }; + theme.background = mkOption { + type = types.nullOr types.path; + default = null; + description = "Path to the background of the sddm theme."; + }; + }; - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - libsForQt5.qt5.qtgraphicaleffects - ]; - services.displayManager = { - defaultSession = "hyprland"; # FIXME: should be dynamically set - sddm = { - enable = true; + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ libsForQt5.qt5.qtgraphicaleffects ]; + services.displayManager = { + defaultSession = "hyprland"; # FIXME: should be dynamically set + sddm = { + enable = true; wayland.enable = true; theme = "${import ./where-is-my-sddm-theme.nix attrs}"; - }; - }; - }; + }; + }; + }; } diff --git a/modules/nixos/dms/sddm/where-is-my-sddm-theme.nix b/modules/nixos/dms/sddm/where-is-my-sddm-theme.nix index 8a96564..bd16ddc 100644 --- a/modules/nixos/dms/sddm/where-is-my-sddm-theme.nix +++ b/modules/nixos/dms/sddm/where-is-my-sddm-theme.nix @@ -1,14 +1,16 @@ # https://github.com/Aman9das/zaneyos/blob/9deb3d0a7690f647b47b2ccd37a7028eae42d7e2/config/pkgs/where-is-my-sddm-theme.nix { - pkgs, + pkgs, namespace, config, - ... -}: let - image = - if (config.${namespace}.dms.sddm.theme.background == null) - then pkgs.nixos-artwork.wallpapers.nineish-dark-gray.gnomeFilePath - else config.${namespace}.dms.sddm.theme.background; + ... +}: +let + image = + if (config.${namespace}.dms.sddm.theme.background == null) then + pkgs.nixos-artwork.wallpapers.nineish-dark-gray.gnomeFilePath + else + config.${namespace}.dms.sddm.theme.background; in pkgs.stdenvNoCC.mkDerivation { name = "where-is-my-sddm-theme"; @@ -18,55 +20,55 @@ pkgs.stdenvNoCC.mkDerivation { rev = "4e55b6a549b559e1d7d21b84e301e427d5b8d005"; sha256 = "sha256-lxdtlNdMxBwCRL7c1Uw/TY6Yv9ycSdQz4BE1w19tzog="; }; - installPhase = # bash + installPhase = # bash '' - mkdir -p $out - ls . -a - cp -R ./where_is_my_sddm_theme_qt5/* $out/ - cd $out/ - #rm Background.jpg - cp -r ${image} $out/background.jpg - #rm theme.conf and set new conf - cat < theme.conf - [General] - # Password mask character - passwordCharacter=● - # Mask password characters or not ("true" or "false") - passwordMask=true - # value "1" is all display width, "0.5" is a half of display width etc. - passwordInputWidth=0.9 - # Background color of password input - passwordInputBackground= - # Radius of password input corners - passwordInputRadius= - # "true" for visible cursor, "false" - passwordInputCursorVisible=false - # Font size of password (in points) - passwordFontSize=24 - passwordCursorColor=random - passwordTextColor= + mkdir -p $out + ls . -a + cp -R ./where_is_my_sddm_theme_qt5/* $out/ + cd $out/ + #rm Background.jpg + cp -r ${image} $out/background.jpg + #rm theme.conf and set new conf + cat < theme.conf + [General] + # Password mask character + passwordCharacter=● + # Mask password characters or not ("true" or "false") + passwordMask=true + # value "1" is all display width, "0.5" is a half of display width etc. + passwordInputWidth=0.9 + # Background color of password input + passwordInputBackground= + # Radius of password input corners + passwordInputRadius= + # "true" for visible cursor, "false" + passwordInputCursorVisible=false + # Font size of password (in points) + passwordFontSize=24 + passwordCursorColor=random + passwordTextColor= - # Show or not sessions choose label - showSessionsByDefault=false - # Font size of sessions choose label (in points). - sessionsFontSize=24 + # Show or not sessions choose label + showSessionsByDefault=false + # Font size of sessions choose label (in points). + sessionsFontSize=24 - # Show or not users choose label - showUsersByDefault=true - # Font size of users choose label (in points) - usersFontSize=32 + # Show or not users choose label + showUsersByDefault=true + # Font size of users choose label (in points) + usersFontSize=32 - # Path to background image - background=background.jpg - # Or use just one color - backgroundFill= - backgroundMode=aspect + # Path to background image + background=background.jpg + # Or use just one color + backgroundFill= + backgroundMode=aspect - # Default text color for all labels - basicTextColor=#fafafa + # Default text color for all labels + basicTextColor=#fafafa - # Radius of background blur - blurRadius=16 - EOT - ''; + # Radius of background blur + blurRadius=16 + EOT + ''; } diff --git a/modules/nixos/hw/audio/default.nix b/modules/nixos/hw/audio/default.nix index 4335ede..ea74c16 100644 --- a/modules/nixos/hw/audio/default.nix +++ b/modules/nixos/hw/audio/default.nix @@ -1,23 +1,25 @@ { - lib, - namespace, - config, - ... -}: let - inherit (lib) mkOption mkIf; + lib, + namespace, + config, + ... +}: +let + inherit (lib) mkOption mkIf; - cfg = config.${namespace}.hw.audio; -in { - options.${namespace}.hw.audio = { - provider = mkOption { - type = lib.types.enum [ "pipewire" ]; - default = "pipewire"; - description = "which audio provider to use."; - }; - }; - - imports = [ ./pipewire.nix ]; - config = mkIf (cfg.provider != "") { - # mkIf (cfg.provider == "pipewire") [ ./pipewire.nix ]; - }; + cfg = config.${namespace}.hw.audio; +in +{ + options.${namespace}.hw.audio = { + provider = mkOption { + type = lib.types.enum [ "pipewire" ]; + default = "pipewire"; + description = "which audio provider to use."; + }; + }; + + imports = [ ./pipewire.nix ]; + config = mkIf (cfg.provider != "") { + # mkIf (cfg.provider == "pipewire") [ ./pipewire.nix ]; + }; } diff --git a/modules/nixos/hw/audio/pipewire.nix b/modules/nixos/hw/audio/pipewire.nix index c6cff73..e6578db 100644 --- a/modules/nixos/hw/audio/pipewire.nix +++ b/modules/nixos/hw/audio/pipewire.nix @@ -1,24 +1,21 @@ +{ lib, pkgs, ... }: { - lib, - pkgs, - ... -}: { - hardware.pulseaudio.enable = false; + hardware.pulseaudio.enable = false; - services.pipewire = { - enable = true; - pulse = { - enable = true; - }; - alsa = { - enable = true; - support32Bit = true; - }; - }; - - environment.systemPackages = with pkgs; [ - pavucontrol - pulsemixer - helvum - ]; + services.pipewire = { + enable = true; + pulse = { + enable = true; + }; + alsa = { + enable = true; + support32Bit = true; + }; + }; + + environment.systemPackages = with pkgs; [ + pavucontrol + pulsemixer + helvum + ]; } diff --git a/modules/nixos/hw/nvidia/default.nix b/modules/nixos/hw/nvidia/default.nix index 05a8744..266a501 100644 --- a/modules/nixos/hw/nvidia/default.nix +++ b/modules/nixos/hw/nvidia/default.nix @@ -1,79 +1,85 @@ { - lib, - pkgs, - inputs, - namespace, - system, - config, - ... -}: let - inherit (lib) mkIf mkEnableOption mkOption; - cfg = config.${namespace}.hw.nvidia; -in { - options.${namespace}.hw.nvidia = { - enable = mkEnableOption "nvidia hardware support."; - version = mkOption { - type = lib.types.enum [ "535" "default" "open" ]; - default = "default"; - description = "which version of nVidia drivers to use."; - }; - }; + lib, + pkgs, + inputs, + namespace, + system, + config, + ... +}: +let + inherit (lib) mkIf mkEnableOption mkOption; + cfg = config.${namespace}.hw.nvidia; +in +{ + options.${namespace}.hw.nvidia = { + enable = mkEnableOption "nvidia hardware support."; + version = mkOption { + type = lib.types.enum [ + "535" + "default" + "open" + ]; + default = "default"; + description = "which version of nVidia drivers to use."; + }; + }; - config = mkIf cfg.enable { - hardware.graphics = { - enable = true; - }; + config = mkIf cfg.enable { + hardware.graphics = { + enable = true; + }; - # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = ["nvidia"]; + # Load nvidia driver for Xorg and Wayland + services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia = { - package = mkIf (cfg.version == "535" ) (let - rcu_patch = pkgs.fetchpatch { - url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; - hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; - }; - in - config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "535.154.05"; - sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg="; - sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k="; - openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo="; - settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10="; - persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE="; - patches = [rcu_patch]; - } - ); - # Modesetting is required. - modesetting.enable = true; + hardware.nvidia = { + package = mkIf (cfg.version == "535") ( + let + rcu_patch = pkgs.fetchpatch { + url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; + hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; + }; + in + config.boot.kernelPackages.nvidiaPackages.mkDriver { + version = "535.154.05"; + sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg="; + sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k="; + openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo="; + settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10="; + persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE="; + patches = [ rcu_patch ]; + } + ); + # Modesetting is required. + modesetting.enable = true; - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. - powerManagement.enable = false; - powerManagement.finegrained = false; + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; + powerManagement.finegrained = false; - open = (cfg.version == "open"); + open = (cfg.version == "open"); - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. - nvidiaSettings = true; + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; - # Optionally, you may need to select the appropriate driver version for your specific GPU. - # package = config.boot.kernelPackages.nvidiaPackages.stable; - prime = { - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; + # Optionally, you may need to select the appropriate driver version for your specific GPU. + # package = config.boot.kernelPackages.nvidiaPackages.stable; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; - sync.enable = true; - # this mode may lower power consumption - # offload = { - # enable = true; - # enableOffloadCmd = true; - # }; - }; - }; - }; + sync.enable = true; + # this mode may lower power consumption + # offload = { + # enable = true; + # enableOffloadCmd = true; + # }; + }; + }; + }; } - diff --git a/modules/nixos/hw/razer/default.nix b/modules/nixos/hw/razer/default.nix index ebfad49..45dba8e 100644 --- a/modules/nixos/hw/razer/default.nix +++ b/modules/nixos/hw/razer/default.nix @@ -1,23 +1,25 @@ { - lib, - namespace, - config, - ... -}: let - inherit (lib) mkIf mkEnableOption; + lib, + namespace, + config, + ... +}: +let + inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.hw.razer; -in { - options.${namespace}.hw.razer = { - enable = mkEnableOption "razer blade tools." ; - }; - - config = mkIf cfg.enable { - services = { - razer-laptop-control.enable = true; - udev.extraRules = '' - KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev" - ''; # needed for correct permissions for razer-laptop-control - }; - }; + cfg = config.${namespace}.hw.razer; +in +{ + options.${namespace}.hw.razer = { + enable = mkEnableOption "razer blade tools."; + }; + + config = mkIf cfg.enable { + services = { + razer-laptop-control.enable = true; + udev.extraRules = '' + KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="plugdev" + ''; # needed for correct permissions for razer-laptop-control + }; + }; } diff --git a/modules/nixos/system/locale/default.nix b/modules/nixos/system/locale/default.nix index 62495c4..6cffbbd 100644 --- a/modules/nixos/system/locale/default.nix +++ b/modules/nixos/system/locale/default.nix @@ -1,33 +1,35 @@ { - pkgs, - namespace, - config, - lib, - ... -}: let - cfg = config.${namespace}.system.locale; - inherit (lib) mkIf mkOption; -in { - options.${namespace}.system.locale = { - managed = mkOption { - type = lib.types.bool; - default = true; - description = "whether to manage locale."; - }; - }; + pkgs, + namespace, + config, + lib, + ... +}: +let + cfg = config.${namespace}.system.locale; + inherit (lib) mkIf mkOption; +in +{ + options.${namespace}.system.locale = { + managed = mkOption { + type = lib.types.bool; + default = true; + description = "whether to manage locale."; + }; + }; - config = mkIf cfg.managed { - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - }; + config = mkIf cfg.managed { + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; } diff --git a/modules/nixos/system/nix/default.nix b/modules/nixos/system/nix/default.nix index 68a12bb..0f05870 100644 --- a/modules/nixos/system/nix/default.nix +++ b/modules/nixos/system/nix/default.nix @@ -1,56 +1,58 @@ { - pkgs, - namespace, - lib, - inputs, - config, - ... -}: let - inherit (lib) mkIf mkOption mkEnableOption; + pkgs, + namespace, + lib, + inputs, + config, + ... +}: +let + inherit (lib) mkIf mkOption mkEnableOption; - cfg = config.${namespace}.system.nix; -in { - options.${namespace}.system.nix = { - managed = mkOption { - type = lib.types.bool; - default = true; - description = "whether to manage nix configuration."; - }; + cfg = config.${namespace}.system.nix; +in +{ + options.${namespace}.system.nix = { + managed = mkOption { + type = lib.types.bool; + default = true; + description = "whether to manage nix configuration."; + }; useHelper = mkEnableOption "whether to use nix helper."; - }; + }; - config = mkIf cfg.managed { - environment.systemPackages = with pkgs; [ - home-manager - sqlite - alejandra - # TODO: add cachix - ]; + config = mkIf cfg.managed { + environment.systemPackages = with pkgs; [ + home-manager + sqlite + alejandra + # TODO: add cachix + ]; - programs.nh = mkIf cfg.useHelper { - enable = true; - }; - - nix = let - flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; - in { - settings = { - experimental-features = "nix-command flakes"; - flake-registry = ""; - # Workaround for https://github.com/NixOS/nix/issues/9574 - nix-path = "https://github.com/NixOS/nixpkgs"; - }; - # Opinionated: disable channels - channel.enable = false; + programs.nh = mkIf cfg.useHelper { enable = true; }; + + nix = + let + flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; + in + { + settings = { + experimental-features = "nix-command flakes"; + flake-registry = ""; + # Workaround for https://github.com/NixOS/nix/issues/9574 + nix-path = "https://github.com/NixOS/nixpkgs"; + }; + # Opinionated: disable channels + channel.enable = false; - # Opinionated: make flake registry and nix path match flake inputs - registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + # Opinionated: make flake registry and nix path match flake inputs + registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; - gc = { - automatic = true; - options = "--delete-older-than 7d"; - }; - }; - }; + gc = { + automatic = true; + options = "--delete-older-than 7d"; + }; + }; + }; } diff --git a/modules/nixos/system/time/default.nix b/modules/nixos/system/time/default.nix index fe7b7ed..ff17b58 100644 --- a/modules/nixos/system/time/default.nix +++ b/modules/nixos/system/time/default.nix @@ -1,22 +1,22 @@ { - lib, - namespace, - config, - ... -}: let - inherit (lib) mkIf mkOption; + lib, + namespace, + config, + ... +}: +let + inherit (lib) mkIf mkOption; - cfg = config.${namespace}.system.time; -in { - options.${namespace}.system.time = { - managed = mkOption { - type = lib.types.bool; - default = true; - description = "whether to manage timezone"; - }; - }; + cfg = config.${namespace}.system.time; +in +{ + options.${namespace}.system.time = { + managed = mkOption { + type = lib.types.bool; + default = true; + description = "whether to manage timezone"; + }; + }; - config = mkIf cfg.managed { - time.timeZone = "America/New_York"; - }; + config = mkIf cfg.managed { time.timeZone = "America/New_York"; }; } diff --git a/modules/nixos/wms/hyprland/default.nix b/modules/nixos/wms/hyprland/default.nix index 4589d11..f533123 100644 --- a/modules/nixos/wms/hyprland/default.nix +++ b/modules/nixos/wms/hyprland/default.nix @@ -1,29 +1,31 @@ { - config, - lib, - namespace, - pkgs, - ... -}: let - inherit (lib) mkIf mkEnableOption enabled; + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf mkEnableOption enabled; - cfg = config.${namespace}.wms.hyprland; -in { - options.${namespace}.wms.hyprland = { - enable = mkEnableOption "hyprland."; - }; + cfg = config.${namespace}.wms.hyprland; +in +{ + options.${namespace}.wms.hyprland = { + enable = mkEnableOption "hyprland."; + }; - config = mkIf cfg.enable { - programs.hyprland.enable = true; - programs.hyprland.portalPackage = pkgs.xdg-desktop-portal-gtk; + config = mkIf cfg.enable { + programs.hyprland.enable = true; + programs.hyprland.portalPackage = pkgs.xdg-desktop-portal-gtk; - xdg.portal = { - enable = true; - xdgOpenUsePortal = false; - extraPortals = with pkgs; [ - xdg-desktop-portal-hyprland - xdg-desktop-portal-gtk - ]; - }; - }; + xdg.portal = { + enable = true; + xdgOpenUsePortal = false; + extraPortals = with pkgs; [ + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk + ]; + }; + }; } diff --git a/systems/x86_64-linux/blade/boot.nix b/systems/x86_64-linux/blade/boot.nix index cb183eb..8613bd2 100644 --- a/systems/x86_64-linux/blade/boot.nix +++ b/systems/x86_64-linux/blade/boot.nix @@ -1,16 +1,16 @@ _: { - boot = { - plymouth = { - enable = true; - }; - loader = { - grub = { - device = "nodev"; - efiSupport = true; - useOSProber = true; - }; - efi.canTouchEfiVariables = true; - }; - supportedFilesystems = ["ntfs"]; - }; + boot = { + plymouth = { + enable = true; + }; + loader = { + grub = { + device = "nodev"; + efiSupport = true; + useOSProber = true; + }; + efi.canTouchEfiVariables = true; + }; + supportedFilesystems = [ "ntfs" ]; + }; } diff --git a/systems/x86_64-linux/blade/default.nix b/systems/x86_64-linux/blade/default.nix index d98d2cc..06fa70b 100644 --- a/systems/x86_64-linux/blade/default.nix +++ b/systems/x86_64-linux/blade/default.nix @@ -1,71 +1,69 @@ { - config, - lib, - namespace, - inputs, + config, + lib, + namespace, + inputs, pkgs, - ... + ... }: let inherit (lib.${namespace}) enabled; in { - imports = [ - ./boot.nix - ./disks.nix - ./hardware-configuration.nix - ]; + imports = [ + ./boot.nix + ./disks.nix + ./hardware-configuration.nix + ]; - dotties = { - hw = { - nvidia = { - enable = true; - version = "535"; - }; - razer = enabled; - }; + dotties = { + hw = { + nvidia = { + enable = true; + version = "535"; + }; + razer = enabled; + }; apps = { thunar = enabled; }; - dms.sddm = { - enable = true; - theme = { - style = "where-is-my-sddm-theme"; - background = pkgs.fetchurl { + dms.sddm = { + enable = true; + theme = { + style = "where-is-my-sddm-theme"; + background = pkgs.fetchurl { url = "https://ploop.city/home.png"; sha256 = "ca39463acd764102888c8cb859b856fd6fb8f974d8bc527827da3017c9210d18"; - }; - }; - }; + }; + }; + }; system.nix = { managed = true; useHelper = true; }; - cli = { - fish = enabled; - }; - - wms = { - hyprland = enabled; - }; - }; - - nixpkgs = { - config = { - allowUnfree = true; - }; - }; + cli = { + fish = enabled; + }; - networking = { - hostName = lib.snowfall.system.get-inferred-system-name ./.; - networkmanager = enabled; - }; + wms = { + hyprland = enabled; + }; + }; + nixpkgs = { + config = { + allowUnfree = true; + }; + }; + networking = { + hostName = lib.snowfall.system.get-inferred-system-name ./.; + networkmanager = enabled; + }; - system.stateVersion = "23.05"; + system.stateVersion = "23.05"; } diff --git a/systems/x86_64-linux/blade/disks.nix b/systems/x86_64-linux/blade/disks.nix index 9b7d13c..c18a744 100644 --- a/systems/x86_64-linux/blade/disks.nix +++ b/systems/x86_64-linux/blade/disks.nix @@ -3,13 +3,29 @@ _: { "/media/shared" = { device = "/dev/disk/by-uuid/17DDE0D865E0DD6C"; fsType = "ntfs-3g"; - options = [ "rw" "uid=1000" "gid=100" "windows_names" "locale=en_US.UTF-8" "dmask=027" "fmask=137"]; + options = [ + "rw" + "uid=1000" + "gid=100" + "windows_names" + "locale=en_US.UTF-8" + "dmask=027" + "fmask=137" + ]; }; - "/media/windows" = { + "/media/windows" = { device = "/dev/disk/by-uuid/2AFE8EADFE8E713D"; fsType = "ntfs-3g"; - options = [ "rw" "uid=1000" "gid=100" "windows_names" "locale=en_US.UTF-8" "dmask=027" "fmask=137"]; + options = [ + "rw" + "uid=1000" + "gid=100" + "windows_names" + "locale=en_US.UTF-8" + "dmask=027" + "fmask=137" + ]; }; }; } diff --git a/systems/x86_64-linux/blade/hardware-configuration.nix b/systems/x86_64-linux/blade/hardware-configuration.nix index 1173157..2d93fdb 100644 --- a/systems/x86_64-linux/blade/hardware-configuration.nix +++ b/systems/x86_64-linux/blade/hardware-configuration.nix @@ -4,30 +4,38 @@ pkgs, modulesPath, ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "thunderbolt" "usbhid" "sdhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "thunderbolt" + "usbhid" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/6c30d922-8bfe-42f8-baf6-9c8c04cba53a"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/189B-4D10"; - fsType = "vfat"; - options = ["fmask=0022" "dmask=0022"]; - }; - }; - swapDevices = []; + "/" = { + device = "/dev/disk/by-uuid/6c30d922-8bfe-42f8-baf6-9c8c04cba53a"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/189B-4D10"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + }; + 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