Compare commits

...

4 Commits

Author SHA1 Message Date
k
8114541671 remove icon from rofi 2024-09-28 23:29:53 -04:00
k
4a31a114a9 moved basics out of sway.nix 2024-09-25 20:01:30 -04:00
k
7ce35c7655 nixfmt 2024-09-25 16:39:04 -04:00
k
235b382535 basic sway 2024-09-25 16:37:56 -04:00
12 changed files with 235 additions and 118 deletions

View File

@ -13,40 +13,39 @@
}; };
outputs = { self, nixpkgs, nixos-hardware, ... }@inputs: outputs = { self, nixpkgs, nixos-hardware, ... }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkg = nixpkgs.legacyPackages.${system}; pkg = nixpkgs.legacyPackages.${system};
in in {
{ nixosConfigurations = {
nixosConfigurations = { laptop = nixpkgs.lib.nixosSystem {
laptop = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; };
specialArgs = {inherit inputs;}; modules = [
modules = [ ./hosts/laptop/configuration.nix
./hosts/laptop/configuration.nix inputs.home-manager.nixosModules.default
inputs.home-manager.nixosModules.default inputs.stylix.nixosModules.stylix
inputs.stylix.nixosModules.stylix nixos-hardware.nixosModules.lenovo-thinkpad-x13-yoga
nixos-hardware.nixosModules.lenovo-thinkpad-x13-yoga ];
]; };
};
server = nixpkgs.lib.nixosSystem { server = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;}; specialArgs = { inherit inputs; };
modules = [ modules = [
./hosts/server/configuration.nix ./hosts/server/configuration.nix
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
nixos-hardware.nixosModules.system76 nixos-hardware.nixosModules.system76
]; ];
}; };
tablet = nixpkgs.lib.nixosSystem { tablet = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;}; specialArgs = { inherit inputs; };
modules = [ modules = [
./hosts/tablet/configuration.nix ./hosts/tablet/configuration.nix
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
nixos-hardware.nixosModules.microsoft-surface-pro-intel nixos-hardware.nixosModules.microsoft-surface-pro-intel
]; ];
}; };
}; };
}; };
} }

View File

@ -10,8 +10,8 @@
# `gnome-extensions list` for a list # `gnome-extensions list` for a list
enabled-extensions = [ enabled-extensions = [
"Vitals@CoreCoding.com" "Vitals@CoreCoding.com"
"blur-my-shell@aunetx" "blur-my-shell@aunetx"
"search-light@icedman.github.com" "search-light@icedman.github.com"
]; ];
}; };
}; };

View File

@ -13,6 +13,7 @@
userName = "k"; userName = "k";
userEmail = "markers711@gmail.com"; userEmail = "markers711@gmail.com";
}; };
tmux = { enable = true; };
starship.enable = true; starship.enable = true;
zsh = { zsh = {
enable = true; enable = true;

37
hosts/home/sway.nix Normal file
View File

@ -0,0 +1,37 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ./waybar.nix ./tile.nix ];
wayland.windowManager.sway = {
enable = true;
config = {
modifier = "Mod4";
floating.border = 0;
window.border = 1;
window.titlebar = false;
terminal = "${pkgs.foot}/bin/foot";
menu = "${pkgs.rofi}/bin/rofi -show drun -modi drun";
bars = [];
gaps = {
inner = 10;
outer = 5;
};
};
};
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
MOZ_USE_XINPUT2 = "1";
XDG_SESSION_TYPE = "wayland";
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
_JAVA_AWT_WM_NONREPARENTING = 1;
};
services = {
swayidle = { enable = true; };
};
}

19
hosts/home/tile.nix Normal file
View File

@ -0,0 +1,19 @@
{ config, pkgs, inputs, ... }:
{
services = {
mako = { enable = true; };
};
programs = {
mako = { enable = true; };
foot = { enable = true; };
swaylock = {enable = true;};
rofi = {
enable = true;
package = pkgs.rofi-wayland;
};
};
}

73
hosts/home/waybar.nix Normal file
View File

@ -0,0 +1,73 @@
{ config, pkgs, ... }: {
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
layer = "bottom";
position = "bottom";
output = [ "eDP-1" ];
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "clock" ];
modules-right = [ "pulseaudio" "network" "battery" ];
cpu = {
interval = 15;
format = " {}%";
max-length = 15;
};
memory = {
interval = 30;
format = " {}%";
max-length = 15;
};
"pulseaudio" = {
format = "{volume}% {icon}";
format-bluetooth = "{volume}% {icon}";
format-muted = "";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "" ];
};
scroll-step = 1;
on-click = "pavucontrol";
};
backlight = {
tooltip = false;
format = " {}%";
interval = 1;
on-scroll-up = "brightnessctl s 1515";
on-scroll-down = "brightnessctl s 1";
};
network = {
format = "{ifname}";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} 󰊗";
format-disconnected = "󰤮";
tooltip-format = "{ifname} via {gwaddr} 󰊗";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
max-length = 50;
};
battery = {
format = "{capacity}% {icon}";
"format-icons" = [ "" "" "" "" "" ];
};
clock = { "format-alt" = "{:%a, %d. %b %H:%M}"; };
};
};
};
}

View File

@ -7,6 +7,8 @@
system.autoUpgrade.enable = true; system.autoUpgrade.enable = true;
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
security.rtkit.enable = true; security.rtkit.enable = true;
security.polkit.enable = true;
security.pam.services.swaylock = {};
powerManagement.enable = true; powerManagement.enable = true;
nix = { nix = {
@ -56,13 +58,16 @@
stylix = { stylix = {
enable = true; enable = true;
autoEnable = true;
polarity = "light"; polarity = "light";
image = ./wallpaper.png; image = ./wallpaper.png;
base16Scheme = "${pkgs.base16-schemes}/share/themes/brushtrees.yaml"; base16Scheme = "${pkgs.base16-schemes}/share/themes/brushtrees.yaml";
opacity = { opacity = {
terminal = .85; terminal = 0.85;
popups = .75; popups = 0.75;
desktop = 0.75;
}; };
cursor = { cursor = {
package = pkgs.adwaita-icon-theme; package = pkgs.adwaita-icon-theme;
name = "Adwaita"; name = "Adwaita";

View File

@ -1,15 +1,10 @@
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }:
{ {
imports = [ imports = [ ../home/home_common.nix ../home/gnome.nix ../home/sway.nix ];
../home/home_common.nix
../home/gnome.nix
];
stylix.enable = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
nerdfonts nerdfonts
@ -46,4 +41,9 @@
defaultEditor = true; defaultEditor = true;
}; };
}; };
stylix = {
enable = true;
autoEnable = true;
};
} }

View File

@ -27,24 +27,20 @@
home-manager = { users = { "k" = import ./home.nix; }; }; home-manager = { users = { "k" = import ./home.nix; }; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ microcodeIntel ];
microcodeIntel
];
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
intel-compute-runtime intel-compute-runtime
intel-media-driver intel-media-driver
vaapiIntel vaapiIntel
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
vpl-gpu-rt vpl-gpu-rt
]; ];
}; };
services.xserver.videoDrivers = ["intel"];
services.xserver.videoDrivers = [ "intel" ];
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions

View File

@ -5,14 +5,12 @@
{ config, pkgs, inputs, nixos-hardware, ... }: { config, pkgs, inputs, nixos-hardware, ... }:
{ {
imports = imports = [ # Include the results of the hardware scan.
[ # Include the results of the hardware scan. ./hardware-configuration.nix
./hardware-configuration.nix ];
]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = ["nix-command" "flakes"];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# Set your time zone. # Set your time zone.
@ -33,19 +31,18 @@
LC_TIME = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8";
}; };
# Enable the X11 windowing system. # Enable the X11 windowing system.
#services.xserver.enable = true; #services.xserver.enable = true;
# Enable the GNOME Desktop Environment. # Enable the GNOME Desktop Environment.
services.xserver.desktopManager.phosh = { services.xserver.desktopManager.phosh = {
enable = true; enable = true;
group = ""; group = "";
user = "k"; user = "k";
phocConfig.xwayland = "immediate"; phocConfig.xwayland = "immediate";
}; };
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;
services.auto-cpufreq.enable = true; services.auto-cpufreq.enable = true;
services.thermald.enable = true; services.thermald.enable = true;
@ -63,38 +60,33 @@
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
}; };
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
programs.zsh.enable = true; programs.zsh.enable = true;
users.users.k = { users.users.k = {
isNormalUser = true; isNormalUser = true;
description = "k"; description = "k";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [zsh]; packages = with pkgs; [ zsh ];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
home-manager = { home-manager = { users = { "k" = import ./home.nix; }; };
users = {
"k" = import ./home.nix;
};
};
system.autoUpgrade.enable = true; system.autoUpgrade.enable = true;
nix.gc.automatic = true; nix.gc.automatic = true;
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
intel-vaapi-driver intel-vaapi-driver
intel-compute-runtime intel-compute-runtime
intel-media-driver intel-media-driver
microcodeIntel microcodeIntel
gnome-console gnome-console
neovim neovim
]; ];
boot.kernelModules = [ "soc_button_array" ]; boot.kernelModules = [ "soc_button_array" ];

View File

@ -4,11 +4,10 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
@ -20,21 +19,18 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
fileSystems."/" = {
device = "/dev/disk/by-uuid/479b497e-7807-48e4-82e6-d6468549a281";
fsType = "ext4";
};
fileSystems."/boot" = {
fileSystems."/" = device = "/dev/disk/by-uuid/DACA-E1BC";
{ device = "/dev/disk/by-uuid/479b497e-7807-48e4-82e6-d6468549a281"; fsType = "vfat";
fsType = "ext4"; };
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/DACA-E1BC";
fsType = "vfat";
};
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/19941c01-ac8c-4609-a834-20259f3ee32e"; } [{ device = "/dev/disk/by-uuid/19941c01-ac8c-4609-a834-20259f3ee32e"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's
@ -44,5 +40,6 @@
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View File

@ -25,17 +25,15 @@
enableCompletion = true; enableCompletion = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
autocd = true; autocd = true;
plugins = [ plugins = [{
{ name = "zsh-nix-shell";
name = "zsh-nix-shell"; file = "nix-shell.plugin.zsh";
file = "nix-shell.plugin.zsh"; src = pkgs.fetchFromGitHub {
src = pkgs.fetchFromGitHub { owner = "chisui";
owner = "chisui"; repo = "zsh-nix-shell";
repo = "zsh-nix-shell"; rev = "v0.8.0";
rev = "v0.8.0"; sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7";
sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7"; };
}; }];
}
];
}; };
} }