Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
Modules:
- changed-files:
- any-glob-to-any-file: modules/**/*
Library:
- changed-files:
- any-glob-to-any-file: lib/**/*
Overlays:
- changed-files:
- any-glob-to-any-file: overlays/**/*
Packages:
- changed-files:
- any-glob-to-any-file: packages/**/*
- any-glob-to-any-file: modules/lib/**/*
Secrets:
- changed-files:
- any-glob-to-any-file: secrets/**/*
Systems:
Hosts:
- changed-files:
- any-glob-to-any-file: modules/hosts/**/*
Neovim:
- changed-files:
- any-glob-to-any-file: modules/{languages,nixvim}/**/*
Nix:
- changed-files:
- any-glob-to-any-file: modules/nix/**/*
HomeLab:
- changed-files:
- any-glob-to-any-file: modules/homelab/**/*
- any-glob-to-any-file: modules/hosts/HomeLab/**/*
MacBook-Pro:
- changed-files:
- any-glob-to-any-file: systems/**/*
repo:
- any-glob-to-any-file: modules/hosts/Proton-MacBook-Air/**/*
MacBook-Air:
- changed-files:
- any-glob-to-any-file: "*"
- any-glob-to-any-file: modules/hosts/Andrea-MacBook-Air/**/*
GitHub-Action:
- changed-files:
- any-glob-to-any-file: .github/workflows/*
147 changes: 43 additions & 104 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,140 +1,79 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:recommended',
'schedule:weekly',
],
enabledManagers: [
'custom.regex',
'github-actions',
],
labels: [
'dependencies',
'merge-queue',
],
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: ["config:recommended", "schedule:weekly"],
enabledManagers: ["custom.regex", "github-actions"],
labels: ["dependencies", "merge-queue"],
customManagers: [
{
customType: 'regex',
managerFilePatterns: [
'/^modules/homelab/.*\\.nix$/',
],
customType: "regex",
managerFilePatterns: ["/^modules/homelab/.*\\.nix$/"],
matchStrings: [
'image = "(?<depName>[^"]+?)(:(?<currentValue>[^@"]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?";',
],
datasourceTemplate: 'docker',
versioningTemplate: 'docker',
datasourceTemplate: "docker",
versioningTemplate: "docker",
},
],
packageRules: [
{
description: 'Never propose pre-release / non-official docker tags (beta, rc, alpha, unstable, ...)',
matchDatasources: [
'docker',
],
allowedVersions: '!/(?i)(alpha|beta|rc\\d*|preview|unstable|nightly|edge|canary|snapshot)/',
description: "Never propose pre-release / non-official docker tags (beta, rc, alpha, unstable, ...)",
matchDatasources: ["docker"],
allowedVersions: "!/(?i)(alpha|beta|rc\\d*|preview|unstable|nightly|edge|canary|snapshot)/",
},
{
description: "imresamu/postgis encodes its real version after the first hyphen (e.g. 17-3.6-bookworm), so strict docker versioning can't detect upgrades; fall back to loose versioning for this image",
matchManagers: [
'custom.regex',
],
matchPackageNames: [
'/imresamu\\/postgis/',
],
versioning: 'loose',
matchManagers: ["custom.regex"],
matchPackageNames: ["/imresamu\\/postgis/"],
versioning: "loose",
},
{
description: 'Label update type so workflows can target them (AI review gates on major+dependencies)',
matchUpdateTypes: [
'major',
],
addLabels: [
'major',
],
description: "Label update type so workflows can target them (AI review gates on major+dependencies)",
matchUpdateTypes: ["major"],
addLabels: ["major"],
},
{
matchUpdateTypes: [
'minor',
],
addLabels: [
'minor',
],
matchUpdateTypes: ["minor"],
addLabels: ["minor"],
},
{
matchUpdateTypes: [
'patch',
'pin',
'pinDigest',
'digest',
'bump',
],
addLabels: [
'other',
],
matchUpdateTypes: ["patch", "pin", "pinDigest", "digest", "bump"],
addLabels: ["other"],
},
{
description: 'Group updates by service',
matchManagers: [
'custom.regex',
],
matchFileNames: [
'modules/homelab/services/beszel/**',
],
groupName: 'beszel',
description: "Group updates by service",
matchManagers: ["custom.regex"],
matchFileNames: ["modules/homelab/services/beszel/**"],
groupName: "beszel",
},
{
matchManagers: [
'custom.regex',
],
matchFileNames: [
'modules/homelab/services/dawarich/**',
],
groupName: 'dawarich',
matchManagers: ["custom.regex"],
matchFileNames: ["modules/homelab/services/dawarich/**"],
groupName: "dawarich",
},
{
matchManagers: [
'custom.regex',
],
matchFileNames: [
'modules/homelab/services/homepage/**',
],
groupName: 'homepage',
matchManagers: ["custom.regex"],
matchFileNames: ["modules/homelab/services/homepage/**"],
groupName: "homepage",
},
{
matchManagers: [
'custom.regex',
],
matchFileNames: [
'modules/homelab/services/immich/**',
],
groupName: 'immich',
matchManagers: ["custom.regex"],
matchFileNames: ["modules/homelab/services/immich/**"],
groupName: "immich",
},
{
matchManagers: [
'custom.regex',
],
matchFileNames: [
'modules/homelab/services/reactive-resume/**',
],
groupName: 'reactive-resume',
matchManagers: ["custom.regex"],
matchFileNames: ["modules/homelab/services/reactive-resume/**"],
groupName: "reactive-resume",
},
{
matchManagers: [
'custom.regex',
],
matchFileNames: [
'modules/homelab/services/sure-finance/**',
],
groupName: 'sure-finance',
matchManagers: ["custom.regex"],
matchFileNames: ["modules/homelab/services/sure-finance/**"],
groupName: "sure-finance",
},
{
matchManagers: [
'custom.regex',
],
matchFileNames: [
'modules/homelab/services/tandoor/**',
],
groupName: 'tandoor',
matchManagers: ["custom.regex"],
matchFileNames: ["modules/homelab/services/tandoor/**"],
groupName: "tandoor",
},
],
}
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v7
- uses: webfactory/ssh-agent@v0.10.0
if: matrix.os == 'ubuntu-26.04-arm'
with:
ssh-private-key: ${{ secrets.ASAHI_FIRMWARE_DEPLOY_KEY }}
# - uses: wimpysworld/nothing-but-nix@main
Expand Down
6 changes: 6 additions & 0 deletions modules/forges/github.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
sops.secrets."github/host" = { };
sops.secrets."github/name" = { };
sops.secrets."github/email" = { };
sops.secrets."github/token" = { };
sops.secrets."github/authorization_key" = {
path = "${hmArgs.config.home.homeDirectory}/.ssh/github_authorisation.pub";
mode = "0644";
Expand Down Expand Up @@ -32,6 +33,11 @@
programs.git.includes = [
{ path = hmArgs.config.sops.templates."git-github-conditional-includes".path; }
];

home.sessionVariables = {
GH_TOKEN = "$(cat ${hmArgs.config.sops.secrets."github/token".path})";
GITHUB_TOKEN = "$(cat ${hmArgs.config.sops.secrets."github/token".path})";
};
};
};
}
6 changes: 6 additions & 0 deletions modules/forges/gitlab.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
sops.secrets."gitlab/host" = { };
sops.secrets."gitlab/name" = { };
sops.secrets."gitlab/email" = { };
sops.secrets."gitlab/token" = { };
sops.secrets."gitlab/authorization_key" = {
path = "${hmArgs.config.home.homeDirectory}/.ssh/gitlab_authorisation.pub";
mode = "0644";
Expand Down Expand Up @@ -32,6 +33,11 @@
programs.git.includes = [
{ path = hmArgs.config.sops.templates."git-gitlab-conditional-includes".path; }
];

home.sessionVariables = {
GITLAB_TOKEN = "$(cat ${hmArgs.config.sops.secrets."gitlab/token".path})";
GITLAB_HOST = "$(cat ${hmArgs.config.sops.secrets."gitlab/host".path})";
};
};
};
}
15 changes: 1 addition & 14 deletions modules/git/tui/gh-dash.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
flake.modules.homeManager.github = hmArgs: {
flake.modules.homeManager.github = {
programs = {
gh = {
enable = true;
Expand Down Expand Up @@ -41,18 +41,5 @@
};
};
};

sops.secrets."github/token" = {
path = "${hmArgs.config.home.homeDirectory}/.secrets/.github_token";
};

home.sessionVariables =
let
tokenCmd = "$(cat ${hmArgs.config.sops.secrets."github/token".path})";
in
{
GH_TOKEN = tokenCmd;
GITHUB_TOKEN = tokenCmd;
};
};
}
40 changes: 28 additions & 12 deletions modules/git/tui/lazygit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
command = " difft --color=always --context={{diffContext}}";
}
]);
# Custom pull request URLs for self-hosted forges.
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-pull-request-urls
services = {
"${hmArgs.config.sops.placeholder."gitlab/host"}" = "gitlab:${
hmArgs.config.sops.placeholder."gitlab/host"
}";
"${hmArgs.config.sops.placeholder."github/host"}" = "github:${
hmArgs.config.sops.placeholder."github/host"
}";
};
customCommands = [
{
key = "<c-a>";
Expand Down Expand Up @@ -183,20 +173,46 @@
enable = true;
};
sops.templates."lazygit-config" = {
content = builtins.readFile ((pkgs.formats.yaml { }).generate "lazygit-config.yml" lazygitSettings);
file = (pkgs.formats.yaml { }).generate "lazygit-config.yml" lazygitSettings;
path = "${configDir}/lazygit/config.yml";
};

# catppuccin sets LG_CONFIG_FILE to its theme file only (dropping ours, since we don't use
# programs.lazygit.settings: https://github.com/catppuccin/nix/blob/main/modules/home-manager/lazygit.nix),
# so force it to load both: theme first, then our sops-rendered config merged on top.
# so force it to load both: theme first, then our generated config merged on top.
# Forge modules contribute extra fragments via sops.templates."lazygit-services-*".
home.sessionVariables.LG_CONFIG_FILE = lib.mkForce (
lib.concatStringsSep "," (
lib.optionals hmArgs.config.catppuccin.lazygit.enable [
"${hmArgs.config.catppuccin.sources.lazygit}/${hmArgs.config.catppuccin.lazygit.flavor}/${hmArgs.config.catppuccin.lazygit.accent}.yml"
]
++ [ "${configDir}/lazygit/config.yml" ]
++ builtins.attrValues (
lib.mapAttrs (_: t: t.path) (
lib.filterAttrs (n: _: lib.hasPrefix "lazygit-services-" n) hmArgs.config.sops.templates
)
)
)
);
};

# Custom pull request URLs for self-hosted forges, merged into lazygit via LG_CONFIG_FILE.
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-pull-request-urls
flake.modules.homeManager.github = hmArgs: {
sops.templates."lazygit-services-github".content = ''
services:
"${hmArgs.config.sops.placeholder."github/host"}": "github:${
hmArgs.config.sops.placeholder."github/host"
}"
'';
};

flake.modules.homeManager.gitlab = hmArgs: {
sops.templates."lazygit-services-gitlab".content = ''
services:
"${hmArgs.config.sops.placeholder."gitlab/host"}": "gitlab:${
hmArgs.config.sops.placeholder."gitlab/host"
}"
'';
};
}
Loading
Loading