From c61d4e89bd384fcf741384e06cc370caf312488f Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 6 Mar 2024 10:23:41 +0100 Subject: [PATCH 1/9] First working version of home-manager alone Useful for my work laptop by now --- flake.nix | 14 +++++++---- home-manager/default.nix | 1 - hosts/yorick-Latitude-7320/home-config.nix | 28 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 hosts/yorick-Latitude-7320/home-config.nix diff --git a/flake.nix b/flake.nix index 716a179..88bb12b 100644 --- a/flake.nix +++ b/flake.nix @@ -72,11 +72,7 @@ in { system = "x86_64-linux"; specialArgs = { inherit stateVersion inputs; - hostname = "luci"; - username = "ephase"; - hostConfig = { - desktop = true; - }; + }; modules = [ ./nixos/default.nix @@ -95,6 +91,14 @@ in { hostname = "rick"; username = "ephase"; }; + }; + work = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit stateVersion inputs; + hostname = "yorick-Latitude-7320"; + username = "yorick"; + }; modules = [ ./home-manager/default.nix ]; diff --git a/home-manager/default.nix b/home-manager/default.nix index d3b9cbc..50f33fa 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -15,5 +15,4 @@ ]++ lib.optional ( builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix ) ../hosts/${hostname}/includes/home-manager.nix; - } diff --git a/hosts/yorick-Latitude-7320/home-config.nix b/hosts/yorick-Latitude-7320/home-config.nix new file mode 100644 index 0000000..79a156b --- /dev/null +++ b/hosts/yorick-Latitude-7320/home-config.nix @@ -0,0 +1,28 @@ +{ ... }: { + config.modules = { + application = { + zathura.enable = true; + }; + cli = { + neovim.enable = true; + vifm.enable = true; + zsh.enable = true; + }; + video = { + kdenlive.enable = false; + mpv.enable = false; + }; + web.firefox.enable = false; + web.qutebrowser.enable = false; + web.webcord.enable = false; + gaming.lutris.enable = false; + desktop.sway = { + enable = false; + kanshi = false; + waybar = { + laptop = false; + gpuThermal.enable = false; + }; + }; + }; +} From 44d24230d4b14e9261789717f0c1089db3e7bad1 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 6 Sep 2024 16:27:48 +0200 Subject: [PATCH 2/9] fix: put correct git informations to work account --- hosts/yorick-Latitude-7320/home-config.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosts/yorick-Latitude-7320/home-config.nix b/hosts/yorick-Latitude-7320/home-config.nix index 79a156b..64cf455 100644 --- a/hosts/yorick-Latitude-7320/home-config.nix +++ b/hosts/yorick-Latitude-7320/home-config.nix @@ -2,11 +2,16 @@ config.modules = { application = { zathura.enable = true; + foot.enable = true; }; cli = { neovim.enable = true; vifm.enable = true; zsh.enable = true; + git = { + enable = true; + userEmail = "ybarbanneau@sellsy.com"; + }; }; video = { kdenlive.enable = false; From 491c67e56b8472b8d096e3a94951b4af87b127f6 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 6 Sep 2024 16:28:12 +0200 Subject: [PATCH 3/9] feat: install Firefox on work host --- hosts/yorick-Latitude-7320/home-config.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hosts/yorick-Latitude-7320/home-config.nix b/hosts/yorick-Latitude-7320/home-config.nix index 64cf455..5fffa1a 100644 --- a/hosts/yorick-Latitude-7320/home-config.nix +++ b/hosts/yorick-Latitude-7320/home-config.nix @@ -5,19 +5,23 @@ foot.enable = true; }; cli = { - neovim.enable = true; - vifm.enable = true; - zsh.enable = true; + direnv.enable = true; + ghq.enable = true; git = { enable = true; userEmail = "ybarbanneau@sellsy.com"; }; + neovim.enable = true; + starship.enable = true; + utils.enable = true; + vifm.enable = true; + zsh.enable = true; }; video = { kdenlive.enable = false; mpv.enable = false; }; - web.firefox.enable = false; + web.firefox.enable = true; web.qutebrowser.enable = false; web.webcord.enable = false; gaming.lutris.enable = false; From 59948590960ebef670b95812511b7be55ca2c78c Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 6 Sep 2024 16:28:14 +0200 Subject: [PATCH 4/9] feat(neovim): install stuff about Terraform --- modules/home-manager/cli/neovim/default.nix | 10 ++++++- .../cli/neovim/files/lspconfig.lua | 30 +++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 998b326..19d8962 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -28,13 +28,17 @@ in # LSP Servers clang-tools hadolint + helm-ls lua-language-server marksman nil nodePackages.bash-language-server python3Packages.python-lsp-server shellcheck - # yaml-language-server + + terraform-lsp + tflint + yaml-language-server # Formatters nixfmt-rfc-style @@ -115,12 +119,15 @@ in p.cpp p.cmake p.dockerfile + p.hcl + p.helm p.latex p.lua p.llvm p.markdown p.markdown_inline p.python + p.terraform p.vim p.yaml ]) @@ -158,6 +165,7 @@ in type = "lua"; config = ( builtins.readFile ./files/whichkey.lua ); } + vim-helm ]; }; }; diff --git a/modules/home-manager/cli/neovim/files/lspconfig.lua b/modules/home-manager/cli/neovim/files/lspconfig.lua index 6ddfddf..84fb126 100644 --- a/modules/home-manager/cli/neovim/files/lspconfig.lua +++ b/modules/home-manager/cli/neovim/files/lspconfig.lua @@ -2,6 +2,21 @@ local lspconfig = require('lspconfig') lspconfig.bashls.setup {} lspconfig.clangd.setup {} +lspconfig.helm_ls.setup{ + settings = { + ['helm-ls'] = { + logLevel = "info", + valuesFiles = { + mainValuesFile = "values.yaml", + lintOverlayValuesFile = "values.lint.yaml", + additionalValuesFilesGlobPattern = "values*.yaml" + } + }, + yamlls = { + enabled = false, + } + } +} lspconfig.lua_ls.setup { single_file_support = true, flags = { @@ -14,14 +29,25 @@ lspconfig.pylsp.setup { settings = { pylsp = { plugins = { - pylint = { + pylint = { enabled = true } } } } } -lspconfig.yamlls.setup{} +lspconfig.terraformls.setup{} +lspconfig.tflint.setup{} +lspconfig.yamlls.setup{ + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.30.0/all.json"] = {"k8s/**/*.yaml", "cluster/**/*.yaml",}, + ["https://taskfile.dev/schema.json"] = {"**/Taskfile.*", "**/taskfile.*",}, + }, + }, + }, +} vim.api.nvim_create_autocmd('LspAttach', { desc = 'LSP actions', From 630daabbd8df14614cdc6643a1b137f39c152af7 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 6 Sep 2024 16:28:24 +0200 Subject: [PATCH 5/9] feat(work): add specific configuration --- flake.nix | 8 +++++++- hosts/yorick-Latitude-7320/home-config.nix | 18 +++-------------- .../includes/home-manager.nix | 20 +++++++++++++++++++ 3 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 hosts/yorick-Latitude-7320/includes/home-manager.nix diff --git a/flake.nix b/flake.nix index 88bb12b..7795410 100644 --- a/flake.nix +++ b/flake.nix @@ -91,9 +91,15 @@ in { hostname = "rick"; username = "ephase"; }; + modules = [ + ./home-manager/default.nix + ]; }; work = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; + pkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ nixgl.overlay ]; + }; extraSpecialArgs = { inherit stateVersion inputs; hostname = "yorick-Latitude-7320"; diff --git a/hosts/yorick-Latitude-7320/home-config.nix b/hosts/yorick-Latitude-7320/home-config.nix index 5fffa1a..b6bab6a 100644 --- a/hosts/yorick-Latitude-7320/home-config.nix +++ b/hosts/yorick-Latitude-7320/home-config.nix @@ -17,21 +17,9 @@ vifm.enable = true; zsh.enable = true; }; - video = { - kdenlive.enable = false; - mpv.enable = false; - }; - web.firefox.enable = true; - web.qutebrowser.enable = false; - web.webcord.enable = false; - gaming.lutris.enable = false; - desktop.sway = { - enable = false; - kanshi = false; - waybar = { - laptop = false; - gpuThermal.enable = false; - }; + web.firefox = { + enable = true; + enableNixGL = true; }; }; } diff --git a/hosts/yorick-Latitude-7320/includes/home-manager.nix b/hosts/yorick-Latitude-7320/includes/home-manager.nix new file mode 100644 index 0000000..0a17bd4 --- /dev/null +++ b/hosts/yorick-Latitude-7320/includes/home-manager.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + dejavu_fonts + font-awesome + lato + liberation_ttf + libertine + libnotify + (nerdfonts.override { + fonts = [ + "FiraCode" + ]; + }) + noto-fonts-emoji + noto-fonts-cjk + slurp + wl-clipboard + ]; +} From e2a58cf55a04acc945ee4b0c001598c3ca6bb400 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 6 Sep 2024 16:28:31 +0200 Subject: [PATCH 6/9] feat(host:work): install and configure cmus --- hosts/yorick-Latitude-7320/home-config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/yorick-Latitude-7320/home-config.nix b/hosts/yorick-Latitude-7320/home-config.nix index b6bab6a..6059fb3 100644 --- a/hosts/yorick-Latitude-7320/home-config.nix +++ b/hosts/yorick-Latitude-7320/home-config.nix @@ -4,6 +4,7 @@ zathura.enable = true; foot.enable = true; }; + audio.cmus.enable = true; cli = { direnv.enable = true; ghq.enable = true; From 50a709fae28aa7c6300598f848206033ef5a8b6c Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 10 Sep 2024 10:46:56 +0200 Subject: [PATCH 7/9] refactor(host:work): reorganise work files --- flake.nix | 5 +++-- hosts/{yorick-Latitude-7320 => work}/home-config.nix | 0 .../{yorick-Latitude-7320 => work}/includes/home-manager.nix | 0 3 files changed, 3 insertions(+), 2 deletions(-) rename hosts/{yorick-Latitude-7320 => work}/home-config.nix (100%) rename hosts/{yorick-Latitude-7320 => work}/includes/home-manager.nix (100%) diff --git a/flake.nix b/flake.nix index 7795410..2f5ee8d 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ in { pkgs.go-task pkgs.convco pkgs.typos + pkgs.home-manager ]; }; }); @@ -102,8 +103,8 @@ in { }; extraSpecialArgs = { inherit stateVersion inputs; - hostname = "yorick-Latitude-7320"; - username = "yorick"; + hostname = "work"; + username = "yorick-barbanneau"; }; modules = [ ./home-manager/default.nix diff --git a/hosts/yorick-Latitude-7320/home-config.nix b/hosts/work/home-config.nix similarity index 100% rename from hosts/yorick-Latitude-7320/home-config.nix rename to hosts/work/home-config.nix diff --git a/hosts/yorick-Latitude-7320/includes/home-manager.nix b/hosts/work/includes/home-manager.nix similarity index 100% rename from hosts/yorick-Latitude-7320/includes/home-manager.nix rename to hosts/work/includes/home-manager.nix From 41f48aa208b0757ec27445182c505255f3bc5a94 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 10 Sep 2024 10:49:51 +0200 Subject: [PATCH 8/9] feat(host:work): integrate Nix app in Gnome Add statement for Nix-installed application into Gnome application in order have Firefox, Foot and other available --- hosts/work/includes/home-manager.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts/work/includes/home-manager.nix b/hosts/work/includes/home-manager.nix index 0a17bd4..b8cd4e4 100644 --- a/hosts/work/includes/home-manager.nix +++ b/hosts/work/includes/home-manager.nix @@ -17,4 +17,6 @@ slurp wl-clipboard ]; + targets.genericLinux.enable = true; + xdg.mime.enable = true; } From 3ebc87b8ba57a747025f5b1241a9bc55bdb9ad21 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 11 Sep 2024 22:20:39 +0200 Subject: [PATCH 9/9] feat(host:rick): install cmus --- hosts/rick/home-config.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosts/rick/home-config.nix b/hosts/rick/home-config.nix index abe7342..6ba8027 100644 --- a/hosts/rick/home-config.nix +++ b/hosts/rick/home-config.nix @@ -6,6 +6,9 @@ foot.enable = false; imv.enable = false; }; + audio = { + cmus.enable = true; + }; cli = { direnv.enable = true; ghq.enable = true;