diff --git a/flake.nix b/flake.nix index 71146f6..e4a6048 100644 --- a/flake.nix +++ b/flake.nix @@ -114,6 +114,11 @@ configs."alpheratz" = { system = "x86_64-linux"; common.nixpkgs = "unstable"; + + laptop = { + powersave.enable = true; + backlight.enable = true; + }; audio = { pipewire.enable = true; diff --git a/hosts/alpheratz/dotfiles/nvim/init.lua b/hosts/alpheratz/dotfiles/nvim/init.lua deleted file mode 100644 index c6978cf..0000000 --- a/hosts/alpheratz/dotfiles/nvim/init.lua +++ /dev/null @@ -1,9 +0,0 @@ -require('config/keymaps') -require('config/settings') -require('config/plugins') -require('config/plugins/lualine') -require('config/plugins/lspconfig') - -local vimscriptpath = vim.fn.stdpath("config") .. "/lua/config/vimscript/" - -vim.cmd('source' .. vimscriptpath .. 'init.vim') diff --git a/hosts/alpheratz/dotfiles/nvim/lazy-lock.json b/hosts/alpheratz/dotfiles/nvim/lazy-lock.json deleted file mode 100644 index b51de3c..0000000 --- a/hosts/alpheratz/dotfiles/nvim/lazy-lock.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "fzf-lua": { "branch": "main", "commit": "b442569ab827f72e344236c598b02cb9dc754e9f" }, - "kanagawa.nvim": { "branch": "master", "commit": "860e4f80df71221d18bf2cd9ef1deb4d364274d2" }, - "lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, - "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, - "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, - "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, - "nvim-lspconfig": { "branch": "master", "commit": "b972e7154bc94ab4ecdbb38c8edbccac36f83996" }, - "nvim-surround": { "branch": "main", "commit": "79aaa42da1f698ed31bcbe7f83081f69dca7ba17" }, - "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, - "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, - "typst.vim": { "branch": "main", "commit": "d9a7650e76c85f8ba437e056d08dd43b01b8bfd6" } -} \ No newline at end of file diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/keymaps.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/keymaps.lua deleted file mode 100644 index ad99733..0000000 --- a/hosts/alpheratz/dotfiles/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,15 +0,0 @@ -vim.g.mapleader=',' -vim.g.maplocalleader=',' - -vim.keymap.set('n', '', 'h') -vim.keymap.set('n', '', 'j') -vim.keymap.set('n', '', 'k') -vim.keymap.set('n', '', 'l') - -vim.keymap.set('n', 'ff', ':FzfLua files') -vim.keymap.set('n', 'fb', ':FzfLua buffers') -vim.keymap.set('n', 'rg', ':FzfLua grep') - -vim.keymap.set('i', '', '') - -vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/init.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/init.lua deleted file mode 100644 index 1730f64..0000000 --- a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/init.lua +++ /dev/null @@ -1,45 +0,0 @@ -local plugins = { - 'rebelot/kanagawa.nvim', - - 'nvim-lualine/lualine.nvim', - 'kyazdani42/nvim-web-devicons', - - 'kylechui/nvim-surround', - - 'ibhagwan/fzf-lua', - - 'neovim/nvim-lspconfig', - 'hrsh7th/nvim-cmp', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - - 'rust-lang/rust.vim', - - { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - opts={}, - }, - - { - 'kaarmu/typst.vim', - ft = 'typst', - lazy = false, - }, - -} - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup(plugins, opts) diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lspconfig.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lspconfig.lua deleted file mode 100644 index b3e4bd3..0000000 --- a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lspconfig.lua +++ /dev/null @@ -1,59 +0,0 @@ -local capabilities = require('cmp_nvim_lsp').default_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = false; - -local lspconfig = require('lspconfig') - -lspconfig.rust_analyzer.setup { - capabilities = capabilities, - settings = { - ["rust-analyzer"] = { - cargo = { - allFeatures = true, - }, - imports = { - group = { - enable = false, - }, - }, - completion = { - postfix = { - enable = false, - }, - }, - }, - }, -} - -local servers = {'ccls', 'typst_lsp'} - -for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - capabilities = capabilities - } -end - -local cmp = require 'cmp' - -cmp.setup { - preselect = cmp.PreselectMode.None, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { 'i', 's' }), - }), - sources = { - { name = 'nvim_lsp' }, - { name = 'path' }, - }, -} diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lualine.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lualine.lua deleted file mode 100644 index 9ae6243..0000000 --- a/hosts/alpheratz/dotfiles/nvim/lua/config/plugins/lualine.lua +++ /dev/null @@ -1,36 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'wombat', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = {}, - always_divide_middle = true, - globalstatus = true, - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = { - lualine_a = {'buffers'}, - lualine_b = {'branch'}, - lualine_c = {'filename'}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {'tabs'} - }, - extensions = {} -} diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/settings.lua b/hosts/alpheratz/dotfiles/nvim/lua/config/settings.lua deleted file mode 100644 index 8efff64..0000000 --- a/hosts/alpheratz/dotfiles/nvim/lua/config/settings.lua +++ /dev/null @@ -1,38 +0,0 @@ -vim.opt.cursorline=true -vim.opt.relativenumber=true -vim.opt.number=true - -vim.opt.scrolloff=10 - -vim.opt.autoindent=true -vim.opt.expandtab=true -vim.opt.softtabstop=4 -vim.opt.shiftwidth=4 -vim.opt.shiftround=true - -vim.opt.backspace={'indent','eol','start'} -vim.opt.hidden=true -vim.opt.laststatus=2 -vim.opt.display='lastline' - -vim.opt.showmode=true -vim.opt.showcmd=true - -vim.opt.incsearch=true -vim.opt.ignorecase=true -vim.opt.smartcase=true - -vim.opt.ttyfast=true -vim.opt.updatetime=300 - -vim.opt.splitright=true - -vim.opt.wrapscan=true -vim.opt.report=0 - -vim.opt.list=true -vim.opt.completeopt=menuone,noselect - -vim.opt.undofile=true - -vim.g['loaded_perl_provider']=0 diff --git a/hosts/alpheratz/dotfiles/nvim/lua/config/vimscript/init.vim b/hosts/alpheratz/dotfiles/nvim/lua/config/vimscript/init.vim deleted file mode 100644 index 2426d07..0000000 --- a/hosts/alpheratz/dotfiles/nvim/lua/config/vimscript/init.vim +++ /dev/null @@ -1,9 +0,0 @@ -filetype plugin indent on -syntax on -colorscheme kanagawa - -if has('multi_byte') && &encoding ==# 'utf-8' - let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' -else - let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' -endif diff --git a/hosts/alpheratz/system.nix b/hosts/alpheratz/system.nix index 463e695..94c83a4 100644 --- a/hosts/alpheratz/system.nix +++ b/hosts/alpheratz/system.nix @@ -36,9 +36,8 @@ boot.loader.efi.efiSysMountPoint = "/efi"; boot.loader.efi.canTouchEfiVariables = true; - powerManagement.powertop.enable = true; - - hardware.graphics.enable = true; + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; fileSystems = { "/".options = [ "compress=zstd" ]; diff --git a/hosts/ankaa/dotfiles/nvim/init.lua b/hosts/ankaa/dotfiles/nvim/init.lua deleted file mode 100644 index c6978cf..0000000 --- a/hosts/ankaa/dotfiles/nvim/init.lua +++ /dev/null @@ -1,9 +0,0 @@ -require('config/keymaps') -require('config/settings') -require('config/plugins') -require('config/plugins/lualine') -require('config/plugins/lspconfig') - -local vimscriptpath = vim.fn.stdpath("config") .. "/lua/config/vimscript/" - -vim.cmd('source' .. vimscriptpath .. 'init.vim') diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/keymaps.lua b/hosts/ankaa/dotfiles/nvim/lua/config/keymaps.lua deleted file mode 100644 index 5b7437e..0000000 --- a/hosts/ankaa/dotfiles/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,17 +0,0 @@ -vim.g.mapleader=',' -vim.g.maplocalleader=',' - -vim.keymap.set('n', '', 'h') -vim.keymap.set('n', '', 'j') -vim.keymap.set('n', '', 'k') -vim.keymap.set('n', '', 'l') - -vim.keymap.set('n', 'ff', ':FzfLua files') -vim.keymap.set('n', 'fb', ':FzfLua buffers') -vim.keymap.set('n', 'rg', ':FzfLua grep_project') - - - -vim.keymap.set('i', '', '') - -vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/plugins/init.lua b/hosts/ankaa/dotfiles/nvim/lua/config/plugins/init.lua deleted file mode 100644 index f82d17d..0000000 --- a/hosts/ankaa/dotfiles/nvim/lua/config/plugins/init.lua +++ /dev/null @@ -1,53 +0,0 @@ -local plugins = { - 'rebelot/kanagawa.nvim', - - 'nvim-lualine/lualine.nvim', - 'kyazdani42/nvim-web-devicons', - - 'kylechui/nvim-surround', - - 'ibhagwan/fzf-lua', - - 'neovim/nvim-lspconfig', - 'hrsh7th/nvim-cmp', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - 'L3MON4D3/LuaSnip', - - { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - opts = {}, - }, - - { - 'kaarmu/typst.vim', - ft = 'typst', - lazy = false, - }, - - 'jalvesaq/Nvim-R', - - { - 'RaafatTurki/hex.nvim', - config = function() - require('hex').setup() - end - }, - -} - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup(plugins, opts) diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/plugins/lspconfig.lua b/hosts/ankaa/dotfiles/nvim/lua/config/plugins/lspconfig.lua deleted file mode 100644 index 8c40e0d..0000000 --- a/hosts/ankaa/dotfiles/nvim/lua/config/plugins/lspconfig.lua +++ /dev/null @@ -1,67 +0,0 @@ -local capabilities = require('cmp_nvim_lsp').default_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = false; - -local lspconfig = require('lspconfig') - -lspconfig.rust_analyzer.setup { - capabilities = capabilities, - settings = { - ["rust-analyzer"] = { - cargo = { - allFeatures = true, - }, - imports = { - group = { - enable = false, - }, - }, - completion = { - postfix = { - enable = false, - }, - }, - }, - }, -} - -lspconfig.omnisharp.setup { - cmd = { "dotnet", "/usr/lib/omnisharp-roslyn/OmniSharp.dll"} -} - -local default_servers = {'pylsp', 'ccls', 'typst_lsp', 'r_language_server', 'lua_ls', 'nil_ls'} - -for _, lsp in ipairs(default_servers) do - lspconfig[lsp].setup { - capabilities = capabilities - } -end - -local luasnip = require 'luasnip' -local cmp = require 'cmp' - - -cmp.setup { - preselect = cmp.PreselectMode.None, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { 'i', 's' }), - }), - sources = { - { name = 'nvim_lsp' }, - { name = 'path' }, - }, -} - - diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/plugins/lualine.lua b/hosts/ankaa/dotfiles/nvim/lua/config/plugins/lualine.lua deleted file mode 100644 index 9ae6243..0000000 --- a/hosts/ankaa/dotfiles/nvim/lua/config/plugins/lualine.lua +++ /dev/null @@ -1,36 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'wombat', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = {}, - always_divide_middle = true, - globalstatus = true, - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = { - lualine_a = {'buffers'}, - lualine_b = {'branch'}, - lualine_c = {'filename'}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {'tabs'} - }, - extensions = {} -} diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/settings.lua b/hosts/ankaa/dotfiles/nvim/lua/config/settings.lua deleted file mode 100644 index 8efff64..0000000 --- a/hosts/ankaa/dotfiles/nvim/lua/config/settings.lua +++ /dev/null @@ -1,38 +0,0 @@ -vim.opt.cursorline=true -vim.opt.relativenumber=true -vim.opt.number=true - -vim.opt.scrolloff=10 - -vim.opt.autoindent=true -vim.opt.expandtab=true -vim.opt.softtabstop=4 -vim.opt.shiftwidth=4 -vim.opt.shiftround=true - -vim.opt.backspace={'indent','eol','start'} -vim.opt.hidden=true -vim.opt.laststatus=2 -vim.opt.display='lastline' - -vim.opt.showmode=true -vim.opt.showcmd=true - -vim.opt.incsearch=true -vim.opt.ignorecase=true -vim.opt.smartcase=true - -vim.opt.ttyfast=true -vim.opt.updatetime=300 - -vim.opt.splitright=true - -vim.opt.wrapscan=true -vim.opt.report=0 - -vim.opt.list=true -vim.opt.completeopt=menuone,noselect - -vim.opt.undofile=true - -vim.g['loaded_perl_provider']=0 diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/vimscript/init.vim b/hosts/ankaa/dotfiles/nvim/lua/config/vimscript/init.vim deleted file mode 100644 index 2426d07..0000000 --- a/hosts/ankaa/dotfiles/nvim/lua/config/vimscript/init.vim +++ /dev/null @@ -1,9 +0,0 @@ -filetype plugin indent on -syntax on -colorscheme kanagawa - -if has('multi_byte') && &encoding ==# 'utf-8' - let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' -else - let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' -endif diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/~/.vimdid/%home%eesim%.config%nvim%lua%config%keymaps.lua b/hosts/ankaa/dotfiles/nvim/lua/config/~/.vimdid/%home%eesim%.config%nvim%lua%config%keymaps.lua deleted file mode 100644 index 9fc01db..0000000 Binary files a/hosts/ankaa/dotfiles/nvim/lua/config/~/.vimdid/%home%eesim%.config%nvim%lua%config%keymaps.lua and /dev/null differ diff --git a/hosts/ankaa/dotfiles/nvim/lua/config/~/.vimdid/%home%eesim%.config%nvim%lua%config%plugins%lspconfig.lua b/hosts/ankaa/dotfiles/nvim/lua/config/~/.vimdid/%home%eesim%.config%nvim%lua%config%plugins%lspconfig.lua deleted file mode 100644 index 8b13c25..0000000 Binary files a/hosts/ankaa/dotfiles/nvim/lua/config/~/.vimdid/%home%eesim%.config%nvim%lua%config%plugins%lspconfig.lua and /dev/null differ diff --git a/modules/home/sway.nix b/modules/home/sway.nix index 790490a..ec0ad05 100644 --- a/modules/home/sway.nix +++ b/modules/home/sway.nix @@ -8,6 +8,7 @@ with lib; let gui = config.simmer.gui; + laptop = config.simmer.laptop; modifier = "Mod4"; in { @@ -29,73 +30,81 @@ in config = { modifier = modifier; - keybindings = { - "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86AudioPause" = "exec playerctl play-pause"; - "XF86AudioNext" = "exec playerctl next"; - "XF86AudioPrev" = "exec playerctl previous"; - "${modifier}+space" = "exec \"kickoff-dot-desktop | ${pkgs.kickoff}/bin/kickoff --from-stdin --stdout | xargs -d '\\n' ${pkgs.sway}/bin/swaymsg exec\""; - "${modifier}+Return" = "exec alacritty "; - "${modifier}+Control+f" = "exec MOZ_ENABLE_WAYLAND=1 firefox"; - "${modifier}+Control+s" = "exec steam"; - "${modifier}+Control+t" = "exec thunar"; - "${modifier}+Control+d" = "exec vesktop --enable-features=WebRTCPipeWireCapturer"; - "${modifier}+Control+x" = "exec feishin"; - "${modifier}+Control+h" = "exec helvum"; - "${modifier}+Control+p" = "exec pavucontrol"; - "${modifier}+Shift+s" = "exec grip -g $(slurp)"; - "${modifier}+Shift+q" = "kill"; - "${modifier}+h" = "focus left"; - "${modifier}+j" = "focus down"; - "${modifier}+k" = "focus up"; - "${modifier}+l" = "focus right"; - "${modifier}+Left" = "focus left"; - "${modifier}+Down" = "focus down"; - "${modifier}+Up" = "focus up"; - "${modifier}+Right" = "focus right"; - "${modifier}+Shift+h" = "move left"; - "${modifier}+Shift+j" = "move down"; - "${modifier}+Shift+k" = "move up"; - "${modifier}+Shift+l" = "move right"; - "${modifier}+Shift+Left" = "move left"; - "${modifier}+Shift+Down" = "move down"; - "${modifier}+Shift+Up" = "move up"; - "${modifier}+Shift+Right" = "move right"; - "${modifier}+b" = "split h"; - "${modifier}+v" = "split v"; - "${modifier}+r" = "mode 'resize'"; - "${modifier}+f" = "fullscreen toggle"; - "${modifier}+Shift+space" = "floating toggle"; - "${modifier}+s" = "layout stacking"; - "${modifier}+w" = "layout tabbed"; - "${modifier}+e" = "layout toggle split"; - "${modifier}+a" = "focus parent"; - "${modifier}+1" = "workspace 1 "; - "${modifier}+2" = "workspace 2"; - "${modifier}+3" = "workspace 3"; - "${modifier}+4" = "workspace 4"; - "${modifier}+5" = "workspace 5"; - "${modifier}+6" = "workspace 6"; - "${modifier}+7" = "workspace 7"; - "${modifier}+8" = "workspace 8"; - "${modifier}+9" = "workspace 9"; - "${modifier}+0" = "workspace 10"; - "${modifier}+Shift+1" = "move container to workspace 1"; - "${modifier}+Shift+2" = "move container to workspace 2"; - "${modifier}+Shift+3" = "move container to workspace 3"; - "${modifier}+Shift+4" = "move container to workspace 4"; - "${modifier}+Shift+5" = "move container to workspace 5"; - "${modifier}+Shift+6" = "move container to workspace 6"; - "${modifier}+Shift+7" = "move container to workspace 7"; - "${modifier}+Shift+8" = "move container to workspace 8"; - "${modifier}+Shift+9" = "move container to workspace 9"; - "${modifier}+Shift+0" = "move container to workspace 10"; - "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'"; - "${modifier}+Shift+c" = "reload"; - }; + keybindings = mkMerge [ + { + "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + "${modifier}+space" = "exec \"kickoff-dot-desktop | ${pkgs.kickoff}/bin/kickoff --from-stdin --stdout | xargs -d '\\n' ${pkgs.sway}/bin/swaymsg exec\""; + "${modifier}+Return" = "exec alacritty "; + "${modifier}+Control+f" = "exec MOZ_ENABLE_WAYLAND=1 firefox"; + "${modifier}+Control+t" = "exec thunar"; + "${modifier}+Control+h" = "exec helvum"; + "${modifier}+Control+p" = "exec pavucontrol"; + "${modifier}+h" = "focus left"; + "${modifier}+j" = "focus down"; + "${modifier}+k" = "focus up"; + "${modifier}+l" = "focus right"; + "${modifier}+Left" = "focus left"; + "${modifier}+Down" = "focus down"; + "${modifier}+Up" = "focus up"; + "${modifier}+Right" = "focus right"; + "${modifier}+Shift+h" = "move left"; + "${modifier}+Shift+j" = "move down"; + "${modifier}+Shift+k" = "move up"; + "${modifier}+Shift+l" = "move right"; + "${modifier}+Shift+Left" = "move left"; + "${modifier}+Shift+Down" = "move down"; + "${modifier}+Shift+Up" = "move up"; + "${modifier}+Shift+Right" = "move right"; + "${modifier}+b" = "split h"; + "${modifier}+v" = "split v"; + "${modifier}+r" = "mode 'resize'"; + "${modifier}+f" = "fullscreen toggle"; + "${modifier}+Shift+space" = "floating toggle"; + "${modifier}+s" = "layout stacking"; + "${modifier}+w" = "layout tabbed"; + "${modifier}+e" = "layout toggle split"; + "${modifier}+a" = "focus parent"; + "${modifier}+1" = "workspace 1 "; + "${modifier}+2" = "workspace 2"; + "${modifier}+3" = "workspace 3"; + "${modifier}+4" = "workspace 4"; + "${modifier}+5" = "workspace 5"; + "${modifier}+6" = "workspace 6"; + "${modifier}+7" = "workspace 7"; + "${modifier}+8" = "workspace 8"; + "${modifier}+9" = "workspace 9"; + "${modifier}+0" = "workspace 10"; + "${modifier}+Shift+1" = "move container to workspace 1"; + "${modifier}+Shift+2" = "move container to workspace 2"; + "${modifier}+Shift+3" = "move container to workspace 3"; + "${modifier}+Shift+4" = "move container to workspace 4"; + "${modifier}+Shift+5" = "move container to workspace 5"; + "${modifier}+Shift+6" = "move container to workspace 6"; + "${modifier}+Shift+7" = "move container to workspace 7"; + "${modifier}+Shift+8" = "move container to workspace 8"; + "${modifier}+Shift+9" = "move container to workspace 9"; + "${modifier}+Shift+0" = "move container to workspace 10"; + "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'"; + "${modifier}+Shift+c" = "reload"; + "${modifier}+Shift+s" = "exec grim -g $(slurp)"; + "${modifier}+Shift+q" = "kill"; + "XF86AudioPause" = "exec playerctl play-pause"; + "XF86AudioNext" = "exec playerctl next"; + "XF86AudioPrev" = "exec playerctl previous"; + } + (mkIf gui.sway.desktop { + "${modifier}+Control+s" = "exec steam"; + "${modifier}+Control+d" = "exec vesktop --enable-features=WebRTCPipeWireCapturer"; + "${modifier}+Control+x" = "exec feishin"; + }) + (mkIf laptop.backlight.enable { + "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5"; + "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5"; + }) + ]; startup = [] ++ optionals gui.sway.desktop [ diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 7fefff3..6ee0a29 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -13,5 +13,6 @@ ./common.nix ./networking.nix ./games.nix + ./laptop.nix ]; } diff --git a/modules/nix/gui.nix b/modules/nix/gui.nix index 20a82d1..f3adb3e 100644 --- a/modules/nix/gui.nix +++ b/modules/nix/gui.nix @@ -36,6 +36,8 @@ in xdg.portal.config.common = [ "wlr" "gtk" ]; programs.thunar.enable = true; + hardware.graphics.enable = true; + fonts = { packages = with pkgs; [ liberation_ttf diff --git a/modules/nix/laptop.nix b/modules/nix/laptop.nix new file mode 100644 index 0000000..bf060b2 --- /dev/null +++ b/modules/nix/laptop.nix @@ -0,0 +1,28 @@ +{ lib +, pkgs +, config +, ... +}: + +with lib; let + cfg = config.simmer.laptop; +in +{ + + config.programs.light.enable = mkIf cfg.backlight.enable true; + + config.powerManagement.powertop.enable = mkIf cfg.powersave.enable true; + config.services.auto-cpufreq = mkIf cfg.powersave.enable { + enable = true; + settings = { + battery = { + governor = "powersave"; + turbo = "never"; + }; + charger = { + governor = "performance"; + turbo = "auto"; + }; + }; + }; +} diff --git a/modules/options/default.nix b/modules/options/default.nix index 311e149..f4a68ce 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -14,5 +14,6 @@ ./networking.nix ./openssh.nix ./system.nix + ./laptop.nix ]; } diff --git a/modules/options/laptop.nix b/modules/options/laptop.nix new file mode 100644 index 0000000..b967efd --- /dev/null +++ b/modules/options/laptop.nix @@ -0,0 +1,24 @@ +{ lib +, pkgs +, config +, ... +}: + +with lib; let + cfg = config.simmer.gui; +in +{ + options.simmer.laptop = { + backlight.enable = mkOption { + description = "Whether to enable backlight control"; + type = types.bool; + default = false; + }; + + powersave.enable = mkOption { + description = "Whether to enable powersaving programs"; + type = types.bool; + default = false; + }; + }; +}