mirror of
https://github.com/larstvei/nix-config.git
synced 2026-02-01 16:20:12 +00:00
Compare commits
9 Commits
9ddaad3888
...
8f247b2e6b
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f247b2e6b | |||
| 4ad67653d0 | |||
| b6af4b0b12 | |||
| 6d44289959 | |||
| 18982bc1ba | |||
| 8dc0ad1d34 | |||
| 970196d5fb | |||
| fe9d7f0575 | |||
| dc8c6e3fa4 |
@ -31,17 +31,14 @@
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nix-rosetta-builder,
|
||||
nanostatus,
|
||||
emacs-larstvei,
|
||||
zen-browser,
|
||||
...
|
||||
}:
|
||||
}@inputs:
|
||||
{
|
||||
darwinConfigurations = {
|
||||
larstvei-macbookpro = darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
|
||||
specialArgs = { inherit emacs-larstvei; };
|
||||
specialArgs = { inherit inputs; };
|
||||
|
||||
modules = [
|
||||
home-manager.darwinModules.default
|
||||
@ -54,7 +51,7 @@
|
||||
|
||||
nixosConfigurations.thinkpad = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit emacs-larstvei nanostatus zen-browser; };
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
home-manager.nixosModules.default
|
||||
./machines/thinkpad
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ pkgs, emacs-larstvei, ... }:
|
||||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../modules/base
|
||||
@ -17,7 +17,7 @@
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit emacs-larstvei; };
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users.larstvei.imports = [ ../../modules/home/full ];
|
||||
};
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
../../modules/desktop
|
||||
];
|
||||
|
||||
security.pam.services.hyprlock = { };
|
||||
|
||||
networking.hostName = "larstvei-think";
|
||||
|
||||
# Bootloader.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ pkgs, zen-browser, ... }:
|
||||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
|
||||
home.packages = [
|
||||
@ -11,8 +11,8 @@
|
||||
];
|
||||
|
||||
imports = [
|
||||
zen-browser.homeModules.beta
|
||||
./hyprland
|
||||
inputs.zen-browser.homeModules.beta
|
||||
./hypr
|
||||
./theme
|
||||
];
|
||||
|
||||
|
||||
32
modules/desktop/hypr/animations/default.nix
Normal file
32
modules/desktop/hypr/animations/default.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
# The animations is taken from Omarchy, see:
|
||||
# https://github.com/basecamp/omarchy/blob/master/default/hypr/looknfeel.conf
|
||||
wayland.windowManager.hyprland.settings.animations = {
|
||||
enabled = true;
|
||||
|
||||
bezier = [
|
||||
"easeOutQuint,0.23,1,0.32,1"
|
||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||
"linear,0,0,1,1"
|
||||
"almostLinear,0.5,0.5,0.75,1.0"
|
||||
"quick,0.15,0,0.1,1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"global, 1, 10, default"
|
||||
"border, 1, 5.39, easeOutQuint"
|
||||
"windows, 1, 4.79, easeOutQuint"
|
||||
"windowsIn, 1, 4.1, easeOutQuint, popin 87%"
|
||||
"windowsOut, 1, 1.49, linear, popin 87%"
|
||||
"fadeIn, 1, 1.73, almostLinear"
|
||||
"fadeOut, 1, 1.46, almostLinear"
|
||||
"fade, 1, 3.03, quick"
|
||||
"layers, 1, 3.81, easeOutQuint"
|
||||
"layersIn, 1, 4, easeOutQuint, fade"
|
||||
"layersOut, 1, 1.5, linear, fade"
|
||||
"fadeLayersIn, 1, 1.79, almostLinear"
|
||||
"fadeLayersOut, 1, 1.39, almostLinear"
|
||||
"workspaces, 0, 0, ease"
|
||||
];
|
||||
};
|
||||
}
|
||||
92
modules/desktop/hypr/bindings/default.nix
Normal file
92
modules/desktop/hypr/bindings/default.nix
Normal file
@ -0,0 +1,92 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
let
|
||||
nanostatus = inputs.nanostatus.packages.${pkgs.system}.default;
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
input = {
|
||||
kb_options = "altwin:swap_alt_win";
|
||||
|
||||
repeat_delay = 300;
|
||||
repeat_rate = 50;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = true;
|
||||
scroll_factor = 0.4;
|
||||
tap-to-click = true;
|
||||
};
|
||||
};
|
||||
|
||||
"$mod" = "SUPER";
|
||||
"$shiftMod" = "SUPER_SHIFT";
|
||||
|
||||
bind = [
|
||||
# Master layout
|
||||
"$mod, F, fullscreen"
|
||||
"$mod, Return, layoutmsg, swapwithmaster master"
|
||||
"$mod, minus, layoutmsg, mfact -0.01"
|
||||
"$mod, equal, layoutmsg, mfact +0.01"
|
||||
"$mod, Tab, layoutmsg, cyclenext"
|
||||
"$shiftMod, Tab, layoutmsg, cycleprev"
|
||||
"$mod, comma, layoutmsg, addmaster"
|
||||
"$mod, period, layoutmsg, removemaster"
|
||||
|
||||
# App launchers / session
|
||||
"$mod, T, exec, kitty"
|
||||
"$mod, E, exec, emacs"
|
||||
"$mod, B, exec, zen"
|
||||
"$mod, Q, killactive"
|
||||
|
||||
"$mod, S, exec, grimblast copysave area /tmp/screenshot-$(date +%F--%T).png"
|
||||
"$shiftMod, S, exec, grimblast copysave screen /tmp/screenshot-$(date +%F--%T).png"
|
||||
|
||||
# Window focus & movement
|
||||
"$mod, H, movefocus, l"
|
||||
"$mod, J, movefocus, d"
|
||||
"$mod, K, movefocus, u"
|
||||
"$mod, L, movefocus, r"
|
||||
"$shiftMod, H, movewindow, l"
|
||||
"$shiftMod, J, movewindow, d"
|
||||
"$shiftMod, K, movewindow, u"
|
||||
"$shiftMod, L, movewindow, r"
|
||||
|
||||
"$mod, =, resizeactive, +10"
|
||||
"$mod, -, resizeactive, -10"
|
||||
|
||||
"$mod, D, exec, darkman toggle"
|
||||
"$mod, space, exec, ${nanostatus}/bin/nanostatus-toggle"
|
||||
"$mod, backspace, exec, hyprlock"
|
||||
|
||||
# Text input (macOS-like way of producing Norwegian characters)
|
||||
"$mod, A, exec, wtype 'å'"
|
||||
"$mod, O, exec, wtype 'ø'"
|
||||
"$mod, apostrophe, exec, wtype 'æ'"
|
||||
"$shiftMod, A, exec, wtype 'Å'"
|
||||
"$shiftMod, O, exec, wtype 'Ø'"
|
||||
"$shiftMod, apostrophe, exec, wtype 'Æ'"
|
||||
|
||||
# Media & brightness
|
||||
", XF86AudioRaiseVolume, exec, pamixer -i 5 "
|
||||
", XF86AudioLowerVolume, exec, pamixer -d 5 "
|
||||
", XF86AudioMute, exec, pamixer -t"
|
||||
", XF86AudioMicMute, exec, pamixer --default-source -t"
|
||||
", XF86MonBrightnessUp, exec, brightnessctl set +5%"
|
||||
", XF86MonBrightnessDown, exec, brightnessctl set 5%-"
|
||||
"SHIFT, XF86MonBrightnessUp, exec, brightnessctl set 100%"
|
||||
"SHIFT, XF86MonBrightnessDown, exec, brightnessctl set 1"
|
||||
]
|
||||
++ builtins.concatLists (
|
||||
builtins.genList (
|
||||
i:
|
||||
let
|
||||
code = "1${toString i}";
|
||||
ws = toString (i + 1);
|
||||
in
|
||||
[
|
||||
"$mod, code:${code}, workspace, ${ws}"
|
||||
"$shiftMod, code:${code}, movetoworkspace, ${ws}"
|
||||
]
|
||||
) 9
|
||||
);
|
||||
};
|
||||
}
|
||||
51
modules/desktop/hypr/default.nix
Normal file
51
modules/desktop/hypr/default.nix
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
imports = [
|
||||
./animations
|
||||
./bindings
|
||||
./hypridle
|
||||
];
|
||||
|
||||
programs.kitty.enable = true;
|
||||
programs.hyprlock.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
|
||||
exec-once = [ "hyprlock || hyprctl dispatch exit" ];
|
||||
|
||||
misc.disable_hyprland_logo = true;
|
||||
|
||||
general = {
|
||||
border_size = 2;
|
||||
layout = "master";
|
||||
};
|
||||
|
||||
# No borders or gaps when there is only one window
|
||||
workspace = "w[t1], gapsin:0, gapsout:0, border:0, rounding:0";
|
||||
|
||||
decoration = {
|
||||
rounding = 15;
|
||||
inactive_opacity = 0.75;
|
||||
blur.enabled = false;
|
||||
shadow.enabled = false;
|
||||
border_part_of_window = true;
|
||||
};
|
||||
|
||||
monitor = [ ",preferred,auto,1" ];
|
||||
|
||||
gestures.workspace_swipe = true;
|
||||
|
||||
cursor = {
|
||||
enable_hyprcursor = false;
|
||||
inactive_timeout = 2;
|
||||
};
|
||||
|
||||
env = [
|
||||
"XCURSOR_THEME,Adwaita"
|
||||
"XCURSOR_SIZE,24"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/desktop/hypr/hypridle/default.nix
Normal file
26
modules/desktop/hypr/hypridle/default.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "hyprlock";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
};
|
||||
listener = [
|
||||
{
|
||||
timeout = 150; # 2.5 min
|
||||
on-timeout = "brightnessctl --save && brightnessctl set 1";
|
||||
on-resume = "brightnessctl --restore";
|
||||
}
|
||||
{
|
||||
timeout = 300; # 5 min
|
||||
on-resume = "loginctl lock-session";
|
||||
}
|
||||
{
|
||||
timeout = 900; # 15 min
|
||||
on-timeout = "systemctl suspend-then-hibernate";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -1,157 +0,0 @@
|
||||
{ pkgs, nanostatus, ... }:
|
||||
{
|
||||
programs.kitty.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
|
||||
misc.disable_hyprland_logo = true;
|
||||
|
||||
general = {
|
||||
border_size = 2;
|
||||
layout = "master";
|
||||
};
|
||||
|
||||
# No borders or gaps when there is only one window
|
||||
workspace = "w[t1], gapsin:0, gapsout:0, border:0";
|
||||
|
||||
decoration = {
|
||||
rounding = 15;
|
||||
inactive_opacity = 0.75;
|
||||
blur.enabled = false;
|
||||
shadow.enabled = false;
|
||||
border_part_of_window = true;
|
||||
};
|
||||
|
||||
# The animations is taken from Omarchy, see:
|
||||
# https://github.com/basecamp/omarchy/blob/master/default/hypr/looknfeel.conf
|
||||
animations = {
|
||||
enabled = true;
|
||||
|
||||
bezier = [
|
||||
"easeOutQuint,0.23,1,0.32,1"
|
||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||
"linear,0,0,1,1"
|
||||
"almostLinear,0.5,0.5,0.75,1.0"
|
||||
"quick,0.15,0,0.1,1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"global, 1, 10, default"
|
||||
"border, 1, 5.39, easeOutQuint"
|
||||
"windows, 1, 4.79, easeOutQuint"
|
||||
"windowsIn, 1, 4.1, easeOutQuint, popin 87%"
|
||||
"windowsOut, 1, 1.49, linear, popin 87%"
|
||||
"fadeIn, 1, 1.73, almostLinear"
|
||||
"fadeOut, 1, 1.46, almostLinear"
|
||||
"fade, 1, 3.03, quick"
|
||||
"layers, 1, 3.81, easeOutQuint"
|
||||
"layersIn, 1, 4, easeOutQuint, fade"
|
||||
"layersOut, 1, 1.5, linear, fade"
|
||||
"fadeLayersIn, 1, 1.79, almostLinear"
|
||||
"fadeLayersOut, 1, 1.39, almostLinear"
|
||||
"workspaces, 0, 0, ease"
|
||||
];
|
||||
};
|
||||
|
||||
monitor = [ ",preferred,auto,1" ];
|
||||
|
||||
gestures.workspace_swipe = true;
|
||||
|
||||
cursor = {
|
||||
enable_hyprcursor = false;
|
||||
inactive_timeout = 2;
|
||||
};
|
||||
|
||||
env = [
|
||||
"XCURSOR_THEME,Adwaita"
|
||||
"XCURSOR_SIZE,24"
|
||||
];
|
||||
|
||||
input = {
|
||||
kb_options = "altwin:swap_alt_win";
|
||||
|
||||
repeat_delay = 300;
|
||||
repeat_rate = 50;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = true;
|
||||
scroll_factor = 0.4;
|
||||
tap-to-click = true;
|
||||
};
|
||||
};
|
||||
|
||||
"$mod" = "SUPER";
|
||||
"$shiftMod" = "SUPER_SHIFT";
|
||||
|
||||
bind = [
|
||||
# Master layout
|
||||
"$mod, F, fullscreen"
|
||||
"$mod, Return, layoutmsg, swapwithmaster master"
|
||||
"$mod, minus, layoutmsg, mfact -0.01"
|
||||
"$mod, equal, layoutmsg, mfact +0.01"
|
||||
"$mod, Tab, layoutmsg, cyclenext"
|
||||
"$shiftMod, Tab, layoutmsg, cycleprev"
|
||||
"$mod, comma, layoutmsg, addmaster"
|
||||
"$mod, period, layoutmsg, removemaster"
|
||||
|
||||
# App launchers / session
|
||||
"$mod, T, exec, kitty"
|
||||
"$mod, E, exec, emacs"
|
||||
"$mod, B, exec, zen"
|
||||
"$mod, Q, killactive"
|
||||
|
||||
"$mod, S, exec, grimblast copysave area /tmp/screenshot-$(date +%F--%T).png"
|
||||
"$shiftMod, S, exec, grimblast copysave screen /tmp/screenshot-$(date +%F--%T).png"
|
||||
|
||||
# Window focus & movement
|
||||
"$mod, H, movefocus, l"
|
||||
"$mod, J, movefocus, d"
|
||||
"$mod, K, movefocus, u"
|
||||
"$mod, L, movefocus, r"
|
||||
"$shiftMod, H, movewindow, l"
|
||||
"$shiftMod, J, movewindow, d"
|
||||
"$shiftMod, K, movewindow, u"
|
||||
"$shiftMod, L, movewindow, r"
|
||||
|
||||
"$mod, =, resizeactive, +10"
|
||||
"$mod, -, resizeactive, -10"
|
||||
|
||||
"$mod, D, exec, darkman toggle"
|
||||
|
||||
"$mod, space, exec, ${nanostatus.packages.${pkgs.system}.default}/bin/nanostatus-toggle"
|
||||
|
||||
# Text input (macOS-like way of producing Norwegian characters)
|
||||
"$mod, A, exec, wtype 'å'"
|
||||
"$mod, O, exec, wtype 'ø'"
|
||||
"$mod, apostrophe, exec, wtype 'æ'"
|
||||
"$shiftMod, A, exec, wtype 'Å'"
|
||||
"$shiftMod, O, exec, wtype 'Ø'"
|
||||
"$shiftMod, apostrophe, exec, wtype 'Æ'"
|
||||
|
||||
# Media & brightness
|
||||
", XF86AudioRaiseVolume, exec, pamixer -i 5 "
|
||||
", XF86AudioLowerVolume, exec, pamixer -d 5 "
|
||||
", XF86AudioMute, exec, pamixer -t"
|
||||
", XF86AudioMicMute, exec, pamixer --default-source -t"
|
||||
", XF86MonBrightnessUp, exec, brightnessctl set +5%"
|
||||
", XF86MonBrightnessDown, exec, brightnessctl set 5%-"
|
||||
]
|
||||
++ builtins.concatLists (
|
||||
builtins.genList (
|
||||
i:
|
||||
let
|
||||
code = "1${toString i}";
|
||||
ws = toString (i + 1);
|
||||
in
|
||||
[
|
||||
"$mod, code:${code}, workspace, ${ws}"
|
||||
"$shiftMod, code:${code}, movetoworkspace, ${ws}"
|
||||
]
|
||||
) 9
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -1,4 +1,3 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
bg = {
|
||||
light = "FAFAFA";
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
{
|
||||
pkgs,
|
||||
nanostatus,
|
||||
emacs-larstvei,
|
||||
zen-browser,
|
||||
...
|
||||
}:
|
||||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
@ -14,7 +8,7 @@
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit nanostatus emacs-larstvei zen-browser; };
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
};
|
||||
|
||||
users.users.larstvei = {
|
||||
@ -32,10 +26,13 @@
|
||||
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings.default_session = {
|
||||
command = "hyprland";
|
||||
settings = rec {
|
||||
initial_session = {
|
||||
command = "hyprland > /dev/null 2>&1";
|
||||
user = "larstvei";
|
||||
};
|
||||
default_session = initial_session;
|
||||
};
|
||||
};
|
||||
|
||||
fonts = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{ pkgs, emacs-larstvei, ... }:
|
||||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
emacs-larstvei.defaultPackage.${pkgs.system}
|
||||
inputs.emacs-larstvei.defaultPackage.${pkgs.system}
|
||||
];
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
gnumake
|
||||
jet
|
||||
jq
|
||||
localsend
|
||||
pandoc
|
||||
parallel
|
||||
ripgrep
|
||||
|
||||
Loading…
Reference in New Issue
Block a user