From 04dc77e8b9e636f74efca49216baa51450f5fab2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 21 Feb 2024 22:54:04 +0100 Subject: [PATCH] Format all the files --- flake.nix | 15 +- hosts/yoga/default.nix | 4 +- hosts/yoga/user.nix | 42 +++--- lib/default.nix | 4 +- lib/mkSystem.nix | 22 +-- modules/direnv/default.nix | 18 +-- modules/dunst/default.nix | 62 ++++---- modules/fuzzel/default.nix | 14 +- modules/gtk/default.nix | 10 +- modules/hyprland/default.nix | 13 +- modules/kanshi/default.nix | 236 +++++++++++++++---------------- modules/kitty/default.nix | 14 +- modules/nvidia/default.nix | 7 +- modules/system/configuration.nix | 77 +++++----- modules/waybar/default.nix | 8 +- modules/zsh/default.nix | 202 +++++++++++++------------- 16 files changed, 365 insertions(+), 383 deletions(-) diff --git a/flake.nix b/flake.nix index 469d8f6..6da170d 100644 --- a/flake.nix +++ b/flake.nix @@ -11,22 +11,21 @@ }; outputs = { nixpkgs, home-manager, ... }@inputs: - let + let system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; + pkgs = nixpkgs.legacyPackages.${system}; lib = nixpkgs.lib; - user = "spagnologasper"; - hostName = "yoga"; + hostName = "yoga"; mkSystem = pkgs: system: hostname: pkgs.lib.nixosSystem { system = system; modules = [ - ./modules/system/configuration.nix + ./modules/system/configuration.nix (./. + "/hosts/${hostname}/hardware-configuration.nix") - (./. + "/hosts/${hostname}/default.nix") + (./. + "/hosts/${hostname}/default.nix") home-manager.nixosModules.home-manager { home-manager = { @@ -37,12 +36,12 @@ }; } ]; - specialArgs = {inherit inputs user hostName; }; + specialArgs = { inherit inputs user hostName; }; }; in { nixosConfigurations = { yoga = mkSystem inputs.nixpkgs "x86_64-linux" "yoga"; - }; + }; }; } diff --git a/hosts/yoga/default.nix b/hosts/yoga/default.nix index 60fad88..9872c21 100644 --- a/hosts/yoga/default.nix +++ b/hosts/yoga/default.nix @@ -1,7 +1,5 @@ { config, pkgs, ... }: { - imports = [ - ../../modules/nvidia/default.nix - ]; + imports = [ ../../modules/nvidia/default.nix ]; } diff --git a/hosts/yoga/user.nix b/hosts/yoga/user.nix index 7ed2130..37e3b4f 100644 --- a/hosts/yoga/user.nix +++ b/hosts/yoga/user.nix @@ -1,25 +1,23 @@ -{ config, lib, inputs, pkgs, ...}: +{ config, lib, inputs, pkgs, ... }: { - imports = [ - ../../modules/default.nix - ]; - config.modules = { - dunst.enable = true; - hyprland.enable = true; - kitty.enable = true; - packages.enable = true; - waybar.enable = true; - zsh.enable = true; - fuzzel.enable = true; - gtk.enable = true; - direnv.enable = true; - kanshi.enable = true; - nvim.enable = false; - git.enable = true; - gammastep.enable = true; - vscode.enable = true; - tmux.enable = true; - starship.enable = true; - }; + imports = [ ../../modules/default.nix ]; + config.modules = { + dunst.enable = true; + hyprland.enable = true; + kitty.enable = true; + packages.enable = true; + waybar.enable = true; + zsh.enable = true; + fuzzel.enable = true; + gtk.enable = true; + direnv.enable = true; + kanshi.enable = true; + nvim.enable = false; + git.enable = true; + gammastep.enable = true; + vscode.enable = true; + tmux.enable = true; + starship.enable = true; + }; } diff --git a/lib/default.nix b/lib/default.nix index c9d221d..6ea99e4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,3 +1 @@ -inputs: { - mkSystem = import ./mkSystem.nix inputs; -} +inputs: { mkSystem = import ./mkSystem.nix inputs; } diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 5ae4789..e2dd2b9 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -1,11 +1,11 @@ -{ self, ... } @ inputs: name: system: inputs.nixpkgs.lib.nixosSystem ( - { - inherit system; - specialArgs = { inherit inputs self; }; - modules = [ - "${self}/hosts/${name}/system.nix" - "${self}/hosts/${name}/user.nix" - inputs.home-manager.nixosModule - ]; - } -) +{ self, ... }@inputs: +name: system: +inputs.nixpkgs.lib.nixosSystem ({ + inherit system; + specialArgs = { inherit inputs self; }; + modules = [ + "${self}/hosts/${name}/system.nix" + "${self}/hosts/${name}/user.nix" + inputs.home-manager.nixosModule + ]; +}) diff --git a/modules/direnv/default.nix b/modules/direnv/default.nix index 4b553ce..b868c21 100644 --- a/modules/direnv/default.nix +++ b/modules/direnv/default.nix @@ -4,12 +4,12 @@ with lib; let cfg = config.modules.direnv; in { - options.modules.direnv = { enable = mkEnableOption "direnv"; }; - config = mkIf cfg.enable { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - enableZshIntegration = true; - }; - }; - } + options.modules.direnv = { enable = mkEnableOption "direnv"; }; + config = mkIf cfg.enable { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/modules/dunst/default.nix b/modules/dunst/default.nix index 0bd9e86..091300d 100644 --- a/modules/dunst/default.nix +++ b/modules/dunst/default.nix @@ -4,39 +4,39 @@ with lib; let cfg = config.modules.dunst; in { - options.modules.dunst = { enable = mkEnableOption "dunst"; }; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - dunst - ]; + options.modules.dunst = { enable = mkEnableOption "dunst"; }; + config = mkIf cfg.enable { + home.packages = with pkgs; [ dunst ]; - services.dunst = { - enable = true; - settings = { - global = { - origin = "top-left"; - offset = "60x12"; - separator_height = 2; - padding = 12; - horizontal_padding = 12; - text_icon_padding = 12; - frame_width = 4; - separator_color = "frame"; - idle_threshold = 120; - font = "FiraCode Nerdfont 12"; - line_height = 0; - format = "%s\n%b"; - alignment = "center"; - icon_position = "off"; - startup_notification = "false"; - corner_radius = 12; + services.dunst = { + enable = true; + settings = { + global = { + origin = "top-left"; + offset = "60x12"; + separator_height = 2; + padding = 12; + horizontal_padding = 12; + text_icon_padding = 12; + frame_width = 4; + separator_color = "frame"; + idle_threshold = 120; + font = "FiraCode Nerdfont 12"; + line_height = 0; + format = '' + %s + %b''; + alignment = "center"; + icon_position = "off"; + startup_notification = "false"; + corner_radius = 12; - frame_color = "#44465c"; - background = "#303241"; - foreground = "#d9e0ee"; - timeout = 2; - }; - }; + frame_color = "#44465c"; + background = "#303241"; + foreground = "#d9e0ee"; + timeout = 2; }; + }; }; + }; } diff --git a/modules/fuzzel/default.nix b/modules/fuzzel/default.nix index f9273cd..8cf316e 100644 --- a/modules/fuzzel/default.nix +++ b/modules/fuzzel/default.nix @@ -4,11 +4,9 @@ with lib; let cfg = config.modules.fuzzel; in { - options.modules.fuzzel = {enable = mkEnableOption "fuzzel"; }; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - fuzzel clipman networkmanager_dmenu - ]; - home.file.".config/fuzzel/fuzzel.ini".source = ./fuzzel.ini; - }; - } + options.modules.fuzzel = { enable = mkEnableOption "fuzzel"; }; + config = mkIf cfg.enable { + home.packages = with pkgs; [ fuzzel clipman networkmanager_dmenu ]; + home.file.".config/fuzzel/fuzzel.ini".source = ./fuzzel.ini; + }; +} diff --git a/modules/gtk/default.nix b/modules/gtk/default.nix index 3e75d82..cd56a34 100644 --- a/modules/gtk/default.nix +++ b/modules/gtk/default.nix @@ -7,7 +7,9 @@ in { options.modules.gtk = { enable = mkEnableOption "gtk"; }; config = mkIf cfg.enable { home.packages = with pkgs; [ - dconf gtk-engine-murrine gnome.gnome-themes-extra + dconf + gtk-engine-murrine + gnome.gnome-themes-extra ]; home.sessionVariables.GTK_THEME = "Catppuccin-Macchiato-Compact-Mauve-Dark"; gtk = { @@ -26,9 +28,9 @@ in { package = pkgs.catppuccin-cursors.macchiatoMauve; }; iconTheme = { - name = "Papirus-Dark"; - package = pkgs.catppuccin-papirus-folders; - }; + name = "Papirus-Dark"; + package = pkgs.catppuccin-papirus-folders; + }; }; home.pointerCursor = { gtk.enable = true; diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index 16d5888..9596368 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -7,12 +7,19 @@ in { options.modules.hyprland = { enable = mkEnableOption "hyprland"; }; config = mkIf cfg.enable { home.packages = with pkgs; [ - hyprpaper hyprland wl-clipboard hyprland-protocols wlogout swayidle + hyprpaper + hyprland + wl-clipboard + hyprland-protocols + wlogout + swayidle ]; home.file.".config/hypr/hyprland.conf".source = ./hyprland.conf; home.file.".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf; - home.file.".config/hypr/wallpaper.png".source = ../../pictures/wallpaper.png; - home.file.".config/hypr/lock-wallpaper.png".source = ../../pictures/lock-wallpaper.png; + home.file.".config/hypr/wallpaper.png".source = + ../../pictures/wallpaper.png; + home.file.".config/hypr/lock-wallpaper.png".source = + ../../pictures/lock-wallpaper.png; }; } diff --git a/modules/kanshi/default.nix b/modules/kanshi/default.nix index 95ed3f3..12c64fb 100644 --- a/modules/kanshi/default.nix +++ b/modules/kanshi/default.nix @@ -4,140 +4,136 @@ with lib; let cfg = config.modules.kanshi; in { - options.modules.kanshi = { enable = mkEnableOption "kanshi"; }; + options.modules.kanshi = { enable = mkEnableOption "kanshi"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - kanshi - ]; + home.packages = with pkgs; [ kanshi ]; services.kanshi = { - enable = true; + enable = true; - systemdTarget = "hyprland-session.target"; + systemdTarget = "hyprland-session.target"; - profiles = { - profile1 = { - outputs = [ - { - criteria = "Dell Inc. DELL P2419HC H565L03"; - position = "0,0"; - } - { - criteria = "eDP-1"; - status = "disable"; - } - ]; - }; + profiles = { + profile1 = { + outputs = [ + { + criteria = "Dell Inc. DELL P2419HC H565L03"; + position = "0,0"; + } + { + criteria = "eDP-1"; + status = "disable"; + } + ]; + }; - yoga = { - outputs = [{ - criteria = "California Institute of Technology 0x1410 Unknown"; - mode = "3072x1920@120Hz"; - scale = 1.0; - }]; - }; - - lj_setup = { - outputs = [ - { - criteria = "Samsung Electric Company C34H89x H4ZRB05512"; - mode = "3440x1440@100Hz"; - } - { - criteria = "California Institute of Technology 0x1410 Unknown"; - status = "disable"; - } - ]; - }; - - portable_monitor = { - outputs = [ - { + yoga = { + outputs = [{ criteria = "California Institute of Technology 0x1410 Unknown"; mode = "3072x1920@120Hz"; scale = 1.0; - position = "1128,3130"; - } - { - criteria = "Avolites Ltd ARZOPA -S1 0000000000000"; - mode = "1920x1080@60Hz"; - position = "1690,2050"; - } - ]; - }; + }]; + }; - portable_monitor_2 = { - outputs = [ - { + lj_setup = { + outputs = [ + { + criteria = "Samsung Electric Company C34H89x H4ZRB05512"; + mode = "3440x1440@100Hz"; + } + { + criteria = "California Institute of Technology 0x1410 Unknown"; + status = "disable"; + } + ]; + }; + + portable_monitor = { + outputs = [ + { + criteria = "California Institute of Technology 0x1410 Unknown"; + mode = "3072x1920@120Hz"; + scale = 1.0; + position = "1128,3130"; + } + { + criteria = "Avolites Ltd ARZOPA -S1 0000000000000"; + mode = "1920x1080@60Hz"; + position = "1690,2050"; + } + ]; + }; + + portable_monitor_2 = { + outputs = [ + { + criteria = "AU Optronics 0x313D Unknown"; + mode = "1920x1080@60Hz"; + scale = 1.0; + position = "1920,1080"; + } + { + criteria = "Avolites Ltd ARZOPA -S1 0000000000000"; + mode = "1920x1080@60Hz"; + position = "1920,0"; + } + ]; + }; + + lj_setup_2 = { + outputs = [ + { + criteria = "AU Optronics 0x313D Unknown"; + status = "disable"; + } + { + criteria = "Samsung Electric Company C34H89x H4ZRB05512"; + mode = "3440x1440@60Hz"; + } + ]; + }; + + hs_1 = { + outputs = [ + { + criteria = "AU Optronics 0x313D Unknown"; + #mode = "1920x1080@60Hz"; + #scale = 1.0; + #position = "0,1080"; + status = "disable"; + } + { + criteria = "Samsung Electric Company S24D330 0x00005B31"; + mode = "1920x1080@60Hz"; + position = "0,0"; + } + ]; + + }; + + hs_22 = { + outputs = [ + { + criteria = + "Philips Consumer Electronics Company PHL27M1N3200Z UK02329015881"; + mode = "1920x1080@144"; + } + { + criteria = "California Institute of Technology 0x1410 Unknown"; + status = "disable"; + } + ]; + }; + + profile7 = { + outputs = [{ criteria = "AU Optronics 0x313D Unknown"; mode = "1920x1080@60Hz"; scale = 1.0; - position = "1920,1080"; - } - { - criteria = "Avolites Ltd ARZOPA -S1 0000000000000"; - mode = "1920x1080@60Hz"; - position = "1920,0"; - } - ]; - }; - - lj_setup_2 = { - outputs = [ - { - criteria = "AU Optronics 0x313D Unknown"; - status = "disable"; - } - { - criteria = "Samsung Electric Company C34H89x H4ZRB05512"; - mode = "3440x1440@60Hz"; - } - ]; - }; - - hs_1 = { - outputs = [ - { - criteria = "AU Optronics 0x313D Unknown"; - #mode = "1920x1080@60Hz"; - #scale = 1.0; - #position = "0,1080"; - status = "disable"; - } - { - criteria = "Samsung Electric Company S24D330 0x00005B31"; - mode = "1920x1080@60Hz"; - position = "0,0"; - } - ]; - - }; - - hs_22 = { - outputs = [ - { - criteria = - "Philips Consumer Electronics Company PHL27M1N3200Z UK02329015881"; - mode = "1920x1080@144"; - } - { - criteria = "California Institute of Technology 0x1410 Unknown"; - status = "disable"; - } - ]; - }; - - profile7 = { - outputs = [{ - criteria = "AU Optronics 0x313D Unknown"; - mode = "1920x1080@60Hz"; - scale = 1.0; - }]; + }]; + }; }; }; + }; - - - - }; } diff --git a/modules/kitty/default.nix b/modules/kitty/default.nix index 961e5fc..874bcbe 100644 --- a/modules/kitty/default.nix +++ b/modules/kitty/default.nix @@ -4,12 +4,10 @@ with lib; let cfg = config.modules.kitty; in { - options.modules.kitty = { enable = mkEnableOption "kitty"; }; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - kitty - ]; + options.modules.kitty = { enable = mkEnableOption "kitty"; }; + config = mkIf cfg.enable { + home.packages = with pkgs; [ kitty ]; - home.file.".config/kitty/kitty.conf".source = ./kitty.conf; - }; - } + home.file.".config/kitty/kitty.conf".source = ./kitty.conf; + }; +} diff --git a/modules/nvidia/default.nix b/modules/nvidia/default.nix index 8f772d8..aeaada9 100644 --- a/modules/nvidia/default.nix +++ b/modules/nvidia/default.nix @@ -1,9 +1,4 @@ -{ - config, - pkgs, - lib, - ... -}: { +{ config, pkgs, lib, ... }: { environment.systemPackages = with pkgs; [ vulkan-loader diff --git a/modules/system/configuration.nix b/modules/system/configuration.nix index 0b7e446..266d0ce 100644 --- a/modules/system/configuration.nix +++ b/modules/system/configuration.nix @@ -4,7 +4,7 @@ nixpkgs.config.allowUnfree = true; -# Remove unecessary preinstalled packages + # Remove unecessary preinstalled packages environment.defaultPackages = [ ]; environment.sessionVariables = { GTK_USE_PORTAL = "1"; }; @@ -17,7 +17,7 @@ environment.etc.openvpn.source = "${pkgs.update-resolv-conf}/libexec/openvpn"; -# Laptop-specific packages (the other ones are installed in `packages.nix`) + # Laptop-specific packages (the other ones are installed in `packages.nix`) environment.systemPackages = with pkgs; [ acpi tlp @@ -32,44 +32,42 @@ enable = true; settings = { default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting 'Welcome to NixOS!' --cmd Hyprland"; + command = + "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting 'Welcome to NixOS!' --cmd Hyprland"; user = "${user}"; }; }; }; services.openssh.enable = true; - systemd.services.sshd.wantedBy = lib.mkForce []; + systemd.services.sshd.wantedBy = lib.mkForce [ ]; programs.ssh.startAgent = true; services.hardware.bolt.enable = true; - hardware.logitech.wireless.enable = true; + hardware.logitech.wireless.enable = true; hardware.logitech.wireless.enableGraphical = true; programs.hyprland.xwayland.enable = true; - virtualisation.libvirtd.enable = true; + virtualisation.libvirtd.enable = true; fonts = { packages = with pkgs; [ jetbrains-mono - roboto - openmoji-color - (nerdfonts.override { fonts = [ "FiraCode" ]; }) - (nerdfonts.override { fonts = [ "FantasqueSansMono" ];}) + roboto + openmoji-color + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + (nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) ]; fontconfig = { hinting.autohint = true; - defaultFonts = { - emoji = [ "OpenMoji Color" ]; - }; + defaultFonts = { emoji = [ "OpenMoji Color" ]; }; }; }; - xdg = { icons.enable = true; portal = { @@ -83,7 +81,6 @@ xdg.portal.config.common.default = "*"; - programs.dconf.enable = true; services.dbus.packages = with pkgs; [ dconf ]; services.dbus.enable = true; @@ -93,10 +90,10 @@ package = lib.mkForce pkgs.gnome3.gvfs; }; -# Firmware Updater + # Firmware Updater services.fwupd.enable = true; -# Nix settings, auto cleanup and enable flakes + # Nix settings, auto cleanup and enable flakes nix = { settings.auto-optimise-store = true; settings.allowed-users = [ "${user}" ]; @@ -109,10 +106,10 @@ experimental-features = nix-command flakes keep-outputs = true keep-derivations = true - ''; + ''; }; -# Boot settings: clean /tmp/, latest kernel and enable bootloader + # Boot settings: clean /tmp/, latest kernel and enable bootloader boot = { tmp.cleanOnBoot = true; loader = { @@ -123,7 +120,7 @@ }; }; -# Set up locales (timezone and keyboard layout) + # Set up locales (timezone and keyboard layout) time.timeZone = "Europe/Ljubljana"; i18n.defaultLocale = "en_US.UTF-8"; console = { @@ -131,25 +128,25 @@ keyMap = "en"; }; -# Set up user and enable sudo + # Set up user and enable sudo users.users.${user} = { isNormalUser = true; extraGroups = [ "input" "wheel" "networkmanager" "libvirtd" "wireshark" ]; - initialHashedPassword = "$6$wqCHereET3WM6UIA$XeJIgGkmO2/zAkktN2JCx5hLNS3kSj6seVQBdSWoMeJ5MOrIha6B/HiDjHI4oKDKYhYVwjgQFqGpncU6OI7Ud/"; # password: d3fault + initialHashedPassword = + "$6$wqCHereET3WM6UIA$XeJIgGkmO2/zAkktN2JCx5hLNS3kSj6seVQBdSWoMeJ5MOrIha6B/HiDjHI4oKDKYhYVwjgQFqGpncU6OI7Ud/"; # password: d3fault shell = pkgs.zsh; }; -# Set up networking and secure it + # Set up networking and secure it networking = { networkmanager.enable = true; hostName = "${hostName}"; - firewall.enable = false; # This one is necessary to expose ports to the netwok. Usefull for smbserver, responder, http.server, ... - extraHosts = - '' - ''; # For adding hosts. + firewall.enable = + false; # This one is necessary to expose ports to the netwok. Usefull for smbserver, responder, http.server, ... + extraHosts = ""; # For adding hosts. }; -# Set environment variables + # Set environment variables environment.variables = { NIXOS_CONFIG_DIR = "$HOME/.config/nixos/"; NIXPKGS_ALLOW_INSECURE = "1"; @@ -167,24 +164,25 @@ }; environment.localBinInPath = true; -# Security + # Security security = { sudo.enable = true; -# Extra security + # Extra security protectKernelImage = true; - pam.services.gtklock.text = lib.readFile "${pkgs.gtklock}/etc/pam.d/gtklock"; + pam.services.gtklock.text = + lib.readFile "${pkgs.gtklock}/etc/pam.d/gtklock"; }; -# Sound (PipeWire) - sound.enable = true; + # Sound (PipeWire) + sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; hardware = { bluetooth.enable = true; @@ -194,7 +192,8 @@ }; }; - virtualisation.waydroid.enable = true; # For mobile app pentesting TODO: Move to module. + virtualisation.waydroid.enable = + true; # For mobile app pentesting TODO: Move to module. programs.adb.enable = true; services.blueman.enable = true; diff --git a/modules/waybar/default.nix b/modules/waybar/default.nix index 695cd6d..466ad0c 100644 --- a/modules/waybar/default.nix +++ b/modules/waybar/default.nix @@ -1,4 +1,4 @@ -{ inputs, lib, config, pkgs, ... }: +{ inputs, lib, config, pkgs, ... }: with lib; let cfg = config.modules.waybar; @@ -10,9 +10,9 @@ in { programs.waybar = { enable = true; package = pkgs.waybar.overrideAttrs (oldAttrs: { - mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; - }); - }; + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + }); + }; home.file.".config/waybar/style.css".source = ./style.css; home.file.".config/waybar/mocha.css".source = ./mocha.css; diff --git a/modules/zsh/default.nix b/modules/zsh/default.nix index 929a50b..ce2a9e7 100644 --- a/modules/zsh/default.nix +++ b/modules/zsh/default.nix @@ -4,114 +4,108 @@ with lib; let cfg = config.modules.zsh; in { - options.modules.zsh = { enable = mkEnableOption "zsh"; }; + options.modules.zsh = { enable = mkEnableOption "zsh"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - zsh - fzf - lsd - grc - eza - ]; + home.packages = with pkgs; [ zsh fzf lsd grc eza ]; - programs.zsh = { - enable = true; - shellAliases = { - md-notes = "cd ~/Documents/md-notes/ && nvim ."; - randwall = "feh --bg-scale --randomize ~/pictures/wallpapers/*"; - zapiski = "~/Documents/faks_git/FRI-ZAPISKI"; - ctf = "cd ~/Documents/ctf/2022"; - faks = "cd ~/Documents/faks"; - faks-git = "cd ~/Documents/faks_git"; - rm = "rm -i"; - night = "brightnessctl s 1%"; - nightlock = "swaylock -c 000000"; - hsrv = "ssh hsrv"; - rs = "export QT_QPA_PLATFORM=xcb; rstudio-bin --no-sandbox &"; - rot13 = "tr 'A-Za-z' 'N-ZA-Mn-za-m'"; - nix-update = "nix-channel --update && nix-env -u"; - ls = "lsd"; - sus = "systemctl suspend"; - sur = "systemctl reboot"; - sup = "power off"; - hg = "history | grep"; - ss = "grc ss"; - tree = "eza --tree"; - rebuild-os = - "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/.config/home-manager#yoga --impure"; - }; - initExtra = '' - export EDITOR='nvim' - - bin_txt() { - curl -X PUT --data "$1" https://p.spanskiduh.dev - } - - bin_file() { - curl -X PUT --data-binary "@$1" https://p.spanskiduh.dev - } - - cleanup-os() { - sudo nix-env --list-generations --profile /nix/var/nix/profiles/system - sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system - sudo nix-collect-garbage -d - sudo nix-store --optimize - sudo nix-env --list-generations --profile /nix/var/nix/profiles/system - - } - - # Gpg tty - GPG_TTY=$(tty) - export GPG_TTY - export FUNCNEST=500 - - ''; - oh-my-zsh = { + programs.zsh = { enable = true; - theme = "cypher"; - plugins = [ - "sudo" - "terraform" - "systemadmin" - "vi-mode" - "z" - "colorize" - "compleat" - "ansible" - ]; - }; + shellAliases = { + md-notes = "cd ~/Documents/md-notes/ && nvim ."; + randwall = "feh --bg-scale --randomize ~/pictures/wallpapers/*"; + zapiski = "~/Documents/faks_git/FRI-ZAPISKI"; + ctf = "cd ~/Documents/ctf/2022"; + faks = "cd ~/Documents/faks"; + faks-git = "cd ~/Documents/faks_git"; + rm = "rm -i"; + night = "brightnessctl s 1%"; + nightlock = "swaylock -c 000000"; + hsrv = "ssh hsrv"; + rs = "export QT_QPA_PLATFORM=xcb; rstudio-bin --no-sandbox &"; + rot13 = "tr 'A-Za-z' 'N-ZA-Mn-za-m'"; + nix-update = "nix-channel --update && nix-env -u"; + ls = "lsd"; + sus = "systemctl suspend"; + sur = "systemctl reboot"; + sup = "power off"; + hg = "history | grep"; + ss = "grc ss"; + tree = "eza --tree"; + rebuild-os = + "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/.config/home-manager#yoga --impure"; + }; + initExtra = '' + export EDITOR='nvim' - plugins = [ - { - name = "zsh-autosuggestions"; - src = pkgs.fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-autosuggestions"; - rev = "v0.4.0"; - sha256 = "0z6i9wjjklb4lvr7zjhbphibsyx51psv50gm07mbb0kj9058j6kc"; - }; - } - { - name = "fzf-tab"; - src = pkgs.fetchFromGitHub { - owner = "Aloxaf"; - repo = "fzf-tab"; - rev = "b06e7574577cd729c629419a62029d31d0565a7a"; - sha256 = "sha256-ilUavAIWmLiMh2PumtErMCpOcR71ZMlQkKhVOTDdHZw="; - }; - } - { - name = "warhol"; - src = pkgs.fetchFromGitHub { - owner = "unixorn"; - repo = "warhol.plugin.zsh"; - rev = "49a2fb6789179c789f54b95221c91fdc1bd5f804"; - sha256 = "sha256-cL7qfgoJseS/epWPyzUy0Ul4GMtyPzYkZ5tsHbRjcRI="; - }; - } - ]; + bin_txt() { + curl -X PUT --data "$1" https://p.spanskiduh.dev + } + + bin_file() { + curl -X PUT --data-binary "@$1" https://p.spanskiduh.dev + } + + cleanup-os() { + sudo nix-env --list-generations --profile /nix/var/nix/profiles/system + sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system + sudo nix-collect-garbage -d + sudo nix-store --optimize + sudo nix-env --list-generations --profile /nix/var/nix/profiles/system + + } + + # Gpg tty + GPG_TTY=$(tty) + export GPG_TTY + export FUNCNEST=500 + + ''; + oh-my-zsh = { + enable = true; + theme = "cypher"; + plugins = [ + "sudo" + "terraform" + "systemadmin" + "vi-mode" + "z" + "colorize" + "compleat" + "ansible" + ]; + }; + + plugins = [ + { + name = "zsh-autosuggestions"; + src = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-autosuggestions"; + rev = "v0.4.0"; + sha256 = "0z6i9wjjklb4lvr7zjhbphibsyx51psv50gm07mbb0kj9058j6kc"; + }; + } + { + name = "fzf-tab"; + src = pkgs.fetchFromGitHub { + owner = "Aloxaf"; + repo = "fzf-tab"; + rev = "b06e7574577cd729c629419a62029d31d0565a7a"; + sha256 = "sha256-ilUavAIWmLiMh2PumtErMCpOcR71ZMlQkKhVOTDdHZw="; + }; + } + { + name = "warhol"; + src = pkgs.fetchFromGitHub { + owner = "unixorn"; + repo = "warhol.plugin.zsh"; + rev = "49a2fb6789179c789f54b95221c91fdc1bd5f804"; + sha256 = "sha256-cL7qfgoJseS/epWPyzUy0Ul4GMtyPzYkZ5tsHbRjcRI="; + }; + } + ]; + + }; }; - - }; }