diff options
| author | Caroline Larimore <caroline@larimo.re> | 2024-07-25 22:52:20 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2024-07-25 23:00:44 -0700 |
| commit | 2f17e369400b9c895b3554008ab3efbc76255428 (patch) | |
| tree | 172c910e17f14bb8d0d7306fe527c2c79140df64 /roles/home/dev | |
| parent | 10c984caf7067656990e5966b4626314f225755f (diff) | |
roles: home: migrate old home module to roles
Diffstat (limited to 'roles/home/dev')
| -rw-r--r-- | roles/home/dev/default.nix | 26 | ||||
| -rw-r--r-- | roles/home/dev/git.nix | 18 | ||||
| -rw-r--r-- | roles/home/dev/vim.nix | 37 | ||||
| -rw-r--r-- | roles/home/dev/vscode.nix | 48 |
4 files changed, 129 insertions, 0 deletions
diff --git a/roles/home/dev/default.nix b/roles/home/dev/default.nix new file mode 100644 index 0000000..b092246 --- /dev/null +++ b/roles/home/dev/default.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, inputs, ... }: +with lib; + +let cfg = config.home.roles.dev; in { + imports = [ + ./git.nix + ./vim.nix + ./vscode.nix + ]; + + options.home.roles.dev = { + enable = mkEnableOption "dev home role"; + + key = mkOption { + type = types.str; + description = "git signing key"; + }; + }; + + config = mkIf cfg.enable { + programs = { + git.enable = true; + vscode.enable = config.home.roles.desktop.enable; + }; + }; +} diff --git a/roles/home/dev/git.nix b/roles/home/dev/git.nix new file mode 100644 index 0000000..be67fdb --- /dev/null +++ b/roles/home/dev/git.nix @@ -0,0 +1,18 @@ +{ config, ... }: + +{ + programs.git = { + userName = "Caroline Larimore"; + userEmail = "caroline@larimo.re"; + + signing = { + key = config.home.roles.dev.key; + signByDefault = true; + }; + + ignores = [ + "*~" + "*.swp" + ]; + }; +} diff --git a/roles/home/dev/vim.nix b/roles/home/dev/vim.nix new file mode 100644 index 0000000..2cb295b --- /dev/null +++ b/roles/home/dev/vim.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +# Honestly, I'm pretty disappointed with +# home-manager's `programs.vim`. It's kinda bad and +# won't let me run `highlight` after `colorscheme` + +lib.mkIf config.home.roles.dev.enable { + home.file.".vim/vimrc".text = '' + set number + set relativenumber + + set termguicolors + set background=dark + colorscheme gruvbox + + syntax on + + highlight Normal guibg=#000000 + + " Awesome magical color override from + " https://gist.github.com/romainl/379904f91fa40533175dfaec4c833f2f + augroup MyColors + autocmd! + autocmd ColorScheme * highlight Normal guibg=#000000 + augroup END + ''; + + home.file.".vim/pack/default/start/gruvbox".source = builtins.fetchGit { + url = "https://github.com/morhetz/gruvbox.git"; + rev = "f1ecde848f0cdba877acb0c740320568252cc482"; + }; + + home.file.".vim/pack/all/start/vim-nix".source = builtins.fetchGit { + url = "https://github.com/LnL7/vim-nix.git"; + rev = "e25cd0f2e5922f1f4d3cd969f92e35a9a327ffb0"; + }; +} diff --git a/roles/home/dev/vscode.nix b/roles/home/dev/vscode.nix new file mode 100644 index 0000000..160ad14 --- /dev/null +++ b/roles/home/dev/vscode.nix @@ -0,0 +1,48 @@ +{ pkgs, ... }: + +{ + programs.vscode = { + package = pkgs.vscodium; + + extensions = with pkgs.vscode-extensions; [ + jdinhlife.gruvbox + vscode-icons-team.vscode-icons + + jnoortheen.nix-ide + golang.go + ziglang.vscode-zig + ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "shader"; + publisher = "slevesque"; + version = "1.1.5"; + sha256 = "3dfdfb15e40c365bfbe1fecb333f7e08ab1c17a5234d9ed9a5c69914ab57d993"; + } + ]; + + userSettings = { + "workbench.colorTheme" = "Gruvbox Dark Medium"; + "workbench.iconTheme" = "vscode-icons"; + "window.titleBarStyle" = "custom"; + + "git.confirmSync" = false; + + "vsicons.dontShowNewVersionMessage" = true; + + "files.associations" = { + "*.vsh" = "glsl"; + "*.fsh" = "glsl"; + "*.gsh" = "glsl"; + }; + + # Zig + "zig.initialSetupDone" = true; + "zig.path" = ""; + "zig.formattingProvider" = "off"; + + "zig.zls.path" = ""; + "zig.zls.enableAutofix" = false; + "zig.zls.enableInlayHints" = false; + }; + }; +} |