From 1d98c35cb50faf3407722cb8fdcb7fae5656f0c3 Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Mon, 2 Sep 2024 20:49:14 +0200 Subject: [PATCH] add bun and node --- flake.lock | 62 +++++++++++++++-------------- flake.nix | 5 ++- hosts/chris-pc/default.nix | 1 + modules/desktop/editors/default.nix | 2 +- modules/desktop/editors/kate.nix | 36 +++++++++++++++++ modules/develop/js.nix | 9 +++-- modules/develop/rust.nix | 40 +++++++++---------- 7 files changed, 100 insertions(+), 55 deletions(-) create mode 100644 modules/desktop/editors/kate.nix diff --git a/flake.lock b/flake.lock index fe552ba..96dceab 100644 --- a/flake.lock +++ b/flake.lock @@ -151,6 +151,27 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1725258763, + "narHash": "sha256-7s5RfYlTljWnKGkK4hOMJCJ0sNQoLYjMxezX3Vijy/0=", + "owner": "nix-community", + "repo": "fenix", + "rev": "0774f58cf1025bbb713971deecc7f07c856be6ed", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "firefox": { "inputs": { "cachix": "cachix", @@ -563,22 +584,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1718428119, - "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1723415338, "narHash": "sha256-K/BVeDLkpswRSBh3APxc2gBNVFEMXGpnkuQz666FiTM=", @@ -669,31 +674,30 @@ }, "root": { "inputs": { + "fenix": "fenix", "firefox": "firefox", "home-manager": "home-manager", "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", "plasma-manager": "plasma-manager", - "rust": "rust", "stylix": "stylix" } }, - "rust": { - "inputs": { - "nixpkgs": "nixpkgs_3" - }, + "rust-analyzer-src": { + "flake": false, "locked": { - "lastModified": 1724638882, - "narHash": "sha256-ap2jIQi/FuUHR6HCht6ASWhoz8EiB99XmI8Esot38VE=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "19b70f147b9c67a759e35824b241f1ed92e46694", + "lastModified": 1725191098, + "narHash": "sha256-YH0kH5CSOnAuPUB1BUzUqvnKiv5SgDhfMNjrkki9Ahk=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "779d9eee2ea403da447278a7007c9627c8878856", "type": "github" }, "original": { - "owner": "oxalica", - "repo": "rust-overlay", + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", "type": "github" } }, @@ -710,7 +714,7 @@ "flake-utils": "flake-utils_3", "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_3", "systems": "systems_3" }, "locked": { diff --git a/flake.nix b/flake.nix index 02a402a..27b217d 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,10 @@ stylix.url = "github:danth/stylix"; - rust.url = "github:oxalica/rust-overlay"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, ... }: diff --git a/hosts/chris-pc/default.nix b/hosts/chris-pc/default.nix index 2e2fe6b..c084a64 100644 --- a/hosts/chris-pc/default.nix +++ b/hosts/chris-pc/default.nix @@ -40,6 +40,7 @@ zed.enable = true; nvim.enable = true; nano.enable = true; + kate.enable = true; }; browsers = { diff --git a/modules/desktop/editors/default.nix b/modules/desktop/editors/default.nix index 736aeb2..ed64f54 100644 --- a/modules/desktop/editors/default.nix +++ b/modules/desktop/editors/default.nix @@ -14,7 +14,7 @@ in { inherit (lib.types) nullOr enum; in { default = mkOption { - type = nullOr (enum [ "nano" "nvim" ]); + type = nullOr (enum [ "nano" "nvim" "zed" "kate" ]); default = "nano"; description = "Default editor for text manipulation"; example = "nvim"; diff --git a/modules/desktop/editors/kate.nix b/modules/desktop/editors/kate.nix new file mode 100644 index 0000000..7237542 --- /dev/null +++ b/modules/desktop/editors/kate.nix @@ -0,0 +1,36 @@ +{ config, options, lib, pkgs, ... }: +let + inherit (lib.meta) getExe; + inherit (lib.modules) mkIf; + + cfg = config.modules.desktop.editors.kate; +in +{ + options.modules.desktop.editors.kate = let + inherit (lib.options) mkEnableOption; + in { enable = mkEnableOption "kate"; }; + + config = mkIf cfg.enable { +# programs.kate = { +# enable = true; +# +# editor = { +# brackets.highlightMatching = true; +# +# indent = { +# keepExtraSpaces = false; +# replaceWithSpaces = true; +# showLines = true; +# undoByShiftTab = true; +# +# width = 4; +# tabWidth = 4; +# }; +# }; +# +# lsp = { +# typescript = {}; +# }; +# }; + }; +} diff --git a/modules/develop/js.nix b/modules/develop/js.nix index fe7e59b..e37b760 100644 --- a/modules/develop/js.nix +++ b/modules/develop/js.nix @@ -12,15 +12,16 @@ in config = mkMerge [ (mkIf config.modules.develop.js.enable { - user.packages = attrValues { - }; + user.packages = with pkgs; [ + bun + nodejs + nodePackages_latest.typescript-language-server + ]; }) (mkIf config.modules.develop.xdg.enable { home = { -# sessionVariables.CARGO_HOME = "$XDG_DATA_HOME/cargo"; -# sessionPath = ["$CARGO_HOME/bin"]; }; }) ]; diff --git a/modules/develop/rust.nix b/modules/develop/rust.nix index 919fa1a..29ec559 100644 --- a/modules/develop/rust.nix +++ b/modules/develop/rust.nix @@ -12,25 +12,25 @@ in }; config = mkMerge [ - (mkIf config.modules.develop.rust.enable { - nixpkgs.overlays = [inputs.rust.overlays.default]; - - user.packages = attrValues { - rust-package = pkgs.rust-bin.stable.latest.default; - inherit (pkgs) rust-analyzer rust-script; - }; - - environment.shellAliases = { - rs = "rustc"; - ca = "cargo"; - }; - }) - - (mkIf config.modules.develop.xdg.enable { - home = { - sessionVariables.CARGO_HOME = "$XDG_DATA_HOME/cargo"; - sessionPath = ["$CARGO_HOME/bin"]; - }; - }) +# (mkIf config.modules.develop.rust.enable { +# # nixpkgs.overlays = [inputs.rust.overlays.default]; +# +# user.packages = attrValues { +# # rust-package = pkgs.rust-bin.stable.latest.default; +# # inherit (pkgs) rust-analyzer rust-script; +# }; +# +# environment.shellAliases = { +# rs = "rustc"; +# ca = "cargo"; +# }; +# }) +# +# (mkIf config.modules.develop.xdg.enable { +# home = { +# sessionVariables.CARGO_HOME = "$XDG_DATA_HOME/cargo"; +# sessionPath = ["$CARGO_HOME/bin"]; +# }; +# }) ]; }