Compare commits
4 Commits
4cac77f4c7
...
36c594ee9e
| Author | SHA1 | Date | |
|---|---|---|---|
| 36c594ee9e | |||
| 0c02ce3e43 | |||
| 0fac241885 | |||
| 41c2552cb1 |
@@ -4,3 +4,4 @@
|
|||||||
# Set NeoVim as default editor
|
# Set NeoVim as default editor
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
export SUDO_EDITOR="$EDITOR"
|
export SUDO_EDITOR="$EDITOR"
|
||||||
|
export SYSTEMD_EDITOR="$EDITOR"
|
||||||
|
|||||||
44
dots/.config/nvim/lua/mr.lua
Normal file
44
dots/.config/nvim/lua/mr.lua
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
local function merge_base()
|
||||||
|
return vim.fn.system("git merge-base origin/main HEAD"):gsub("%s+", "")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.files()
|
||||||
|
local base = merge_base()
|
||||||
|
require("fzf-lua").fzf_exec("git diff --name-only " .. base .. "...HEAD", {
|
||||||
|
prompt = "MR files> ",
|
||||||
|
actions = {
|
||||||
|
["default"] = function(selected)
|
||||||
|
vim.cmd("edit " .. selected[1])
|
||||||
|
require("gitsigns").diffthis(base)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.commits()
|
||||||
|
local base = merge_base()
|
||||||
|
require("fzf-lua").fzf_exec("git log --oneline " .. base .. "..HEAD", {
|
||||||
|
prompt = "MR commits> ",
|
||||||
|
actions = {
|
||||||
|
["default"] = function(selected)
|
||||||
|
local sha = selected[1]:match("^(%S+)")
|
||||||
|
require("fzf-lua").fzf_exec("git diff --name-only " .. sha .. "~1.." .. sha, {
|
||||||
|
prompt = sha:sub(1, 7) .. " files> ",
|
||||||
|
actions = {
|
||||||
|
["default"] = function(files)
|
||||||
|
vim.cmd("edit " .. files[1])
|
||||||
|
require("gitsigns").diffthis(sha .. "~1")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("MRFiles", M.files, {})
|
||||||
|
vim.api.nvim_create_user_command("MRCommits", M.commits, {})
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -46,6 +46,10 @@
|
|||||||
url = "github:cachix/git-hooks.nix";
|
url = "github:cachix/git-hooks.nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
work-cli = {
|
||||||
|
url = "path:/home/hektor/test-gsd";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
@@ -144,6 +148,7 @@
|
|||||||
dotsPath
|
dotsPath
|
||||||
myUtils
|
myUtils
|
||||||
;
|
;
|
||||||
|
hasSopsHmModule = false; # TODO: set to true after re-encrypting secrets for work host's age key
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
# inputs.sops-nix.homeManagerModules.sops # TODO: re-enable after re-encrypting secrets for this host's age key
|
||||||
../../modules
|
../../modules
|
||||||
../../modules/ai-tools
|
../../modules/ai-tools
|
||||||
|
../../modules/work-cli
|
||||||
../../modules/anki
|
../../modules/anki
|
||||||
../../modules/browser
|
../../modules/browser
|
||||||
../../modules/bruno
|
../../modules/bruno
|
||||||
@@ -30,6 +31,7 @@ in
|
|||||||
../../modules/k8s/k9s.nix
|
../../modules/k8s/k9s.nix
|
||||||
../../modules/keepassxc
|
../../modules/keepassxc
|
||||||
../../modules/music
|
../../modules/music
|
||||||
|
../../modules/networking
|
||||||
../../modules/nodejs
|
../../modules/nodejs
|
||||||
../../modules/nvim
|
../../modules/nvim
|
||||||
../../modules/pandoc
|
../../modules/pandoc
|
||||||
@@ -42,7 +44,7 @@ in
|
|||||||
../../modules/vscode
|
../../modules/vscode
|
||||||
];
|
];
|
||||||
|
|
||||||
sops.age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
|
# sops.age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; # TODO: re-enable with sops module
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
@@ -75,6 +77,24 @@ in
|
|||||||
git.gitlab.enable = true;
|
git.gitlab.enable = true;
|
||||||
secrets.vault.enable = true;
|
secrets.vault.enable = true;
|
||||||
|
|
||||||
|
programs.work-cli = {
|
||||||
|
enable = true;
|
||||||
|
gitlab = {
|
||||||
|
url = "https://gitlab.com";
|
||||||
|
project = "";
|
||||||
|
group = "";
|
||||||
|
};
|
||||||
|
jira = {
|
||||||
|
enable = true;
|
||||||
|
url = "";
|
||||||
|
projectKey = "";
|
||||||
|
};
|
||||||
|
vault = {
|
||||||
|
enable = true;
|
||||||
|
url = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
gh.enable = true;
|
gh.enable = true;
|
||||||
kubecolor.enable = true;
|
kubecolor.enable = true;
|
||||||
|
|||||||
43
home/hosts/work/packages.local.nix
Normal file
43
home/hosts/work/packages.local.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs;
|
||||||
|
let
|
||||||
|
nodejs = [
|
||||||
|
biome
|
||||||
|
tsx
|
||||||
|
];
|
||||||
|
oasdiff = buildGoModule rec {
|
||||||
|
pname = "oasdiff";
|
||||||
|
version = "1.11.10";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "oasdiff";
|
||||||
|
repo = "oasdiff";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-/Pk2mKzdYKl51RvEkm5yRDMHz2vISgoHlnel+llDJus=";
|
||||||
|
};
|
||||||
|
vendorHash = "sha256-ZKs9Ai8Q9Yj4V9GIufYRh9cl3ZUKnSehwpaodyGXtfg=";
|
||||||
|
};
|
||||||
|
misc = [
|
||||||
|
curl
|
||||||
|
flameshot
|
||||||
|
fzf-git-sh
|
||||||
|
git-machete
|
||||||
|
gitlab-ci-local
|
||||||
|
go
|
||||||
|
lua
|
||||||
|
ngrok
|
||||||
|
oasdiff
|
||||||
|
responder
|
||||||
|
rustlings
|
||||||
|
sleuthkit
|
||||||
|
vault-bin
|
||||||
|
xclip
|
||||||
|
xmage
|
||||||
|
# xwayland-satellite
|
||||||
|
# (python314.withPackages (ppkgs: [
|
||||||
|
# ppkgs.plyer
|
||||||
|
# ppkgs.dbus-python
|
||||||
|
# ]))
|
||||||
|
];
|
||||||
|
in
|
||||||
|
misc ++ nodejs
|
||||||
9
home/modules/networking/default.nix
Normal file
9
home/modules/networking/default.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
wireshark
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,5 +4,8 @@
|
|||||||
./style.nix
|
./style.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.waybar.enable = true;
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
systemd.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
110
home/modules/work-cli/default.nix
Normal file
110
home/modules/work-cli/default.nix
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.programs.work-cli;
|
||||||
|
workCliPkg = inputs.work-cli.packages.${pkgs.system}.default;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.programs.work-cli = {
|
||||||
|
enable = lib.mkEnableOption "work-cli unified developer workflow CLI";
|
||||||
|
|
||||||
|
general = {
|
||||||
|
defaultBranch = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "main";
|
||||||
|
description = "Default git branch name";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
gitlab = {
|
||||||
|
url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "https://gitlab.com";
|
||||||
|
description = "GitLab instance URL";
|
||||||
|
};
|
||||||
|
|
||||||
|
project = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "GitLab project path (namespace/repo)";
|
||||||
|
};
|
||||||
|
|
||||||
|
group = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "GitLab group path";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
jira = {
|
||||||
|
enable = lib.mkEnableOption "jira integration";
|
||||||
|
|
||||||
|
url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Jira instance URL";
|
||||||
|
};
|
||||||
|
|
||||||
|
projectKey = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Jira project key";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vault = {
|
||||||
|
enable = lib.mkEnableOption "vault integration";
|
||||||
|
|
||||||
|
url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Vault instance URL";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
repos = {
|
||||||
|
path = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "~/work";
|
||||||
|
description = "Local path where repos are cloned";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = [ workCliPkg ];
|
||||||
|
|
||||||
|
home.file.".config/work/config.toml".text = ''
|
||||||
|
[general]
|
||||||
|
default_branch = "${cfg.general.defaultBranch}"
|
||||||
|
|
||||||
|
[gitlab]
|
||||||
|
url = "${cfg.gitlab.url}"
|
||||||
|
project = "${cfg.gitlab.project}"
|
||||||
|
group = "${cfg.gitlab.group}"
|
||||||
|
|
||||||
|
[repos]
|
||||||
|
path = "${cfg.repos.path}"
|
||||||
|
''
|
||||||
|
+ lib.optionalString cfg.jira.enable ''
|
||||||
|
|
||||||
|
[jira]
|
||||||
|
url = "${cfg.jira.url}"
|
||||||
|
project_key = "${cfg.jira.projectKey}"
|
||||||
|
''
|
||||||
|
+ lib.optionalString cfg.vault.enable ''
|
||||||
|
|
||||||
|
[vault]
|
||||||
|
url = "${cfg.vault.url}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
programs.bash.initExtra = ''
|
||||||
|
eval "$(${workCliPkg}/bin/work --show-completion bash 2>/dev/null)"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user