diff --git a/flake.nix b/flake.nix index 99ea621..0e6483f 100755 --- a/flake.nix +++ b/flake.nix @@ -24,21 +24,17 @@ }; in { nixosConfigurations = { - myNixos = nixpkgs.lib.nixosSystem { + lena = nixpkgs.lib.nixosSystem { inherit system; modules = [ ./nixos/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.forestcat = import ./home.nix; + } ]; }; }; - homeConfigurations = { - forestcat = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ - ./home.nix - ]; - }; - - }; }; } diff --git a/home.nix b/home.nix index 89f5a08..391caa9 100755 --- a/home.nix +++ b/home.nix @@ -1,6 +1,13 @@ { config, pkgs, ... }: { + imports = [ + ./local-configs/zsh + ]; + + + + # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "forestcat"; @@ -39,6 +46,13 @@ # Home Manager is pretty good at managing dotfiles. The primary way to manage # plain files is through 'home.file'. home.file = { + + ".config/hypr/hyprland.conf".source = ./local-configs/hyprland/hyprland.conf; + ".config/hypr/start.sh".source = ./local-configs/hyprland/hyprland-start.sh; + ".config/alacritty/alacritty.yml".source = ./local-configs/alacritty/alacritty.yml; + + ".config/waybar/config".source = ./local-configs/waybar/config; + ".config/waybar/style.css".source = ./local-configs/waybar/style.css; # # Building this configuration will create a copy of 'dotfiles/screenrc' in # # the Nix store. Activating the configuration will then make '~/.screenrc' a # # symlink to the Nix store copy. @@ -64,21 +78,20 @@ # /etc/profiles/per-user/forestcat/etc/profile.d/hm-session-vars.sh # - # home.file.".config/hypr/hyprland.conf".source = ./hyprland.conf; - - home.sessionVariables = { +home.sessionVariables = { EDITOR = "hx"; }; - programs.nushell = { - enable = true; - shellAliases = { - ll = "ls -l"; - cheetah = "curl -d 'Lena: Done ✓' https://ntfy.forestcat.org/cheetah"; - reboot = "systemctl reboot"; - rebuild = "sudo nixos-rebuild switch --flake ~/nix-configs/#myNixos --show-trace"; - }; - }; - + # programs.nushell = { + # enable = true; + # shellAliases = { + # ll = "ls -l"; + # cheetah = "curl -d 'Lena: Done ✓' https://ntfy.forestcat.org/cheetah"; + # reboot = "systemctl reboot"; + # rebuild = "sudo nixos-rebuild switch --flake ~/nix-configs/#myNixos --show-trace"; + # nx = "nix shell nixpkgs/nixos-23.11#"; + # }; + # }; + # services.polybar.enable = true; # services.xserver.windowManager.i3.configFile = "./local-configs/config"; diff --git a/local-configs/hyprland/hyprland-start.sh b/local-configs/hyprland/hyprland-start.sh index 175926a..7005f9a 100755 --- a/local-configs/hyprland/hyprland-start.sh +++ b/local-configs/hyprland/hyprland-start.sh @@ -9,7 +9,11 @@ swww init & nm-applet --indicator & # infobar -waybar & +waybar -c ~/.config/waybar/config & # dunst notification deamon dunst + + +# start nextcloud in the background for file syncing +nextcloud --background diff --git a/local-configs/hyprland/hyprland.conf b/local-configs/hyprland/hyprland.conf index 2a072ae..a974a06 100644 --- a/local-configs/hyprland/hyprland.conf +++ b/local-configs/hyprland/hyprland.conf @@ -22,7 +22,7 @@ monitor=eDP-1,1920x1080@60,0x0,1.2 # Set programs that you use $terminal = alacritty -$fileManager = dolphin +$fileManager = thunar $menu = rofi -show drun -show-icons # Some default env vars. @@ -175,6 +175,30 @@ bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 +# will switch to a submap called resize +bind=$mainMod, R, submap, resize + +# will start a submap called "resize" +submap=resize + +# sets repeatable binds for resizing the active window +binde=,right,resizeactive,20 0 +binde=,left,resizeactive,-20 0 +binde=,up,resizeactive,0 -20 +binde=,down,resizeactive,0 20 + +binde=,l,resizeactive,20 0 +binde=,h,resizeactive,-20 0 +binde=,k,resizeactive,0 -20 +binde=,j,resizeactive,0 20 + +# use reset to go back to the global submap +bind=,escape,submap,reset + +# will reset the submap, meaning end the current one and return to the global one +submap=reset + + # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic diff --git a/local-configs/waybar/config b/local-configs/waybar/config new file mode 100644 index 0000000..714b3ba --- /dev/null +++ b/local-configs/waybar/config @@ -0,0 +1,91 @@ +{ + "layer": "top", + "modules-left": ["custom/launcher","cpu","memory","custom/media","tray"], + "modules-center": ["river/tags", "hyprland/workspaces" ], + "modules-right": ["custom/updates","custom/wallpaper","backlight","pulseaudio","clock", "battery","custom/power"], + + "pulseaudio": { + "tooltip": false, + "scroll-step": 5, + "format": "{icon} {volume}%", + "format-muted": "{icon} {volume}%", + "on-click":"pactl set-sink-mute @DEFAULT_SINK@ toggle", + "format-icons": { + "default": ["", "", ""] + } + }, + + "river/tags": { + "num-tags": 6 + }, + "network": { + "tooltip": false, + "format-wifi": " {essid}", + "format-ethernet": "" + }, + "backlight": { + "tooltip": false, + "format": " {}%", + "interval":1, + "on-scroll-up": "light -A 5", + "on-scroll-down": "light -U 5" + }, + "battery": { + "states": { + "good": 95, + "warning": 30, + "critical": 20 + }, + "format": "{icon} {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""] + }, + "tray":{ + "icon-size":18, + "spacing": 10 + }, + "clock": { + "format": "{: %I:%M %p  %d/%m/%Y}" + }, + "cpu": { + "interval": 15, + "format": " {}%", + "max-length": 10 + }, + "memory": { + "interval": 30, + "format": " {}%", + "max-length": 10 + }, + "custom/media": { + "interval": 30, + "format": "{icon} {}", + "return-type": "json", + "max-length": 20, + "format-icons": { + "spotify": " ", + "default": " " + }, + "escape": true, + "exec": "$HOME/.config/system_scripts/mediaplayer.py 2> /dev/null", + "on-click": "playerctl play-pause" + }, + "custom/launcher":{ + "format": " ", + "on-click": "rofi -show drun", + "on-click-right": "killall rofi" + }, + "custom/power":{ + "format": " ", + "on-click": "bash ~/.config/rofi/leave/leave.sh", + }, + "custom/updates":{ + "format": "{} Update(s)", + "exec": "checkupdates | wc -l", + "exec-if": "[[ $(checkupdates | wc -l) != 0 ]]", + "interval": 15, + "on-click": "alacritty -e paru -Syu && notify-send 'The system has been updated' " + } +} diff --git a/local-configs/waybar/style.css b/local-configs/waybar/style.css new file mode 100644 index 0000000..79048bd --- /dev/null +++ b/local-configs/waybar/style.css @@ -0,0 +1,247 @@ +* { + border: none; + border-radius: 10; + font-family: "JetbrainsMono Nerd Font" ; + font-size: 15px; + min-height: 10px; +} + +window#waybar { + background: transparent; +} + +window#waybar.hidden { + opacity: 0.2; +} + +#window { + margin-top: 6px; + padding-left: 10px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: transparent; + background: transparent; +} +#tags { + margin-top: 6px; + margin-left: 12px; + font-size: 4px; + margin-bottom: 0px; + border-radius: 10px; + background: #161320; + transition: none; +} + +#tags button { + transition: none; + color: #B5E8E0; + background: transparent; + font-size: 16px; + border-radius: 2px; +} + +#tags button.occupied { + transition: none; + color: #F28FAD; + background: transparent; + font-size: 4px; +} + +#tags button.focused { + color: #ABE9B3; + border-top: 2px solid #ABE9B3; + border-bottom: 2px solid #ABE9B3; +} + +#tags button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + color: #FAE3B0; + border-color: #E8A2AF; + color: #E8A2AF; +} + +#tags button.focused:hover { + color: #E8A2AF; +} + +#network { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #bd93f9; +} + +#pulseaudio { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #1A1826; + background: #FAE3B0; +} + +#battery { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #B5E8E0; +} + +#battery.charging, #battery.plugged { + color: #161320; + background-color: #B5E8E0; +} + +#battery.critical:not(.charging) { + background-color: #B5E8E0; + color: #161320; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +@keyframes blink { + to { + background-color: #BF616A; + color: #B5E8E0; + } +} + +#backlight { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #F8BD96; +} +#clock { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #ABE9B3; + /*background: #1A1826;*/ +} + +#memory { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + margin-bottom: 0px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: #161320; + background: #DDB6F2; +} +#cpu { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + margin-bottom: 0px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: #161320; + background: #96CDFB; +} + +#tray { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + margin-bottom: 0px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: #B5E8E0; + background: #161320; +} + +#custom-launcher { + font-size: 24px; + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 5px; + border-radius: 10px; + transition: none; + color: #89DCEB; + background: #161320; +} + +#custom-power { + font-size: 20px; + margin-top: 6px; + margin-left: 8px; + margin-right: 8px; + padding-left: 10px; + padding-right: 5px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #F28FAD; +} + +#custom-wallpaper { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #C9CBFF; +} + +#custom-updates { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #E8A2AF; +} + +#custom-media { + margin-top: 6px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + margin-bottom: 0px; + border-radius: 10px; + transition: none; + color: #161320; + background: #F2CDCD; +} diff --git a/local-configs/zsh/default.nix b/local-configs/zsh/default.nix new file mode 100644 index 0000000..8a3947f --- /dev/null +++ b/local-configs/zsh/default.nix @@ -0,0 +1,61 @@ +{ config, pkgs, ... }: + +{ + programs.zsh = { + enable = true; + + dotDir = ".config/zsh"; + + history = { + extended = true; + }; + + localVariables = { + # Enable Oh My Zsh history timestamp output. + # See: https://github.com/ohmyzsh/ohmyzsh/wiki/Settings#hist_stamps + HIST_STAMPS = "yyyy-mm-dd"; + }; + + # Make use of Oh My Zsh + # See the projects sites: + # https://ohmyz.sh/ + # https://github.com/ohmyzsh/ohmyzsh/ + # See the projects documentation: + # https://github.com/ohmyzsh/ohmyzsh/wiki + oh-my-zsh = { + enable = true; + theme = "agnoster"; + custom = "/home/forestcat/.config/oh-my-zsh-custom"; + plugins = [ + "history-substring-search" + "timer" + "pass" + ]; + extraConfig = '' + # Only show the command execution timer, if the command ran for at least 15 seconds. + TIMER_THRESHOLD=15 + ''; + }; + + initExtra = '' + nx() { + nix shell nixpkgs/nixos-23.11#$@ + } + + # history-substring-search configuration + # See: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/history-substring-search#configuration + # Ensure unique search results in history-substring-search. + # Needs to be set here instead of in oh-my-zsh.extraConfig to work apparently. + HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 + ''; + + shellAliases = { + # Others. + miau = "echo miau"; + ll = "ls -l"; + cheetah = "curl -d 'Lena: Done ✓' https://ntfy.forestcat.org/cheetah"; + rebuild = "sudo nixos-rebuild switch --flake ~/nix-configs/ --show-trace"; + }; + }; +} + diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 48c6137..d8d36d4 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -68,14 +68,16 @@ hardware.pulseaudio.support32Bit = true; hardware.pulseaudio.package = pkgs.pulseaudioFull; + programs.zsh.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.forestcat = { isNormalUser = true; description = "forestcat"; extraGroups = ["networkmanager" "wheel" "audio" "davfs2" "video"]; packages = with pkgs; []; + shell = pkgs.zsh; }; - users.defaultUserShell = pkgs.nushellFull; + # users.defaultUserShell = pkgs.zsh; # Allow unfree packages nixpkgs.config.allowUnfree = true; @@ -97,6 +99,7 @@ environment.systemPackages = with pkgs; [ # System Packages go here brave + nextcloud-client davfs2 htop picom-jonaburg @@ -221,10 +224,10 @@ xwayland.enable = true; }; - environment.sessionVariables = { - WLR_NO_HARDWARE_CURSORS = "1"; # if mouse cursor invisible - NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland - }; + # environment.sessionVariables = { + # WLR_NO_HARDWARE_CURSORS = "1"; # if mouse cursor invisible + # NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland + # }; hardware = { opengl.enable = true; # Enable opengl