diff --git a/.gitignore b/.gitignore index 07cc058..b1f0d86 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ !modules/ !modules/common/ +!modules/common/helix/ !modules/common/nushell/ !modules/common/ssh/ !modules/darwin/ diff --git a/flake.lock b/flake.lock index 2d0ba17..34e9830 100644 --- a/flake.lock +++ b/flake.lock @@ -14,11 +14,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1723293904, - "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "lastModified": 1736955230, + "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", "owner": "ryantm", "repo": "agenix", - "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", "type": "github" }, "original": { @@ -53,11 +53,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1736318091, - "narHash": "sha256-RkRHXZaMgOMGgkW2YmEqxxDDYRiGFbfr1JuaI0VrCKo=", + "lastModified": 1739082714, + "narHash": "sha256-cylMa750pId3Hqvzyurd86qJIYyyMWB0M7Gbh7ZB2tY=", "owner": "nix-community", "repo": "fenix", - "rev": "9e13860d50cbfd42e79101a516e1939c7723f093", + "rev": "e84058a7fe56aa01f2db19373cce190098494698", "type": "github" }, "original": { @@ -66,43 +66,6 @@ "type": "github" } }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems_2" @@ -139,37 +102,6 @@ "type": "github" } }, - "git-hooks-nix": { - "inputs": { - "flake-compat": [ - "nix" - ], - "gitignore": [ - "nix" - ], - "nixpkgs": [ - "nix", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1734279981, - "narHash": "sha256-NdaCraHPp8iYMWzdXAt5Nv6sA3MUzlCiGiR586TCwo0=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "aa9f40c906904ebd83da78e7f328cd8aeaeae785", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -177,11 +109,11 @@ ] }, "locked": { - "lastModified": 1736421950, - "narHash": "sha256-RyrX0WFXxFrYvzHNLTIyuk3NcNl3UBykuYru/P0zW5E=", + "lastModified": 1739051380, + "narHash": "sha256-p1QSLO8DJnANY+ppK7fjD8GqfCrEIDjso1CSRHsXL7Y=", "owner": "nix-community", "repo": "home-manager", - "rev": "d4aebb947a301b8da8654a804979a738c5c5da50", + "rev": "5af1b9a0f193ab6138b89a8e0af8763c21bbf491", "type": "github" }, "original": { @@ -199,11 +131,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1738673966, - "narHash": "sha256-05ae98oBGt8JeI6PkNXbmuS64cftTbW6MpDkUYZ3rq0=", + "lastModified": 1739043245, + "narHash": "sha256-WmlACEj2OB7XpBYEyvUZiEcSoCXLtRVqJ2UYLBtICGw=", "owner": "jj-vcs", "repo": "jj", - "rev": "e995f7eec2c07010ff16e8f0f717771396c81292", + "rev": "07c63ed182bb1cbd9b52fe8e4f41638bdb5aafb6", "type": "github" }, "original": { @@ -232,29 +164,6 @@ "type": "github" } }, - "nix": { - "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", - "git-hooks-nix": "git-hooks-nix", - "nixpkgs": "nixpkgs_3", - "nixpkgs-23-11": "nixpkgs-23-11", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1736440804, - "narHash": "sha256-3cmTOPnZuDEGBtttZXPbads+kmIP1RHrqzjHxqYKWD0=", - "owner": "NixOS", - "repo": "nix", - "rev": "2d9b213cc2b4284f8432aa3883b15d390c665db4", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nix", - "type": "github" - } - }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -262,11 +171,11 @@ ] }, "locked": { - "lastModified": 1736370755, - "narHash": "sha256-iWcjToBpx4PUd74uqvIGAfqqVfyrvRLRauC/SxEKIF0=", + "lastModified": 1739034224, + "narHash": "sha256-Mj/8jDzh1KNmUhWqEeVlW3hO9MZkxqioJGnmR7rivaE=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "57733bd1dc81900e13438e5b4439239f1b29db0e", + "rev": "0b6f96a6b9efcfa8d3cc8023008bcbcd1b9bc1a4", "type": "github" }, "original": { @@ -277,11 +186,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1736012469, - "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", + "lastModified": 1739020877, + "narHash": "sha256-mIvECo/NNdJJ/bXjNqIh8yeoSjVLAuDuTUzAo7dzs8Y=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", + "rev": "a79cfe0ebd24952b580b1cf08cd906354996d547", "type": "github" }, "original": { @@ -291,38 +200,6 @@ "type": "github" } }, - "nixpkgs-23-11": { - "locked": { - "lastModified": 1717159533, - "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1731890469, @@ -341,27 +218,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1734359947, - "narHash": "sha256-1Noao/H+N8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E=", + "lastModified": 1739097848, + "narHash": "sha256-bbdQB0Y4mB2msqbyQ9QC+YPDZGt1evUK53AwQSyShHM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "48d12d5e70ee91fe8481378e540433a7303dbf6a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1736453036, - "narHash": "sha256-pg+bsDf72cTh5fkqoMdnReljXdo4CovuLktzwZfl1CA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "271ad8a6123201357e397df692314026ac87f89c", + "rev": "9a0b855695c31ea653181b742c65e026bada3881", "type": "github" }, "original": { @@ -378,20 +239,19 @@ "home-manager": "home-manager", "jj": "jj", "nil": "nil", - "nix": "nix", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_3", "themes": "themes" } }, "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1736266405, - "narHash": "sha256-V2FDSb8YjuquZduBRNp5niWYlWurja2yGN6Xzh5GPYk=", + "lastModified": 1738997488, + "narHash": "sha256-jeNdFVtEDLypGIbNqBjURovfw9hMkVtlLR7j/5fRh54=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "91fc0a239af4e56b84b1d3974ac0f34dcc99b895", + "rev": "208bc52b5dc177badc081c64eb0584a313c73242", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9c5cd5d..319291a 100644 --- a/flake.nix +++ b/flake.nix @@ -56,7 +56,7 @@ fenix.url = "github:nix-community/fenix"; - nix.url = "github:NixOS/nix"; + # nix.url = "github:NixOS/nix"; nil.url = "github:oxalica/nil"; jj = { diff --git a/modules/common/git.nix b/modules/common/git.nix index b2f1d72..85e06dd 100644 --- a/modules/common/git.nix +++ b/modules/common/git.nix @@ -63,9 +63,9 @@ in { gst = "git status"; } <| mkIf config.isDesktop { - "\"??\"" = "gh copilot suggest --target shell"; - "\"gh?\"" = "gh copilot suggest --target gh"; - "\"git?\"" = "gh copilot suggest --target git"; + "??" = "gh copilot suggest --target shell --"; + "gh?" = "gh copilot suggest --target gh --"; + "git?" = "gh copilot suggest --target git --"; }; environment.systemPackages = [ diff --git a/modules/common/helix.nix b/modules/common/helix/default.nix similarity index 60% rename from modules/common/helix.nix rename to modules/common/helix/default.nix index f81b697..d1edc0f 100644 --- a/modules/common/helix.nix +++ b/modules/common/helix/default.nix @@ -6,25 +6,25 @@ in { shellAliases.x = "hx"; }; - nixpkgs.overlays = [(self: super: { - helix = super.helix.overrideAttrs (old: { - version = "25.01.1"; + # nixpkgs.overlays = [(self: super: { + # helix = super.helix.overrideAttrs (old: { + # version = "25.01.1"; - src = self.fetchzip { - url = "https://github.com/cull-os/helix/releases/download/ci-release-25.01.1/helix-ci-release-25.01.1-source.tar.xz"; - hash = "sha256-bvlzXRAdPvz8P49KENSw9gupQNaUm/+3eZZ1q7+fTsw="; - stripRoot = false; - }; + # src = self.fetchzip { + # url = "https://github.com/cull-os/helix/releases/download/ci-release-25.01.1/helix-ci-release-25.01.1-source.tar.xz"; + # hash = "sha256-bvlzXRAdPvz8P49KENSw9gupQNaUm/+3eZZ1q7+fTsw="; + # stripRoot = false; + # }; - # TODO: Delete this as this was fixed on latest unstable. - preVersionCheck = ""; + # # TODO: Delete this as this was fixed on latest unstable. + # preVersionCheck = ""; - cargoDeps = super.helix.cargoDeps.overrideAttrs (_: { - inherit (self.helix) src; - outputHash = "sha256-O5ECrKyF9x5r7w9wMIqbYYuGFIeUaRgtzDfYK9dFjp4="; - }); - }); - })]; + # cargoDeps = super.helix.cargoDeps.overrideAttrs (_: { + # inherit (self.helix) src; + # outputHash = "sha256-O5ECrKyF9x5r7w9wMIqbYYuGFIeUaRgtzDfYK9dFjp4="; + # }); + # }); + # })]; home-manager.sharedModules = [{ @@ -68,11 +68,6 @@ in { formatter = prettier name; }) [ "css" "scss" "yaml" ]; in denoFormatterLanguages ++ prettierLanguages ++ [ - { - name = "nix"; - auto-format = false; - formatter.command = "alejandra"; - } { name = "html"; # Added vto. @@ -104,33 +99,74 @@ in { formatter = denoFormatter "tsx"; language-servers = [ "deno" ]; } + + # NON-DENO + { + name = "nix"; + auto-format = false; + formatter.command = "alejandra"; + } + + { + name = "rust"; + + debugger.name = "lldb-dap"; + debugger.transport = "stdio"; + debugger.command = "lldb-dap"; + + debugger.templates = [{ + name = "binary"; + request = "launch"; + + completion = [{ + name = "binary"; + completion = "filename"; + }]; + + args.program = "{0}"; + args.initCommands = [ "command script import ${pkgs.writeText "lldb_dap_rustc_primer.py" '' + import subprocess + import pathlib + import lldb + + # Not hardcoding a nix store path here on purpose. + rustlib_etc = pathlib.Path(subprocess.getoutput("rustc --print sysroot")) / "lib" / "rustlib" / "etc" + if not rustlib_etc.exists(): + raise RuntimeError("Unable to determine rustc sysroot") + + # Load lldb_lookup.py and execute lldb_commands with the correct path + lldb.debugger.HandleCommand(f"""command script import "{rustlib_etc / 'lldb_lookup.py'}" """) + lldb.debugger.HandleCommand(f"""command source -s 0 "{rustlib_etc / 'lldb_commands'}" """) + ''}" ]; + }]; + } ]; - languages.language-server = { - deno = { - command = "deno"; - args = [ "lsp" ]; + languages.language-server.deno = { + command = "deno"; + args = [ "lsp" ]; - environment.NO_COLOR = "1"; + environment.NO_COLOR = "1"; - config.javascript = enabled { - lint = true; - unstable = true; + config.javascript = enabled { + lint = true; + unstable = true; - suggest.imports.hosts."https://deno.land" = true; + suggest.imports.hosts."https://deno.land" = true; - inlayHints = { - enumMemberValues.enabled = true; - functionLikeReturnTypes.enabled = true; - parameterNames.enabled = "all"; - parameterTypes.enabled = true; - propertyDeclarationTypes.enabled = true; - variableTypes.enabled = true; - }; + inlayHints = { + enumMemberValues.enabled = true; + functionLikeReturnTypes.enabled = true; + parameterNames.enabled = "all"; + parameterTypes.enabled = true; + propertyDeclarationTypes.enabled = true; + variableTypes.enabled = true; }; }; + }; - rust-analyzer.config.check.command = "clippy"; + languages.language-server.rust-analyzer = { + config.check.command = "clippy"; }; settings.theme = "gruvbox_dark_hard"; @@ -203,6 +239,7 @@ in { # RUST pkgs.rust-analyzer-nightly + pkgs.lldb_20 # TYPESCRIPT & OTHERS pkgs.deno @@ -214,4 +251,3 @@ in { pkgs.zls ]; } - diff --git a/modules/common/nushell/configuration.nu b/modules/common/nushell/configuration.nu index eb19838..87c7c42 100644 --- a/modules/common/nushell/configuration.nu +++ b/modules/common/nushell/configuration.nu @@ -151,11 +151,6 @@ $env.config.completions = { } } -$env.config.filesize = { - format: auto - metric: true -} - $env.config.cursor_shape = { vi_insert: line vi_normal: block diff --git a/modules/common/nushell/default.nix b/modules/common/nushell/default.nix index 2c382ba..af8bb5b 100644 --- a/modules/common/nushell/default.nix +++ b/modules/common/nushell/default.nix @@ -26,21 +26,21 @@ in { environment.variables.STARSHIP_LOG = "error"; - nixpkgs.overlays = [(self: super: { - starship = super.starship.overrideAttrs (old: { - src = self.fetchFromGitHub { - owner = "poliorcetics"; - repo = "starship"; - rev = "19926e1e0aa25eddf63f93ba270d60eef023338f"; - hash = "sha256-mi2O8JzXNLIF0/GuXVyf27JVV7d6zoskIjB29r5fPso="; - }; + # nixpkgs.overlays = [(self: super: { + # starship = super.starship.overrideAttrs (old: { + # src = self.fetchFromGitHub { + # owner = "poliorcetics"; + # repo = "starship"; + # rev = "19926e1e0aa25eddf63f93ba270d60eef023338f"; + # hash = "sha256-mi2O8JzXNLIF0/GuXVyf27JVV7d6zoskIjB29r5fPso="; + # }; - cargoDeps = super.starship.cargoDeps.overrideAttrs (_: { - inherit (self.starship) src; - outputHash = "sha256-3NJV+hsgX3H8pycso0gCdzxJg8SgVwGMbIoHDDRZBvY="; - }); - }); - })]; + # cargoDeps = super.starship.cargoDeps.overrideAttrs (_: { + # inherit (self.starship) src; + # outputHash = "sha256-3NJV+hsgX3H8pycso0gCdzxJg8SgVwGMbIoHDDRZBvY="; + # }); + # }); + # })]; home-manager.sharedModules = [(homeArgs: let homeConfig = homeArgs.config;