Compare commits

..

3 Commits

7 changed files with 26 additions and 257 deletions

View File

@@ -1,44 +0,0 @@
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

48
flake.lock generated
View File

@@ -121,11 +121,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1773806610, "lastModified": 1774843378,
"narHash": "sha256-mh0egzUnzXfHPrOjWI0hChOiyfibEqb8lPtfQaqfTdo=", "narHash": "sha256-8QLbY8F7UdxeQaW0KUVgr1/YPIupe+1lGjS5joR+ZCw=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "df5c2d43f13c73d6bc16f4ccdacd588d8442af3d", "rev": "0a31b668e3ebb599f95dc518076d709e8dddb57c",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -284,11 +284,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772893680, "lastModified": 1775036584,
"narHash": "sha256-JDqZMgxUTCq85ObSaFw0HhE+lvdOre1lx9iI6vYyOEs=", "narHash": "sha256-zW0lyy7ZNNT/x8JhzFHBsP2IPx7ATZIPai4FJj12BgU=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "8baab586afc9c9b57645a734c820e4ac0a604af9", "rev": "4e0eb042b67d863b1b34b3f64d52ceb9cd926735",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -344,11 +344,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773810247, "lastModified": 1775047159,
"narHash": "sha256-6Vz1Thy/1s7z+Rq5OfkWOBAdV4eD+OrvDs10yH6xJzQ=", "narHash": "sha256-UWM4VZvfKaPwA9FMu7iZha5YAE8vsEtUazk+rFxmbTY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d47357a4c806d18a3e853ad2699eaec3c01622e7", "rev": "1ce9e62690dfdd7e76bd266ccb9a887778410eb2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -400,10 +400,10 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1773505989, "lastModified": 1773999602,
"narHash": "sha256-zmKDguP5ReYfb2LK3gICP0xVZXnkV7Zt+iq6dFGqLPo=", "narHash": "sha256-Th4RuCEPHC8y1w/wrW9OSv9nAJ3/NSZ3MJ4DHhCXCKE=",
"ref": "main", "ref": "main",
"rev": "e7472aa92a8bce003fccb310191c45948165a8c3", "rev": "6f4b099a0c5ad1cca97f4ba1a665faaaed367f13",
"shallow": true, "shallow": true,
"type": "git", "type": "git",
"url": "ssh://git@github.com/hektor/nix-secrets" "url": "ssh://git@github.com/hektor/nix-secrets"
@@ -453,11 +453,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1773533765, "lastModified": 1774933469,
"narHash": "sha256-qonGfS2lzCgCl59Zl63jF6dIRRpvW3AJooBGMaXjHiY=", "narHash": "sha256-OrnCQeUO2bqaWUl0lkDWyGWjKsOhtCyd7JSfTedQNUE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "f8e82243fd601afb9f59ad230958bd073795cbfe", "rev": "f4c4c2c0c923d7811ac2a63ccc154767e4195337",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -469,11 +469,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1773734432, "lastModified": 1774709303,
"narHash": "sha256-IF5ppUWh6gHGHYDbtVUyhwy/i7D261P7fWD1bPefOsw=", "narHash": "sha256-D3Q07BbIA2KnTcSXIqqu9P586uWxN74zNoCH3h2ESHg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cda48547b432e8d3b18b4180ba07473762ec8558", "rev": "8110df5ad7abf5d4c0f6fb0f8f978390e77f9685",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -667,11 +667,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773698643, "lastModified": 1774910634,
"narHash": "sha256-VCiDjE8kNs8uCAK73Ezk1r3fFuc4JepvW07YFqaN968=", "narHash": "sha256-B+rZDPyktGEjOMt8PcHKYmgmKoF+GaNAFJhguktXAo0=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "8237de83e8200d16fe0c4467b02a1c608ff28044", "rev": "19bf3d8678fbbfbc173beaa0b5b37d37938db301",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -717,11 +717,11 @@
"tinted-zed": "tinted-zed" "tinted-zed": "tinted-zed"
}, },
"locked": { "locked": {
"lastModified": 1773792048, "lastModified": 1774897726,
"narHash": "sha256-Oy9PCLG3vtflFBWcJd8c/EB3h5RU7ABAIDWn6JrGf6o=", "narHash": "sha256-k/H2/oyex6GEC6uYXYetrboFQeTmX1Ouwv/zaW7b/Z0=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "3f2f9d307fe58c6abe2a16eb9b62c42d53ef5ee1", "rev": "9b4a5eb409ceac2dd6ad495c7988e189a418cd30",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -46,10 +46,6 @@
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 =
@@ -148,7 +144,6 @@
dotsPath dotsPath
myUtils myUtils
; ;
hasSopsHmModule = false; # TODO: set to true after re-encrypting secrets for work host's age key
}; };
}; };
}; };

View File

@@ -10,10 +10,9 @@ let
in in
{ {
imports = [ imports = [
# inputs.sops-nix.homeManagerModules.sops # TODO: re-enable after re-encrypting secrets for this host's age key inputs.sops-nix.homeManagerModules.sops
../../modules ../../modules
../../modules/ai-tools ../../modules/ai-tools
../../modules/work-cli
../../modules/anki ../../modules/anki
../../modules/browser ../../modules/browser
../../modules/bruno ../../modules/bruno
@@ -31,7 +30,6 @@ 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
@@ -44,7 +42,7 @@ in
../../modules/vscode ../../modules/vscode
]; ];
# sops.age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; # TODO: re-enable with sops module sops.age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@@ -77,24 +75,6 @@ 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;

View File

@@ -1,43 +0,0 @@
{ 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

View File

@@ -1,9 +0,0 @@
{ pkgs, ... }:
{
config = {
home.packages = with pkgs; [
wireshark
];
};
}

View File

@@ -1,110 +0,0 @@
{
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)"
'';
};
}