From b78ad12e00d333355312cd294dabfd0ed4ccface Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Mon, 9 Oct 2023 21:35:30 -0400 Subject: [PATCH] still trying to set up helix --- flake.lock | 36 +++++++++++------------------------- flake.nix | 15 ++++++--------- programs/helix.nix | 37 ++++++++++++++++++++++++++++++------- 3 files changed, 47 insertions(+), 41 deletions(-) diff --git a/flake.lock b/flake.lock index bcae00b..b1d209c 100644 --- a/flake.lock +++ b/flake.lock @@ -4,15 +4,15 @@ "inputs": { "flake-compat": "flake-compat", "flake-utils": [ - "helix-master", + "helix", "flake-utils" ], "nixpkgs": [ - "helix-master", + "helix", "nixpkgs" ], "rust-overlay": [ - "helix-master", + "helix", "rust-overlay" ] }, @@ -64,11 +64,13 @@ "type": "github" } }, - "helix-master": { + "helix": { "inputs": { "crane": "crane", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "rust-overlay": "rust-overlay" }, "locked": { @@ -107,22 +109,6 @@ } }, "nixpkgs": { - "locked": { - "lastModified": 1690272529, - "narHash": "sha256-MakzcKXEdv/I4qJUtq/k/eG+rVmyOZLnYNC2w1mB59Y=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "ef99fa5c5ed624460217c31ac4271cfb5cb2502c", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { "locked": { "lastModified": 1696604326, "narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=", @@ -140,19 +126,19 @@ }, "root": { "inputs": { - "helix-master": "helix-master", + "helix": "helix", "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" } }, "rust-overlay": { "inputs": { "flake-utils": [ - "helix-master", + "helix", "flake-utils" ], "nixpkgs": [ - "helix-master", + "helix", "nixpkgs" ] }, diff --git a/flake.nix b/flake.nix index c5aac7f..1dccc15 100644 --- a/flake.nix +++ b/flake.nix @@ -4,23 +4,20 @@ inputs = { # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - helix-master.url = "github:helix-editor/helix/master"; + helix = { + url = "github:helix-editor/helix/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = inputs @ { nixpkgs, home-manager, helix-master, ... }: + outputs = inputs @ { nixpkgs, home-manager, ... }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; - # pkgs = import nixpkgs { - # inherit system; - # config = { - # allowUnfree = true; - # }; - # }; in { homeConfigurations."tacocat" = home-manager.lib.homeManagerConfiguration { inherit pkgs; @@ -35,7 +32,7 @@ # Optionally use extraSpecialArgs # to pass through arguments to home.nix - extraSpecialArgs = {inherit inputs system helix-master;}; + extraSpecialArgs = {inherit inputs system;}; }; }; } diff --git a/programs/helix.nix b/programs/helix.nix index f49b47c..f648510 100644 --- a/programs/helix.nix +++ b/programs/helix.nix @@ -1,9 +1,9 @@ -{ config, pkgs, helix-master, ... }: +{ config, pkgs, inputs, ... }: { programs.helix = { enable = true; - package = helix-master.packages."x86_64-linux".default; + package = inputs.helix.packages."x86_64-linux".default; settings = { theme = "rose_pine_moon"; editor = { @@ -15,22 +15,45 @@ auto-format = false; idle-timeout = 400; color-modes = true; -# gutters = [ "diff" "diagnostics" "line-numbers" "spacer" ]; -# gutters.layout = [ "diff" "diagnostics" "line-numbers" "spacer" ]; + soft-wrap.enable = true; whitespace = { render = { - space = "all"; + space = "none"; tab = "none"; newline = "none"; }; }; - indent-guides = { render = true; character = "▏"; }; - }; }; + languages = { + language = [{ + name = "nix"; + scope = "flake.nix"; + roots = [ "flake.nix" "flake.lock" ]; + injection-regex = "nix"; + auto-format = false; + file-types = [ "nix" ]; + comment-token = "#"; + indent = { + tab-width = 2; + unit = " "; + }; + language-servers = [ "${pkgs.nil}" ]; + formatter = { + command = "${pkgs.nixpkgs-fmt}"; + }; + }]; +# grammar = [{ +# name = "nix"; +# source = { +# git = "https://github.com/nix-community/tree-sitter-nix"; +# rev = "66e3e9ce9180ae08fc57372061006ef83f0abde7"; +# }; +# }]; + }; }; }