diff --git a/home-manager/modules/vscode/settings.json b/home-manager/modules/vscode/settings.json index 8a4b7cc..427e8c2 100644 --- a/home-manager/modules/vscode/settings.json +++ b/home-manager/modules/vscode/settings.json @@ -1,470 +1,843 @@ { - "editor.formatOnSave": true, - "editor.fontFamily": "Iosevka Nerd Font", - "workbench.iconTheme": "Monokai Pro Icons", - "workbench.enableExperiments": false, - "workbench.preferredDarkColorTheme": "Monokai Pro", - "editor.fontLigatures": true, - "vsicons.dontShowNewVersionMessage": true, - "workbench.startupEditor": "newUntitledFile", - "rust-analyzer.cargo.allFeatures": true, - "rust-analyzer.checkOnSave.command": "clippy", - "editor.suggestSelection": "first", - "git.autofetch": true, - "vim.cursorStylePerMode.insert": "line", - "vim.cursorStylePerMode.normal": "block", - "vim.cursorStylePerMode.replace": "block-outline", - "vim.cursorStylePerMode.visual": "underline", - "vim.cursorStylePerMode.visualblock": "underline", - "vim.cursorStylePerMode.visualline": "underline", - "vim.normalModeKeyBindingsNonRecursive": [ - { - "before": ["h"], - "after": ["h"] - }, - { - "before": ["n"], - "after": ["j"] - }, - { - "before": ["e"], - "after": ["k"] - }, - { - "before": ["i"], - "after": ["l"] - }, - { - "before": ["l"], - "after": ["b"] - }, - { - "before": ["L"], - "after": ["B"] - }, - { - "before": ["u"], - "after": ["e"] - }, - { - "before": ["U"], - "after": ["E"] - }, - { - "before": ["y"], - "after": ["W"] - }, - { - "before": ["Y"], - "after": ["W"] - }, - { - "before": ["s"], - "after": ["i"] - }, - { - "before": ["S"], - "after": ["I"] - }, - { - "before": ["t"], - "after": ["a"] - }, - { - "before": ["T"], - "after": ["A"] - }, - { - "before": ["w"], - "after": ["c"] - }, - { - "before": ["W"], - "after": ["C"] - }, - { - "before": ["ww"], - "after": ["cc"] - }, - { - "before": ["x"], - "after": ["x"] - }, - { - "before": ["c"], - "after": ["y"] - }, - { - "before": ["v"], - "after": ["p"] - }, - { - "before": ["X"], - "after": ["dd"] - }, - { - "before": ["C"], - "after": ["yy"] - }, - { - "before": ["V"], - "after": ["P"] - }, - { - "before": ["gv"], - "after": ["gp"] - }, - { - "before": ["gV"], - "after": ["gP"] - }, - { - "before": ["z"], - "after": ["u"] - }, - { - "before": ["gz"], - "after": ["U"] - }, - { - "before": ["Z"], - "after": [""] - }, - { - "before": ["a"], - "after": ["v"] - }, - { - "before": ["A"], - "after": ["V"] - }, - { - "before": ["ga"], - "after": ["gv"] - }, - { - "before": ["p"], - "after": ["t"] - }, - { - "before": ["P"], - "after": ["T"] - }, - { - "before": ["b"], - "after": [";"] - }, - { - "before": ["B"], - "after": [","] - }, - { - "before": ["k"], - "after": ["n"] - }, - { - "before": ["K"], - "after": ["N"] - }, - { - "before": ["j"], - "after": ["z"] - }, - { - "before": ["jn"], - "after": ["zj"] - }, - { - "before": ["je"], - "after": ["zk"] - }, - { - "before": ["gX"], - "after": ["X"] - }, - { - "before": ["gK"], - "after": ["K"] - }, - { - "before": ["gL"], - "after": ["L"] - }, - { - "before": ["h"], - "after": ["h"] - }, - { - "before": ["n"], - "after": ["j"] - }, - { - "before": ["e"], - "after": ["k"] - }, - { - "before": ["i"], - "after": ["l"] - } - ], - "vim.visualModeKeyBindingsNonRecursive": [ - { - "before": ["h"], - "after": ["h"] - }, - { - "before": ["n"], - "after": ["j"] - }, - { - "before": ["e"], - "after": ["k"] - }, - { - "before": ["i"], - "after": ["l"] - }, - { - "before": ["l"], - "after": ["b"] - }, - { - "before": ["L"], - "after": ["B"] - }, - { - "before": ["u"], - "after": ["e"] - }, - { - "before": ["U"], - "after": ["E"] - }, - { - "before": ["y"], - "after": ["W"] - }, - { - "before": ["Y"], - "after": ["W"] - }, - { - "before": ["w"], - "after": ["c"] - }, - { - "before": ["W"], - "after": ["C"] - }, - { - "before": ["x"], - "after": ["x"] - }, - { - "before": ["c"], - "after": ["y"] - }, - { - "before": ["v"], - "after": ["p"] - }, - { - "before": ["X"], - "after": ["d"] - }, - { - "before": ["C"], - "after": ["y"] - }, - { - "before": ["V"], - "after": ["P"] - }, - { - "before": ["gv"], - "after": ["gp"] - }, - { - "before": ["gV"], - "after": ["gP"] - }, - { - "before": ["z"], - "after": [":undo"] - }, - { - "before": ["gz"], - "after": [":undo"] - }, - { - "before": ["Z"], - "after": [":redo"] - }, - { - "before": ["a"], - "after": ["v"] - }, - { - "before": ["A"], - "after": ["V"] - }, - { - "before": [" s"], - "after": ["(mode() =~# \"[V]\" ? \"0o$I\" : \"I\""] - }, - { - "before": [" S"], - "after": ["(mode() =~# \"[V]\" ? \"0o$I\" : \"I\""] - }, - { - "before": [" t"], - "after": ["(mode() =~# \"[V]\" ? \"0o$A\" : \"I\""] - }, - { - "before": [" T"], - "after": ["(mode() =~# \"[V]\" ? \"0o$A\" : \"I\""] - }, - { - "before": ["p"], - "after": ["t"] - }, - { - "before": ["P"], - "after": ["T"] - }, - { - "before": ["b"], - "after": [";"] - }, - { - "before": ["B"], - "after": [","] - }, - { - "before": ["k"], - "after": ["n"] - }, - { - "before": ["K"], - "after": ["N"] - }, - { - "before": ["j"], - "after": ["z"] - }, - { - "before": ["jn"], - "after": ["zj"] - }, - { - "before": ["je"], - "after": ["zk"] - }, - { - "before": ["gX"], - "after": ["X"] - }, - { - "before": ["gK"], - "after": ["K"] - }, - { - "before": ["gL"], - "after": ["L"] - }, - { - "before": ["h"], - "after": ["h"] - }, - { - "before": ["n"], - "after": ["j"] - }, - { - "before": ["e"], - "after": ["k"] - }, - { - "before": ["i"], - "after": ["l"] - } - ], - "vim.textwidth": 120, - "workbench.editor.enablePreviewFromQuickOpen": false, - "editor.lineNumbers": "relative", - "emmet.includeLanguages": { - "html-leex": "html" - }, - "emmet.triggerExpansionOnTab": true, - "python.languageServer": "Default", - "shellcheck.enableQuickFix": true, - "shellcheck.customArgs": ["--enable=all"], - "workbench.colorTheme": "Monokai Pro", - "[elixir]": { - "editor.defaultFormatter": "JakeBecker.elixir-ls" - }, - "remote.SSH.useLocalServer": false, - "remote.SSH.remotePlatform": { - "horus-vpn": "linux", - "horus": "linux" - }, - "tailwindCSS.includeLanguages": { - "svelte": "html", - "surface": "html", - "elixir": "html" - }, - "tailwindCSS.emmetCompletions": true, - "docker.showStartPage": false, - "workbench.editorAssociations": { - "*.ipynb": "jupyter.notebook.ipynb" - }, - "editor.cursorStyle": "line", - "editor.wordSeparators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-", - "editor.wordWrap": "off", - "editor.tabSize": 2, - "editor.minimap.enabled": false, - "editor.bracketPairColorization.enabled": true, - "python.formatting.provider": "black", - "telemetry.telemetryLevel": "off", - "python.formatting.blackArgs": ["--skip-string-normalization"], - "[typescript]": { - "editor.defaultFormatter": "vscode.typescript-language-features" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[svelte]": { - "editor.defaultFormatter": "svelte.svelte-vscode" - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[markdown]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[cpp]": { - "editor.defaultFormatter": "xaver.clang-format" - }, - "files.associations": { - "*.livemd": "markdown", - "*.wrap": "ini" - }, - "[python]": { - "editor.tabSize": 4 - }, - "[nix]": { - "editor.defaultFormatter": "aaronduino.nix-lsp" - }, - "[rust]": { - "editor.tabSize": 4 - } -} + "[cpp]": { + "editor.defaultFormatter": "xaver.clang-format" + }, + "[elixir]": { + "editor.defaultFormatter": "JakeBecker.elixir-ls" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[markdown]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[nix]": { + "editor.defaultFormatter": "aaronduino.nix-lsp" + }, + "[python]": { + "editor.tabSize": 4 + }, + "[rust]": { + "editor.tabSize": 4 + }, + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "docker.showStartPage": false, + "editor.bracketPairColorization.enabled": true, + "editor.cursorStyle": "line", + "editor.fontFamily": "Iosevka Nerd Font", + "editor.fontLigatures": true, + "editor.formatOnSave": true, + "editor.lineNumbers": "relative", + "editor.minimap.enabled": false, + "editor.suggestSelection": "first", + "editor.tabSize": 2, + "editor.wordSeparators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-", + "editor.wordWrap": "off", + "emmet.includeLanguages": { + "html-leex": "html" + }, + "emmet.triggerExpansionOnTab": true, + "files.associations": { + "*.livemd": "markdown", + "*.wrap": "ini" + }, + "git.autofetch": true, + "python.formatting.blackArgs": [ + "--skip-string-normalization" + ], + "python.formatting.provider": "black", + "python.languageServer": "Default", + "remote.SSH.remotePlatform": { + "horus-vpn": "linux", + "horus": "linux" + }, + "remote.SSH.useLocalServer": false, + "rust-analyzer.cargo.allFeatures": true, + "rust-analyzer.checkOnSave.command": "clippy", + "shellcheck.customArgs": [ + "--enable=all" + ], + "shellcheck.enableQuickFix": true, + "tailwindCSS.emmetCompletions": true, + "tailwindCSS.includeLanguages": { + "svelte": "html", + "surface": "html", + "elixir": "html" + }, + "telemetry.telemetryLevel": "off", + "vim.cursorStylePerMode.insert": "line", + "vim.cursorStylePerMode.normal": "block", + "vim.cursorStylePerMode.replace": "block-outline", + "vim.cursorStylePerMode.visual": "underline", + "vim.cursorStylePerMode.visualblock": "underline", + "vim.cursorStylePerMode.visualline": "underline", + "vim.normalModeKeyBindingsNonRecursive": [ + { + "before": [ + "h" + ], + "after": [ + "h" + ] + }, + { + "before": [ + "n" + ], + "after": [ + "j" + ] + }, + { + "before": [ + "e" + ], + "after": [ + "k" + ] + }, + { + "before": [ + "i" + ], + "after": [ + "l" + ] + }, + { + "before": [ + "l" + ], + "after": [ + "b" + ] + }, + { + "before": [ + "L" + ], + "after": [ + "B" + ] + }, + { + "before": [ + "u" + ], + "after": [ + "e" + ] + }, + { + "before": [ + "U" + ], + "after": [ + "E" + ] + }, + { + "before": [ + "y" + ], + "after": [ + "W" + ] + }, + { + "before": [ + "Y" + ], + "after": [ + "W" + ] + }, + { + "before": [ + "s" + ], + "after": [ + "i" + ] + }, + { + "before": [ + "S" + ], + "after": [ + "I" + ] + }, + { + "before": [ + "t" + ], + "after": [ + "a" + ] + }, + { + "before": [ + "T" + ], + "after": [ + "A" + ] + }, + { + "before": [ + "w" + ], + "after": [ + "c" + ] + }, + { + "before": [ + "W" + ], + "after": [ + "C" + ] + }, + { + "before": [ + "ww" + ], + "after": [ + "cc" + ] + }, + { + "before": [ + "x" + ], + "after": [ + "x" + ] + }, + { + "before": [ + "c" + ], + "after": [ + "y" + ] + }, + { + "before": [ + "v" + ], + "after": [ + "p" + ] + }, + { + "before": [ + "X" + ], + "after": [ + "dd" + ] + }, + { + "before": [ + "C" + ], + "after": [ + "yy" + ] + }, + { + "before": [ + "V" + ], + "after": [ + "P" + ] + }, + { + "before": [ + "gv" + ], + "after": [ + "gp" + ] + }, + { + "before": [ + "gV" + ], + "after": [ + "gP" + ] + }, + { + "before": [ + "z" + ], + "after": [ + "u" + ] + }, + { + "before": [ + "gz" + ], + "after": [ + "U" + ] + }, + { + "before": [ + "Z" + ], + "after": [ + "" + ] + }, + { + "before": [ + "a" + ], + "after": [ + "v" + ] + }, + { + "before": [ + "A" + ], + "after": [ + "V" + ] + }, + { + "before": [ + "ga" + ], + "after": [ + "gv" + ] + }, + { + "before": [ + "p" + ], + "after": [ + "t" + ] + }, + { + "before": [ + "P" + ], + "after": [ + "T" + ] + }, + { + "before": [ + "b" + ], + "after": [ + ";" + ] + }, + { + "before": [ + "B" + ], + "after": [ + "," + ] + }, + { + "before": [ + "k" + ], + "after": [ + "n" + ] + }, + { + "before": [ + "K" + ], + "after": [ + "N" + ] + }, + { + "before": [ + "j" + ], + "after": [ + "z" + ] + }, + { + "before": [ + "jn" + ], + "after": [ + "zj" + ] + }, + { + "before": [ + "je" + ], + "after": [ + "zk" + ] + }, + { + "before": [ + "gX" + ], + "after": [ + "X" + ] + }, + { + "before": [ + "gK" + ], + "after": [ + "K" + ] + }, + { + "before": [ + "gL" + ], + "after": [ + "L" + ] + }, + { + "before": [ + "h" + ], + "after": [ + "h" + ] + }, + { + "before": [ + "n" + ], + "after": [ + "j" + ] + }, + { + "before": [ + "e" + ], + "after": [ + "k" + ] + }, + { + "before": [ + "i" + ], + "after": [ + "l" + ] + } + ], + "vim.textwidth": 120, + "vim.visualModeKeyBindingsNonRecursive": [ + { + "before": [ + "h" + ], + "after": [ + "h" + ] + }, + { + "before": [ + "n" + ], + "after": [ + "j" + ] + }, + { + "before": [ + "e" + ], + "after": [ + "k" + ] + }, + { + "before": [ + "i" + ], + "after": [ + "l" + ] + }, + { + "before": [ + "l" + ], + "after": [ + "b" + ] + }, + { + "before": [ + "L" + ], + "after": [ + "B" + ] + }, + { + "before": [ + "u" + ], + "after": [ + "e" + ] + }, + { + "before": [ + "U" + ], + "after": [ + "E" + ] + }, + { + "before": [ + "y" + ], + "after": [ + "W" + ] + }, + { + "before": [ + "Y" + ], + "after": [ + "W" + ] + }, + { + "before": [ + "w" + ], + "after": [ + "c" + ] + }, + { + "before": [ + "W" + ], + "after": [ + "C" + ] + }, + { + "before": [ + "x" + ], + "after": [ + "x" + ] + }, + { + "before": [ + "c" + ], + "after": [ + "y" + ] + }, + { + "before": [ + "v" + ], + "after": [ + "p" + ] + }, + { + "before": [ + "X" + ], + "after": [ + "d" + ] + }, + { + "before": [ + "C" + ], + "after": [ + "y" + ] + }, + { + "before": [ + "V" + ], + "after": [ + "P" + ] + }, + { + "before": [ + "gv" + ], + "after": [ + "gp" + ] + }, + { + "before": [ + "gV" + ], + "after": [ + "gP" + ] + }, + { + "before": [ + "z" + ], + "after": [ + ":undo" + ] + }, + { + "before": [ + "gz" + ], + "after": [ + ":undo" + ] + }, + { + "before": [ + "Z" + ], + "after": [ + ":redo" + ] + }, + { + "before": [ + "a" + ], + "after": [ + "v" + ] + }, + { + "before": [ + "A" + ], + "after": [ + "V" + ] + }, + { + "before": [ + " s" + ], + "after": [ + "(mode() =~# \"[V]\" ? \"0o$I\" : \"I\"" + ] + }, + { + "before": [ + " S" + ], + "after": [ + "(mode() =~# \"[V]\" ? \"0o$I\" : \"I\"" + ] + }, + { + "before": [ + " t" + ], + "after": [ + "(mode() =~# \"[V]\" ? \"0o$A\" : \"I\"" + ] + }, + { + "before": [ + " T" + ], + "after": [ + "(mode() =~# \"[V]\" ? \"0o$A\" : \"I\"" + ] + }, + { + "before": [ + "p" + ], + "after": [ + "t" + ] + }, + { + "before": [ + "P" + ], + "after": [ + "T" + ] + }, + { + "before": [ + "b" + ], + "after": [ + ";" + ] + }, + { + "before": [ + "B" + ], + "after": [ + "," + ] + }, + { + "before": [ + "k" + ], + "after": [ + "n" + ] + }, + { + "before": [ + "K" + ], + "after": [ + "N" + ] + }, + { + "before": [ + "j" + ], + "after": [ + "z" + ] + }, + { + "before": [ + "jn" + ], + "after": [ + "zj" + ] + }, + { + "before": [ + "je" + ], + "after": [ + "zk" + ] + }, + { + "before": [ + "gX" + ], + "after": [ + "X" + ] + }, + { + "before": [ + "gK" + ], + "after": [ + "K" + ] + }, + { + "before": [ + "gL" + ], + "after": [ + "L" + ] + }, + { + "before": [ + "h" + ], + "after": [ + "h" + ] + }, + { + "before": [ + "n" + ], + "after": [ + "j" + ] + }, + { + "before": [ + "e" + ], + "after": [ + "k" + ] + }, + { + "before": [ + "i" + ], + "after": [ + "l" + ] + } + ], + "vsicons.dontShowNewVersionMessage": true, + "window.titleBarStyle": "custom", + "workbench.colorTheme": "Monokai Pro", + "workbench.editor.enablePreviewFromQuickOpen": false, + "workbench.editorAssociations": { + "*.ipynb": "jupyter.notebook.ipynb" + }, + "workbench.enableExperiments": false, + "workbench.iconTheme": "Monokai Pro Icons", + "workbench.preferredDarkColorTheme": "Monokai Pro", + "workbench.startupEditor": "newUntitledFile" +} \ No newline at end of file diff --git a/machines/loki/configuration.nix b/machines/loki/configuration.nix index b94d54c..5636d1c 100644 --- a/machines/loki/configuration.nix +++ b/machines/loki/configuration.nix @@ -22,6 +22,11 @@ # inherit (users) users; # enable = true; # }; + livebook = { + enable = true; + dataDir = "/home/erwin/workspace/livebook"; + userMapping = "1000:100"; + }; networking = { enable = true; dhcpInterfaces = [ "enp4s0" ]; diff --git a/machines/loki/hardware-configuration.nix b/machines/loki/hardware-configuration.nix index 59cd64f..50cc5c2 100644 --- a/machines/loki/hardware-configuration.nix +++ b/machines/loki/hardware-configuration.nix @@ -11,7 +11,7 @@ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.kernelModules = [ "kvm-amd" "apple-mfi-fastcharge" ]; boot.extraModulePackages = [ ]; fileSystems."/" = diff --git a/modules/livebook/default.nix b/modules/livebook/default.nix new file mode 100644 index 0000000..ba95f9b --- /dev/null +++ b/modules/livebook/default.nix @@ -0,0 +1,39 @@ +{ pkgs, config, lib, ... }: +with lib; +let + cfg = config.eboskma.livebook; +in +{ + options.eboskma.livebook = { + enable = mkEnableOption "Start a livebook container"; + dataDir = mkOption { + description = "Livebook data directory"; + type = types.path; + }; + userMapping = mkOption { + description = "User to run the container as"; + type = types.str; + }; + }; + + config = mkIf (cfg.enable) { + eboskma.docker.enable = true; + + virtualisation.oci-containers.containers = { + livebook = { + autoStart = true; + image = "livebook/livebook"; + ports = [ + "8080:8080" + ]; + volumes = [ + "${cfg.dataDir}:/data" + ]; + extraOptions = [ + "--pull=always" + "--user=${cfg.userMapping}" + ]; + }; + }; + }; +}