diff --git a/common/automapaper/automapaper.nix b/common/automapaper/automapaper.nix deleted file mode 100644 index 209a49d..0000000 --- a/common/automapaper/automapaper.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, inputs, pkgs, ... }: - -{ - home.packages = [ - inputs.automapaper.packages.${pkgs.system}.default - ]; - - home.file = { - "${config.xdg.configHome}/automapaper/config.toml".source = ./config.toml; - "${config.xdg.configHome}/automapaper/config2nd.toml".source = ./config2nd.toml; - "${config.xdg.configHome}/automapaper/state.frag".source = ./state.frag; - "${config.xdg.configHome}/automapaper/init.frag".source = ./init.frag; - "${config.xdg.configHome}/automapaper/display.frag".source = ./display.frag; - }; -} diff --git a/common/dunst.nix b/common/dunst.nix deleted file mode 100644 index 05fe9fe..0000000 --- a/common/dunst.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, inputs, ... }: - -{ - services.dunst = { - enable = true; - }; -} diff --git a/common/firefox.nix b/common/firefox.nix deleted file mode 100644 index 333a75e..0000000 --- a/common/firefox.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, inputs, ... }: - -{ - home.packages = with pkgs; [ - firefox - ]; - - programs.firefox = { - enable = true; - # TODO add some default firefox settings - }; - -} diff --git a/common/git.nix b/common/git.nix deleted file mode 100644 index f5b6684..0000000 --- a/common/git.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, inputs, ... }: - -{ - home.packages = with pkgs; [ - git - ]; - programs.git = { - enable = true; - userName = "Noa Aarts"; - userEmail = "itepastra@gmail.com"; - extraConfig = { - init = { defaultBranch = "main"; }; - safe.directory = "/etc/nixos"; - pull.rebase = false; - }; - }; - -} diff --git a/common/kitty.nix b/common/kitty.nix deleted file mode 100644 index 56ca91c..0000000 --- a/common/kitty.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, pkgs, inputs, ... }: - -{ - home.packages = with pkgs; [ - kitty - ]; - programs.kitty = { - enable = true; - settings = { - confirm_os_window_close = 0; - }; - shellIntegration.enableZshIntegration = true; - }; -} diff --git a/common/nvim/init.lua b/common/nvim/init.lua index cf5783c..6c399be 100644 --- a/common/nvim/init.lua +++ b/common/nvim/init.lua @@ -579,6 +579,8 @@ require("lazy").setup({ python = { "black" }, go = { "gopls" }, + + nix = { "nixpkgs-fmt" }, -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. diff --git a/common/wofi.nix b/common/wofi.nix deleted file mode 100644 index 13b2458..0000000 --- a/common/wofi.nix +++ /dev/null @@ -1,120 +0,0 @@ -{ config, pkgs, inputs, nix-colors, ... }: - -{ - imports = [ - ./colors.nix - ]; - home.packages = with pkgs; [ - (writeShellScriptBin "wofi-launch" '' - ${wofi}/bin/wofi --show drun - '') - (writeShellScriptBin "wofi-power" '' - lock="Lock" - poweroff="Poweroff" - reboot="Reboot" - sleep="Suspend" - - selected_option=$(echo -e "$lock\n$sleep\n$reboot\n$poweroff" | wofi --dmenu -i -p "Powermenu") - - if [ "$selected_option" == "$lock" ] - then - echo "lock" - swaylock - elif [ "$selected_option" == "$poweroff" ] - then - echo "poweroff" - poweroff - elif [ "$selected_option" == "$reboot" ] - then - echo "reboot" - reboot - elif [ "$selected_option" == "$sleep" ] - then - echo "sleep" - suspend - else - echo "No match" - fi - '') - ]; - programs.wofi = { - enable = true; - settings = { - - }; - style = '' - * { - outline: none; - outline-style: none; - } - - #window { - margin: 10px; - border: none; - background-color: #${config.colorScheme.palette.background}; - border-radius: 10px; - font-family: - JetBrains Mono NF, - monospace; - font-weight: bold; - font-size: 14px; - } - - #outer-box { - margin: 10px; - border: 2px #${config.colorScheme.palette.backgroundMuted}; - border-radius: 10px; - background-color: transparent; - } - - #input { - border: none; - border-radius: 10px; - margin-left: 2px; - color: #${config.colorScheme.palette.info}; - outline-style: none; - background-color: #${config.colorScheme.palette.background}; - } - - #scroll { - border: 10px solid #${config.colorScheme.palette.border}; - border-radius: 10px; - /*padding-right: 10px;*/ - outline: none; - background-color: #${config.colorScheme.palette.background}; - } - - #inner-box { - border: none; - border-radius: 10px; - background-color: transparent; - } - - #entry { - border: none; - /*border-radius: 10px; - margin-right: 15px; - margin-left: 15px;*/ - padding-right: 10px; - padding-left: 10px; - color: #${config.colorScheme.palette.text}; - background-color: #${config.colorScheme.palette.background}; - } - #entry:selected { - border: none; - background-color: #${config.colorScheme.palette.info}; - } - - #text:selected { - border: none; - color: #${config.colorScheme.palette.textMuted}; - } - - #img { - background-color: transparent; - margin-right: 6px; - } - ''; - }; - -} diff --git a/common/zsh.nix b/common/zsh.nix deleted file mode 100644 index c053dc3..0000000 --- a/common/zsh.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: - -{ - home.packages = with pkgs; [ - zsh - ]; - programs.direnv = { - enable=true; - enableZshIntegration=true; - nix-direnv.enable=true; - }; - programs.zsh = { - enable=true; - shellAliases = { - ll = "lsd -l"; - lt = "lsd -l --tree"; - update = "nix flake update --commit-lock-file $HOME/nixos && sudo nixos-rebuild switch --flake $HOME/nixos"; - }; - history = { - path = "${config.xdg.dataHome}/zsh/history"; - size = 10000; - }; - oh-my-zsh = { - enable = true; - plugins = [ "git" ]; - theme = "frisk"; - }; - }; - -} diff --git a/hosts/default/home.nix b/hosts/default/home.nix index 2502b1d..cc120a1 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -4,16 +4,12 @@ imports = [ inputs.nixvim.homeManagerModules.nixvim - ../../common/zsh.nix ../../modules/hyprland.nix ../../modules/games - ../../common/kitty.nix - ../../common/git.nix + ../../modules/applications ../../common/nvim/nvim.nix ../../common/discord/discord.nix ../../common/spotify.nix - ../../common/automapaper/automapaper.nix - ../../common/firefox.nix ]; # Home Manager needs a bit of information about you and the paths it should # manage. @@ -34,6 +30,13 @@ modules = { hyprland.enable = true; games.enable = true; + apps = { + enable = true; + git = { + name = "Noa Aarts"; + email = "itepastra@gmail.com"; + }; + }; }; # The home.packages option allows you to install Nix packages into your diff --git a/modules/applications/default.nix b/modules/applications/default.nix new file mode 100644 index 0000000..34e9e57 --- /dev/null +++ b/modules/applications/default.nix @@ -0,0 +1,25 @@ +{ lib, config, pkgs, ... }: +let + cfg = config.modules.apps; +in +{ + options.modules.apps = { + enable = lib.mkEnableOption "enable desktop applications"; + }; + + imports = [ + ./firefox.nix + ./git.nix + ./kitty.nix + ./zsh.nix + ]; + + config = lib.mkIf cfg.enable { + modules.apps = { + firefox.enable = true; + git.enable = true; + kitty.enable = true; + zsh.enable = true; + }; + }; +} diff --git a/modules/applications/firefox.nix b/modules/applications/firefox.nix new file mode 100644 index 0000000..705d72e --- /dev/null +++ b/modules/applications/firefox.nix @@ -0,0 +1,17 @@ +{ lib, config, pkgs, ... }: +let + cfg = config.modules.apps.firefox; +in +{ + options.modules.apps.firefox = { + enable = lib.mkEnableOption "enable firefox"; + }; + + config = lib.mkIf cfg.enable { + programs.firefox = { + enable = true; + # TODO: add some default firefox settings + }; + }; + +} diff --git a/modules/applications/git.nix b/modules/applications/git.nix new file mode 100644 index 0000000..190494f --- /dev/null +++ b/modules/applications/git.nix @@ -0,0 +1,34 @@ +{ lib, config, pkgs, ... }: +let + cfg = config.modules.apps.git; +in +{ + options.modules.apps.git = { + enable = lib.mkEnableOption "enable git"; + name = lib.mkOption { + example = "Jill Doe"; + description = "the git user Name"; + type = lib.types.str; + }; + email = lib.mkOption { + example = "jilldoe@test.local"; + description = "the git user Name"; + type = lib.types.str; + }; + }; + + + config = lib.mkIf cfg.enable { + programs.git = { + enable = true; + userName = cfg.name; + userEmail = cfg.email; + extraConfig = { + init = { defaultBranch = "main"; }; + safe.directory = "/etc/nixos"; + pull.rebase = false; + }; + }; + }; + +} diff --git a/modules/applications/kitty.nix b/modules/applications/kitty.nix new file mode 100644 index 0000000..90f5906 --- /dev/null +++ b/modules/applications/kitty.nix @@ -0,0 +1,19 @@ +{ lib, config, pkgs, ... }: +let + cfg = config.modules.apps.kitty; +in +{ + options.modules.apps.kitty = { + enable = lib.mkEnableOption "enable the kitty terminal emulator"; + }; + + config = lib.mkIf cfg.enable { + programs.kitty = { + enable = true; + settings = { + confirm_os_window_close = 0; + }; + shellIntegration.enableZshIntegration = true; + }; + }; +} diff --git a/modules/applications/zsh.nix b/modules/applications/zsh.nix new file mode 100644 index 0000000..28fb285 --- /dev/null +++ b/modules/applications/zsh.nix @@ -0,0 +1,36 @@ +{ lib, config, pkgs, ... }: +let + cfg = config.modules.apps.zsh; +in +{ + options.modules.apps.zsh = { + enable = lib.mkEnableOption "enable zsh with oh-my-zsh"; + enableAliases = lib.mkEnableOption "whether to enable shellAliases"; + }; + + config = lib.mkIf cfg.enable { + programs.direnv = { + enable=true; + enableZshIntegration=true; + nix-direnv.enable=true; + }; + programs.zsh = { + enable=true; + shellAliases = lib.mkIf cfg.enableAliases { + ll = "lsd -l"; + lt = "lsd -l --tree"; + update = "nix flake update --commit-lock-file $HOME/nixos && sudo nixos-rebuild switch --flake $HOME/nixos"; + }; + history = { + path = "${config.xdg.dataHome}/zsh/history"; + size = 10000; + }; + oh-my-zsh = { + enable = true; + plugins = [ "git" ]; + theme = "frisk"; + }; + }; + }; + +} diff --git a/modules/automapaper/automapaper.nix b/modules/automapaper/automapaper.nix new file mode 100644 index 0000000..c4ebfbf --- /dev/null +++ b/modules/automapaper/automapaper.nix @@ -0,0 +1,25 @@ +{ lib, config, pkgs, inputs, ... }: +let + cfg = config.modules.automapaper; +in +{ + options.modules.automapaper = { + enable = lib.mkEnableOption "enable automapaper"; + }; + + + config = lib.mkIf cfg.enable { + home.packages = [ + inputs.automapaper.packages.${pkgs.system}.default + ]; + + home.file = { + "${config.xdg.configHome}/automapaper/config.toml".source = ./config.toml; + "${config.xdg.configHome}/automapaper/config2nd.toml".source = ./config2nd.toml; + "${config.xdg.configHome}/automapaper/state.frag".source = ./state.frag; + "${config.xdg.configHome}/automapaper/init.frag".source = ./init.frag; + "${config.xdg.configHome}/automapaper/display.frag".source = ./display.frag; + }; + }; + +} diff --git a/common/automapaper/config.toml b/modules/automapaper/config.toml similarity index 100% rename from common/automapaper/config.toml rename to modules/automapaper/config.toml diff --git a/common/automapaper/config2nd.toml b/modules/automapaper/config2nd.toml similarity index 100% rename from common/automapaper/config2nd.toml rename to modules/automapaper/config2nd.toml diff --git a/common/automapaper/display.frag b/modules/automapaper/display.frag similarity index 100% rename from common/automapaper/display.frag rename to modules/automapaper/display.frag diff --git a/common/automapaper/init.frag b/modules/automapaper/init.frag similarity index 100% rename from common/automapaper/init.frag rename to modules/automapaper/init.frag diff --git a/common/automapaper/state.frag b/modules/automapaper/state.frag similarity index 100% rename from common/automapaper/state.frag rename to modules/automapaper/state.frag diff --git a/modules/hyprland.nix b/modules/hyprland.nix index c2696a2..19bbe88 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -15,15 +15,23 @@ in default = pkgs.kitty; description = "What terminal emulator should be used in hyprland"; }; + wallpapers.automapaper = { + enable = lib.mkEnableOption "enable automapaper"; + }; }; imports = [ ./waybar/default.nix ./wofi.nix ./dunst.nix + ./automapaper/automapaper.nix ]; + config = lib.mkIf cfg.enable { modules = { + automapaper = { + enable = true; + }; waybar = { modules = { left = [ "hyprland/workspaces" "tray" "hyprland/window" ]; @@ -70,8 +78,8 @@ in exec-once = [ "waybar" "dunst" - "automapaper -C ${config.xdg.configHome}/automapaper/config.toml" - "automapaper -C ${config.xdg.configHome}/automapaper/config2nd.toml" + (lib.mkIf cfg.wallpapers.automapaper.enable "automapaper -C ${config.xdg.configHome}/automapaper/config.toml") + (lib.mkIf cfg.wallpapers.automapaper.enable "automapaper -C ${config.xdg.configHome}/automapaper/config2nd.toml") "hyprctl dispatcher focusmonitor 1" "hypridle" ];