diff --git a/configuration.nix b/configuration.nix index 531c6e9..d4293c7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -32,6 +32,8 @@ ''; }; + services.fwupd.enable = true; + services.gnome.gnome-keyring.enable = true; services.resolved.enable = true; @@ -41,31 +43,7 @@ programs = { appgate-sdp.enable = true; zsh.enable = true; - }; - - services.xserver = { - enable = true; - windowManager.i3.enable = true; - - layout = "de"; - xkbVariant = "nodeadkeys"; - xkbModel = "pc105"; - - libinput = { - enable = true; - touchpad = { - horizontalScrolling = false; - naturalScrolling = true; - }; - }; - - displayManager = { - defaultSession = "none+i3"; - autoLogin = { - enable = true; - user = "mandlm"; - }; - }; + gphoto2.enable = true; }; virtualisation.docker.enable = true; @@ -79,16 +57,32 @@ keyMap = "de-latin1-nodeadkeys"; }; - fonts.fonts = with pkgs; [ - (nerdfonts.override { fonts = [ "DejaVuSansMono" "FiraCode" ]; }) - font-awesome + fonts.packages = with pkgs; [ + (nerdfonts.override { fonts = [ "DejaVuSansMono" "NerdFontsSymbolsOnly" ]; }) + dejavu_fonts + fira-code ]; - hardware.pulseaudio.enable = true; + hardware = { + opengl.enable = true; - hardware.sane = { - enable = true; - extraBackends = [ pkgs.sane-airscan ]; + sane = { + enable = true; + extraBackends = [ pkgs.sane-airscan ]; + }; + }; + + security = { + polkit.enable = true; + rtkit.enable = true; + pam.services.swaylock = { }; + + pam.yubico = { + enable = true; + mode = "challenge-response"; + id = [ "23664350" ]; + control = "sufficient"; + }; }; environment.systemPackages = with pkgs; [ @@ -98,11 +92,35 @@ environment.pathsToLink = [ "/share/zsh" ]; + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-wlr + pkgs.xdg-desktop-portal-gtk + ]; + config = { + common = { + default = [ "wlr" "gtk" ]; + }; + }; + }; + + services.udev.packages = [ pkgs.yubikey-personalization ]; + + services.pipewire = { + enable = true; + wireplumber.enable = true; + pulse.enable = true; + }; + services.openssh = { enable = true; settings.X11Forwarding = true; }; + services.udisks2.enable = true; + services.printing = { enable = true; }; diff --git a/flake.lock b/flake.lock index 3a5b822..4472ee2 100644 --- a/flake.lock +++ b/flake.lock @@ -7,43 +7,43 @@ ] }, "locked": { - "lastModified": 1693208669, - "narHash": "sha256-hHFaaUsZ860wvppPeiu7nJn/nXZjJfnqAQEu9SPFE9I=", + "lastModified": 1704099619, + "narHash": "sha256-QRVMkdxLmv+aKGjcgeEg31xtJEIsYq4i1Kbyw5EPS6g=", "owner": "nix-community", "repo": "home-manager", - "rev": "5bac4a1c06cd77cf8fc35a658ccb035a6c50cd2c", + "rev": "7e398b3d76bc1503171b1364c9d4a07ac06f3851", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.05", + "ref": "release-23.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1694304580, - "narHash": "sha256-5tIpNodDpEKT8mM/F5zCzWEAnidOg8eb1/x3SRaaBLs=", + "lastModified": 1704420045, + "narHash": "sha256-C36QmoJd5tdQ5R9MC1jM7fBkZW9zBUqbUCsgwS6j4QU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4c8cf44c5b9481a4f093f1df3b8b7ba997a7c760", + "rev": "c1be43e8e837b8dbee2b3665a007e761680f0c3d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1694183432, - "narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=", + "lastModified": 1704538339, + "narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b", + "rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 903ce6d..c9c58b6 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,10 @@ { inputs = { - nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05; + nixpkgs.url = github:NixOS/nixpkgs/nixos-23.11; nixpkgs-unstable.url = github:NixOS/nixpkgs/nixos-unstable; home-manager = { - url = github:nix-community/home-manager/release-23.05; + url = github:nix-community/home-manager/release-23.11; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -32,6 +32,7 @@ system = "x86_64-linux"; modules = [ ./configuration.nix + ./greetd.nix ./users.nix ./machines/nixos-vm/configuration.nix ./machines/nixos-vm/hardware-configuration.nix @@ -53,6 +54,7 @@ system = "x86_64-linux"; modules = [ ./configuration.nix + ./greetd.nix ./users.nix ./machines/apache/configuration.nix ./machines/apache/hardware-configuration.nix @@ -77,6 +79,7 @@ system = "x86_64-linux"; modules = [ ./configuration.nix + ./greetd.nix ./users.nix ./machines/p330/configuration.nix ./machines/p330/hardware-configuration.nix @@ -101,6 +104,7 @@ system = "x86_64-linux"; modules = [ ./configuration.nix + ./greetd.nix ./users.nix ./machines/yoga/configuration.nix ./machines/yoga/hardware-configuration.nix diff --git a/greetd.nix b/greetd.nix new file mode 100644 index 0000000..564d9e6 --- /dev/null +++ b/greetd.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: +{ + services.greetd = { + enable = true; + settings = { + default_session.command = '' + ${pkgs.greetd.tuigreet}/bin/tuigreet \ + --time \ + --asterisks \ + --user-menu \ + --cmd sway + ''; + }; + }; + + environment.etc."greetd/environments".text = '' + sway + ''; +} diff --git a/home-manager/carapace.nix b/home-manager/carapace.nix new file mode 100644 index 0000000..92f2b3d --- /dev/null +++ b/home-manager/carapace.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, user, theme, ... }: +{ + programs.carapace = { + enable = true; + enableZshIntegration = true; + enableNushellIntegration = true; + }; +} + diff --git a/home-manager/direnv.nix b/home-manager/direnv.nix index 1061719..1dd2ed5 100644 --- a/home-manager/direnv.nix +++ b/home-manager/direnv.nix @@ -5,6 +5,7 @@ direnv = { enable = true; enableZshIntegration = true; + enableNushellIntegration = true; nix-direnv.enable = true; }; }; diff --git a/home-manager/firefox.nix b/home-manager/firefox.nix new file mode 100644 index 0000000..327b21a --- /dev/null +++ b/home-manager/firefox.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, user, ... }: + +{ + programs = { + firefox = { + enable = true; + }; + }; +} diff --git a/home-manager/i3/default.nix b/home-manager/i3/default.nix deleted file mode 100644 index 9a93754..0000000 --- a/home-manager/i3/default.nix +++ /dev/null @@ -1,136 +0,0 @@ -{ config, lib, pkgs, user, ... }: - -let - cfg = config.xsession.windowManager.i3; - font.name = "DejaVu Sans Mono"; - font.size = 12.0; -in -{ - imports = [ - ./i3status-rust.nix - ]; - - home.file = { - workspaces = { - source = ./workspaces; - target = ".config/i3/workspaces"; - recursive = true; - }; - wallpapers = { - source = ./wallpapers; - target = ".config/i3/wallpapers"; - recursive = true; - }; - }; - - xsession.windowManager.i3 = { - enable = true; - - config = { - modifier = "Mod4"; - terminal = "${pkgs.kitty}/bin/kitty"; - - fonts = { - names = [ font.name ]; - size = font.size; - }; - - window = { - titlebar = false; - border = 0; - }; - - floating = { - titlebar = false; - border = 0; - }; - - menu = "${pkgs.rofi}/bin/rofi -show drun"; - - bars = [{ - mode = "hide"; - position = "top"; - statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml"; - - fonts = { - names = [ font.name ]; - size = font.size * 1.1; - }; - }]; - - defaultWorkspace = "workspace number 1"; - - keybindings = lib.mkOptionDefault { - "${cfg.config.modifier}+Shift+o" = "exec xdg-open \"zoommtg://zoom.us/join?action=join&confno=4861587170&pwd=ZVk3aHphcWppY21ONjZOMVh6STN6dz09\""; - "${cfg.config.modifier}+Shift+s" = "exec flameshot gui"; - }; - - startup = [ - { command = "i3-msg 'workspace 1; append_layout ~/.config/i3/workspaces/workspace-1.json'"; } - { command = "i3-msg 'workspace 2; append_layout ~/.config/i3/workspaces/workspace-2.json'"; } - { command = "i3-msg 'workspace 4; append_layout ~/.config/i3/workspaces/workspace-4.json'"; } - { command = "i3-msg 'workspace 5; append_layout ~/.config/i3/workspaces/workspace-5.json'"; } - { command = "kitty"; notification = false; } - { command = "firefox"; notification = false; } - { command = "element-desktop"; notification = false; } - { command = "keepassxc"; notification = false; } - { command = "nextcloud"; notification = false; } - { command = "thunderbird"; notification = false; } - ]; - - assigns = { - "6" = [{ class = "^\.zoom $"; }]; - }; - }; - }; - - services = { - betterlockscreen = { - enable = true; - arguments = [ "--update /home/mandlm/.config/i3/wallpapers/nix-wallpaper-dracula.png" ]; - }; - - flameshot = { - enable = true; - settings = { - General = { - showStartupLaunchMessage = false; - }; - }; - }; - - unclutter.enable = true; - - dunst = { - enable = true; - settings = { - global = { - follow = "keyboard"; - font = "DejaVu Sans Mono 11"; - frame_width = 1; - }; - - urgency_low = { - frame_color = "#268bd2"; - foreground = "#eee8d5"; - background = "#002b36"; - timeout = 4; - }; - - urgency_normal = { - frame_color = "#859900"; - foreground = "#eee8d5"; - background = "#002b36"; - timeout = 6; - }; - - urgency_critical = { - frame_color = "#dc322f"; - foreground = "#eee8d5"; - background = "#002b36"; - timeout = 8; - }; - }; - }; - }; -} diff --git a/home-manager/i3/wallpapers/nix-wallpaper-dracula.png b/home-manager/i3/wallpapers/nix-wallpaper-dracula.png deleted file mode 100644 index 8e439ac..0000000 Binary files a/home-manager/i3/wallpapers/nix-wallpaper-dracula.png and /dev/null differ diff --git a/home-manager/i3/workspaces/workspace-1.json b/home-manager/i3/workspaces/workspace-1.json deleted file mode 100644 index d6ce6b0..0000000 --- a/home-manager/i3/workspaces/workspace-1.json +++ /dev/null @@ -1,10 +0,0 @@ -// vim:ts=4:sw=4:et -{ - "name": "Terminal", - "swallows": [ - { - "class": "^kitty$" - } - ], - "type": "con" -} diff --git a/home-manager/i3/workspaces/workspace-2.json b/home-manager/i3/workspaces/workspace-2.json deleted file mode 100644 index a6d29f3..0000000 --- a/home-manager/i3/workspaces/workspace-2.json +++ /dev/null @@ -1,10 +0,0 @@ -// vim:ts=4:sw=4:et -{ - "name": "Element", - "swallows": [ - { - "class": "^Element$" - } - ], - "type": "con" -} diff --git a/home-manager/i3/workspaces/workspace-4.json b/home-manager/i3/workspaces/workspace-4.json deleted file mode 100644 index 108f590..0000000 --- a/home-manager/i3/workspaces/workspace-4.json +++ /dev/null @@ -1,10 +0,0 @@ -// vim:ts=4:sw=4:et -{ - "name": "Email", - "swallows": [ - { - "class": "^thunderbird$" - } - ], - "type": "con" -} diff --git a/home-manager/i3/workspaces/workspace-5.json b/home-manager/i3/workspaces/workspace-5.json deleted file mode 100644 index 7c74fa7..0000000 --- a/home-manager/i3/workspaces/workspace-5.json +++ /dev/null @@ -1,10 +0,0 @@ -// vim:ts=4:sw=4:et -{ - "name": "Browser", - "swallows": [ - { - "class": "^firefox$" - } - ], - "type": "con" -} diff --git a/home-manager/kitty.nix b/home-manager/kitty.nix index dc585bf..372d237 100644 --- a/home-manager/kitty.nix +++ b/home-manager/kitty.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, user, theme, ... }: +{ theme, ... }: let theme_name = if theme == "light" then "Solarized Light" else "Solarized Dark"; @@ -9,7 +9,7 @@ in enable = true; theme = theme_name; font = { - name = "FiraCode Nerd Font Mono"; + name = "FiraCode"; }; settings = { tab_bar_style = "powerline"; diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index 6e4969d..390e874 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -1,49 +1,5 @@ { config, lib, pkgs, user, theme, ... }: -let - cmp-nvim-lsp-signature-help = pkgs.vimUtils.buildVimPlugin { - name = "cmp-nvim-lsp-signature-help"; - version = "2023-02-27"; - src = pkgs.fetchFromGitHub { - owner = "hrsh7th"; - repo = "cmp-nvim-lsp-signature-help"; - rev = "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1"; - sha256 = "sha256-yDxYvjTIeXIKYR3tg+bf+okXKr5JYc/I9obP+6uKey4="; - }; - meta.homepage = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help"; - }; - - lsp_lines-nvim = pkgs.vimUtils.buildVimPlugin { - name = "lsp_lines.nvim"; - version = "2023-02-27"; - src = pkgs.fetchgit { - url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim"; - rev = "ec98b45c8280e5ef8c84028d4f38aa447276c002"; - sha256 = "sha256-HjLCfuvZZ7vTJT0Te5VBRLNWvWIBFBou1Mvoxe2Hi3c="; - }; - meta.homepage = "https://git.sr.ht/~whynothugo/lsp_lines.nvim"; - }; - pre-commit-nvim = pkgs.vimUtils.buildVimPlugin { - name = "pre-commit.nvim"; - version = "2022-08-05"; - src = pkgs.fetchgit { - url = "https://github.com/Ttibsi/pre-commit.nvim"; - rev = "4a608cef0f0a196fa39cdc60579eb9cf601d21c4"; - sha256 = "Y0biF/yrOX1YYztj8/u0n8zPN4YLGLSQL3vb9I3+3dE="; - }; - meta.homepage = "https://github.com/Ttibsi/pre-commit.nvim"; - }; - vim-flog = pkgs.vimUtils.buildVimPlugin { - name = "vim-flog"; - version = "2023-01-24"; - src = pkgs.fetchgit { - url = "https://github.com/rbong/vim-flog"; - rev = "2ba8af2c9682e3560db5b813d10acf3ba3415bc1"; - sha256 = "sha256-xnzHAc30DD9W9/5s8PvpuBaEUJbB4BJ7WqbNb/CY3mY="; - }; - meta.homepage = "https://github.com/rbong/vim-flog/"; - }; -in { home.packages = with pkgs.unstable; [ xclip @@ -62,8 +18,12 @@ in nodePackages.typescript nodePackages.dockerfile-language-server-nodejs nodePackages.vscode-langservers-extracted + nodePackages.volar lldb vscode-extensions.vadimcn.vscode-lldb + marksman + clang-tools + cmake-language-server ]; # symlink for a stable path @@ -103,7 +63,6 @@ in plenary-nvim vim-illuminate registers-nvim - pre-commit-nvim vim-surround editorconfig-nvim @@ -138,10 +97,11 @@ in # LSP nvim-lspconfig lsp-status-nvim - rust-tools-nvim + rustaceanvim neodev-nvim null-ls-nvim lsp_lines-nvim + lsp-inlayhints-nvim # debugging nvim-dap @@ -183,6 +143,10 @@ in vim.g.gitblame_date_format = "%r" + -- setup illuminate highlight groups + vim.api.nvim_set_hl(0, "IlluminatedWordText", { bold = true }) + vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "IlluminatedWordText" }) + vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "IlluminatedWordText" }) EOF ''; }; diff --git a/home-manager/neovim/indent-blankline.lua b/home-manager/neovim/indent-blankline.lua index 921a59b..d7e7b6c 100644 --- a/home-manager/neovim/indent-blankline.lua +++ b/home-manager/neovim/indent-blankline.lua @@ -1,6 +1,5 @@ -require("indent_blankline").setup { - char = "┊", - buftype_exclude = { "terminal", "help", "nofile" }, - filetype_exclude = { 'help', 'packer' }, - show_trailing_blankline_indent = false +require("ibl").setup { + indent = { + char = "┊", + }, } diff --git a/home-manager/neovim/lspconfig.lua b/home-manager/neovim/lspconfig.lua index 700c1cf..e767caf 100644 --- a/home-manager/neovim/lspconfig.lua +++ b/home-manager/neovim/lspconfig.lua @@ -15,11 +15,12 @@ local on_attach = function(client, bufnr) }) end + require("lsp-inlayhints").on_attach(client, bufnr) + local telescope = require("telescope.builtin") nnoremap("gD", vim.lsp.buf.declaration) nnoremap("gd", telescope.lsp_definitions) - nnoremap("gt", telescope.lsp_type_definitions) nnoremap("gi", telescope.lsp_implementations) nnoremap("gr", telescope.lsp_references) nnoremap("K", vim.lsp.buf.hover) @@ -39,16 +40,16 @@ local on_attach = function(client, bufnr) callback = format_buffer, }) end - - local illuminate = require("illuminate") - illuminate.on_attach(client) end +require("lsp-inlayhints").setup({}) + local lsp_status = require("lsp-status") lsp_status.config({ current_function = false, show_filename = false, diagnostics = true, + status_symbol = "", }) lsp_status.register_progress() @@ -66,7 +67,11 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities(lsp_status.cap local servers = { ["bashls"] = {}, + ["clangd"] = {}, + ["cmake"] = {}, ["dockerls"] = {}, + ["eslint"] = {}, + ["html"] = {}, ["jsonls"] = {}, ["lua_ls"] = { Lua = { @@ -84,6 +89,8 @@ local servers = { }, }, }, + ["marksman"] = {}, + ["nushell"] = {}, ["pylsp"] = { pylsp = { plugins = { @@ -115,12 +122,8 @@ for lsp, settings in pairs(servers) do }) end --- setup rust tools -local codelldb_base_path = vim.env.HOME .. "/.vscode-extensions/vscode-lldb/share/vscode/extensions/vadimcn.vscode-lldb/" -local codelldb_bin_path = codelldb_base_path .. 'adapter/codelldb' -local codelldb_lib_path = codelldb_base_path .. 'lldb/lib/liblldb.so' - -require("rust-tools").setup({ +-- setup rustaceanvim +vim.g.rustaceanvim = { server = { on_attach = on_attach, settings = { @@ -134,20 +137,14 @@ require("rust-tools").setup({ }, }, }, - capabilities = capabilities, }, - dap = { - adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_bin_path, codelldb_lib_path) - }, -}) +} -- setup null-ls for markdown formatting local null_ls = require("null-ls") null_ls.setup({ sources = { null_ls.builtins.formatting.prettier, - null_ls.builtins.code_actions.eslint_d, - null_ls.builtins.diagnostics.eslint_d, null_ls.builtins.diagnostics.tsc, }, on_attach = on_attach, @@ -178,16 +175,8 @@ for type, icon in pairs(diagnostics_signs) do vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end --- setup html languageserver -lspconfig["html"].setup({ - cmd = { "html-languageserver", "--stdio" }, - on_attach = on_attach, - capabilities = capabilities, -}) - -- setup volar lspconfig["volar"].setup({ - cmd = { "./node_modules/.bin/vue-language-server", "--stdio" }, filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json' }, on_attach = on_attach, capabilities = capabilities, diff --git a/home-manager/neovim/treesitter.lua b/home-manager/neovim/treesitter.lua index 931c77d..eca7e14 100644 --- a/home-manager/neovim/treesitter.lua +++ b/home-manager/neovim/treesitter.lua @@ -1,14 +1,14 @@ require('nvim-treesitter.configs').setup({ highlight = { enable = true, - additional_vim_regex_highlighting = false }, - indent = { - enable = false, - }, - rainbow = { + incremental_selection = { enable = true, - extended_mode = true, - max_file_lines = nil, + keymaps = { + init_selection = "v", + node_decremental = "<", + node_incremental = ">", + scope_incremental = false, + }, }, }) diff --git a/home-manager/nushell.nix b/home-manager/nushell.nix new file mode 100644 index 0000000..88abfc1 --- /dev/null +++ b/home-manager/nushell.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, user, theme, ... }: +{ + programs.nushell = { + enable = true; + extraConfig = '' + let carapace_completer = {|spans| + carapace $spans.0 nushell $spans | from json + } + $env.config = { + show_banner: false, + edit_mode: vi + shell_integration: true + use_kitty_protocol: true + completions: { + case_sensitive: false # case-sensitive completions + quick: true # set to false to prevent auto-selecting completions + partial: true # set to false to prevent partial filling of the prompt + algorithm: "fuzzy" # prefix or fuzzy + external: { + # set to false to prevent nushell looking into $env.PATH to find more suggestions + enable: true + # set to lower can improve completion performance at the cost of omitting some options + max_results: 100 + completer: $carapace_completer # check 'carapace_completer' + } + } + } + $env.PATH = ($env.PATH | + split row (char esep) | + prepend /home/myuser/.apps | + append /usr/bin/env + ) + ''; + }; +} + diff --git a/home-manager/rofi.nix b/home-manager/rofi.nix deleted file mode 100644 index 0c75bfd..0000000 --- a/home-manager/rofi.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, pkgs, user, ... }: - -{ - programs.rofi = { - enable = true; - font = "DejaVu Sans Mono 12"; - terminal = "${pkgs.kitty}/bin/kitty"; - extraConfig = { - show-icons = true; - matching = "fuzzy"; - }; - }; -} diff --git a/home-manager/sway/default.nix b/home-manager/sway/default.nix new file mode 100644 index 0000000..badef4d --- /dev/null +++ b/home-manager/sway/default.nix @@ -0,0 +1,141 @@ +{ config, lib, pkgs, user, ... }: +let + font.name = "DejaVu Sans Mono"; + font.size = 12.0; + lock_command = "${pkgs.swaylock-fancy}/bin/swaylock-fancy --daemonize --show-failed-attempts --ignore-empty-password"; + swaymsg = "${pkgs.sway}/bin/swaymsg"; +in +{ + imports = [ + ./i3status-rust.nix + ./dunst.nix + ]; + + home.packages = with pkgs; [ + xdg-utils + shotman + wl-clipboard + ]; + + programs.fuzzel = { + enable = true; + settings = { + main = { + terminal = "${pkgs.kitty}/bin/kitty"; + layer = "overlay"; + font = "DejaVu Sans Mono:size=12"; + }; + colors = { + background = "002b36ff"; + border = "ffffffaa"; + }; + }; + }; + + programs.swaylock = { + enable = true; + package = pkgs.swaylock-fancy; + }; + + home.pointerCursor = { + name = "Adwaita"; + package = pkgs.gnome.adwaita-icon-theme; + size = 24; + x11 = { + enable = true; + defaultCursor = "Adwaita"; + }; + }; + + services.swayidle = { + enable = true; + events = [ + { event = "before-sleep"; command = lock_command; } + ]; + timeouts = [ + { timeout = 900; command = "${swaymsg} output '*' power off"; resumeCommand = "${swaymsg} output '*' power on"; } + { timeout = 1000; command = lock_command; } + ]; + }; + + wayland.windowManager.sway = { + enable = true; + + config = rec { + modifier = "Mod4"; + terminal = "${pkgs.kitty}/bin/kitty"; + + input = { + "type:keyboard" = { + xkb_layout = "de"; + xkb_variant = "nodeadkeys"; + }; + "type:touchpad" = { + natural_scroll = "enabled"; + tap = "enabled"; + accel_profile = "flat"; + dwt = "enabled"; + }; + }; + + seat = { + "*" = { + hide_cursor = "5000"; + }; + + }; + + defaultWorkspace = "1"; + + focus.newWindow = "urgent"; + + floating.criteria = [{ app_id = "zoom"; floating = true; }]; + + fonts = { + names = [ font.name ]; + size = font.size; + }; + + bars = [{ + mode = "hide"; + position = "top"; + statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml"; + + fonts = { + names = [ font.name ]; + size = font.size; + }; + }]; + + menu = "${pkgs.fuzzel}/bin/fuzzel"; + + keybindings = + let + modifier = config.wayland.windowManager.sway.config.modifier; + in + lib.mkOptionDefault { + "${modifier}+Shift+o" = "exec xdg-open \"zoommtg://zoom.us/join?action=join&confno=4861587170&pwd=ZVk3aHphcWppY21ONjZOMVh6STN6dz09\""; + "${modifier}+Shift+s" = "exec shotman --capture region --copy"; + "${modifier}+l" = "exec ${lock_command}"; + "${modifier}+Shift+m" = "output DP-2 power off, output DP-3 power off, output DP-2 power on, output DP-3 power on"; + }; + + assigns = { + "6" = [{ class = "^\.zoom $"; }]; + }; + + startup = [ + { command = "keepassxc"; } + { command = "nextcloud"; } + { command = "swaymsg 'workspace 1"; } + { command = "kitty"; } + { command = "swaymsg 'workspace 2"; } + { command = "element-desktop"; } + { command = "swaymsg 'workspace 4"; } + { command = "thunderbird"; } + { command = "swaymsg 'workspace 5"; } + { command = "firefox"; } + ]; + }; + }; +} diff --git a/home-manager/sway/dunst.nix b/home-manager/sway/dunst.nix new file mode 100644 index 0000000..f7078d5 --- /dev/null +++ b/home-manager/sway/dunst.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, user, ... }: +{ + services.dunst = { + enable = true; + settings = { + global = { + follow = "keyboard"; + font = "DejaVu Sans Mono 11"; + frame_width = 1; + }; + + urgency_low = { + frame_color = "#268bd2"; + foreground = "#eee8d5"; + background = "#002b36"; + timeout = 4; + }; + + urgency_normal = { + frame_color = "#859900"; + foreground = "#eee8d5"; + background = "#002b36"; + timeout = 6; + }; + + urgency_critical = { + frame_color = "#dc322f"; + foreground = "#eee8d5"; + background = "#002b36"; + timeout = 8; + }; + }; + }; +} diff --git a/home-manager/i3/i3status-rust.nix b/home-manager/sway/i3status-rust.nix similarity index 100% rename from home-manager/i3/i3status-rust.nix rename to home-manager/sway/i3status-rust.nix diff --git a/home-manager/zoxide.nix b/home-manager/zoxide.nix new file mode 100644 index 0000000..47c1207 --- /dev/null +++ b/home-manager/zoxide.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, user, theme, ... }: + +{ + programs.zoxide = { + enable = true; + enableNushellIntegration = true; + enableZshIntegration = true; + }; +} + diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix index 4ee0682..a33a598 100644 --- a/home-manager/zsh.nix +++ b/home-manager/zsh.nix @@ -5,8 +5,8 @@ in { programs.zsh = { enable = true; - enableAutosuggestions = true; - enableCompletion = true; + # enableAutosuggestions = true; + # enableCompletion = true; history.size = 10000; initExtra = '' @@ -23,7 +23,7 @@ in }; shellAliases = { - ls = "exa --group-directories-first --git"; + ls = "eza --group-directories-first --git"; neovide = "neovide --multigrid"; xclip = "xclip -selection clipboard"; }; diff --git a/home-mandlm.nix b/home-mandlm.nix index 287dbc0..d57ee53 100644 --- a/home-mandlm.nix +++ b/home-mandlm.nix @@ -4,10 +4,12 @@ home = { username = "${user}"; homeDirectory = "/home/${user}"; + sessionPath = [ + "$HOME/.cargo/bin/" + ]; packages = with pkgs; [ - exa - firefox + unstable.eza jq htop ripgrep @@ -28,7 +30,9 @@ kubectl kubectx gnome.simple-scan - nix-output-monitor + calibre + libreoffice + gthumb ]; stateVersion = "22.05"; @@ -37,16 +41,19 @@ programs.home-manager.enable = true; imports = [ + ./home-manager/firefox.nix ./home-manager/fzf.nix ./home-manager/git.nix ./home-manager/kitty.nix ./home-manager/neovim ./home-manager/gpg + ./home-manager/carapace.nix ./home-manager/zsh.nix + ./home-manager/nushell.nix ./home-manager/starship.nix - ./home-manager/i3 - ./home-manager/rofi.nix + ./home-manager/sway ./home-manager/direnv.nix ./home-manager/bat.nix + ./home-manager/zoxide.nix ]; } diff --git a/machines/apache/configuration.nix b/machines/apache/configuration.nix index d3d2b13..7f30ab2 100644 --- a/machines/apache/configuration.nix +++ b/machines/apache/configuration.nix @@ -3,6 +3,5 @@ { networking.hostName = "apache"; boot.loader.grub.enableCryptodisk = true; - services.xserver.videoDrivers = [ "intel" "nvidia" ]; } diff --git a/machines/p330/configuration.nix b/machines/p330/configuration.nix index fc06f1c..14add4f 100644 --- a/machines/p330/configuration.nix +++ b/machines/p330/configuration.nix @@ -2,35 +2,5 @@ { networking.hostName = "p330"; - networking.hostId = "05130071"; - boot.loader.grub.enableCryptodisk = true; - boot.supportedFilesystems = [ "zfs" ]; - - services.xserver = { - videoDrivers = [ "intel" ]; - dpi = 144; - xrandrHeads = [ - { - output = "DP2"; - primary = true; - monitorConfig = '' - Option "Position" "0 790" - ''; - } - { - output = "DP3"; - monitorConfig = '' - Option "Position" "3840 0" - Option "Rotate" "right" - ''; - } - ]; - serverFlagsSection = '' - Option "BlankTime" "19" - Option "StandbyTime" "0" - Option "SuspendTime" "0" - Option "OffTime" "20" - ''; - }; } diff --git a/machines/p330/home-mandlm.nix b/machines/p330/home-mandlm.nix index 810d749..e4d1c2d 100644 --- a/machines/p330/home-mandlm.nix +++ b/machines/p330/home-mandlm.nix @@ -1,23 +1,30 @@ { config, lib, pkgs, user, ... }: { - xsession.windowManager.i3.config = { + wayland.windowManager.sway.config = { + output = { + DP-2 = { + scale = "1.5"; + position = "0 526"; + }; + DP-3 = { + scale = "1.5"; + position = "2560 0"; + transform = "90"; + }; + }; + workspaceOutputAssign = [ - { workspace = "1"; output = "DP3"; } - { workspace = "2"; output = "DP2"; } - { workspace = "3"; output = "DP3"; } - { workspace = "4"; output = "DP2"; } - { workspace = "5"; output = "DP3"; } - { workspace = "6"; output = "DP2"; } - { workspace = "7"; output = "DP3"; } - { workspace = "8"; output = "DP2"; } - { workspace = "9"; output = "DP3"; } - { workspace = "10"; output = "DP2"; } + { workspace = "0"; output = "DP-2"; } + { workspace = "1"; output = "DP-3"; } + { workspace = "2"; output = "DP-2"; } + { workspace = "3"; output = "DP-3"; } + { workspace = "4"; output = "DP-2"; } + { workspace = "5"; output = "DP-3"; } + { workspace = "6"; output = "DP-2"; } + { workspace = "7"; output = "DP-3"; } + { workspace = "8"; output = "DP-2"; } + { workspace = "9"; output = "DP-3"; } ]; }; - - programs.kitty.font.size = 16; - programs.rofi.font = lib.mkForce "DejaVu Sans Mono 16"; - - services.betterlockscreen.inactiveInterval = 20; } diff --git a/users.nix b/users.nix index 7843422..fbc8c2f 100644 --- a/users.nix +++ b/users.nix @@ -8,8 +8,18 @@ isNormalUser = true; uid = 1000; home = "/home/mandlm"; - shell = pkgs.zsh; - extraGroups = [ "wheel" "networkmanager" "audio" "video" "input" "docker" "scanner" "lp" ]; + shell = pkgs.nushell; + extraGroups = [ + "wheel" + "networkmanager" + "audio" + "video" + "input" + "docker" + "scanner" + "lp" + "camera" + ]; hashedPassword = "$6$wV6dzYlgke5tN01q$rCMP/Hquss/1BgKarnZUkmejpBtjEcwmlUhbhAAmjc2Pwdbztp3yr/bD/LJ63XoZ0oD7yhTMqbECDdMqNKKDe/"; openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI6NmrDRvDtUkeJM8cE7DvZKtiNBKUQ+30MhOX4BwWPzN2b+kM+TjZ5Dtiln+Zbk/QToCDFir+CIKHshpgtCPAvVkjmldeqqflKKUkShTjWfF2zRwEql58DGaTuJqPgMhS9ZVDI5OL6VoecSxWOLSKCqGu4R+yJJnTRBSaoHNzBsq81psYk/yty+QofbWsJktjJc2r3JSuM8UUVkCVqcYS9wd/3vW3NbkqOL7KJhktsJa6sBZfTs1Yr1lpKqJou24CE1TGwTxiZ7SASjiRzbtK7J9jJBCjZ80hgEp/Cop0caaVw7aedo6xRC26X2TSm7ljAdvcPew9m6ayxuLaV9Nz mandlm@apache" ]; };