From fac169231ce6dc9eb99c2ce069698c31bbc472f4 Mon Sep 17 00:00:00 2001 From: Rachel Lambda Samuelsson Date: Mon, 24 Jun 2024 21:53:35 +0200 Subject: [PATCH] refactor :) --- computational/configuration.nix | 1 + flake.lock | 64 ++- flake.nix | 103 +++-- home/all.nix | 22 + home/applications.nix | 74 ++++ home/fetch.nix | 13 + home/git.nix | 11 + home/gpg.nix | 7 + home/hm-settings.nix | 8 + home/launcher.nix | 7 + home/media.nix | 11 + home/neovim.nix | 176 ++++++++ home/rachel.nix | 511 ------------------------ home/shell.nix | 30 ++ home/ssh.nix | 34 ++ home/terminal.nix | 28 ++ home/tmux.nix | 62 +++ home/xdg-dirs.nix | 15 + lambda/configuration.nix | 1 + pkgs/bqn-nvim.nix | 10 + pkgs/bqn-vim.nix | 10 + {shared => pkgs}/sax2nf.nix | 0 pkgs/shell-menu.nix | 20 + shared/graphical.nix | 46 +++ shared/secrets.nix | 4 - shared/{desktop.nix => user-system.nix} | 139 ++----- 26 files changed, 750 insertions(+), 657 deletions(-) create mode 100644 home/all.nix create mode 100644 home/applications.nix create mode 100644 home/fetch.nix create mode 100644 home/git.nix create mode 100644 home/gpg.nix create mode 100644 home/hm-settings.nix create mode 100644 home/launcher.nix create mode 100644 home/media.nix create mode 100644 home/neovim.nix delete mode 100644 home/rachel.nix create mode 100644 home/shell.nix create mode 100644 home/ssh.nix create mode 100644 home/terminal.nix create mode 100644 home/tmux.nix create mode 100644 home/xdg-dirs.nix create mode 100644 pkgs/bqn-nvim.nix create mode 100644 pkgs/bqn-vim.nix rename {shared => pkgs}/sax2nf.nix (100%) create mode 100644 pkgs/shell-menu.nix create mode 100644 shared/graphical.nix delete mode 100644 shared/secrets.nix rename shared/{desktop.nix => user-system.nix} (71%) diff --git a/computational/configuration.nix b/computational/configuration.nix index 16bd89c..74de799 100644 --- a/computational/configuration.nix +++ b/computational/configuration.nix @@ -5,6 +5,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix ]; + hardware.opengl = { enable = true; driSupport = true; diff --git a/flake.lock b/flake.lock index f59034d..5e6c0c3 100644 --- a/flake.lock +++ b/flake.lock @@ -93,6 +93,24 @@ "type": "github" } }, + "flake-utils_3": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -146,19 +164,26 @@ "type": "github" } }, - "nixpkgs_2": { + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", + "lastModified": 1719241096, + "narHash": "sha256-36De9zA7fp976ZPxATQ2LHcQohUUISCGlAcCKJqRC/0=", + "owner": "nix-community", + "repo": "plasma-manager", + "rev": "d67f2f550a26da44554f239c7043112e0cfbb231", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "plasma-manager", "type": "github" } }, @@ -166,9 +191,11 @@ "inputs": { "agda": "agda", "cornelis": "cornelis", + "flake-utils": "flake-utils_3", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "plasma-manager": "plasma-manager", "ssbm-nix": "ssbm-nix" } }, @@ -190,7 +217,9 @@ }, "ssbm-nix": { "inputs": { - "nixpkgs": "nixpkgs_2", + "nixpkgs": [ + "nixpkgs-unstable" + ], "slippi-desktop": "slippi-desktop" }, "locked": { @@ -221,6 +250,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index a91d435..326e351 100644 --- a/flake.nix +++ b/flake.nix @@ -5,71 +5,102 @@ inputs = { nixpkgs.url = "github:NixOs/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:NixOs/nixpkgs/nixos-unstable"; - home-manager.url = "github:nix-community/home-manager/release-24.05"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - agda.url = "github:agda/agda/v2.6.4.1"; - agda.inputs.nixpkgs.follows = "nixpkgs"; - cornelis.url = "github:isovector/cornelis/"; - cornelis.inputs.nixpkgs.follows = "nixpkgs"; - ssbm-nix.url = "github:lytedev/ssbm-nix"; + flake-utils.url = "github:numtide/flake-utils"; + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + agda = { + url = "github:agda/agda/v2.6.4.1"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + cornelis = { + url = "github:isovector/cornelis/"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + ssbm-nix = { + url = "github:lytedev/ssbm-nix"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, agda, cornelis, ssbm-nix }: + outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, agda, cornelis, ssbm-nix, plasma-manager, flake-utils }: let nix-config-module = { nix.registry.nixpkgs.flake = nixpkgs; nix.registry.unstable.flake = nixpkgs-unstable; system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; }; - rachel-home-module = - ({ pkgs, ... }: - let system = pkgs.stdenv.system; - in { + rachel-home-module = + system: { home-manager = { + sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; useGlobalPkgs = true; useUserPackages = true; - users.rachel = import ./home/rachel.nix { - pkgs = pkgs; + users.rachel = import ./home/all.nix { + pkgs = import nixpkgs { + system = system; + config.allowUnfree = true; + }; unstable = import nixpkgs-unstable { system = system; config.allowUnfree = true; }; - agda = agda.packages.${system}.Agda; - cornelis = cornelis.packages.${system}.cornelis; - cornelis-vim = cornelis.packages.${system}.cornelis-vim; - slippi-netplay = ssbm-nix.packages.${system}.slippi-netplay; + extra = { + agda = agda.packages.${system}.Agda; + cornelis = cornelis.packages.${system}.cornelis; + cornelis-vim = cornelis.packages.${system}.cornelis-vim; + slippi-netplay = ssbm-nix.packages.${system}.slippi-netplay; + sax2nf = self.packages.${system}.sax2nf; + bqn-vim = self.packages.${system}.bqn-vim; + bqn-nvim = self.packages.${system}.bqn-nvim; + shell-menu = self.packages.${system}.bqn-nvim; + }; }; }; - } - ); + }; + base-modules = [ + nix-config-module + ssbm-nix.nixosModule + home-manager.nixosModules.home-manager + ]; in { - nixosConfigurations.lambda = nixpkgs.lib.nixosSystem { + nixosConfigurations.lambda = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; - modules = [ - nix-config-module - ssbm-nix.nixosModule + modules = base-modules ++ [ ./lambda/configuration.nix - ./shared/desktop.nix - home-manager.nixosModules.home-manager - rachel-home-module + ./shared/user-system.nix + ./shared/graphical.nix + (rachel-home-module system) ]; }; - nixosConfigurations.computational = nixpkgs.lib.nixosSystem { + nixosConfigurations.computational = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; - modules = [ - nix-config-module - ssbm-nix.nixosModule + modules = base-modules ++ [ ./computational/configuration.nix - ./shared/desktop.nix - home-manager.nixosModules.home-manager - rachel-home-module + ./shared/user-system.nix + ./shared/graphical.nix + (rachel-home-module system) ]; }; keyboardLayouts.fox = ./shared/fox.xkb; - fonts.sax2nf = import ./shared/sax2nf.nix { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; - }; + } // flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + packages = { + bqn-vim = import ./pkgs/bqn-vim.nix { inherit pkgs; }; + bqn-nvim = import ./pkgs/bqn-nvim.nix { inherit pkgs; }; + sax2nf = import ./pkgs/sax2nf.nix { inherit pkgs; }; + shell-menu = import ./pkgs/shell-menu.nix { inherit pkgs; }; + }; + }); } diff --git a/home/all.nix b/home/all.nix new file mode 100644 index 0000000..352c693 --- /dev/null +++ b/home/all.nix @@ -0,0 +1,22 @@ +{ pkgs, unstable, extra, ... }: +let common = rec { + username = "rachel"; + homeDir = "/home/${username}"; +}; +in { + imports = builtins.map (x: import x { inherit pkgs unstable extra common; }) [ + ./applications.nix + ./fetch.nix + ./git.nix + ./gpg.nix + ./hm-settings.nix + ./launcher.nix + ./media.nix + ./neovim.nix + ./shell.nix + ./ssh.nix + ./terminal.nix + ./tmux.nix + ./xdg-dirs.nix + ]; +} diff --git a/home/applications.nix b/home/applications.nix new file mode 100644 index 0000000..0a6c89c --- /dev/null +++ b/home/applications.nix @@ -0,0 +1,74 @@ +{ pkgs, unstable, extra, ... }: +{ + home.packages = (with pkgs; [ + unzip + zip + xz + gzip + bzip2 + p7zip + usbutils + pciutils + nettools + nmap + arp-scan + julia-bin + (python3.withPackages (ps: with ps; [ + ipython + matplotlib + numpy + scipy + ])) + ghc + firefox + gnupg + discord + dig + xxd + slack + imagemagick + ffmpeg + yt-dlp + libreoffice + protonmail-bridge + pass + protonvpn-gui + thunderbird + tidal-hifi + signal-desktop + transmission-gtk + xclip + clinfo + glxinfo + vulkan-tools + obs-studio + file + gimp + bat + steam + steam-run + rmapi + lutris + texlive.combined.scheme-full + zulip + rink + typst + ttyper + idris2 + prismlauncher + vimv + whalebird + lean4 + remmina + git-crypt + vcv-rack + ]) ++ [ + extra.agda + unstable.zoom-us + extra.sax2nf + extra.cornelis + extra.slippi-netplay + unstable.kicad + unstable.renoise + ]; +} diff --git a/home/fetch.nix b/home/fetch.nix new file mode 100644 index 0000000..cd00af3 --- /dev/null +++ b/home/fetch.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + programs.hyfetch = { + enable = true; + settings = { + preset = "lesbian"; + mode = "rgb"; + color_align = { + mode = "horizontal"; + }; + }; + }; +} diff --git a/home/git.nix b/home/git.nix new file mode 100644 index 0000000..4d478a9 --- /dev/null +++ b/home/git.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + programs.git = { + enable = true; + userName = "Rachel Lambda Samuelsson"; + userEmail = "depsterr@protonmail.com"; + extraConfig = { + init.defaultBranch = "master"; + }; + }; +} diff --git a/home/gpg.nix b/home/gpg.nix new file mode 100644 index 0000000..1554637 --- /dev/null +++ b/home/gpg.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + services.gpg-agent = { + enable = true; + pinentryPackage = pkgs.pinentry-qt; + }; +} diff --git a/home/hm-settings.nix b/home/hm-settings.nix new file mode 100644 index 0000000..3c75935 --- /dev/null +++ b/home/hm-settings.nix @@ -0,0 +1,8 @@ +{ common, ... }: +{ + home = { + username = common.username; + homeDirectory = common.homeDir; + stateVersion = "24.05"; + }; +} diff --git a/home/launcher.nix b/home/launcher.nix new file mode 100644 index 0000000..dc9fb86 --- /dev/null +++ b/home/launcher.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.rofi = { + enable = true; + theme = "gruvbox-dark-soft"; + }; +} diff --git a/home/media.nix b/home/media.nix new file mode 100644 index 0000000..899bfc9 --- /dev/null +++ b/home/media.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + programs.mpv = { + enable = true; + config = { + hwdec = "auto-safe"; + vo = "gpu"; + profile = "gpu-hq"; + }; + }; +} diff --git a/home/neovim.nix b/home/neovim.nix new file mode 100644 index 0000000..2d9e644 --- /dev/null +++ b/home/neovim.nix @@ -0,0 +1,176 @@ +{ pkgs, extra, ... }: +{ + programs.neovim = { + defaultEditor = true; + enable = true; + vimAlias = true; + extraLuaConfig = '' + require('tmux').setup({ copy_sync = { redirect_to_clipboard = true } }); + require('Comment').setup() + require('nvim-surround').setup() + require('numb').setup() + local lspcfg = require('lspconfig') + lspcfg.typst_lsp.setup({ + cmd = { '${pkgs.typst-lsp}/bin/typst-lsp' }, + }) + lspcfg.rust_analyzer.setup({}) + lspcfg.hls.setup({}) + lspcfg.pyright.setup({ + cmd = { '${pkgs.nodePackages.pyright}/bin/pyright-langserver', '--stdio' }, + }) + lspcfg.nixd.setup({ + cmd = { '${pkgs.nixd}/bin/nixd' }, + }) + lspcfg.ltex.setup({ + cmd = { '${pkgs.ltex-ls}/bin/ltex-ls' }, + filetypes = { 'bib', 'gitcommit', 'markdown', 'plaintext', 'tex', 'pandoc', 'typst' }, + settings = { + ltex = { + language = 'auto' + } + } + }) + lspcfg.clangd.setup({ + cmd = { '${pkgs.clang-tools}/bin/clangd' }, + }) + lspcfg.ocamllsp.setup({}) + lspcfg.purescriptls.setup({}) + require('orgmode').setup({}) + require('lean').setup({ + mappings = true, + }) + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'gruvbox', + component_separators = { left = "", right = ""}, + section_separators = { left = "", right = ""}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = { { + 'diagnostics', + always_visible = true, + on_click = function(n,b,m) + vim.diagnostic.goto_next() + end + } }, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + } + + vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + local opts = { buffer = args.buf } + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'r', vim.lsp.buf.rename, opts) + vim.keymap.set('n', 'a', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) + vim.keymap.set('n', 'n', vim.diagnostic.goto_next, opts) + vim.keymap.set('n', 'N', vim.diagnostic.goto_prev, opts) + vim.keymap.set('i', '', vim.lsp.omnifunc, opts) + end, + }) + + vim.api.nvim_create_autocmd({ "BufNew" + , "TextChanged" + , "TextChangedI" + , "TextChangedP" + , "TextChangedT" + }, { + callback = function(args) + vim.diagnostic.disable(args.buf) + end + }) + + vim.api.nvim_create_autocmd({"BufWrite"}, { + callback = function(args) + vim.diagnostic.enable(args.buf) + end + }) + ''; + extraConfig = '' + set rnu nu + set ts=2 sw=2 expandtab + set clipboard=unnamedplus + set laststatus=3 noshowmode + set signcolumn=no + set linebreak + let g:cornelis_use_global_binary = 1 + set conceallevel=2 concealcursor=nc + colorscheme gruvbox + hi Normal guibg=NONE ctermbg=NONE + + let maplocalleader="!" + let g:bqn_prefix_key="!" + runtime agda-input.vim + call cornelis#bind_input(" ", "!") + call cornelis#bind_input("exc", "!") + + inoremap + + nnoremap j gj + nnoremap k gk + nnoremap gj j + nnoremap gk k + + au BufRead,BufNewFile *.agda call AgdaFiletype() + au BufRead,BufNewFile *.lagda.* call AgdaFiletype() + function! AgdaFiletype() + nnoremap :CornelisLoad + nnoremap :CornelisRefine + nnoremap :CornelisMakeCase + nnoremap , :CornelisTypeContext + nnoremap . :CornelisTypeContextInfer + nnoremap :CornelisTypeInfer + nnoremap :CornelisSolve + nnoremap :CornelisAuto + nnoremap gd :CornelisGoToDefinition + nnoremap :CornelisPrevGoal + nnoremap :CornelisNextGoal + nnoremap :CornelisIgnoreAbstract + nnoremap :CornelisGive + endfunction + ''; + plugins = (with pkgs.vimPlugins; [ + nvim-surround + comment-nvim + vimtex + gruvbox-nvim + tmux-nvim + nvim-lspconfig + idris2-vim + numb-nvim + typst-vim + orgmode + vim-obsession + lean-nvim + lualine-nvim + ]) ++ [ + extra.cornelis-vim + extra.bqn-vim + extra.bqn-nvim + ]; + }; +} diff --git a/home/rachel.nix b/home/rachel.nix deleted file mode 100644 index 2b7ab9f..0000000 --- a/home/rachel.nix +++ /dev/null @@ -1,511 +0,0 @@ -{ pkgs, unstable, cornelis, cornelis-vim, agda, slippi-netplay, ... }: -let username = "rachel"; - homeDir = "/home/${username}"; - SAX2NF = import ../shared/sax2nf.nix { inherit pkgs; }; - hpkgs = pkgs.haskellPackages; - hls_wrapper = pkgs.writeScript "hls" '' - export PATH="${hpkgs.haskell-language-server}/bin:$PATH" - exec ${hpkgs.haskell-language-server}/bin/haskell-language-server-wrapper "$@" - ''; -in -{ - home = { - username = username; - homeDirectory = homeDir; - packages = with pkgs; [ - unzip - zip - xz - gzip - bzip2 - p7zip - usbutils - pciutils - nettools - nmap - arp-scan - julia-bin - (python3.withPackages (ps: with ps; [ - ipython - matplotlib - numpy - scipy - ])) - hpkgs.ghc - firefox - gnupg - agda - discord - dig - xxd - unstable.zoom-us - slack - imagemagick - ffmpeg - sl - cowsay - lolcat - fortune - banner - yt-dlp - libreoffice - protonmail-bridge - pass - protonvpn-cli_2 - thunderbird - tidal-hifi - signal-desktop - transmission-gtk - xclip - clinfo - glxinfo - vulkan-tools - obs-studio - file - gimp - SAX2NF - twemoji-color-font - bat - steam - steam-run - rmapi - lutris - texlive.combined.scheme-full - cornelis - zulip - rink - sage - typst - ttyper - idris2 - prismlauncher - vimv - whalebird - lean4 - slippi-netplay - unstable.kicad - remmina - unstable.renoise - git-crypt - vcv-rack - ]; - stateVersion = "24.05"; - }; - - xdg.userDirs = { - enable = true; - createDirectories = true; - desktop = "${homeDir}"; - documents = "${homeDir}/doc"; - download = "${homeDir}/dwn"; - music = "${homeDir}/music"; - pictures = "${homeDir}/img"; - publicShare = "${homeDir}/srv"; - templates = "${homeDir}/doc/templates"; - videos = "${homeDir}/vid"; - }; - - programs = { - bash = { - enable = true; - enableCompletion = false; - historyFile = "/dev/null"; - sessionVariables = { - PS1 ="\\033[1m\\u\\033[0m@\\033[1m\\h\\033[0m: \\w\nλ "; - BROWSER = "firefox"; - XINITRC = "${homeDir}/bin/xinitrc"; - XAUTHORITY = "${homeDir}/.local/share/Xauthority"; - PASH_KEYID = "3E4A909C8FEF6E3783699C79DFC26EF8EDAD6D71"; - QT_AUTO_SCREEN_FACTOR = 1; - PATH = "${homeDir}/bin:$PATH"; - }; - shellAliases = { - x = "startx"; - rm = "rm -i"; - cal = "cal -m"; - }; - initExtra = '' - source ~/.profile - set -o vi - ''; - }; - - mpv = { - enable = true; - config = { - hwdec = "auto-safe"; - vo = "gpu"; - profile = "gpu-hq"; - }; - }; - - rofi = { - enable = true; - theme = "gruvbox-dark-soft"; - }; - - git = { - enable = true; - userName = "Rachel Lambda Samuelsson"; - userEmail = "depsterr@protonmail.com"; - extraConfig = { - init.defaultBranch = "master"; - }; - }; - - neovim = { - defaultEditor = true; - enable = true; - vimAlias = true; - extraLuaConfig = '' - require('tmux').setup({ copy_sync = { redirect_to_clipboard = true } }); - require('Comment').setup() - require('nvim-surround').setup() - require('numb').setup() - local lspcfg = require('lspconfig') - lspcfg.typst_lsp.setup({ - cmd = { '${pkgs.typst-lsp}/bin/typst-lsp' }, - }) - lspcfg.rust_analyzer.setup({}) - lspcfg.hls.setup({ - cmd = { '${hls_wrapper}', 'lsp' }, - }) - lspcfg.pyright.setup({ - cmd = { '${pkgs.nodePackages.pyright}/bin/pyright-langserver', '--stdio' }, - }) - lspcfg.nixd.setup({ - cmd = { '${pkgs.nixd}/bin/nixd' }, - }) - lspcfg.ltex.setup({ - cmd = { '${pkgs.ltex-ls}/bin/ltex-ls' }, - filetypes = { 'bib', 'gitcommit', 'markdown', 'plaintext', 'tex', 'pandoc', 'typst' }, - settings = { - ltex = { - language = 'en-US' - } - } - }) - lspcfg.clangd.setup({ - cmd = { '${pkgs.clang-tools}/bin/clangd' }, - }) - lspcfg.ocamllsp.setup({}) - lspcfg.purescriptls.setup({}) - require('orgmode').setup({}) - require('lean').setup({ - mappings = true, - }) - require('lualine').setup { - options = { - icons_enabled = true, - theme = 'gruvbox', - component_separators = { left = "", right = ""}, - section_separators = { left = "", right = ""}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = { { - 'diagnostics', - always_visible = true, - on_click = function(n,b,m) - vim.diagnostic.goto_next() - end - } }, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - } - - vim.api.nvim_create_autocmd('LspAttach', { - callback = function(args) - local opts = { buffer = args.buf } - vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) - vim.keymap.set('n', 'r', vim.lsp.buf.rename, opts) - vim.keymap.set('n', 'a', vim.lsp.buf.code_action, opts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) - vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) - vim.keymap.set('n', 'n', vim.diagnostic.goto_next, opts) - vim.keymap.set('n', 'N', vim.diagnostic.goto_prev, opts) - vim.keymap.set('i', '', vim.lsp.omnifunc, opts) - end, - }) - - vim.api.nvim_create_autocmd({ "BufNew" - , "TextChanged" - , "TextChangedI" - , "TextChangedP" - , "TextChangedT" - }, { - callback = function(args) - vim.diagnostic.disable(args.buf) - end - }) - - vim.api.nvim_create_autocmd({"BufWrite"}, { - callback = function(args) - vim.diagnostic.enable(args.buf) - end - }) - ''; - extraConfig = '' - set rnu nu - set ts=2 sw=2 expandtab - set clipboard=unnamedplus - set laststatus=3 noshowmode - set signcolumn=no - set linebreak - let g:cornelis_use_global_binary = 1 - set conceallevel=2 concealcursor=nc - colorscheme gruvbox - hi Normal guibg=NONE ctermbg=NONE - - let maplocalleader="!" - let g:bqn_prefix_key="!" - runtime agda-input.vim - call cornelis#bind_input(" ", "!") - call cornelis#bind_input("exc", "!") - - inoremap - - nnoremap j gj - nnoremap k gk - nnoremap gj j - nnoremap gk k - - au BufRead,BufNewFile *.agda call AgdaFiletype() - au BufRead,BufNewFile *.lagda.* call AgdaFiletype() - function! AgdaFiletype() - nnoremap :CornelisLoad - nnoremap :CornelisRefine - nnoremap :CornelisMakeCase - nnoremap , :CornelisTypeContext - nnoremap . :CornelisTypeContextInfer - nnoremap :CornelisTypeInfer - nnoremap :CornelisSolve - nnoremap :CornelisAuto - nnoremap gd :CornelisGoToDefinition - nnoremap :CornelisPrevGoal - nnoremap :CornelisNextGoal - nnoremap :CornelisIgnoreAbstract - nnoremap :CornelisGive - endfunction - ''; - plugins = let - bqn-vim = pkgs.vimUtils.buildVimPlugin { - name = "bqn-vim"; - src = "${pkgs.fetchFromGitHub { - owner = "mlochbaum"; - repo = "BQN"; - rev = "f4b09b675386c789c8296c96874871916a3abdcf"; - hash = "sha256-rvsageS5sYF9QvWuoRutjx5i0ngrfhGvIPRO834pwwM="; - }}/editors/vim"; - }; - bqn-nvim = pkgs.vimUtils.buildVimPlugin { - name = "bqn-nvim"; - src = pkgs.fetchFromSourcehut { - owner = "~detegr"; - repo = "nvim-bqn"; - rev = "52d8b49f3ebc32d340e2e2b8dba1f6bbd1873b78"; - hash = "sha256-5wITedTuUn9BKLqmQtPWeFNOa8dXfPIRpUvPSkNJcas="; - }; - }; - in - with pkgs.vimPlugins; [ - nvim-surround - comment-nvim - vimtex - gruvbox-nvim - tmux-nvim - cornelis-vim - nvim-lspconfig - idris2-vim - numb-nvim - typst-vim - orgmode - vim-obsession - lean-nvim - bqn-vim - bqn-nvim - lualine-nvim - ]; - }; - - tmux = { - enable = true; - clock24 = true; - escapeTime = 0; - keyMode = "vi"; - mouse = false; - shortcut = "a"; - extraConfig = '' - bind h split -hb -c '#{pane_current_path}' - bind j split -v -c '#{pane_current_path}' - bind k split -vb -c '#{pane_current_path}' - bind l split -h -c '#{pane_current_path}' - - is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'" - - bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' - bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' - bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' - bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' - - bind-key -T copy-mode-vi 'C-h' select-pane -L - bind-key -T copy-mode-vi 'C-j' select-pane -D - bind-key -T copy-mode-vi 'C-k' select-pane -U - bind-key -T copy-mode-vi 'C-l' select-pane -R - - bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1' - bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1' - bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1' - bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1' - - bind-key -T copy-mode-vi M-h resize-pane -L 1 - bind-key -T copy-mode-vi M-j resize-pane -D 1 - bind-key -T copy-mode-vi M-k resize-pane -U 1 - bind-key -T copy-mode-vi M-l resize-pane -R 1 - - set -g pane-border-style bg=default - set -g pane-border-style fg="#1D1F21" - set -g pane-active-border-style bg=default - set -g pane-active-border-style fg="#333333" - - set-option -g status on - set-option -g status-style bg=default - set-option -g status-style fg="#ef7627" - set-option -g status-interval 2 - set-option -g status-justify "centre" - set-option -g status-right " λ " - - set -g status-interval 1 - set-window-option -g window-status-separator "-" - set-window-option -g window-status-current-format " #[fg=#b55690 bold]!![ #{b:pane_current_path}/ ] #{b:window_index} $ #{b:pane_current_command}!! " - set-window-option -g window-status-format " #{b:window_index} [ #{b:pane_current_path}/ ] #{b:pane_current_command} " - - set -g @resurrect-strategy-nvim 'session' - set -g @resurrect-capture-pane-contents 'on' - ''; - plugins = with pkgs.tmuxPlugins; [ - resurrect - ]; - }; - - hyfetch = { - enable = true; - settings = { - preset = "lesbian"; - mode = "rgb"; - color_align = { - mode = "horizontal"; - }; - }; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - alacritty = { - enable = true; - settings = { - window = { - padding.x = 5; - padding.y = 5; - decorations = "None"; - dynamic_title = false; - }; - mouse.hide_when_typing = true; - scrolling.history = 0; - font = { - normal.family = "SAX2 Nerd Font"; - size = 11; - }; - colors = { - draw_bold_text_with_bright_colors = false; - primary = { - background = "#1d1f21"; - foreground = "#c5c8c6"; - }; - }; - shell.program = - let tmux-menu = pkgs.writeScript "tmux-menu" '' - s="$(tmux ls 2>/dev/null)" - [ "$s" ] && s="$s - " - c=$(${pkgs.fzf}/bin/fzf -1 <<-EOF - ''${s}New Session - Raw Shell - EOF - ) || exit - case "$c" in - "New Session") - read -p "Name? " -r n - ${pkgs.tmux}/bin/tmux new -s "$n" ;; - "Raw Shell") - ${pkgs.bashInteractive}/bin/bash --login ;; - *) - ${pkgs.tmux}/bin/tmux attach-session -t "''${c%%:*}" ;; - esac - ''; in "${tmux-menu}"; - }; - }; - - ssh = { - enable = true; - matchBlocks = { - remarkable = { - hostname = "10.11.99.1"; - user = "root"; - }; - lazarus = { - hostname = "rachel.cafe"; - user = "deppy"; - }; - zelda = { - hostname = "zelda.dhack.se"; - user = "dhack"; - }; - link = { - hostname = "link.dhack.se"; - user = "dhack"; - }; - medli = { - hostname = "pub.dhack.se"; - user = "hacke"; - port = 222; - }; - ganon = { - hostname = "ganon.dhack.se"; - user = "lambda"; - port = 222; - }; - }; - }; - }; - - services = { - gpg-agent = { - enable = true; - pinentryPackage = pkgs.pinentry-qt; - }; - }; -} diff --git a/home/shell.nix b/home/shell.nix new file mode 100644 index 0000000..5e6e9ea --- /dev/null +++ b/home/shell.nix @@ -0,0 +1,30 @@ +{ common, ... }: +{ + programs.bash = { + enable = true; + enableCompletion = false; + historyFile = "/dev/null"; + sessionVariables = { + PS1 ="\\033[1m\\u\\033[0m@\\033[1m\\h\\033[0m: \\w\nλ "; + BROWSER = "firefox"; + XINITRC = "${common.homeDir}/bin/xinitrc"; + XAUTHORITY = "${common.homeDir}/.local/share/Xauthority"; + PASH_KEYID = "3E4A909C8FEF6E3783699C79DFC26EF8EDAD6D71"; + QT_AUTO_SCREEN_FACTOR = 1; + PATH = "${common.homeDir}/bin:$PATH"; + }; + shellAliases = { + x = "startx"; + rm = "rm -i"; + cal = "cal -m"; + }; + initExtra = '' + source ~/.profile + set -o vi + ''; + }; + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; +} diff --git a/home/ssh.nix b/home/ssh.nix new file mode 100644 index 0000000..3bf5978 --- /dev/null +++ b/home/ssh.nix @@ -0,0 +1,34 @@ +{ ... }: +{ + programs.ssh = { + enable = true; + matchBlocks = { + remarkable = { + hostname = "10.11.99.1"; + user = "root"; + }; + lazarus = { + hostname = "rachel.cafe"; + user = "deppy"; + }; + zelda = { + hostname = "zelda.dhack.se"; + user = "dhack"; + }; + link = { + hostname = "link.dhack.se"; + user = "dhack"; + }; + medli = { + hostname = "pub.dhack.se"; + user = "hacke"; + port = 222; + }; + ganon = { + hostname = "ganon.dhack.se"; + user = "lambda"; + port = 222; + }; + }; + }; +} diff --git a/home/terminal.nix b/home/terminal.nix new file mode 100644 index 0000000..e98e759 --- /dev/null +++ b/home/terminal.nix @@ -0,0 +1,28 @@ +{ extra, ... }: +{ + programs.alacritty = { + enable = true; + settings = { + window = { + padding.x = 5; + padding.y = 5; + decorations = "None"; + dynamic_title = false; + }; + mouse.hide_when_typing = true; + scrolling.history = 0; + font = { + normal.family = "SAX2 Nerd Font"; + size = 11; + }; + colors = { + draw_bold_text_with_bright_colors = false; + primary = { + background = "#1d1f21"; + foreground = "#c5c8c6"; + }; + }; + shell.program = extra.shell-menu; + }; + }; +} diff --git a/home/tmux.nix b/home/tmux.nix new file mode 100644 index 0000000..6eeecfa --- /dev/null +++ b/home/tmux.nix @@ -0,0 +1,62 @@ +{ pkgs, ... }: +{ + programs.tmux = { + enable = true; + clock24 = true; + escapeTime = 0; + keyMode = "vi"; + mouse = false; + shortcut = "a"; + extraConfig = '' + bind h split -hb -c '#{pane_current_path}' + bind j split -v -c '#{pane_current_path}' + bind k split -vb -c '#{pane_current_path}' + bind l split -h -c '#{pane_current_path}' + + is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'" + + bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' + bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' + bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' + bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' + + bind-key -T copy-mode-vi 'C-h' select-pane -L + bind-key -T copy-mode-vi 'C-j' select-pane -D + bind-key -T copy-mode-vi 'C-k' select-pane -U + bind-key -T copy-mode-vi 'C-l' select-pane -R + + bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1' + bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1' + bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1' + bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1' + + bind-key -T copy-mode-vi M-h resize-pane -L 1 + bind-key -T copy-mode-vi M-j resize-pane -D 1 + bind-key -T copy-mode-vi M-k resize-pane -U 1 + bind-key -T copy-mode-vi M-l resize-pane -R 1 + + set -g pane-border-style bg=default + set -g pane-border-style fg="#1D1F21" + set -g pane-active-border-style bg=default + set -g pane-active-border-style fg="#333333" + + set-option -g status on + set-option -g status-style bg=default + set-option -g status-style fg="#ef7627" + set-option -g status-interval 2 + set-option -g status-justify "centre" + set-option -g status-right " λ " + + set -g status-interval 1 + set-window-option -g window-status-separator "-" + set-window-option -g window-status-current-format " #[fg=#b55690 bold]!![ #{b:pane_current_path}/ ] #{b:window_index} $ #{b:pane_current_command}!! " + set-window-option -g window-status-format " #{b:window_index} [ #{b:pane_current_path}/ ] #{b:pane_current_command} " + + set -g @resurrect-strategy-nvim 'session' + set -g @resurrect-capture-pane-contents 'on' + ''; + plugins = with pkgs.tmuxPlugins; [ + resurrect + ]; + }; +} diff --git a/home/xdg-dirs.nix b/home/xdg-dirs.nix new file mode 100644 index 0000000..d43c21d --- /dev/null +++ b/home/xdg-dirs.nix @@ -0,0 +1,15 @@ +{ common, ... }: +{ + xdg.userDirs = { + enable = true; + createDirectories = true; + desktop = "${common.homeDir}"; + documents = "${common.homeDir}/doc"; + download = "${common.homeDir}/dwn"; + music = "${common.homeDir}/music"; + pictures = "${common.homeDir}/img"; + publicShare = "${common.homeDir}/srv"; + templates = "${common.homeDir}/doc/templates"; + videos = "${common.homeDir}/vid"; + }; +} diff --git a/lambda/configuration.nix b/lambda/configuration.nix index d00779e..b1e20d8 100644 --- a/lambda/configuration.nix +++ b/lambda/configuration.nix @@ -5,6 +5,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix ]; + hardware.opengl = { enable = true; driSupport = true; diff --git a/pkgs/bqn-nvim.nix b/pkgs/bqn-nvim.nix new file mode 100644 index 0000000..d1b0f42 --- /dev/null +++ b/pkgs/bqn-nvim.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +pkgs.vimUtils.buildVimPlugin { + name = "bqn-nvim"; + src = pkgs.fetchFromSourcehut { + owner = "~detegr"; + repo = "nvim-bqn"; + rev = "52d8b49f3ebc32d340e2e2b8dba1f6bbd1873b78"; + hash = "sha256-5wITedTuUn9BKLqmQtPWeFNOa8dXfPIRpUvPSkNJcas="; + }; +} diff --git a/pkgs/bqn-vim.nix b/pkgs/bqn-vim.nix new file mode 100644 index 0000000..096bb3c --- /dev/null +++ b/pkgs/bqn-vim.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +pkgs.vimUtils.buildVimPlugin { + name = "bqn-vim"; + src = "${pkgs.fetchFromGitHub { + owner = "mlochbaum"; + repo = "BQN"; + rev = "f4b09b675386c789c8296c96874871916a3abdcf"; + hash = "sha256-rvsageS5sYF9QvWuoRutjx5i0ngrfhGvIPRO834pwwM="; + }}/editors/vim"; +} diff --git a/shared/sax2nf.nix b/pkgs/sax2nf.nix similarity index 100% rename from shared/sax2nf.nix rename to pkgs/sax2nf.nix diff --git a/pkgs/shell-menu.nix b/pkgs/shell-menu.nix new file mode 100644 index 0000000..0de5908 --- /dev/null +++ b/pkgs/shell-menu.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +pkgs.writeScript "tmux-menu" '' + s="$(${pkgs.tmux}/bin/tmux ls 2>/dev/null)" + [ "$s" ] && s="$s + " + c=$(${pkgs.fzf}/bin/fzf -1 <<-EOF + ''${s}New Session + Raw Shell + EOF + ) || exit + case "$c" in + "New Session") + read -p "Name? " -r n + ${pkgs.tmux}/bin/tmux new -s "$n" ;; + "Raw Shell") + ${pkgs.bashInteractive}/bin/bash --login ;; + *) + ${pkgs.tmux}/bin/tmux attach-session -t "''${c%%:*}" ;; + esac +'' diff --git a/shared/graphical.nix b/shared/graphical.nix new file mode 100644 index 0000000..c138c75 --- /dev/null +++ b/shared/graphical.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: +{ + # [DESKTOP / XORG / WAYLAND] + services.libinput = { + enable = true; + touchpad = { + naturalScrolling = true; + accelProfile = "flat" ; + tapping = false; + }; + }; + services.xserver = { + enable = true; + desktopManager.plasma5.enable = true; + displayManager.startx.enable = true; + }; + + # [SOUND] + sound.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + + alsa = { + enable = true; + support32Bit = true; + }; + + pulse.enable = true; + + jack.enable = true; + + wireplumber.enable = true; + }; + + programs.gamemode = { + enable = true; + settings.general.renice = 20; + }; + nixpkgs.config.allowUnfree = true; + programs.steam.enable = true; + ssbm.gcc = { + rules.enable = true; + oc-kmod.enable = true; + }; +} diff --git a/shared/secrets.nix b/shared/secrets.nix deleted file mode 100644 index 6f02c4a..0000000 --- a/shared/secrets.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - etaUser = "user"; - etaPass = "pass"; -} diff --git a/shared/desktop.nix b/shared/user-system.nix similarity index 71% rename from shared/desktop.nix rename to shared/user-system.nix index 8ed8751..ee096d6 100644 --- a/shared/desktop.nix +++ b/shared/user-system.nix @@ -1,10 +1,33 @@ { pkgs, ... }: { - services.openssh = { - enable = true; + # [LOCALE] + time.timeZone = "Europe/Stockholm"; + i18n.defaultLocale = "en_GB.UTF-8"; + i18n.supportedLocales = [ "sv_SE.UTF-8/UTF-8" "en_GB.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" ]; + + # [NIX] + nix = { settings = { - PasswordAuthentication = false; - PermitRootLogin = "no"; + bash-prompt = "\\033[1m\\u\\033[0m@\\033[1m\\h\\033[0m: \\w\\n❄\\040"; + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + registry = { + templates = { + from = { + type = "indirect"; + id = "templates"; + }; + to = { + type = "git"; + url = "https://githug.xyz/xenchel/templates"; + }; + }; }; }; @@ -23,55 +46,7 @@ options = [ "username=${secrets.etaUser}" "password=${secrets.etaPass}" "uid=1000" "gid=1000" "x-systemd.automount" "noauto" "x-systemd.idle-timeout=60" ]; }; - # [LOCALE] - time.timeZone = "Europe/Stockholm"; - i18n.defaultLocale = "en_GB.UTF-8"; - i18n.supportedLocales = [ "sv_SE.UTF-8/UTF-8" "en_GB.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" ]; - - # [NIX] - nix = { - settings = { - bash-prompt = "\\033[1m\\u\\033[0m@\\033[1m\\h\\033[0m: \\w\\n❄\\040"; - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; - }; - gc = { - automatic = true; - dates = "monthly"; - options = "--delete-older-than 30d"; - }; - registry = { - templates = { - from = { - type = "indirect"; - id = "templates"; - }; - to = { - type = "git"; - url = "https://githug.xyz/xenchel/templates"; - }; - }; - }; - }; - - nixpkgs.config.allowUnfree = true; - nixpkgs.config.permittedInsecurePackages = [ - "electron-21.4.4" # needed for whalebird - ]; - - # [DESKTOP / XORG / WAYLAND] - services.libinput = { - enable = true; - touchpad = { - naturalScrolling = true; - accelProfile = "flat" ; - tapping = false; - }; - }; services.xserver = { - enable = true; - desktopManager.plasma5.enable = true; - displayManager.startx.enable = true; xkb = { layout = "fox,sus"; options = "ctrl:nocaps,grp:alt_shift_toggle"; @@ -88,57 +63,18 @@ }; }; - # [TTY] - console = { - useXkbConfig = true; - font = "LatGrkCyr-12x22"; - }; - - # [SOUND] - sound.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - - alsa = { - enable = true; - support32Bit = true; - }; - - pulse.enable = true; - - jack.enable = true; - - wireplumber.enable = true; - }; - - # [PACKAGES / PROGRAMS] environment.systemPackages = with pkgs; [ git git-crypt neovim ]; - programs.gamemode = { - enable = true; - settings.general.renice = 20; + + # [TTY] + console = { + useXkbConfig = true; + font = "LatGrkCyr-12x22"; }; - programs.steam.enable = true; - ssbm.gcc = { - rules.enable = true; - oc-kmod.enable = true; - }; - - # [SERVICES] - services.printing.enable = true; - virtualisation.docker.enable = true; - services.mullvad-vpn.enable = true; - - - # [SECURITY / FIREWALL] - networking.firewall.enable = true; - networking.firewall.allowedTCPPorts = [ 22 ]; - networking.firewall.allowedUDPPorts = [ ]; security.doas = { enable = true; @@ -166,4 +102,15 @@ { domain = "rachel"; item = "nice"; "type" = "soft"; value = "-20"; } { domain = "rachel"; item = "nice"; "type" = "hard"; value = "-20"; } ]; + + # [SERVICES] + services.printing.enable = true; + virtualisation.docker.enable = true; + services.mullvad-vpn.enable = true; + + + # [SECURITY / FIREWALL] + networking.firewall.enable = true; + networking.firewall.allowedTCPPorts = [ 22 ]; + networking.firewall.allowedUDPPorts = [ ]; }