alejandra

This commit is contained in:
Tristan 2024-01-05 18:48:13 +00:00
parent 7cbdcdcd87
commit 4d0ee4459a
12 changed files with 331 additions and 341 deletions

View file

@ -18,10 +18,11 @@
} @ inputs: let } @ inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
mkConf = import ./lib/mkconf.nix; mkConf = import ./lib/mkconf.nix;
pkgs = import nixpkgs {inherit system;};
user = "tristan"; user = "tristan";
userName = "Tristan Beedell"; userName = "Tristan Beedell";
in { in {
formatter.${system} = pkgs.alejandra;
nixosConfigurations = { nixosConfigurations = {
zenix = mkConf "zenix" { zenix = mkConf "zenix" {
inherit inputs nixpkgs system user userName home-manager; inherit inputs nixpkgs system user userName home-manager;

View file

@ -341,5 +341,4 @@ in {
}; };
programs.direnv.enable = true; programs.direnv.enable = true;
} }

View file

@ -179,5 +179,4 @@ user: {
services.prometheus.exporters.node.enable = true; services.prometheus.exporters.node.enable = true;
networking.networkmanager.insertNameservers = ["1.1.1.1" "1.0.0.1"]; networking.networkmanager.insertNameservers = ["1.1.1.1" "1.0.0.1"];
} }

View file

@ -120,7 +120,5 @@
}; };
wallpaper = ../images/nix-soft.png; wallpaper = ../images/nix-soft.png;
}; };
}; };
} }

View file

@ -15,7 +15,6 @@ nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
({pkgs, ...}: { ({pkgs, ...}: {
stylix.image = ../images/demonslayer.png; stylix.image = ../images/demonslayer.png;

View file

@ -7,7 +7,7 @@
with lib; let with lib; let
cfg = config.displays; cfg = config.displays;
renderDisplaysForHyprland = displays: (map displayHyprlandSetting (builtins.filter (d: d.enable) displays )); renderDisplaysForHyprland = displays: (map displayHyprlandSetting (builtins.filter (d: d.enable) displays));
displayHyprlandSetting = display: displayHyprlandSetting = display:
specificDisplay display specificDisplay display

View file

@ -12,5 +12,8 @@ in {
type = lib.types.oneOf ["hyprland" "sway"]; type = lib.types.oneOf ["hyprland" "sway"];
}; };
config = if opt == "hyprland" then (import ../programs/hyprland.nix {inherit user;} {inherit lib pkgs;}) else {}; config =
if opt == "hyprland"
then (import ../programs/hyprland.nix {inherit user;} {inherit lib pkgs;})
else {};
} }

View file

@ -3,174 +3,171 @@
pkgs, pkgs,
... ...
}: { }: {
services.greetd = { services.greetd = {
enable = true; enable = true;
settings = rec { settings = rec {
hypr_session = { hypr_session = {
command = "Hyprland"; command = "Hyprland";
user = user; user = user;
};
default_session = hypr_session;
}; };
default_session = hypr_session;
}; };
};
home-manager.users.${user}.imports = [ home-manager.users.${user}.imports = [
( import ./swaylock.nix ) (import ./swaylock.nix)
( import ./swayidle.nix ) (import ./swayidle.nix)
{ {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
configPackages = [ pkgs.hyprland ]; configPackages = [pkgs.hyprland];
extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-gtk ]; extraPortals = [pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-gtk];
}; };
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
settings = { settings = {
input = { input = {
touchpad = { touchpad = {
natural_scroll = true; natural_scroll = true;
scroll_factor = 0.5; scroll_factor = 0.5;
};
};
gestures = {
workspace_swipe = true;
workspace_swipe_numbered = true;
};
decoration = {
rounding = 5;
drop_shadow = false;
};
bezier = [
"overshot, 0.05, 0.9, 0.1, 1.1"
"linear, 0.0, 0.0, 1.0, 1.0"
];
animations = {
enabled = true;
animation = [
"windows, 1, 1, default, popin"
"border, 1, 1, default"
"fade, 1, 1, default"
"workspaces, 1, 3, overshot"
"borderangle,1, 50, linear, loop"
];
};
bind = [
"SUPER, h, movefocus,l"
"SUPER, l, movefocus,r"
"SUPER, j, layoutmsg,cyclenext"
"SUPER, k, layoutmsg,cycleprev"
"SUPER, space, layoutmsg,swapwithmaster master"
"SUPER, F, fullscreen,"
"SUPER, V, togglefloating,"
"SUPER, W, layoutmsg, orientationprev"
"SUPER_SHIFT, W, layoutmsg, orientationnext"
"SUPER_SHIFT, V, togglegroup,"
"SUPER_SHIFT, h, changegroupactive,b"
"SUPER_SHIFT, h, moveintogroup,l"
"SUPER_SHIFT, l, moveintogroup,r"
"SUPER_SHIFT, l, changegroupactive,f"
"SUPER, Y, togglespecialworkspace"
"SUPER_SHIFT, Y, movetoworkspace, special"
"SUPER_SHIFT, X, killactive"
"SUPER, slash, focuswindow, brave-browser"
"SUPER, n, focuswindow, Logseq"
"SUPER, R, submap, resize"
"SUPER,1,workspace,1"
"SUPER,2,workspace,2"
"SUPER,3,workspace,3"
"SUPER,4,workspace,4"
"SUPER,5,workspace,5"
"SUPER,6,workspace,6"
"SUPER,7,workspace,7"
"SUPER,8,workspace,8"
"SUPER,9,workspace,9"
"SUPER,0,workspace,10"
"SUPER,left,workspace,r-1"
"SUPER,right,workspace,r+1"
"SUPER_SHIFT,1,movetoworkspace,1"
"SUPER_SHIFT,2,movetoworkspace,2"
"SUPER_SHIFT,3,movetoworkspace,3"
"SUPER_SHIFT,4,movetoworkspace,4"
"SUPER_SHIFT,5,movetoworkspace,5"
"SUPER_SHIFT,6,movetoworkspace,6"
"SUPER_SHIFT,7,movetoworkspace,7"
"SUPER_SHIFT,8,movetoworkspace,8"
"SUPER_SHIFT,9,movetoworkspace,9"
"SUPER_SHIFT,0,movetoworkspace,10"
];
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
env = [
"GDK_BACKEND,wayland,x11"
"QT_QPA_PLATFORM,wayland;xcb"
"SDL_VIDEODRIVER,wayland"
"CLUTTER_BACKEND,wayland"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"NIXOS_OZONE_WL,1"
"WLR_NO_HARDWARE_CURSORS,1"
];
windowrule = [
"float, title:wlogout"
"idleinhibit always, vrmonitor"
"idleinhibit focus, steam_app"
];
workspace = [
"11, default:true"
];
general = {
gaps_out = 10;
resize_on_border = true;
layout = "master";
# "col.active_border" = "rgb(FFFF00) rgb(00FFFF) rgb(FF00FF)";
border_size = lib.mkDefault 5;
};
master = {
mfact = 0.7;
new_on_top = true;
};
misc = {
vrr = 2;
focus_on_activate = true;
}; };
}; };
# https://wiki.hyprland.org/Configuring/Variables/ gestures = {
extraConfig = '' workspace_swipe = true;
submap = resize workspace_swipe_numbered = true;
binde = ,right,resizeactive,10 0 };
binde = ,left,resizeactive,-10 0 decoration = {
binde = ,up,resizeactive,0 -10 rounding = 5;
binde = ,down,resizeactive,0 10 drop_shadow = false;
binde = ,k,resizeactive,0 -10 };
binde = ,j,resizeactive,0 10 bezier = [
binde = ,l,splitratio,0.05 "overshot, 0.05, 0.9, 0.1, 1.1"
binde = ,h,splitratio,-0.05 "linear, 0.0, 0.0, 1.0, 1.0"
binde = SHIFT,l,splitratio,0.3 ];
binde = SHIFT,h,splitratio,-0.3 animations = {
enabled = true;
bind = , escape, submap,reset animation = [
bind = , enter, submap,reset "windows, 1, 1, default, popin"
bind = SUPER, R, submap,reset "border, 1, 1, default"
bind = CONTROL, C, submap,reset "fade, 1, 1, default"
submap = reset "workspaces, 1, 3, overshot"
''; "borderangle,1, 50, linear, loop"
];
};
bind = [
"SUPER, h, movefocus,l"
"SUPER, l, movefocus,r"
"SUPER, j, layoutmsg,cyclenext"
"SUPER, k, layoutmsg,cycleprev"
"SUPER, space, layoutmsg,swapwithmaster master"
"SUPER, F, fullscreen,"
"SUPER, V, togglefloating,"
"SUPER, W, layoutmsg, orientationprev"
"SUPER_SHIFT, W, layoutmsg, orientationnext"
"SUPER_SHIFT, V, togglegroup,"
"SUPER_SHIFT, h, changegroupactive,b"
"SUPER_SHIFT, h, moveintogroup,l"
"SUPER_SHIFT, l, moveintogroup,r"
"SUPER_SHIFT, l, changegroupactive,f"
"SUPER, Y, togglespecialworkspace"
"SUPER_SHIFT, Y, movetoworkspace, special"
"SUPER_SHIFT, X, killactive"
"SUPER, slash, focuswindow, brave-browser"
"SUPER, n, focuswindow, Logseq"
"SUPER, R, submap, resize"
"SUPER,1,workspace,1"
"SUPER,2,workspace,2"
"SUPER,3,workspace,3"
"SUPER,4,workspace,4"
"SUPER,5,workspace,5"
"SUPER,6,workspace,6"
"SUPER,7,workspace,7"
"SUPER,8,workspace,8"
"SUPER,9,workspace,9"
"SUPER,0,workspace,10"
"SUPER,left,workspace,r-1"
"SUPER,right,workspace,r+1"
"SUPER_SHIFT,1,movetoworkspace,1"
"SUPER_SHIFT,2,movetoworkspace,2"
"SUPER_SHIFT,3,movetoworkspace,3"
"SUPER_SHIFT,4,movetoworkspace,4"
"SUPER_SHIFT,5,movetoworkspace,5"
"SUPER_SHIFT,6,movetoworkspace,6"
"SUPER_SHIFT,7,movetoworkspace,7"
"SUPER_SHIFT,8,movetoworkspace,8"
"SUPER_SHIFT,9,movetoworkspace,9"
"SUPER_SHIFT,0,movetoworkspace,10"
];
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
env = [
"GDK_BACKEND,wayland,x11"
"QT_QPA_PLATFORM,wayland;xcb"
"SDL_VIDEODRIVER,wayland"
"CLUTTER_BACKEND,wayland"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"NIXOS_OZONE_WL,1"
"WLR_NO_HARDWARE_CURSORS,1"
];
windowrule = [
"float, title:wlogout"
"idleinhibit always, vrmonitor"
"idleinhibit focus, steam_app"
];
workspace = [
"11, default:true"
];
general = {
gaps_out = 10;
resize_on_border = true;
layout = "master";
# "col.active_border" = "rgb(FFFF00) rgb(00FFFF) rgb(FF00FF)";
border_size = lib.mkDefault 5;
};
master = {
mfact = 0.7;
new_on_top = true;
};
misc = {
vrr = 2;
focus_on_activate = true;
};
}; };
# https://wiki.hyprland.org/Configuring/Variables/
extraConfig = ''
submap = resize
binde = ,right,resizeactive,10 0
binde = ,left,resizeactive,-10 0
binde = ,up,resizeactive,0 -10
binde = ,down,resizeactive,0 10
binde = ,k,resizeactive,0 -10
binde = ,j,resizeactive,0 10
binde = ,l,splitratio,0.05
binde = ,h,splitratio,-0.05
binde = SHIFT,l,splitratio,0.3
binde = SHIFT,h,splitratio,-0.3
services.mako = { bind = , escape, submap,reset
enable = true; bind = , enter, submap,reset
}; bind = SUPER, R, submap,reset
bind = CONTROL, C, submap,reset
submap = reset
'';
};
programs.waybar.settings.mainBar.modules-left = services.mako = {
["hyprland/workspaces" "hyprland/window"]; enable = true;
};
programs.waybar.settings.mainBar.modules-left = ["hyprland/workspaces" "hyprland/window"];
} }
]; ];
} }

View file

@ -4,103 +4,103 @@
config, config,
... ...
}: { }: {
services.greetd = { services.greetd = {
enable = true; enable = true;
settings = rec { settings = rec {
sway_session = { sway_session = {
command = "sway"; command = "sway";
user = user; user = user;
};
default_session = sway_session;
}; };
default_session = sway_session;
}; };
};
home-manager.users.${user}.imports = [ home-manager.users.${user}.imports = [
( import ./swaylock.nix ) (import ./swaylock.nix)
{ {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
configPackages = [ pkgs.sway ]; configPackages = [pkgs.sway];
extraPortals = [ pkgs.xdg-desktop-portal-sway pkgs.xdg-desktop-portal-gtk ]; extraPortals = [pkgs.xdg-desktop-portal-sway pkgs.xdg-desktop-portal-gtk];
}; };
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
}; };
services.swayidle = { services.swayidle = {
enable = true; enable = true;
systemdTarget = "graphical-session.target"; systemdTarget = "graphical-session.target";
events = [ events = [
{ {
event = "before-sleep"; event = "before-sleep";
command = "${pkgs.swaylock-effects}/bin/swaylock"; command = "${pkgs.swaylock-effects}/bin/swaylock";
} }
{ {
event = "lock"; event = "lock";
command = "${pkgs.swaylock-effects}/bin/swaylock"; command = "${pkgs.swaylock-effects}/bin/swaylock";
} }
]; ];
timeouts = [ timeouts = [
{ {
timeout = 300; timeout = 300;
command = "${pkgs.swaylock-effects}/bin/swaylock -f"; command = "${pkgs.swaylock-effects}/bin/swaylock -f";
} }
{ {
timeout = 600; timeout = 600;
command = "systemctl suspend"; command = "systemctl suspend";
} }
]; ];
}; };
services.mako.enable = true; services.mako.enable = true;
programs.waybar = { programs.waybar = {
enable = true; enable = true;
settings = { settings = {
mainBar = { mainBar = {
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 36; height = 36;
modules-left = ["sway/workspaces" "sway/window"]; modules-left = ["sway/workspaces" "sway/window"];
modules-right = ["mpris" "pulseaudio" "clock" "tray" "battery"]; modules-right = ["mpris" "pulseaudio" "clock" "tray" "battery"];
clock = { clock = {
format = "📅 {:%a %b-%d %I:%M %p}"; format = "📅 {:%a %b-%d %I:%M %p}";
};
pulseaudio = {
format-muted = "🔇 {volume}";
format = "{icon} {volume}";
format-icons.default = ["🔈" "🔉" "🔊"];
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
};
mpris = {
format = "{player_icon} {artist} - {title}";
format-paused = "{status_icon} {player_icon} {artist} - {title}";
player-icons = {
default = "";
mpd = "🎵";
kdeconnect = "";
}; };
pulseaudio = { status-icons = {
format-muted = "🔇 {volume}"; paused = "";
format = "{icon} {volume}";
format-icons.default = ["🔈" "🔉" "🔊"];
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
}; };
mpris = { };
format = "{player_icon} {artist} - {title}"; battery = {
format-paused = "{status_icon} {player_icon} {artist} - {title}"; format = "{icon} {capacity}%";
player-icons = { format-icons = ["🤏" "🪫" "🔋" "🔋"];
default = ""; format-charging = "🔌 {capacity}%";
mpd = "🎵"; states = {
kdeconnect = ""; warning = 30;
}; critical = 15;
status-icons = {
paused = "";
};
};
battery = {
format = "{icon} {capacity}%";
format-icons = ["🤏" "🪫" "🔋" "🔋"];
format-charging = "🔌 {capacity}%";
states = {
warning = 30;
critical = 15;
};
}; };
}; };
}; };
systemd = {
enable = true;
target = "graphical-session.target";
};
}; };
} systemd = {
]; enable = true;
target = "graphical-session.target";
};
};
}
];
} }

View file

@ -1,28 +1,26 @@
{pkgs,...}: { {pkgs, ...}: {
services.swayidle = {
services.swayidle = { enable = true;
enable = true; systemdTarget = "graphical-session.target";
systemdTarget = "graphical-session.target"; events = [
events = [ {
{ event = "before-sleep";
event = "before-sleep"; command = "${pkgs.swaylock-effects}/bin/swaylock";
command = "${pkgs.swaylock-effects}/bin/swaylock"; }
} {
{ event = "lock";
event = "lock"; command = "${pkgs.swaylock-effects}/bin/swaylock";
command = "${pkgs.swaylock-effects}/bin/swaylock"; }
} ];
]; timeouts = [
timeouts = [ {
{ timeout = 300;
timeout = 300; command = "${pkgs.swaylock-effects}/bin/swaylock -f";
command = "${pkgs.swaylock-effects}/bin/swaylock -f"; }
} {
{ timeout = 600;
timeout = 600; command = "systemctl suspend";
command = "systemctl suspend"; }
} ];
]; };
};
} }

View file

@ -1,14 +1,13 @@
{pkgs,...}: { {pkgs, ...}: {
programs.swaylock = {
programs.swaylock = { enable = true;
enable = true; package = pkgs.swaylock-effects;
package = pkgs.swaylock-effects; settings = {
settings = { clock = true;
clock = true; screenshots = true;
screenshots = true; effect-scale = 0.5;
effect-scale = 0.5; effect-blur = "10x10";
effect-blur = "10x10"; grace = 5;
grace = 5; };
}; };
};
} }

View file

@ -1,50 +1,47 @@
{pkgs,...}: { {pkgs, ...}: {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
settings = { settings = {
mainBar = { mainBar = {
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 36; height = 36;
modules-right = ["mpris" "pulseaudio" "clock" "tray" "battery"]; modules-right = ["mpris" "pulseaudio" "clock" "tray" "battery"];
clock = { clock = {
format = "📅 {:%a %b-%d %I:%M %p}"; format = "📅 {:%a %b-%d %I:%M %p}";
}; };
pulseaudio = { pulseaudio = {
format-muted = "🔇 {volume}"; format-muted = "🔇 {volume}";
format = "{icon} {volume}"; format = "{icon} {volume}";
format-icons.default = ["🔈" "🔉" "🔊"]; format-icons.default = ["🔈" "🔉" "🔊"];
on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
}; };
mpris = { mpris = {
format = "{player_icon} {artist} - {title}"; format = "{player_icon} {artist} - {title}";
format-paused = "{status_icon} {player_icon} {artist} - {title}"; format-paused = "{status_icon} {player_icon} {artist} - {title}";
player-icons = { player-icons = {
default = ""; default = "";
mpd = "🎵"; mpd = "🎵";
kdeconnect = ""; kdeconnect = "";
};
status-icons = {
paused = "";
};
};
battery = {
format = "{icon} {capacity}%";
format-icons = ["🤏" "🪫" "🔋" "🔋"];
format-charging = "🔌 {capacity}%";
states = {
warning = 30;
critical = 15;
};
};
};
}; };
systemd = { status-icons = {
enable = true; paused = "";
target = "graphical-session.target";
}; };
}; };
battery = {
format = "{icon} {capacity}%";
format-icons = ["🤏" "🪫" "🔋" "🔋"];
format-charging = "🔌 {capacity}%";
states = {
warning = 30;
critical = 15;
};
};
};
};
systemd = {
enable = true;
target = "graphical-session.target";
};
};
} }