From 0ed78d898e7e2cc3e69dc7f80cd5d3e0e2d122b2 Mon Sep 17 00:00:00 2001 From: aleidk Date: Sun, 9 Jul 2023 19:10:49 -0400 Subject: [PATCH] add basic (and working) sway config --- .gitignore | 1 + config/sway/config | 8 ++- nixos/configuration.nix | 141 +++++++++++++++++++++++++--------------- nixos/theme.nix | 18 +++++ 4 files changed, 112 insertions(+), 56 deletions(-) create mode 100644 nixos/theme.nix diff --git a/.gitignore b/.gitignore index 0cb4115..260dba0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ config/mpv/shaders **/*-lock.json config/spicetify/Backup nixos/hardware-configuration.nix +result diff --git a/config/sway/config b/config/sway/config index 630dcfa..91f0bfa 100644 --- a/config/sway/config +++ b/config/sway/config @@ -21,12 +21,12 @@ set $term alacritty # Your preferred application launcher # Note: pass the final command to swaymsg so that the resulting window can be opened # on the original workspace that the command was run on. -set $menu dmenu_path | dmenu | xargs swaymsg exec -- +set $menu bemenu-run ### Output configuration # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -output * bg ~/Pictures/wallpaper.jpg fill +# output * bg ~/Pictures/wallpaper.jpg fill # # Example configuration: # @@ -221,4 +221,8 @@ bar { } } +# Start Stuff + +exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK + include /etc/sway/config.d/* diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 0dfe14c..b6f3acb 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -6,7 +6,8 @@ { imports = - [ # Include the results of the hardware scan. + [ + # Include the results of the hardware scan. ./hardware-configuration.nix ]; @@ -17,10 +18,6 @@ networking.hostName = "nixos"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable networking networking.networkmanager.enable = true; @@ -46,8 +43,26 @@ services.xserver.enable = true; # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; + services.xserver.displayManager.sddm.enable = true; + services.xserver.displayManager.sddm.theme = "catppuccin-macchiato"; + # services.xserver.displayManager.gdm.wayland = true; + # services.xserver.desktopManager.gnome.enable = true; + # enable sway window manager + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + extraSessionCommands = '' + export MOZ_ENABLE_WAYLAND=1 + ''; + }; + programs.waybar.enable = true; + + services.dbus.enable = true; + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; # Configure keymap in X11 services.xserver = { @@ -88,7 +103,6 @@ extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; [ firefox - # thunderbird ]; }; @@ -98,37 +112,51 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - alacritty - bat - cargo - duf - exa - fd - flatpak - fzf - jq - gcc - git - gnome.gnome-software - gnome.gnome-tweaks - gnomeExtensions.hibernate-status-button - hyprland - hyprpaper - lazygit - luajitPackages.luarocks - neovim - nerdfonts - nodejs - ripgrep - rustc - sd - starship - tealdeer - tmux - tree-sitter - wget - zellij - zsh + alacritty + bat + bemenu + cargo + duf + exa + fd + flatpak + fzf + gcc + git + glib + gnome.gnome-software + gnome.gnome-tweaks + gnomeExtensions.hibernate-status-button + grim + grim #screenshots + hyprland + hyprpaper + jq + lazygit + luajitPackages.luarocks + mako + mako + neovim + nodejs + ripgrep + rustc + sd + slurp + slurp # screenshot + starship + swayidle + swaylock + swaycons + tealdeer + tmux + tree-sitter + wget + wl-clipboard + wl-clipboard + xdg-utils + zellij + zsh + (callPackage ./theme.nix { }).sddm-catppucin-theme ]; # Some programs need SUID wrappers, can be configured further or are @@ -144,12 +172,6 @@ # Enable the OpenSSH daemon. # services.openssh.enable = true; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave @@ -157,18 +179,29 @@ # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "23.05"; # Did you read the comment? + services.flatpak.enable = true; -nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; -system.autoUpgrade.enable = true; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + system.autoUpgrade.enable = true; -programs.zsh.enable = true; + programs.zsh.enable = true; + + users.defaultUserShell = pkgs.zsh; + environment.shells = with pkgs; [ zsh ]; + + fonts.fonts = with pkgs; [ + (nerdfonts.override { + fonts = [ + "JetBrainsMono" + ]; + } + ) + ]; -users.defaultUserShell = pkgs.zsh; -environment.shells = with pkgs; [ zsh ]; } diff --git a/nixos/theme.nix b/nixos/theme.nix new file mode 100644 index 0000000..b733d40 --- /dev/null +++ b/nixos/theme.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchFromGitHub }: +{ + sddm-catppucin-theme = stdenv.mkDerivation rec { + pname = "sddm-catppucin-theme"; + version = "1"; + dontBuild = true; + installPhase = '' + mkdir -p $out/share/sddm/themes + cp -aR $src/src/* $out/share/sddm/themes/ + ''; + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "sddm"; + rev = "bde6932e1ae0f8fdda76eff5c81ea8d3b7d653c0"; + sha256 = "1lg10dyxgz080qfcp6k3zk6374jlj067s6p5fgx5r135ivy8mrki"; + }; + }; +}