From 1327644df3397428dadd59b85c5f6eefec30353a Mon Sep 17 00:00:00 2001 From: Peter Esselius Date: Tue, 26 Nov 2024 11:55:24 +0100 Subject: [PATCH] changes --- darwin-modules/nix.nix | 4 +- extra-builtins.nix | 11 +++ flake.lock | 130 ++++++++++++++----------- flake.nix | 2 + home-configurations/peteresselius.nix | 3 +- home-modules/git.nix | 3 +- home-modules/neovim.nix | 55 ++++++++++- home-modules/nix.nix | 3 + home-modules/profiles/tools/common.nix | 4 + home-modules/profiles/tools/work.nix | 1 + nixos-configurations/vm.nix | 6 +- 11 files changed, 160 insertions(+), 62 deletions(-) create mode 100644 extra-builtins.nix diff --git a/darwin-modules/nix.nix b/darwin-modules/nix.nix index 8d17e9f..e0aece7 100644 --- a/darwin-modules/nix.nix +++ b/darwin-modules/nix.nix @@ -4,7 +4,7 @@ nixpkgs.config.allowUnfree = true; nix = { - package = pkgs.nixVersions.nix_2_23; + # package = pkgs.nixVersions.nix_2_23; extraOptions = '' extra-experimental-features = nix-command flakes use-case-hack = false @@ -20,6 +20,8 @@ "esselius.cachix.org-1:h6FQzpdflxdZfnnL0caV88xt5K5sNzgO0VIHQthTymA=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; + plugin-files = "${pkgs.nix-plugins}/lib/nix/plugins"; + extra-builtins-file = "${../extra-builtins.nix}"; }; optimise = { diff --git a/extra-builtins.nix b/extra-builtins.nix new file mode 100644 index 0000000..1d852a2 --- /dev/null +++ b/extra-builtins.nix @@ -0,0 +1,11 @@ +{ exec, ... }: + +let + bashScript = script: [ "bash" "-c" script ]; + run = command: bashScript '' + echo '"'$(${command})'"' + ''; +in +{ + gcloudToken = exec (run "gcloud auth print-access-token"); +} diff --git a/flake.lock b/flake.lock index 481889f..bdeebc3 100644 --- a/flake.lock +++ b/flake.lock @@ -76,20 +76,35 @@ "brew-src": { "flake": false, "locked": { - "lastModified": 1718075954, - "narHash": "sha256-4TeUhv5VLEufP+Z/NkKnUk4NUaf59cMsj6NvsVbE+8w=", + "lastModified": 1731323744, + "narHash": "sha256-SxUQm4cTHcaoPQHoXe26ZV8cZiMWBGow8MjE4L+MckM=", "owner": "Homebrew", "repo": "brew", - "rev": "3f08c75e7b950d4340dab462f3e7f77e8093fa2b", + "rev": "254bf3fe9d8fa2e1b2fb55dbcf535b2d870180c4", "type": "github" }, "original": { "owner": "Homebrew", - "ref": "4.3.5", + "ref": "4.4.5", "repo": "brew", "type": "github" } }, + "cfg-work": { + "locked": { + "lastModified": 1731815259, + "narHash": "sha256-J5SFzjW6+FnfIWL71Kuggu1Z8vZjoJnv7+Upvzi5N7M=", + "owner": "esselius", + "repo": "cfg-work", + "rev": "c9bb01fdd796411359c6eed3d71ff84f420cfd03", + "type": "github" + }, + "original": { + "owner": "esselius", + "repo": "cfg-work", + "type": "github" + } + }, "devshell": { "inputs": { "nixpkgs": [ @@ -169,11 +184,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1726153070, - "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -190,11 +205,11 @@ ] }, "locked": { - "lastModified": 1727826117, - "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -244,11 +259,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -274,11 +289,11 @@ ] }, "locked": { - "lastModified": 1729104314, - "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", + "lastModified": 1732021966, + "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", + "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", "type": "github" }, "original": { @@ -338,11 +353,11 @@ ] }, "locked": { - "lastModified": 1729716953, - "narHash": "sha256-FbRKGRRd0amsk/WS/UV9ukJ8jT1dZ2pJBISxkX+uq6A=", + "lastModified": 1732025103, + "narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=", "owner": "nix-community", "repo": "home-manager", - "rev": "a4353cc43d1b4dd6bdeacea90eb92a8b7b78a9d7", + "rev": "a46e702093a5c46e192243edbd977d5749e7f294", "type": "github" }, "original": { @@ -365,16 +380,16 @@ ] }, "locked": { - "lastModified": 1729544999, - "narHash": "sha256-YcyJLvTmN6uLEBGCvYoMLwsinblXMkoYkNLEO4WnKus=", + "lastModified": 1729958008, + "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", "owner": "NuschtOS", "repo": "ixx", - "rev": "65c207c92befec93e22086da9456d3906a4e999c", + "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", "type": "github" }, "original": { "owner": "NuschtOS", - "ref": "v0.0.5", + "ref": "v0.0.6", "repo": "ixx", "type": "github" } @@ -445,11 +460,11 @@ ] }, "locked": { - "lastModified": 1727003835, - "narHash": "sha256-Cfllbt/ADfO8oxbT984MhPHR6FJBaglsr1SxtDGbpec=", + "lastModified": 1732016537, + "narHash": "sha256-XwXUK+meYnlhdQz2TVE4Wv+tsx1CkdGbDPt1tRzCNH4=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "bd7d1e3912d40f799c5c0f7e5820ec950f1e0b3d", + "rev": "61cee20168a3ebb71a9efd70a55adebaadfbe4d4", "type": "github" }, "original": { @@ -466,11 +481,11 @@ ] }, "locked": { - "lastModified": 1728901530, - "narHash": "sha256-I9Qd0LnAsEGHtKE9+uVR0iDFmsijWSy7GT0g3jihG4Q=", + "lastModified": 1732016537, + "narHash": "sha256-XwXUK+meYnlhdQz2TVE4Wv+tsx1CkdGbDPt1tRzCNH4=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "a60ac02f9466f85f092e576fd8364dfc4406b5a6", + "rev": "61cee20168a3ebb71a9efd70a55adebaadfbe4d4", "type": "github" }, "original": { @@ -513,11 +528,11 @@ ] }, "locked": { - "lastModified": 1719720211, - "narHash": "sha256-FNK5ZxmNC+V/wOuioc5HqkUy0ld4eW3NqcsZHLYg9HI=", + "lastModified": 1732145543, + "narHash": "sha256-VRQh/lvCSko9YV7haXyPt7DSp+EkgjjBv/9U4cY9c50=", "owner": "zhaofengli", "repo": "nix-homebrew", - "rev": "0afc51fd86693c73e4b60be8ed8c782c4c09b4cc", + "rev": "ac3945ee614f69ab89c6935b3f0567028de5f012", "type": "github" }, "original": { @@ -533,11 +548,11 @@ ] }, "locked": { - "lastModified": 1726975622, - "narHash": "sha256-bPDZosnom0+02ywmMZAvmj7zvsQ6mVv/5kmvSgbTkaY=", + "lastModified": 1731814505, + "narHash": "sha256-l9ryrx1Twh08a+gxrMGM9O/aZKEimZfa6sZVyPCImgI=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "c7515c2fdaf2e1f3f49856cef6cec95bb2138417", + "rev": "bdba246946fb079b87b4cada4df9b1cdf1c06132", "type": "github" }, "original": { @@ -548,11 +563,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727264057, - "narHash": "sha256-KQPI8CTTnB9CrJ7LrmLC4VWbKZfljEPBXOFGZFRpxao=", + "lastModified": 1731797254, + "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "759537f06e6999e141588ff1c9be7f3a5c060106", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", "type": "github" }, "original": { @@ -564,11 +579,11 @@ }, "nixpkgs-darwin": { "locked": { - "lastModified": 1727284797, - "narHash": "sha256-roj2jFZ/VNBQBBmUvvYRGiWbegZEgRk9Y1dhcY8kgLA=", + "lastModified": 1730891215, + "narHash": "sha256-i85DPrhDuvzgvIWCpJlbfM2UFtNYbapo20MtQXsvay4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "37df9bcf93431c7f9f9358aec2d7ed0a52d7ba1d", + "rev": "c128e44a249d6180740d0a979b6480d5b795c013", "type": "github" }, "original": { @@ -580,23 +595,23 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1725233747, - "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", + "lastModified": 1730504152, + "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1729658218, - "narHash": "sha256-9Rg+AqLqvqqJniP/OQB3GtgXoAd8IlazsHp97va042Y=", + "lastModified": 1731890469, + "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a", + "rev": "5083ec887760adfe12af64830a66807423a859a7", "type": "github" }, "original": { @@ -621,11 +636,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1729758248, - "narHash": "sha256-xTe7A0cOue3c+IGJOQ3ofbitBf4XhfXViWeDGNZUGkM=", + "lastModified": 1732143099, + "narHash": "sha256-lh2Qi8gd1SwJVGo7gJjoFvS/djS5Nimaw25j792PJjM=", "owner": "nix-community", "repo": "nixvim", - "rev": "46f658d9606278ca8ebd0220039293e30d38a706", + "rev": "2f71c4250bef7a52fe21bd00d1e58c119f62008c", "type": "github" }, "original": { @@ -644,11 +659,11 @@ ] }, "locked": { - "lastModified": 1729722634, - "narHash": "sha256-Mw5mYQ6+IGEiHqgOKK0enG0IfdBpDBtWCLaSXGRvDCk=", + "lastModified": 1731936508, + "narHash": "sha256-z0BSSf78LkxIrrFXZYmCoRRAxAmxMUKpK7CyxQRvkZI=", "owner": "NuschtOS", "repo": "search", - "rev": "4a4d46245d5b247c817782c60ddc06e48a3afacd", + "rev": "fe07070f811b717a4626d01fab714a87d422a9e1", "type": "github" }, "original": { @@ -719,6 +734,7 @@ "inputs": { "agenix": "agenix", "authentik-nix": "authentik-nix", + "cfg-work": "cfg-work", "ez-configs": "ez-configs", "flake-parts": "flake-parts", "home-manager": "home-manager", @@ -938,11 +954,11 @@ ] }, "locked": { - "lastModified": 1729242555, - "narHash": "sha256-6jWSWxv2crIXmYSEb3LEVsFkCkyVHNllk61X4uhqfCs=", + "lastModified": 1732111664, + "narHash": "sha256-XWHuPWcP59QnHEewdZJXBX1TA2lAP78Vz4daG6tfIr4=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "d986489c1c757f6921a48c1439f19bfb9b8ecab5", + "rev": "62003fdad7a5ab7b6af3ea9bd7290e4c220277d0", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a83cc77..e6485a5 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,8 @@ nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; + cfg-work.url = "github:esselius/cfg-work"; + raspberry-pi-nix.url = "github:tstat/raspberry-pi-nix/v0.4.0"; raspberry-pi-nix.inputs.nixpkgs.follows = "nixpkgs"; authentik-nix.url = "github:nix-community/authentik-nix/version/2024.6.1"; diff --git a/home-configurations/peteresselius.nix b/home-configurations/peteresselius.nix index 0f0f1ff..a4fb76e 100644 --- a/home-configurations/peteresselius.nix +++ b/home-configurations/peteresselius.nix @@ -1,4 +1,4 @@ -{ pkgs, ezModules, config, lib, ... }: +{ inputs, pkgs, ezModules, config, lib, ... }: let inherit (lib) mkMerge mkIf; @@ -9,6 +9,7 @@ in ezModules.git ezModules.ssh ezModules.profiles + inputs.cfg-work.homeModules.sbt ]; config = mkMerge [ diff --git a/home-modules/git.nix b/home-modules/git.nix index 9e3febc..0f2e440 100644 --- a/home-modules/git.nix +++ b/home-modules/git.nix @@ -47,7 +47,8 @@ ghq = { root = "~/src"; }; - url."git@github.com:".insteadOf = "https://github.com"; + url."git@github.com:pagero".insteadOf = "https://github.com/pagero"; + url."git@github.com:esselius".insteadOf = "https://github.com/esselius"; }; }; diff --git a/home-modules/neovim.nix b/home-modules/neovim.nix index 1f847e7..041cebd 100755 --- a/home-modules/neovim.nix +++ b/home-modules/neovim.nix @@ -22,7 +22,11 @@ in undofile = true; }; + + editorconfig.enable = true; + plugins = { + clangd-extensions.enable = true; web-devicons.enable = true; auto-save.enable = true; @@ -52,11 +56,16 @@ in servers = { nixd.enable = true; - metals.enable = true; + metals = { + enable = true; + filetypes = [ "sc" "scala" ]; + }; dockerls.enable = true; tilt_ls.enable = true; protols = { enable = true; package = null; }; pylsp.enable = true; + gopls.enable = true; + clangd.enable = true; }; }; @@ -74,9 +83,53 @@ in { name = "path"; } { name = "buffer"; } ]; + settings = { + mapping = { + "" = ''cmp.mapping(cmp.mapping.complete(), { "i", "c" })''; + "" = "cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close(), })"; + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = "cmp.mapping.confirm({ select = true })"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + "" = "cmp.mapping.complete()"; + }; + }; }; }; + extraPlugins = with pkgs.vimPlugins; [ + nvim-metals + plenary-nvim + (pkgs.vimUtils.buildVimPlugin { + name = "dbtpal.nvim"; + src = pkgs.fetchFromGitHub { + owner = "PedramNavid"; + repo = "dbtpal"; + rev = "c526f65"; + hash = "sha256-qQZrfTUIhmYaXwNFnTudnapK41g7xww5VPfggLyrrew="; + }; + }) + ]; + + extraConfigLua = '' + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + pattern = { "scala", "sbt", "java" }, + callback = function() + require("metals").initialize_or_attach({}) + end, + group = nvim_metals_group, + }) + require("dbtpal").setup({ + path_to_dbt = "dbt", + path_to_dbt_project = "src/dbt", + path_to_dbt_profiles_dir = vim.fn.getcwd(), + extended_path_search = true, + protect_compiled_files = true, + custom_dbt_syntax_enabled = true, + }) + require("telescope").load_extension("dbtpal") + ''; + colorschemes.gruvbox.enable = true; }; diff --git a/home-modules/nix.nix b/home-modules/nix.nix index 9fef74c..5403f8b 100644 --- a/home-modules/nix.nix +++ b/home-modules/nix.nix @@ -1,5 +1,8 @@ +{ pkgs, ... }: + { nix = { + # package = pkgs.nixVersions.nix_2_23; settings = { substituters = [ "https://cache.nixos.org" diff --git a/home-modules/profiles/tools/common.nix b/home-modules/profiles/tools/common.nix index 8b667aa..c9cc2d9 100644 --- a/home-modules/profiles/tools/common.nix +++ b/home-modules/profiles/tools/common.nix @@ -42,5 +42,9 @@ postgresql killall file + unzip + devenv + arion + docker-client ]; } diff --git a/home-modules/profiles/tools/work.nix b/home-modules/profiles/tools/work.nix index 3d31623..d160606 100644 --- a/home-modules/profiles/tools/work.nix +++ b/home-modules/profiles/tools/work.nix @@ -51,6 +51,7 @@ in minio-client sqlfluff stern + kubectl ]; home.sessionPath = [ diff --git a/nixos-configurations/vm.nix b/nixos-configurations/vm.nix index 6b2b8f3..18a41c6 100644 --- a/nixos-configurations/vm.nix +++ b/nixos-configurations/vm.nix @@ -1,4 +1,4 @@ -{ modulesPath, ezModules, ... }: +{ ezModules, pkgs, lib, ... }: { nixpkgs.hostPlatform = "aarch64-linux"; @@ -18,4 +18,8 @@ virtualisation.docker.enable = true; nixpkgs.config.allowUnsupportedSystem = true; + + boot.kernel.sysctl."fs.inotify.max_user_instances" = 256; + + programs.nix-ld.enable = true; }