commit 92675f27bf3bd243d1c49a1cea84426f15e1bac2 Author: 0xTux <0xtux@pm.me> Date: Tue Sep 5 04:35:35 2023 +0530 initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..eadd2aa --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# tux's NixOS configuration flake + +## Installation + +Currently there is 1 host: +1. esoteric + - UEFI boot w/ systemd-boot + +Hosts can be build with: + +``` +sudo nixos-rebuild switch --flake .# +``` + +## Components + +| | Wayland | Xorg | +|---------------|------------|------------------| +| DM | TTY1 Login | SDDM | +| WM/DE | Hyprland | BSPWM | +| Compositor | Hyprland | Picom (Jonaburg) | +| Bar | / | Polybar + Eww | +| Hotkeys | Hyprland | Sxhkd | +| Launcher | / | Rofi | +| Notifications | Dunst | Dunst | +| Terminal | Alacritty | Alacritty | +| Editor | Neovim | Neovim | \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6c7d042 --- /dev/null +++ b/flake.lock @@ -0,0 +1,84 @@ +{ + "nodes": { + "astronvim": { + "flake": false, + "locked": { + "lastModified": 1693570730, + "narHash": "sha256-MJ1K8SL9K784PeI/4tKHzp+cACDrhQ89W9ZlONdXWsA=", + "owner": "AstroNvim", + "repo": "AstroNvim", + "rev": "b1a158eb3d8abda33cc28f3e9ca730530880e71b", + "type": "github" + }, + "original": { + "owner": "AstroNvim", + "ref": "v3.36.7", + "repo": "AstroNvim", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1693208669, + "narHash": "sha256-hHFaaUsZ860wvppPeiu7nJn/nXZjJfnqAQEu9SPFE9I=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "5bac4a1c06cd77cf8fc35a658ccb035a6c50cd2c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1693428224, + "narHash": "sha256-FWUUlhYqkGEySUD0blTADRiDQ7fw+H1ikivfu88uy+w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "841889913dfd06a70ffb39f603e29e46f45f0c1a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1693565476, + "narHash": "sha256-ya00zHt7YbPo3ve/wNZ/6nts61xt7wK/APa6aZAfey0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "aa8aa7e2ea35ce655297e8322dc82bf77a31d04b", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "astronvim": "astronvim", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2681c7c --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "tux's NixOS Flake"; + + nixConfig = { + experimental-features = [ "nix-command" "flakes" ]; + }; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager/release-23.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + astronvim.url = "github:AstroNvim/AstroNvim/v3.36.7"; + astronvim.flake = false; + }; + + outputs = args@ { nixpkgs, nixpkgs-unstable, home-manager, astronvim, ... }: + let + username = "tux"; + in + { + nixosConfigurations = ( + import ./hosts { + inherit args username nixpkgs nixpkgs-unstable home-manager astronvim; + } + ); + }; +} diff --git a/hosts/configuration.nix b/hosts/configuration.nix new file mode 100644 index 0000000..d96c10c --- /dev/null +++ b/hosts/configuration.nix @@ -0,0 +1,102 @@ +{ pkgs, username, ... }: + +{ + imports = + [ + ../modules/virtualisation/docker.nix + ]; + + fonts.fonts = with pkgs; [ + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + ]; + + users = { + defaultUserShell = pkgs.zsh; + users.${username} = { + initialPassword = "${username}"; + isNormalUser = true; + extraGroups = [ "networkmanager" "wheel" "storage" "audio" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D 0xtux@pm.me" + ]; + }; + }; + + services = { + openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + }; + }; + }; + + programs = { + zsh = { + enable = true; + ohMyZsh.enable = true; + syntaxHighlighting.enable = true; + autosuggestions.enable = true; + }; + git = { + enable = true; + config = { + user = { + email = "0xtux@pm.me"; + name = "0xTux"; + signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D 0xtux@pm.me"; + }; + commit.gpgsign = true; + gpg.format = "ssh"; + }; + }; + starship.enable = true; + dconf.enable = true; + seahorse.enable = true; + nix-ld.enable = true; + }; + + environment.systemPackages = with pkgs; [ + + # Codecs + x264 + x265 + + # Runtime + nodejs + nodePackages.pnpm + go + python311 + gcc + jdk17 + + # Utils + ranger + nitch + wget + pciutils + portal + fast-cli + exa + bat + zoxide + ripgrep + lazygit + gdu + bottom + btop + nvtop + zip + unzip + + # xorg + xorg.xsetroot + xorg.xwininfo + xorg.xrandr + xorg.xhost + xorg.xev + + ]; + + system.stateVersion = "23.05"; +} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..090ce08 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,54 @@ +{ args, username, nixpkgs, nixpkgs-unstable, home-manager, astronvim, ... }: + +let + system = "x86_64-linux"; + + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + config.joypixels.acceptLicense = true; + }; + + pkgs-unstable = import nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + config.joypixels.acceptLicense = true; + }; +in +{ + sirius = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit args username pkgs pkgs-unstable; + hostname = "sirius"; + }; + modules = [ + + # Common config + ./configuration.nix + + # Device specific config + ./sirius/configuration.nix + + # Home Manager + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { + inherit username pkgs pkgs-unstable astronvim; + }; + home-manager.users.${username} = { + imports = [ + + # Common config + ./home.nix + + # Device specific config + ./sirius/home.nix + ]; + }; + } + ]; + }; +} diff --git a/hosts/home.nix b/hosts/home.nix new file mode 100644 index 0000000..559ab4d --- /dev/null +++ b/hosts/home.nix @@ -0,0 +1,18 @@ +{ pkgs, username, ... }: + +{ + imports = [ + ../modules/alacritty/home.nix + ../modules/nvim/home.nix + ]; + + home = { + username = "${username}"; + homeDirectory = "/home/${username}"; + stateVersion = "23.05"; + + packages = with pkgs; [ ]; + }; + + programs.home-manager.enable = true; +} diff --git a/hosts/sirius/configuration.nix b/hosts/sirius/configuration.nix new file mode 100755 index 0000000..885daad --- /dev/null +++ b/hosts/sirius/configuration.nix @@ -0,0 +1,212 @@ +{ pkgs, pkgs-unstable, username, hostname, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + + ../../modules/bspwm/configuration.nix + ../../modules/hyprland/configuration.nix + + ../../modules/virtualisation/waydroid.nix + ../../modules/virtualisation/qemu.nix + + ../../modules/hardware/nvidia.nix + ../../modules/hardware/bluetooth.nix + ]; + + time.timeZone = "Asia/Kolkata"; + i18n.defaultLocale = "en_IN"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_IN"; + LC_IDENTIFICATION = "en_IN"; + LC_MEASUREMENT = "en_IN"; + LC_MONETARY = "en_IN"; + LC_NAME = "en_IN"; + LC_NUMERIC = "en_IN"; + LC_PAPER = "en_IN"; + LC_TELEPHONE = "en_IN"; + LC_TIME = "en_IN"; + }; + + xdg.portal.enable = true; + sound.enable = true; + + boot = { + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = [ "ntfs" ]; + initrd.systemd.enable = true; + initrd.network.enable = true; + + loader = { + systemd-boot = { + enable = true; + configurationLimit = 5; + }; + efi.canTouchEfiVariables = true; + timeout = 1; + }; + plymouth = { + enable = true; + theme = "breeze"; + }; + }; + + networking = { + hostName = "${hostname}"; + networkmanager.enable = true; + }; + + security = { + polkit.enable = true; + sudo.wheelNeedsPassword = false; + rtkit.enable = true; + }; + + hardware = { + nvidia.prime.nvidiaBusId = "PCI:1:0:0"; + nvidia.prime.amdgpuBusId = "PCI:7:0:0"; + pulseaudio.enable = true; + pulseaudio.support32Bit = true; + }; + + systemd = { + enableEmergencyMode = false; + + user = { + services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + + # services.barrier = { + # description = "Barrier KVM Client"; + # wantedBy = [ "graphical.target" ]; + # wants = [ "network-online.target" ]; + # after = [ "network-online.target" ]; + # serviceConfig = { + # Type = "simple"; + # ExecStart = "${pkgs.barrier}/bin/barrierc -f --debug INFO --display :0 --name esoteric --disable-crypto 192.168.1.2:24800"; + # Restart = "always"; + # RestartSec = 3; + # }; + # }; + }; + }; + + services = { + logind = { + extraConfig = "HandlePowerKey=suspend"; + lidSwitch = "suspend"; + lidSwitchExternalPower = "suspend"; + }; + + syncthing = { + enable = true; + user = "tux"; + dataDir = "/home/tux/"; + }; + + mopidy = { + enable = true; + extensionPackages = [ pkgs.mopidy-mpd pkgs.mopidy-spotify pkgs.mopidy-mopify ]; + }; + + xserver = { + enable = true; + layout = "in"; + xkbVariant = "eng"; + libinput.touchpad.naturalScrolling = true; + }; + + supergfxd.enable = true; + + asusd = { + enable = true; + enableUserService = true; + asusdConfig = "bat_charge_limit: 80"; + }; + + gvfs.enable = true; + tumbler.enable = true; + flatpak.enable = true; + gnome.gnome-keyring.enable = true; + tailscale.enable = true; + }; + + programs = { + thunar = { + enable = true; + plugins = with pkgs.xfce; [ thunar-archive-plugin thunar-volman ]; + }; + steam = { + enable = true; + }; + nix-ld.enable = true; + }; + + nixpkgs = { + config = { + pulseaudio = true; + permittedInsecurePackages = [ + "python-2.7.18.6" + ]; + }; + + overlays = [ + (final: prev: { + vscode = prev.vscode.overrideAttrs (oldAttrs: rec { + src = (builtins.fetchTarball { + url = "https://code.visualstudio.com/sha/download?build=stable&os=linux-x64"; + sha256 = "09hy3nw1bblrl0blzpwv492gy0hwwbaq4csx00mcymskginz1wyx"; + }); + version = "latest"; + buildInputs = oldAttrs.buildInputs ++ [ pkgs.krb5 ]; + }); + }) + ]; + }; + + environment.systemPackages = with pkgs; [ + + barrier + lxappearance + service-wrapper + polkit_gnome + + libreoffice-qt + wezterm + firefox + brave + discord + starship + telegram-desktop + parsec-bin + steam + spotify + geany + galaxy-buds-client + anydesk + beekeeper-studio + vlc + retroarch + qbittorrent + blender + neovide + vscode + + colorpicker + scrcpy + nixpkgs-fmt + + ]; +} diff --git a/hosts/sirius/hardware-configuration.nix b/hosts/sirius/hardware-configuration.nix new file mode 100644 index 0000000..730d7b7 --- /dev/null +++ b/hosts/sirius/hardware-configuration.nix @@ -0,0 +1,38 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c1d20368-e03e-4965-bdb4-5cc928518c1f"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/6FC0-6829"; + fsType = "vfat"; + }; + + 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 + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/sirius/home.nix b/hosts/sirius/home.nix new file mode 100644 index 0000000..a50b0e3 --- /dev/null +++ b/hosts/sirius/home.nix @@ -0,0 +1,7 @@ +{ config, pkgs, pkgs-unstable, username, ... }: + +{ + imports = [ + ../../modules/hyprland/home.nix + ]; +} diff --git a/modules/alacritty/config/alacritty.yml b/modules/alacritty/config/alacritty.yml new file mode 100755 index 0000000..2438958 --- /dev/null +++ b/modules/alacritty/config/alacritty.yml @@ -0,0 +1,29 @@ +import: + - ~/.config/alacritty/rice-colors.yml + - ~/.config/alacritty/fonts.yml + +window: + padding: + x: 15 + y: 15 + + decorations: none + + opacity: 1.0 + dynamic_title: true + + history: 10000 + multiplier: 3 + +selection: + save_to_clipboard: false + +cursor: + style: + shape: Block + blinking: On + + unfocused_hollow: false + blink_interval: 550 + +live_config_reload: true diff --git a/modules/alacritty/config/fonts.yml b/modules/alacritty/config/fonts.yml new file mode 100755 index 0000000..deba877 --- /dev/null +++ b/modules/alacritty/config/fonts.yml @@ -0,0 +1,14 @@ +font: + normal: + family: JetBrainsMono Nerd Font + + bold: + family: JetBrainsMono Nerd Font + + italic: + family: JetBrainsMono Nerd Font + + bold_italic: + family: JetBrainsMono Nerd Font + + size: 10 diff --git a/modules/alacritty/config/rice-colors.yml b/modules/alacritty/config/rice-colors.yml new file mode 100755 index 0000000..2ed43ce --- /dev/null +++ b/modules/alacritty/config/rice-colors.yml @@ -0,0 +1,44 @@ +schemes: + sirius: &sirius + primary: + background: "#000000" + foreground: "0xa6accd" + normal: + black: "0x1b1e28" + red: "0xd0679d" + green: "0x5de4c7" + yellow: "0xfffac2" + blue: "0x89ddff" + magenta: "0xfcc5e9" + cyan: "0xadd7ff" + white: "0xffffff" + bright: + black: "0xa6accd" + red: "0xd0679d" + green: "0x5de4c7" + yellow: "0xfffac2" + blue: "0xadd7ff" + magenta: "0xfae4fc" + cyan: "0x89ddff" + white: "0xffffff" + cursor: + cursor: "#bb9af7" + text: CellBackground + search: + matches: + foreground: "0x1b1e28" + background: "0xadd7ff" + focused_match: + foreground: "0x1b1e28" + background: "0xadd7ff" + footer_bar: + foreground: "0x1b1e28" + background: "0xadd7ff" + selection: + text: CellForeground + background: "0x303340" + vi_mode_cursor: + text: CellBackground + cursor: CellForeground + +colors: *sirius diff --git a/modules/alacritty/home.nix b/modules/alacritty/home.nix new file mode 100644 index 0000000..5e4b2b5 --- /dev/null +++ b/modules/alacritty/home.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + programs.alacritty.enable = true; + + xdg.configFile = { + "alacritty".source = ./config; + }; +} diff --git a/modules/bspwm/configuration.nix b/modules/bspwm/configuration.nix new file mode 100644 index 0000000..841e12e --- /dev/null +++ b/modules/bspwm/configuration.nix @@ -0,0 +1,54 @@ +{ pkgs, username, ... }: + +{ + services.xserver.displayManager.sddm.enable = true; + services.xserver.displayManager.defaultSession = "none+bspwm"; + services.xserver.displayManager.autoLogin.enable = true; + services.xserver.displayManager.autoLogin.user = "${username}"; + services.xserver.windowManager.bspwm.enable = true; + + environment.systemPackages = with pkgs; [ + sxhkd + polybar + picom-jonaburg + papirus-icon-theme + rofi + dunst + tdrop + pavucontrol + libsForQt5.bismuth + nitrogen + feh + viewnior + networkmanager_dmenu + gvfs + weston + bibata-cursors + dracula-theme + dracula-icon-theme + eww + rustup + kitty + brightnessctl + lsd + jq + playerctl + mopidy + mopidy-mpd + mopidy-spotify + mopidy-mopify + ncmpcpp + xdotool + ueberzug + maim + pamixer + xdg-user-dirs + webp-pixbuf-loader + xorg.xprop + physlock + jetbrains-mono + terminus-nerdfont + inconsolata + joypixels + ]; +} diff --git a/modules/hardware/bluetooth.nix b/modules/hardware/bluetooth.nix new file mode 100644 index 0000000..70a5e28 --- /dev/null +++ b/modules/hardware/bluetooth.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + hardware.bluetooth = { + enable = true; + }; + + services.blueman.enable = true; +} diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix new file mode 100644 index 0000000..5b8de30 --- /dev/null +++ b/modules/hardware/nvidia.nix @@ -0,0 +1,10 @@ +{ ... }: + +{ + hardware = { + nvidia.prime.offload.enable = true; + opengl.enable = true; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; +} diff --git a/modules/hyprland/config/hyprland.conf b/modules/hyprland/config/hyprland.conf new file mode 100644 index 0000000..120163d --- /dev/null +++ b/modules/hyprland/config/hyprland.conf @@ -0,0 +1,164 @@ +# This is an example Hyprland config file. +# +# Refer to the wiki for more information. + +# +# Please note not all available settings / options are set here. +# For a full list, see the wiki +# + +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,auto + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +# exec-once = waybar & hyprpaper & firefox + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Some default env vars. +env = XCURSOR_SIZE,24 + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = false + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 5 + gaps_out = 20 + border_size = 2 + col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.inactive_border = rgba(595959aa) + + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 10 + + blur { + enabled = true + size = 3 + passes = 1 + } + + drop_shadow = true + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = true + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = false +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more +device:epic-mouse-v1 { + sensitivity = -0.5 +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Q, exec, alacritty +bind = $mainMod, C, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, E, exec, dolphin +bind = $mainMod, V, togglefloating, +bind = $mainMod, R, exec, wofi --show drun +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, J, togglesplit, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow \ No newline at end of file diff --git a/modules/hyprland/configuration.nix b/modules/hyprland/configuration.nix new file mode 100644 index 0000000..be1e08b --- /dev/null +++ b/modules/hyprland/configuration.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + programs.hyprland.enable = true; +} diff --git a/modules/hyprland/home.nix b/modules/hyprland/home.nix new file mode 100644 index 0000000..c0a5ba4 --- /dev/null +++ b/modules/hyprland/home.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: + +{ + # imports = [ hyprland.homeManagerModules.default ]; + + xdg.configFile = { + "hypr".source = ./config; + }; + + # wayland.windowManager.hyprland = { + # enable = true; + # xwayland.enable = true; + # }; + +} diff --git a/modules/nvim/home.nix b/modules/nvim/home.nix new file mode 100644 index 0000000..e0a8587 --- /dev/null +++ b/modules/nvim/home.nix @@ -0,0 +1,68 @@ +{ pkgs, astronvim, ... }: + +{ + xdg.configFile = { + "nvim".source = astronvim; + "astronvim/lua/user".source = ./user; + }; + + programs = { + neovim = { + enable = true; + defaultEditor = true; + + viAlias = false; + vimAlias = true; + + withPython3 = true; + withNodeJs = true; + }; + }; + + home = { + packages = with pkgs; [ + #-- python + nodePackages.pyright # python language server + python311Packages.black # python formatter + python311Packages.ruff-lsp + + #-- nix + nil + rnix-lsp + statix # Lints and suggestions for the nix programming language + deadnix # Find and remove unused code in .nix source files + alejandra # Nix Code Formatter + + #-- golang + go + gomodifytags + iferr # generate error handling code for go + impl # generate function implementation for go + gotools # contains tools like: godoc, goimports, etc. + gopls # go language server + delve # go debugger + + #-- lua + stylua + lua-language-server + + #-- bash + nodePackages.bash-language-server + shellcheck + shfmt + + #-- javascript/typescript --# + nodePackages.typescript + nodePackages.typescript-language-server + + #-- Misc + hadolint # Dockerfile linter + tree-sitter # common language parser/highlighter + nodePackages.prettier # common code formatter + + #-- Optional Requirements: + gdu # disk usage analyzer, required by AstroNvim + ripgrep # fast search tool, required by AstroNvim's 'fw'( is space key) + ]; + }; +} diff --git a/modules/nvim/user/init.lua b/modules/nvim/user/init.lua new file mode 100644 index 0000000..1027f23 --- /dev/null +++ b/modules/nvim/user/init.lua @@ -0,0 +1,141 @@ +local M = {} + +M.colorscheme = "poimandres" +M.icons = { + VimIcon = "", + ScrollText = "", + GitBranch = "", + GitAdd = "", + GitChange = "", + GitDelete = "", +} +M.heirline = { + separators = { + left = { "", " " }, + right = { " ", "" }, + tab = { "", "" }, + }, + colors = function(hl) + local get_hlgroup = require("astronvim.utils").get_hlgroup + local comment_fg = get_hlgroup("Comment").fg + hl.git_branch_fg = comment_fg + hl.git_added = comment_fg + hl.git_changed = comment_fg + hl.git_removed = comment_fg + hl.blank_bg = get_hlgroup("Folded").fg + hl.file_info_bg = get_hlgroup("Visual").bg + hl.nav_icon_bg = get_hlgroup("String").fg + hl.nav_fg = hl.nav_icon_bg + hl.folder_icon_bg = get_hlgroup("Error").fg + return hl + end, + attributes = { + mode = { bold = true }, + }, + icon_highlights = { + file_icon = { + statusline = false, + }, + }, +} +M.plugins = { + { + "goolord/alpha-nvim", + opts = function(_, opts) + opts.section.header.val = { + "██████████████████████████████████████████████████", + "█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█░░░░░░░░██░░░░░░░░█", + "█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀▄▀░░██░░▄▀▄▀░░█", + "█░░░░░░▄▀░░░░░░█░░▄▀░░██░░▄▀░░█░░░░▄▀░░██░░▄▀░░░░█", + "█████░░▄▀░░█████░░▄▀░░██░░▄▀░░███░░░░▄▀▄▀▄▀░░░░███", + "█████░░▄▀░░█████░░▄▀░░██░░▄▀░░█████░░▄▀▄▀▄▀░░█████", + "█████░░▄▀░░█████░░▄▀░░██░░▄▀░░███░░░░▄▀▄▀▄▀░░░░███", + "█████░░▄▀░░█████░░▄▀░░░░░░▄▀░░█░░░░▄▀░░██░░▄▀░░░░█", + "█████░░▄▀░░█████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀░░██░░▄▀▄▀░░█", + "█████░░░░░░█████░░░░░░░░░░░░░░█░░░░░░░░██░░░░░░░░█", + "██████████████████████████████████████████████████", + } + end, + }, + "AstroNvim/astrocommunity", + { import = "astrocommunity.utility.noice-nvim" }, + { import = "astrocommunity.pack.json" }, + { import = "astrocommunity.pack.bash" }, + { import = "astrocommunity.pack.lua" }, + { import = "astrocommunity.pack.python" }, + { import = "astrocommunity.pack.go" }, + { import = "astrocommunity.pack.typescript" }, + { import = "astrocommunity.pack.prisma" }, + { "olivercederborg/poimandres.nvim", name = "poimandres", opts = { disable_background = true } }, + { + "rebelot/heirline.nvim", + opts = function(_, opts) + local status = require("astronvim.utils.status") + opts.statusline = { + hl = { fg = "fg", bg = "bg" }, + status.component.mode({ + mode_text = { icon = { kind = "VimIcon", padding = { right = 1, left = 1 } } }, + surround = { + separator = "left", + color = function() + return { main = status.hl.mode_bg(), right = "blank_bg" } + end, + }, + }), + status.component.builder({ + { provider = "" }, + surround = { separator = "left", color = { main = "blank_bg", right = "file_info_bg" } }, + }), + status.component.file_info({ + file_icon = { padding = { left = 0 } }, + filename = { fallback = "Empty" }, + padding = { right = 1 }, + surround = { separator = "left", condition = false }, + }), + status.component.git_branch({ surround = { separator = "none" } }), + status.component.git_diff({ padding = { left = 1 }, surround = { separator = "none" } }), + status.component.fill(), + status.component.lsp({ lsp_client_names = false, surround = { separator = "none", color = "bg" } }), + status.component.fill(), + status.component.diagnostics({ surround = { separator = "right" } }), + status.component.lsp({ lsp_progress = false, surround = { separator = "right" } }), + { + status.component.builder({ + { provider = require("astronvim.utils").get_icon("FolderClosed") }, + padding = { right = 1 }, + hl = { fg = "bg" }, + surround = { separator = "right", color = "folder_icon_bg" }, + }), + status.component.file_info({ + filename = { + fname = function(nr) + return vim.fn.getcwd(nr) + end, + padding = { left = 1 }, + }, + file_icon = false, + file_modified = false, + file_read_only = false, + surround = { separator = "none", color = "file_info_bg", condition = false }, + }), + }, + { + status.component.builder({ + { provider = require("astronvim.utils").get_icon("ScrollText") }, + padding = { right = 1 }, + hl = { fg = "bg" }, + surround = { separator = "right", color = { main = "nav_icon_bg", left = "file_info_bg" } }, + }), + status.component.nav({ + percentage = { padding = { right = 1 } }, + ruler = false, + scrollbar = false, + surround = { separator = "none", color = "file_info_bg" }, + }), + }, + } + return opts + end, + }, +} +return M diff --git a/modules/virtualisation/docker.nix b/modules/virtualisation/docker.nix new file mode 100644 index 0000000..a35c12b --- /dev/null +++ b/modules/virtualisation/docker.nix @@ -0,0 +1,9 @@ +{ username, ... }: + +{ + virtualisation = { + docker.enable = true; + }; + + users.users.${username}.extraGroups = [ "docker" ]; +} diff --git a/modules/virtualisation/qemu.nix b/modules/virtualisation/qemu.nix new file mode 100644 index 0000000..a863a7d --- /dev/null +++ b/modules/virtualisation/qemu.nix @@ -0,0 +1,13 @@ +{ pkgs, username, ... }: + +{ + virtualisation = { + libvirtd.enable = true; + }; + + users.users.${username}.extraGroups = [ "libvirtd" ]; + + environment.systemPackages = with pkgs; [ + virt-manager + ]; +} diff --git a/modules/virtualisation/waydroid.nix b/modules/virtualisation/waydroid.nix new file mode 100644 index 0000000..2795482 --- /dev/null +++ b/modules/virtualisation/waydroid.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + virtualisation = { + waydroid.enable = true; + }; +}