From 8dbe62606b418932532aa036df636e5697f72d13 Mon Sep 17 00:00:00 2001 From: materus Date: Mon, 4 Nov 2024 20:15:41 +0100 Subject: [PATCH] configurations: update vscode config --- .../Old-materusPC/home/materus/default.nix | 74 +-------- configurations/profile/home/editor/code.nix | 143 ++++++++++++++++-- flake.lock | 122 +++++++-------- 3 files changed, 190 insertions(+), 149 deletions(-) diff --git a/configurations/host/Old-materusPC/home/materus/default.nix b/configurations/host/Old-materusPC/home/materus/default.nix index 158a94d..e7ef7bd 100644 --- a/configurations/host/Old-materusPC/home/materus/default.nix +++ b/configurations/host/Old-materusPC/home/materus/default.nix @@ -50,79 +50,7 @@ enableTerminalExtra = lib.mkDefault true; enableNixDevel = lib.mkDefault true; editor.code.fhs.enable = false; - editor.code.fhs.extensions = - let - ext = (materusCfg.configInputs.nix-vscode-extensions.extensions."${materusCfg.arch}".forVSCodeVersion - config.programs.vscode.package.version); - in - with ext; - with pkgs; - [ - #Cpp - open-vsx.twxs.cmake - vscode-extensions.ms-vscode.cpptools - vscode-marketplace.ms-vscode.cmake-tools - vscode-marketplace.cs128.cs128-clang-tidy - - #Python - vscode-marketplace.ms-python.python - vscode-marketplace.ms-python.vscode-pylance - vscode-marketplace.ms-python.debugpy - - # CSharp - open-vsx.muhammad-sammy.csharp - - - #Java - open-vsx.redhat.java - open-vsx.vscjava.vscode-java-debug - - #DLang - open-vsx.webfreak.code-d - - - #Nix - open-vsx.jnoortheen.nix-ide - - #Web - open-vsx.ecmel.vscode-html-css - open-vsx.formulahendry.auto-close-tag - - #Lua - open-vsx.sumneko.lua - - #YAML, XML - open-vsx.redhat.vscode-yaml - open-vsx.redhat.vscode-xml - - #Git - open-vsx.donjayamanne.githistory - open-vsx.mhutchie.git-graph - open-vsx.eamodio.gitlens - - #Other - open-vsx.ms-azuretools.vscode-docker - open-vsx.webfreak.debug - open-vsx.mkhl.direnv - vscode-marketplace.ms-vscode-remote.remote-ssh - vscode-marketplace.ms-vscode-remote.remote-containers - open-vsx.esbenp.prettier-vscode - open-vsx.formulahendry.code-runner - open-vsx.leonardssh.vscord - open-vsx.ms-vscode.hexeditor - open-vsx.alefragnani.project-manager - vscode-marketplace.cantonios.project-templates - - #Icons - open-vsx.pkief.material-icon-theme - open-vsx.pkief.material-product-icons - #Themes - open-vsx.dracula-theme.theme-dracula - - #Languages - vscode-marketplace.ms-ceintl.vscode-language-pack-pl - - ]; + editor.code.fhs.packages = (ps: with ps; let llvmpkgs = llvmPackages_16; in [ llvmpkgs.clang llvmpkgs.llvm diff --git a/configurations/profile/home/editor/code.nix b/configurations/profile/home/editor/code.nix index f52b9d9..fda4843 100644 --- a/configurations/profile/home/editor/code.nix +++ b/configurations/profile/home/editor/code.nix @@ -1,20 +1,141 @@ -{ config, lib, pkgs, materusArg, ... }: +{ config, lib, pkgs, materusArg, materusCfg, ... }: let cfg = config.materus.profile.editor.code; -in -{ - options.materus.profile.editor.code.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable VSCodium with materus cfg"; - options.materus.profile.editor.code.fhs.enable = materusArg.pkgs.lib.mkBoolOpt false "Use fhs vscodium"; - options.materus.profile.editor.code.fhs.packages = lib.mkOption { default = (ps: [ ]); }; - options.materus.profile.editor.code.fhs.extensions = lib.mkOption { default = []; }; + ext = let + market = + (materusCfg.configInputs.nix-vscode-extensions.extensions."${materusCfg.arch}".forVSCodeVersion + config.programs.vscode.package.version); + marketNv = + (materusCfg.configInputs.nix-vscode-extensions.extensions."${materusCfg.arch}"); + in with market; + with pkgs; [ + #Cpp + open-vsx.twxs.cmake + vscode-extensions.ms-vscode.cpptools + vscode-marketplace.ms-vscode.cmake-tools + vscode-marketplace.cs128.cs128-clang-tidy + + #Python + vscode-marketplace.ms-python.python + vscode-marketplace.ms-python.vscode-pylance + vscode-marketplace.ms-python.debugpy + + # CSharp + open-vsx.muhammad-sammy.csharp + + #Java + open-vsx.redhat.java + open-vsx.vscjava.vscode-java-debug + + #DLang + open-vsx.webfreak.code-d + + #Nix + open-vsx.jnoortheen.nix-ide + + #Web + open-vsx.ecmel.vscode-html-css + open-vsx.formulahendry.auto-close-tag + + #Lua + open-vsx.sumneko.lua + + #YAML, XML + open-vsx.redhat.vscode-yaml + open-vsx.redhat.vscode-xml + + #Git + open-vsx.donjayamanne.githistory + open-vsx.mhutchie.git-graph + open-vsx.eamodio.gitlens + + #Other + open-vsx.ms-azuretools.vscode-docker + open-vsx.webfreak.debug + open-vsx.mkhl.direnv + vscode-marketplace.ms-vscode-remote.remote-ssh + vscode-marketplace.ms-vscode-remote.remote-containers + open-vsx.esbenp.prettier-vscode + open-vsx.formulahendry.code-runner + open-vsx.leonardssh.vscord + open-vsx.ms-vscode.hexeditor + open-vsx.alefragnani.project-manager + vscode-marketplace.cantonios.project-templates + + #Icons + open-vsx.pkief.material-icon-theme + open-vsx.pkief.material-product-icons + #Themes + open-vsx.dracula-theme.theme-dracula + open-vsx.ahmadawais.shades-of-purple + + #Languages + marketNv.vscode-marketplace.ms-ceintl.vscode-language-pack-pl + + ]; + set = { + "vscord.app.name" = lib.mkDefault "VSCodium"; + "window.dialogStyle" = lib.mkDefault "custom"; + "window.titleBarStyle" = lib.mkDefault "custom"; + "editor.fontFamily" = + lib.mkDefault "'Hack Nerd Font', 'monospace', monospace"; + "workbench.colorTheme" = lib.mkDefault "Shades of Purple"; + "workbench.productIconTheme" = lib.mkDefault "material-product-icons"; + "workbench.iconTheme" = lib.mkDefault "material-icon-theme"; + + "d.aggressiveUpdate" = lib.mkDefault false; + "d.servedPath" = lib.mkDefault "${pkgs.serve-d}/bin/serve-d"; + + "direnv.path.executable" = lib.mkDefault "${pkgs.direnv}/bin/direnv"; + + "nix.enableLanguageServer" = lib.mkDefault true; + "nix.serverPath" = lib.mkDefault "${pkgs.nixd}/bin/nixd"; + "nix.formatterPath" = lib.mkDefault "${pkgs.nixfmt-classic}/bin/nixfmt"; + "nix.serverSettings" = { + "nixd" = { "formatting" = { "command" = lib.mkDefault [ "nixfmt" ]; }; }; + }; + + "C_Cpp.clang_format_path" = + lib.mkDefault "${pkgs.clang-tools}/bin/clang-format"; + "C_Cpp.clang_format_fallbackStyle" = lib.mkDefault "Microsoft"; + "clang-tidy.executable" = + lib.mkDefault "${pkgs.clang-tools}/bin/clang-tidy"; + "redhat.telemetry.enabled" = lib.mkDefault false; + "python.defaultInterpreterPath" = + lib.mkDefault "${pkgs.python3Full}/bin/python"; + "[cpp]" = { + "editor.defaultFormatter" = lib.mkDefault "xaver.clang-format"; + }; + + }; +in { + options.materus.profile.editor.code.enable = + materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop + "Enable VSCodium with materus cfg"; + options.materus.profile.editor.code.fhs.enable = + materusArg.pkgs.lib.mkBoolOpt false "Use fhs vscodium"; + options.materus.profile.editor.code.fhs.packages = + lib.mkOption { default = (ps: [ ]); }; + options.materus.profile.editor.code.extensions = + lib.mkOption { default = [ ]; }; + options.materus.profile.editor.code.settings = + lib.mkOption { default = { }; }; config = lib.mkIf cfg.enable { + materus.profile.editor.code.extensions = ext; + materus.profile.editor.code.settings = set; programs.vscode = { enable = lib.mkDefault true; - package = lib.mkDefault (if (cfg.fhs.enable) then (pkgs.vscodium.fhsWithPackages cfg.fhs.packages) else pkgs.vscodium); - mutableExtensionsDir = lib.mkDefault config.materus.profile.editor.code.fhs.enable; - extensions = lib.mkDefault config.materus.profile.editor.code.fhs.extensions; - enableExtensionUpdateCheck = lib.mkDefault config.materus.profile.editor.code.fhs.enable; + package = lib.mkDefault (if (cfg.fhs.enable) then + (pkgs.vscodium.fhsWithPackages cfg.fhs.packages) + else + pkgs.vscodium); + mutableExtensionsDir = + lib.mkDefault config.materus.profile.editor.code.fhs.enable; + extensions = lib.mkDefault config.materus.profile.editor.code.extensions; + enableExtensionUpdateCheck = + lib.mkDefault config.materus.profile.editor.code.fhs.enable; enableUpdateCheck = lib.mkDefault false; + userSettings = lib.mkDefault config.materus.profile.editor.code.settings; }; materus.profile.fonts.enable = lib.mkDefault true; }; diff --git a/flake.lock b/flake.lock index f223820..3f8b91d 100644 --- a/flake.lock +++ b/flake.lock @@ -152,10 +152,6 @@ }, "emacs-overlay": { "inputs": { - "flake-utils": [ - "configInputs", - "flake-utils" - ], "nixpkgs": [ "configInputs", "nixpkgs" @@ -163,11 +159,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1730394842, - "narHash": "sha256-g2OJ2m0lhavtek1wGkn0Bj3VCnvzE3GmtLEY3SJaYoM=", + "lastModified": 1730739613, + "narHash": "sha256-UNwS+2868c7B1CcInYTZfCKj+DlChm6BbEL5m/VtbDY=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "cedccfff0d6e1fb9c62f77fb4e05169256219eca", + "rev": "8d1826ba7648bd2704c6beed35a9e9e3327178d1", "type": "github" }, "original": { @@ -179,10 +175,6 @@ }, "emacs-overlay_2": { "inputs": { - "flake-utils": [ - "configInputs-stable", - "flake-utils" - ], "nixpkgs": [ "configInputs-stable", "nixpkgs" @@ -190,11 +182,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1730394842, - "narHash": "sha256-g2OJ2m0lhavtek1wGkn0Bj3VCnvzE3GmtLEY3SJaYoM=", + "lastModified": 1730711584, + "narHash": "sha256-7XpfL6x0or0qH3NjtiujcyUzFrZu72b/pyLCbwk0+2s=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "cedccfff0d6e1fb9c62f77fb4e05169256219eca", + "rev": "ca2129b1d5afb32e46299dc48e03467522352bd5", "type": "github" }, "original": { @@ -387,11 +379,11 @@ ] }, "locked": { - "lastModified": 1730016908, - "narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=", + "lastModified": 1730633670, + "narHash": "sha256-ZFJqIXpvVKvzOVFKWNRDyIyAo+GYdmEPaYi1bZB6uf0=", "owner": "nix-community", "repo": "home-manager", - "rev": "e83414058edd339148dc142a8437edb9450574c8", + "rev": "8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661", "type": "github" }, "original": { @@ -430,11 +422,11 @@ ] }, "locked": { - "lastModified": 1730339415, - "narHash": "sha256-3dbUPDSAteNUvaMh3mh61FBQNhhT9n3XBQH2HK0C8+I=", + "lastModified": 1730685024, + "narHash": "sha256-w0cQSTjLBaUSziPGwyI0nbWVD64+N3ByoSxC0CEZmeI=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "bdda106fe8c2beda62338254783c562bfb5648a2", + "rev": "16ca007ec37c29a8b97e4899f33c013defbdb2f9", "type": "github" }, "original": { @@ -457,11 +449,11 @@ ] }, "locked": { - "lastModified": 1730339415, - "narHash": "sha256-3dbUPDSAteNUvaMh3mh61FBQNhhT9n3XBQH2HK0C8+I=", + "lastModified": 1730685024, + "narHash": "sha256-w0cQSTjLBaUSziPGwyI0nbWVD64+N3ByoSxC0CEZmeI=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "bdda106fe8c2beda62338254783c562bfb5648a2", + "rev": "16ca007ec37c29a8b97e4899f33c013defbdb2f9", "type": "github" }, "original": { @@ -527,11 +519,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1730368399, - "narHash": "sha256-F8vJtG389i9fp3k2/UDYHMed3PLCJYfxCqwiVP7b9ig=", + "lastModified": 1730537918, + "narHash": "sha256-GJB1/aaTnAtt9sso/EQ77TAGJ/rt6uvlP0RqZFnWue8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "da14839ac5f38ee6adbdb4e6db09b5eef6d6ccdc", + "rev": "f6e0cd5c47d150c4718199084e5764f968f1b560", "type": "github" }, "original": { @@ -543,11 +535,11 @@ }, "nixos-hardware_2": { "locked": { - "lastModified": 1730368399, - "narHash": "sha256-F8vJtG389i9fp3k2/UDYHMed3PLCJYfxCqwiVP7b9ig=", + "lastModified": 1730537918, + "narHash": "sha256-GJB1/aaTnAtt9sso/EQ77TAGJ/rt6uvlP0RqZFnWue8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "da14839ac5f38ee6adbdb4e6db09b5eef6d6ccdc", + "rev": "f6e0cd5c47d150c4718199084e5764f968f1b560", "type": "github" }, "original": { @@ -575,11 +567,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1730137625, - "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "lastModified": 1730327045, + "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "rev": "080166c15633801df010977d9d7474b4a6c549d7", "type": "github" }, "original": { @@ -591,11 +583,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1729973466, - "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", + "lastModified": 1730602179, + "narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", + "rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c", "type": "github" }, "original": { @@ -607,11 +599,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1730137625, - "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "lastModified": 1730327045, + "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "rev": "080166c15633801df010977d9d7474b4a6c549d7", "type": "github" }, "original": { @@ -623,11 +615,11 @@ }, "nixpkgs-stable_4": { "locked": { - "lastModified": 1729973466, - "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", + "lastModified": 1730602179, + "narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", + "rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c", "type": "github" }, "original": { @@ -639,11 +631,11 @@ }, "nixpkgs-stable_5": { "locked": { - "lastModified": 1730137625, - "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "lastModified": 1730327045, + "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "rev": "080166c15633801df010977d9d7474b4a6c549d7", "type": "github" }, "original": { @@ -655,11 +647,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1730200266, - "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", "type": "github" }, "original": { @@ -684,11 +676,11 @@ }, "nur_2": { "locked": { - "lastModified": 1730404063, - "narHash": "sha256-ChiDyRLibp0juaAX0UG8+TlMamzz3s2DFaq4OZ902do=", + "lastModified": 1730742119, + "narHash": "sha256-npA4wtBgm9s5C0ElDYkyiBXeBGsxDqT6e7sPGwtDLFc=", "owner": "nix-community", "repo": "NUR", - "rev": "3f56164326915180b00cf69913c248036fa0048c", + "rev": "3c7a45327b6a9f8b02df8d3acf213fd0616d59ef", "type": "github" }, "original": { @@ -713,11 +705,11 @@ }, "nur_4": { "locked": { - "lastModified": 1730404063, - "narHash": "sha256-ChiDyRLibp0juaAX0UG8+TlMamzz3s2DFaq4OZ902do=", + "lastModified": 1730720916, + "narHash": "sha256-sLuyisXE2KkcQ3gai2Y10e7vrddDCnR4n+op9n67AD0=", "owner": "nix-community", "repo": "NUR", - "rev": "3f56164326915180b00cf69913c248036fa0048c", + "rev": "4a9ef04ed3048a17b50a11499e7f08d2ff00080c", "type": "github" }, "original": { @@ -752,11 +744,11 @@ ] }, "locked": { - "lastModified": 1730366788, - "narHash": "sha256-0Ezvv4KkyFdLAblPBFDgZbiMLlJZtpHruT2i4KC2wIY=", + "lastModified": 1730635861, + "narHash": "sha256-Npp3pl9aeAiq+wZPDbw2ZxybNuZWyuN7AY6fik56DCo=", "owner": "nix-community", "repo": "plasma-manager", - "rev": "f634d5f6ee9be365b2ca08b2d00e0e3b0c240b9e", + "rev": "293668587937daae1df085ee36d2b2d0792b7a0f", "type": "github" }, "original": { @@ -778,11 +770,11 @@ ] }, "locked": { - "lastModified": 1730366788, - "narHash": "sha256-0Ezvv4KkyFdLAblPBFDgZbiMLlJZtpHruT2i4KC2wIY=", + "lastModified": 1730635861, + "narHash": "sha256-Npp3pl9aeAiq+wZPDbw2ZxybNuZWyuN7AY6fik56DCo=", "owner": "nix-community", "repo": "plasma-manager", - "rev": "f634d5f6ee9be365b2ca08b2d00e0e3b0c240b9e", + "rev": "293668587937daae1df085ee36d2b2d0792b7a0f", "type": "github" }, "original": { @@ -829,11 +821,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1729999681, - "narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=", + "lastModified": 1730605784, + "narHash": "sha256-1NveNAMLHbxOg0BpBMSVuZ2yW2PpDnZLbZ25wV50PMc=", "owner": "Mic92", "repo": "sops-nix", - "rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56", + "rev": "e9b5eef9b51cdf966c76143e13a9476725b2f760", "type": "github" }, "original": { @@ -852,11 +844,11 @@ "nixpkgs-stable": "nixpkgs-stable_4" }, "locked": { - "lastModified": 1729999681, - "narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=", + "lastModified": 1730605784, + "narHash": "sha256-1NveNAMLHbxOg0BpBMSVuZ2yW2PpDnZLbZ25wV50PMc=", "owner": "Mic92", "repo": "sops-nix", - "rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56", + "rev": "e9b5eef9b51cdf966c76143e13a9476725b2f760", "type": "github" }, "original": {