Merge branch 'nixos' into nixos-work
This commit is contained in:
commit
b20fa368c1
20 changed files with 432 additions and 217 deletions
|
|
@ -173,8 +173,8 @@ in
|
|||
|
||||
programs = {
|
||||
mtr.enable = true;
|
||||
command-not-found.enable = true;
|
||||
starship.enable = true;
|
||||
command-not-found.enable = false;
|
||||
};
|
||||
|
||||
services = {
|
||||
|
|
|
|||
|
|
@ -100,10 +100,14 @@ in
|
|||
enable = true;
|
||||
startInBackground = true;
|
||||
};
|
||||
systemd.user.services.nextcloud-client.Service = {
|
||||
RestartSec = "500ms";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
illum.enable = true;
|
||||
resolved.enable = true;
|
||||
gnome.gnome-keyring.enable = true;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
|
|
@ -111,5 +115,16 @@ in
|
|||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# faster startup https://majiehong.com/post/2021-07-30_slow_nixos_startup/
|
||||
networking = {
|
||||
# no need to wait interfaces to have an IP to continue booting
|
||||
dhcpcd.wait = "background";
|
||||
# avoid checking if IP is already taken to boot a few seconds faster
|
||||
dhcpcd.extraConfig = "noarp";
|
||||
};
|
||||
# disable network-online.target
|
||||
systemd.services.NetworkManager-wait-online.enable = false;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{ config
|
||||
, lib
|
||||
, inputs
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
|
|
@ -33,13 +34,27 @@ in
|
|||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.programs.firefox = {
|
||||
enable = true;
|
||||
profiles."default".extraConfig = mkIf cfg.arkenfox.enable ''
|
||||
// Arkenfox user.js
|
||||
${arkenfox}
|
||||
profiles."default" = {
|
||||
extraConfig = mkIf cfg.arkenfox.enable ''
|
||||
// Arkenfox user.js
|
||||
${arkenfox}
|
||||
|
||||
// Overrides
|
||||
${cfg.arkenfox.overrides}
|
||||
'';
|
||||
// Overrides
|
||||
${cfg.arkenfox.overrides}
|
||||
'';
|
||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
darkreader
|
||||
firefox-color
|
||||
istilldontcareaboutcookies
|
||||
kagi-search
|
||||
keepassxc-browser
|
||||
languagetool
|
||||
multi-account-containers
|
||||
ublock-origin
|
||||
wikiwand-wikipedia-modernized
|
||||
vimium
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,10 +111,10 @@ in
|
|||
}
|
||||
|
||||
misc {
|
||||
# disable_hypr_chan = true
|
||||
vrr = 1
|
||||
mouse_move_enables_dpms = true
|
||||
key_press_enables_dpms = true
|
||||
force_default_wallpaper = 0
|
||||
}
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
|
|
@ -142,80 +142,81 @@ in
|
|||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
|
||||
# Window binds
|
||||
bind = $mainMod , F , togglefloating ,
|
||||
bind = $mainMod , P , pseudo ,
|
||||
bind = $mainMod , Q , killactive ,
|
||||
bind = $mainMod , T , togglesplit ,
|
||||
bind = $mainMod SHIFT , F , fullscreen ,
|
||||
bind = $mainMod , F , togglefloating ,
|
||||
bind = $mainMod , P , pseudo ,
|
||||
bind = $mainMod , Q , killactive ,
|
||||
bind = $mainMod , T , togglesplit ,
|
||||
bind = $mainMod SHIFT , F , fullscreen ,
|
||||
|
||||
# Program binds
|
||||
bind = $mainMod , B , exec , rofi-bluetooth
|
||||
bind = $mainMod , C , exec , rofi -show calc -modi calc -no-show-match -no-sort | wl-copy
|
||||
bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle
|
||||
bind = $mainMod , M , exec , hyprctl keyword general:layout master
|
||||
bind = $mainMod , R , exec , rofi -show combi
|
||||
bind = $mainMod , RETURN , exec , kitty
|
||||
bind = $mainMod , B , exec , rofi-bluetooth
|
||||
bind = $mainMod , C , exec , rofi -show calc -modi calc -no-show-match -no-sort | wl-copy
|
||||
bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle
|
||||
bind = $mainMod , M , exec , hyprctl keyword general:layout master
|
||||
bind = $mainMod , R , exec , rofi -show combi
|
||||
bind = $mainMod , RETURN , exec , kitty
|
||||
bind = $mainMod SHIFT , RETURN , exec , kitty -- tmux new -A -s home
|
||||
|
||||
# XF86 keys
|
||||
binde = , XF86AudioLowerVolume , exec , pamixer -d 5
|
||||
binde = , XF86AudioRaiseVolume , exec , pamixer -i 5
|
||||
bind = , XF86AudioMute , exec , pamixer -t
|
||||
bind = , XF86AudioNext , exec , playerctl -p "spotifyd,firefox" next
|
||||
bind = , XF86AudioPlay , exec , playerctl -p "spotifyd,firefox" play-pause
|
||||
bind = , XF86AudioPrev , exec , playerctl -p "spotifyd,firefox" previous
|
||||
bind = , XF86AudioMute , exec , pamixer -t
|
||||
bind = , XF86AudioNext , exec , playerctl -p "spotifyd,firefox" next
|
||||
bind = , XF86AudioPlay , exec , playerctl -p "spotifyd,firefox" play-pause
|
||||
bind = , XF86AudioPrev , exec , playerctl -p "spotifyd,firefox" previous
|
||||
|
||||
# Move focus with mainMod + hjkl
|
||||
binde = $mainMod, H, movefocus, l
|
||||
binde = $mainMod, L, movefocus, r
|
||||
binde = $mainMod, K, movefocus, u
|
||||
binde = $mainMod, J, movefocus, d
|
||||
binde = $mainMod , H , movefocus , l
|
||||
binde = $mainMod , L , movefocus , r
|
||||
binde = $mainMod , K , movefocus , u
|
||||
binde = $mainMod , J , movefocus , d
|
||||
|
||||
# Change current active window size with mainMod + SHIFT + hjkl
|
||||
binde = $mainMod SHIFT, H, resizeactive, -10 0
|
||||
binde = $mainMod SHIFT, J, resizeactive, 0 10
|
||||
binde = $mainMod SHIFT, K, resizeactive, 0 -10
|
||||
binde = $mainMod SHIFT, L, resizeactive, 10 0
|
||||
binde = $mainMod SHIFT , H , resizeactive , -10 0
|
||||
binde = $mainMod SHIFT , J , resizeactive , 0 10
|
||||
binde = $mainMod SHIFT , K , resizeactive , 0 -10
|
||||
binde = $mainMod SHIFT , L , resizeactive , 10 0
|
||||
|
||||
# Move current active window with mainMod + ALT + hjkl
|
||||
bind = $mainMod ALT, H, movewindow, l
|
||||
bind = $mainMod ALT, J, movewindow, d
|
||||
bind = $mainMod ALT, K, movewindow, u
|
||||
bind = $mainMod ALT, L, movewindow, r
|
||||
bind = $mainMod ALT , H , movewindow , l
|
||||
bind = $mainMod ALT , J , movewindow , d
|
||||
bind = $mainMod ALT , K , movewindow , u
|
||||
bind = $mainMod ALT , L , movewindow , r
|
||||
|
||||
# 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
|
||||
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
|
||||
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
|
||||
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
|
||||
bindm = $mainMod , mouse:272 , movewindow
|
||||
bindm = $mainMod , mouse:273 , resizewindow
|
||||
|
||||
# Toggle waybar
|
||||
bindr = $mainMod, SUPER_L, exec, pkill -USR1 waybar
|
||||
bindr = $mainMod , SUPER_L , exec , pkill -USR1 waybar
|
||||
|
||||
# Extra Config
|
||||
${cfg.extraConfig}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
} @ args:
|
||||
|
||||
|
|
@ -9,8 +8,7 @@ with lib;
|
|||
let
|
||||
cfg = config.my.programs.hyprland;
|
||||
|
||||
hyprland-nvidia = pkgs.hyprland.override { enableNvidiaPatches = true; };
|
||||
hyprland = if cfg.nvidiaSupport then hyprland-nvidia else pkgs.hyprland;
|
||||
hyprland = config.programs.hyprland.finalPackage;
|
||||
in
|
||||
{
|
||||
options.my.programs.hyprland = {
|
||||
|
|
@ -50,21 +48,33 @@ in
|
|||
rofi.enable = true;
|
||||
};
|
||||
wallpapers.enable = true;
|
||||
services.dunst.enable = true;
|
||||
services.wallpaper.enable = true;
|
||||
services = {
|
||||
dunst.enable = true;
|
||||
wallpaper = {
|
||||
enable = true;
|
||||
target = "hyprland-session.target";
|
||||
};
|
||||
spotify-player.target = "hyprland-session.target";
|
||||
};
|
||||
};
|
||||
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
enableNvidiaPatches = cfg.nvidiaSupport;
|
||||
};
|
||||
|
||||
home-manager.users.moritz = {
|
||||
|
||||
# import home-manager module
|
||||
imports = [ inputs.hyprland.homeManagerModules.default ];
|
||||
|
||||
# enable home-manager module
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = hyprland;
|
||||
recommendedEnvironment = true;
|
||||
enableNvidiaPatches = cfg.nvidiaSupport;
|
||||
extraConfig = import ./_config.nix args;
|
||||
systemd.extraCommands = [
|
||||
"systemctl --user stop hyprland-session.target"
|
||||
"sleep 1.5"
|
||||
"systemctl --user start hyprland-session.target"
|
||||
"systemctl --user start xdg-desktop-portal-hyprland.service"
|
||||
];
|
||||
};
|
||||
|
||||
# add waybar as a status bar
|
||||
|
|
@ -74,7 +84,7 @@ in
|
|||
# start using systemd service
|
||||
systemd = {
|
||||
enable = true;
|
||||
target = "graphical-session.target";
|
||||
target = "hyprland-session.target";
|
||||
};
|
||||
|
||||
settings = {
|
||||
|
|
@ -135,29 +145,11 @@ in
|
|||
};
|
||||
systemdTarget = "hyprland-session.target";
|
||||
};
|
||||
|
||||
systemd.user.services.nextcloud-client.Service = {
|
||||
RestartSec = "500ms";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# adds pam module for swaylock
|
||||
security.pam.services.swaylock = { };
|
||||
|
||||
# only consider graphical-session.target started when hyprland-sesstion.target is reached
|
||||
systemd.user.targets.hyprland-session = {
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
before = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
systemd.user.services.xdg-desktop-portal-hyprland = {
|
||||
after = [ "hyrpland-session.target" ];
|
||||
requiredBy = [ "xdg-desktop-portal.service" ];
|
||||
};
|
||||
|
||||
# add user packages for wayland and hyprland in particular
|
||||
users.users.moritz.packages = with pkgs; [
|
||||
brightnessctl # control brightness
|
||||
|
|
@ -190,7 +182,6 @@ in
|
|||
__GL_VRR_ALLOWED = "0";
|
||||
});
|
||||
|
||||
|
||||
services = {
|
||||
dbus.enable = true;
|
||||
# use pipewire (needed for screensharing)
|
||||
|
|
@ -209,18 +200,31 @@ in
|
|||
user = "moritz";
|
||||
};
|
||||
defaultSession = "hyprland";
|
||||
sessionPackages = [ hyprland ]; # can't set the defaultSession otherwise
|
||||
};
|
||||
};
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
|
||||
home-manager.users.moritz.systemd.user.services =
|
||||
let
|
||||
units = [ "waybar" ];
|
||||
mkAfter = _: {
|
||||
Unit = {
|
||||
After = [ "hyprland-session.target" ];
|
||||
Wants = [ "hyprland-session.target" ];
|
||||
};
|
||||
};
|
||||
in
|
||||
genAttrs units mkAfter;
|
||||
|
||||
# desktop portal (for screensharing)
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = mkForce false;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
|
||||
};
|
||||
systemd.user.services =
|
||||
let
|
||||
units = [ "pipewire" "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "wireplumber" ];
|
||||
mkAfter = _: {
|
||||
after = [ "hyprland-session.target" ];
|
||||
wants = [ "hyprland-session.target" ];
|
||||
};
|
||||
in
|
||||
genAttrs units mkAfter;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ in
|
|||
fish
|
||||
isort
|
||||
jq
|
||||
nil
|
||||
nixd
|
||||
nixpkgs-fmt
|
||||
nodePackages.bash-language-server
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ with builtins;
|
|||
}
|
||||
{
|
||||
plugin = nvim-cmp;
|
||||
keys = [
|
||||
{ key = "<leader>tc"; cmd = "<cmd>CmpToggle<cr>"; desc = "Toggle Cmp sources"; }
|
||||
];
|
||||
conf = readFile ./lua/nvim-cmp.lua;
|
||||
event = [ "InsertEnter" ];
|
||||
dependencies = [
|
||||
|
|
|
|||
|
|
@ -120,3 +120,97 @@ cmp.event:on(
|
|||
},
|
||||
})
|
||||
)
|
||||
|
||||
local pickers = require("telescope.pickers")
|
||||
local finders = require("telescope.finders")
|
||||
local conf = require("telescope.config").values
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
|
||||
local all_sources = vim.deepcopy(cmp.get_config().sources)
|
||||
|
||||
local find = function(sources, name)
|
||||
for k, source in ipairs(sources) do
|
||||
if source.name == name then
|
||||
return k
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
local is_active = function(name)
|
||||
local active_sources = cmp.get_config().sources
|
||||
local index = find(active_sources, name)
|
||||
return index ~= nil
|
||||
end
|
||||
|
||||
local enable_source = function(name, force)
|
||||
if force or not is_active(name) then
|
||||
local source_index = find(all_sources, name)
|
||||
if source_index ~= nil then
|
||||
local active_sources = cmp.get_config().sources
|
||||
local source = all_sources[source_index]
|
||||
table.insert(active_sources, 1, source)
|
||||
cmp.setup({ sources = active_sources })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local disable_source = function(identifier)
|
||||
if type(identifier) == "string" then
|
||||
identifier = find(all_sources, identifier)
|
||||
end
|
||||
local active_sources = cmp.get_config().sources
|
||||
table.remove(active_sources, identifier)
|
||||
end
|
||||
|
||||
local toggle_sources = function(name)
|
||||
local active_sources = cmp.get_config().sources
|
||||
local index = find(active_sources, name)
|
||||
if index ~= nil then
|
||||
disable_source(index)
|
||||
else
|
||||
enable_source(name, true)
|
||||
end
|
||||
end
|
||||
|
||||
-- our picker function: sources
|
||||
local sources_picker = function(opts)
|
||||
opts = opts or {}
|
||||
pickers
|
||||
.new(opts, {
|
||||
prompt_title = "sources",
|
||||
finder = finders.new_table({
|
||||
results = vim.tbl_map(function(source)
|
||||
return source.name
|
||||
end, all_sources),
|
||||
entry_maker = function(entry)
|
||||
return {
|
||||
value = entry,
|
||||
display = function(tbl)
|
||||
local name = tbl["ordinal"]
|
||||
local active = is_active(name)
|
||||
return string.format("%s %s", name, active and "✅" or "❌")
|
||||
end,
|
||||
ordinal = entry,
|
||||
}
|
||||
end,
|
||||
}),
|
||||
sorter = conf.generic_sorter(opts),
|
||||
attach_mappings = function(prompt_bufnr, _)
|
||||
actions.select_default:replace(function()
|
||||
actions.close(prompt_bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
toggle_sources(selection["value"])
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
:find()
|
||||
end
|
||||
|
||||
-- autocommand for sources_picker
|
||||
vim.api.nvim_create_user_command("CmpToggle", sources_picker, {})
|
||||
|
||||
-- disable sources by default
|
||||
disable_source("codeium")
|
||||
|
|
|
|||
|
|
@ -134,11 +134,12 @@ end
|
|||
|
||||
local servers = {
|
||||
"bashls",
|
||||
"gopls",
|
||||
"nil_ls",
|
||||
"nixd",
|
||||
"pylsp",
|
||||
"ruff_lsp",
|
||||
"typst_lsp",
|
||||
"gopls",
|
||||
}
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig_setup(lsp, {})
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
local telekasten = require("telekasten")
|
||||
telekasten.setup({
|
||||
home = vim.fn.expand("~/Nextcloud/Notes/zettelkasten"),
|
||||
home = vim.fn.expand("~/Documents/Nextcloud/Notes/zettelkasten"),
|
||||
auto_set_filetype = false,
|
||||
image_subdir = "assets",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ in
|
|||
type = types.package;
|
||||
default = pkgs.spotify-player;
|
||||
};
|
||||
target = mkOption {
|
||||
type = types.str;
|
||||
default = "graphical-session.target";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -44,9 +48,8 @@ in
|
|||
}
|
||||
];
|
||||
systemd.user.services.spotify-player = {
|
||||
after = [ "graphical-session.target" "network.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
after = [ cfg.target "network.target" ];
|
||||
wantedBy = [ cfg.target ];
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
Restart = "always";
|
||||
|
|
|
|||
|
|
@ -10,12 +10,17 @@ in
|
|||
type = types.str;
|
||||
default = "30m";
|
||||
};
|
||||
target = mkOption {
|
||||
type = types.str;
|
||||
default = "graphical-session.target";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.wallpaper = {
|
||||
script = "${getExe config.my.programs.wallpaper.package} -r -v";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
wantedBy = [ cfg.target ];
|
||||
after = [ cfg.target ];
|
||||
serviceConfig = {
|
||||
Restart = "always";
|
||||
RuntimeMaxSec = cfg.frequency;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue