1
Fork 0

Better octodns file structure

This commit is contained in:
prescientmoon 2024-10-13 02:34:34 +02:00
parent 190dde841e
commit 35bc79265c
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
33 changed files with 219 additions and 381 deletions

View file

@ -72,6 +72,7 @@ in
satellite.dns.records = lib.flatten [ satellite.dns.records = lib.flatten [
(ghPage "doffycup") (ghPage "doffycup")
(ghPage "erratic-gate") (ghPage "erratic-gate")
(ghPage "giftstogo")
(migaduMail "" "kfkhyexd") (migaduMail "" "kfkhyexd")
(migaduMail "orbit" "24s7lnum") (migaduMail "orbit" "24s7lnum")
]; ];

View file

@ -0,0 +1,69 @@
{
pkgs,
octodnsConfig,
nixosConfigurations ? { },
extraModules ? [ ],
}:
let
# {{{ Prepare packages
octodns = pkgs.octodns.overrideAttrs (_: {
version = "unstable-2024-10-08";
src = pkgs.fetchFromGitHub {
owner = "octodns";
repo = "octodns";
rev = "a1456cb1fcf00916ca06b204755834210a3ea9cf";
sha256 = "192hbxhb0ghcbzqy3h8q194n4iy7bqfj9ra9qqjff3x2z223czxb";
};
});
octodns-cloudflare = pkgs.python3Packages.callPackage (import ./octodns-cloudflare.nix) {
inherit octodns;
};
fullOctodns = octodns.withProviders (ps: [ octodns-cloudflare ]);
in
# }}}
rec {
# {{{ Build zone files
octodns-zones =
let
nixosConfigModules = pkgs.lib.mapAttrsToList (_: current: {
satellite.dns = current.config.satellite.dns;
}) nixosConfigurations;
evaluated = pkgs.lib.evalModules {
specialArgs = {
inherit pkgs;
};
modules = [ ./nixos-module.nix ] ++ nixosConfigModules ++ extraModules;
};
in
import ./gen-zone-file.nix {
inherit pkgs;
inherit (evaluated) config;
};
# }}}
# {{{ Make the CLI use the newly built zone files
octodns-sync = pkgs.symlinkJoin {
name = "octodns-sync";
paths = [ fullOctodns ];
buildInputs = [
pkgs.makeWrapper
pkgs.yq
];
postBuild = ''
cat ${octodnsConfig} | yq '.providers.zones.directory="${octodns-zones}"' > $out/config.yaml
wrapProgram $out/bin/octodns-sync \
--run 'export CLOUDFLARE_TOKEN=$( \
sops \
--decrypt \
--extract "[\"cloudflare_dns_api_token\"]" \
./hosts/nixos/common/secrets.yaml \
)' \
--add-flags "--config-file $out/config.yaml"
'';
};
# }}}
}

View file

@ -0,0 +1,37 @@
{
config,
pkgs,
lib ? pkgs.lib,
}:
let
format = pkgs.formats.yaml { };
cfg = config.satellite.dns;
grouped = builtins.groupBy (entry: entry.zone) cfg.records;
cpInvocations = lib.mapAttrsToList (
zone: group:
let
grouped = builtins.groupBy (entry: entry.at) group;
contents = lib.mapAttrs (
at: entries:
lib.lists.forEach entries (
entry:
let
content =
if builtins.typeOf entry.value == "list" then
{ values = entry.value; }
else
{ inherit (entry) value; };
cloudflare = if entry.enableCloudflareProxy then { octodns.cloudflare.proxied = true; } else { };
in
{ inherit (entry) ttl type; } // content // cloudflare
)
) grouped;
file = format.generate "${zone}.yaml" contents;
in
"cp ${file} $out/${zone}.yaml"
) grouped;
in
pkgs.runCommand "octodns-zones" { } ''
mkdir $out
${lib.concatStringsSep "\n" cpInvocations}
''

View file

@ -1,48 +0,0 @@
{ pkgs, self, ... }:
rec {
octodns-zones =
let
nixosConfigModules = pkgs.lib.mapAttrsToList (
key: current:
# The iso image doesn't do any dns stuff
if key == "iso" then
{ }
else
# Copy over all dns records
{ satellite.dns = current.config.satellite.dns; }
) self.nixosConfigurations;
evaluated = pkgs.lib.evalModules {
specialArgs = {
inherit pkgs;
};
modules = [
../modules/nixos/dns.nix
../modules/common/octodns.nix
./common.nix
] ++ nixosConfigModules;
};
in
evaluated.config.satellite.dns.octodns;
octodns-sync = pkgs.symlinkJoin {
name = "octodns-sync";
paths = [ self.packages.${pkgs.system}.octodns ];
buildInputs = [
pkgs.makeWrapper
pkgs.yq
];
postBuild = ''
cat ${./octodns.yaml} | yq '.providers.zones.directory="${octodns-zones}"' > $out/config.yaml
wrapProgram $out/bin/octodns-sync \
--run 'export CLOUDFLARE_TOKEN=$( \
sops \
--decrypt \
--extract "[\"cloudflare_dns_api_token\"]" \
./hosts/nixos/common/secrets.yaml \
)' \
--add-flags "--config-file $out/config.yaml"
'';
};
}

View file

@ -602,6 +602,22 @@
} }
}, },
"flake-compat_7": { "flake-compat_7": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_8": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1673956053, "lastModified": 1673956053,
@ -823,24 +839,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_8": {
"inputs": {
"systems": "systems_7"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"fromYaml": { "fromYaml": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1276,11 +1274,11 @@
"purifix": "purifix" "purifix": "purifix"
}, },
"locked": { "locked": {
"lastModified": 1713856075, "lastModified": 1728771451,
"narHash": "sha256-3nmcWGRczFJAiObkG+XUK9OdY8EVjySOUbDSK6yVyVE=", "narHash": "sha256-WazYd0cPY7FqDanOfyMf9qiciSj2wEL8NJ1sV8LV4Rs=",
"owner": "prescientmoon", "owner": "prescientmoon",
"repo": "miros", "repo": "miros",
"rev": "37081c34cb04b0751527c4ed740220c57cea3151", "rev": "2e49f31f22855d1428ab693cf7d0e25b839dce28",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -2077,21 +2075,21 @@
}, },
"spicetify-nix": { "spicetify-nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_8", "flake-compat": "flake-compat_7",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1704167711, "lastModified": 1728706579,
"narHash": "sha256-kFDq+kf/Di/P8bq5sUP8pVwRkrSVrABksBjMPmLic3s=", "narHash": "sha256-uMa7cC1F2m7DHGOT5yQ1ZoUFVWxsnZDBi9VXwOgnhqw=",
"owner": "the-argus", "owner": "Gerg-L",
"repo": "spicetify-nix", "repo": "spicetify-nix",
"rev": "1325416f951d6a82cfddb1289864ad782e2b87c4", "rev": "59aa525938e501bdacad3753034e864a426b66f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "the-argus", "owner": "Gerg-L",
"repo": "spicetify-nix", "repo": "spicetify-nix",
"type": "github" "type": "github"
} }
@ -2107,7 +2105,7 @@
"base16-kitty": "base16-kitty", "base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux", "base16-tmux": "base16-tmux",
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"flake-compat": "flake-compat_7", "flake-compat": "flake-compat_8",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nixpkgs": "nixpkgs_13" "nixpkgs": "nixpkgs_13"
@ -2265,21 +2263,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"template-haskell-reload": { "template-haskell-reload": {
"flake": false, "flake": false,
"locked": { "locked": {

View file

@ -56,7 +56,7 @@
miros.inputs.nixpkgs.follows = "nixpkgs"; miros.inputs.nixpkgs.follows = "nixpkgs";
# Spotify client with theming support # Spotify client with theming support
spicetify-nix.url = "github:the-argus/spicetify-nix"; spicetify-nix.url = "github:Gerg-L/spicetify-nix";
spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; spicetify-nix.inputs.nixpkgs.follows = "nixpkgs";
# }}} # }}}
# {{{ Theming # {{{ Theming
@ -103,10 +103,12 @@
myPkgs = import ./pkgs { inherit pkgs upkgs; }; myPkgs = import ./pkgs { inherit pkgs upkgs; };
in in
myPkgs myPkgs
// { // (import ./dns/implementation) {
octodns = myPkgs.octodns.withProviders (ps: [ myPkgs.octodns-cloudflare ]); inherit pkgs;
extraModules = [ ./dns/config/common.nix ];
octodnsConfig = ./dns/config/octodns.yaml;
nixosConfigurations = builtins.removeAttrs self.nixosConfigurations [ "iso" ];
} }
// (import ./dns/pkgs.nix) { inherit pkgs self system; }
); );
# }}} # }}}
# {{{ Bootstrapping and other pinned devshells # {{{ Bootstrapping and other pinned devshells

View file

@ -1,11 +1,17 @@
{ inputs, pkgs, config, lib, ... }: {
inputs,
pkgs,
config,
lib,
...
}:
let let
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
themeMap = lib.fix (self: { themeMap = lib.fix (self: {
"Catppuccin Mocha" = spicePkgs.themes.Comfy; "Catppuccin Mocha" = spicePkgs.themes.comfy;
"Catppuccin Latte" = spicePkgs.themes.Comfy; "Catppuccin Latte" = spicePkgs.themes.comfy;
"Catppuccin Frappe" = spicePkgs.themes.Comfy; "Catppuccin Frappe" = spicePkgs.themes.comfy;
"Catppuccin Macchiato" = spicePkgs.themes.Comfy; "Catppuccin Macchiato" = spicePkgs.themes.comfy;
default.light = self."Catppuccin Latte"; default.light = self."Catppuccin Latte";
default.dark = self."Catppuccin Macchiato"; default.dark = self."Catppuccin Macchiato";
@ -32,34 +38,28 @@ in
colorScheme = config.satellite.theming.get colorschemeMap; colorScheme = config.satellite.theming.get colorschemeMap;
enabledExtensions = with spicePkgs.extensions; [ enabledExtensions = with spicePkgs.extensions; [
adblock
betterGenres
bookmark
fullAlbumDate
fullAppDisplayMod fullAppDisplayMod
shuffle # Working shuffle groupSession
keyboardShortcut keyboardShortcut
skipStats # Track my skips
listPlaylistsWithSong # Adds button to show playlists which contain a song listPlaylistsWithSong # Adds button to show playlists which contain a song
playlistIntersection # Shows stuff that's in two different playlists playlistIntersection # Shows stuff that's in two different playlists
fullAlbumDate
bookmark
trashbin
groupSession
wikify # Shows an artist's wikipedia entry
songStats
showQueueDuration
# REASON: broken
# https://github.com/the-argus/spicetify-nix/issues/50
# genre
adblock
savePlaylists # Adds a button to duplicate playlists savePlaylists # Adds a button to duplicate playlists
showQueueDuration
shuffle # Working shuffle
skipStats # Track my skips
songStats
trashbin
wikify # Shows an artist's wikipedia entry
]; ];
}; };
# {{{ Persistence # {{{ Persistence
satellite.persistence.at.state.apps.spotify.directories = [ satellite.persistence.at.state.apps.spotify.directories = [ "${config.xdg.configHome}/spotify" ];
"${config.xdg.configHome}/spotify"
];
satellite.persistence.at.cache.apps.spotify.directories = [ satellite.persistence.at.cache.apps.spotify.directories = [ "${config.xdg.cacheHome}/spotify" ];
"${config.xdg.cacheHome}/spotify"
];
# }}} # }}}
} }

View file

@ -1 +0,0 @@
require("my.abbreviations.fp").setup()

View file

@ -10,7 +10,6 @@
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" }, "conform": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" },
"crates": { "branch": "main", "commit": "c3fd47391de6999f4c939af89494d08443f71916" }, "crates": { "branch": "main", "commit": "c3fd47391de6999f4c939af89494d08443f71916" },
"discord-rich-presence": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"dressing": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, "dressing": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" },
"fidget": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "fidget": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"flash": { "branch": "main", "commit": "d0799ae43a581d9f190e182e2a1f389d2887c42a" }, "flash": { "branch": "main", "commit": "d0799ae43a581d9f190e182e2a1f389d2887c42a" },
@ -43,8 +42,10 @@
"nui": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nui": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
"null-ls": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "null-ls": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"obsidian": { "branch": "main", "commit": "14e0427bef6c55da0d63f9a313fd9941be3a2479" },
"plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"purescript": { "branch": "main", "commit": "82348352e6568fcc0385bd7c99a8ead3a479feea" }, "purescript": { "branch": "main", "commit": "82348352e6568fcc0385bd7c99a8ead3a479feea" },
"quicker.nvim": { "branch": "master", "commit": "183041a46d6c908eefb1c23ea02cce9c8f41256e" },
"rustacean": { "branch": "master", "commit": "5c0c44149e43b907dae2e0fe053284ad56226eb7" }, "rustacean": { "branch": "master", "commit": "5c0c44149e43b907dae2e0fe053284ad56226eb7" },
"rzip": { "branch": "master", "commit": "f65400fed27b27c7cff7ef8d428c4e5ff749bf28" }, "rzip": { "branch": "master", "commit": "f65400fed27b27c7cff7ef8d428c4e5ff749bf28" },
"scrap": { "branch": "main", "commit": "cc8453ed613932c744c3d1ec42f379b78bd8b92c" }, "scrap": { "branch": "main", "commit": "cc8453ed613932c744c3d1ec42f379b78bd8b92c" },
@ -52,6 +53,5 @@
"typst": { "branch": "main", "commit": "4d18ced62599ffe5b3c0e5e49566d5456121bc02" }, "typst": { "branch": "main", "commit": "4d18ced62599ffe5b3c0e5e49566d5456121bc02" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"wakatime": { "branch": "master", "commit": "3cb40867cb5a3120f9bef76eff88edc7f1dc1a23" }, "wakatime": { "branch": "master", "commit": "3cb40867cb5a3120f9bef76eff88edc7f1dc1a23" },
"web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, "web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }
"which-key.nvim": { "branch": "main", "commit": "c77cda8cd2f54965e4316699f1d124a2b3bf9d49" }
} }

View file

@ -1,15 +0,0 @@
local A = require("my.abbreviations")
local scrap = require("scrap")
local M = {}
M.symbols = {
{ "mto", ">>=" }, -- [M]onadic [t]o
{ "oalt", "<|>" }, -- [O]peration [A]lternative
{ "omono", "<>" }, -- [O]peration [M]onoid
}
function M.setup()
A.manyLocalAbbr(scrap.expand_many(M.symbols, A.no_capitalization))
end
return M

View file

@ -1,13 +0,0 @@
local A = require("my.abbreviations")
local scrap = require("scrap")
local M = {}
M.words = {
{ "thrf", "therefore" },
}
function M.setup()
A.manyGlobalAbbr(scrap.expand_many(M.words))
end
return M

View file

@ -23,8 +23,4 @@ function M.manyGlobalAbbr(abbreviations)
end end
end end
function M.setup()
require("my.abbreviations.global").setup()
end
return M return M

View file

@ -8,26 +8,6 @@ local function nocap(d)
end end
M.words = { M.words = {
-- {{{ General phrases
{ "thrf", "therefore" },
{ "bcla", "by contradiction let's assume" },
{ "wlg", "without loss of generality" },
{ "tits", "that is to say," },
{ "wpbd", "we will prove the statement in both directions." },
{ "stam{,s}", "statement{}" },
{ "{ww,tt}{m,i}", "{which,this} {means,implies}" },
{ "cex{,s}", "counterexample{}" },
{ "er{t,s,r}", "{transitivity,symmetry,reflexivity}" },
-- }}}
-- {{{ Calculus & analysis
{ "ib{p,s}", "integration by {parts,substitution}" },
{ "{o,c,}nb{,h}{,s}", "{open,closed,} neighbour{,hood}{}" },
{
"{n,}{{c,}d,iv,it}ble",
"{non-,}{{continuously,} differentia,inverti,integra}ble",
},
nocap({ "lshiz{c,}", "Lipschitz{ condition,}" }),
-- }}}
-- {{{ Linear algebra -- {{{ Linear algebra
{ "rref", "reduced row echalon form" }, { "rref", "reduced row echalon form" },
{ "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" }, { "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" },

View file

@ -6,8 +6,7 @@ end
function M.setup() function M.setup()
require("lazy").setup({ require("lazy").setup({
require("my.plugins.themes"), require("my.themes"),
require("my.plugins.whichkey"),
unpack(require("nix").lazy), unpack(require("nix").lazy),
}, { }, {
defaults = { lazy = true }, defaults = { lazy = true },

View file

@ -1,35 +0,0 @@
local runtime = require("my.tempest")
local M = {
"folke/which-key.nvim",
-- event = "VeryLazy",
lazy = true,
cond = runtime.blacklist("vscode"),
}
function M.config()
local wk = require("which-key")
wk.setup({
window = {
winblend = 0,
pumblend = 0,
border = "single",
},
layout = { align = "center" },
})
wk.register({
["<leader>"] = {
f = { name = "[F]iles" },
g = { name = "[G]o to" },
r = { name = "[R]ename / [R]eplace / [R]eload" },
l = { name = "[L]ocal" },
w = { name = "[W]orkspace" },
y = { name = "[Y]ank" },
s = { name = "[S]ettings" },
},
})
end
return M

View file

@ -1 +0,0 @@
Context/!

View file

@ -362,9 +362,7 @@ let
# {{{ scrap # {{{ scrap
scrap = { scrap = {
package = "prescientmoon/scrap.nvim"; package = "prescientmoon/scrap.nvim";
event = "InsertEnter"; event = "InsertEnter";
config.setup."my.abbreviations" = true;
}; };
# }}} # }}}
# }}} # }}}
@ -375,10 +373,6 @@ let
name = "mini.statusline"; name = "mini.statusline";
dependencies.lua = [ "web-devicons" ]; dependencies.lua = [ "web-devicons" ];
cond = blacklist [
"vscode"
"firenvim"
];
lazy = false; lazy = false;
opts.content.inactive = opts.content.inactive =
@ -417,10 +411,6 @@ let
name = "mini.files"; name = "mini.files";
dependencies.lua = [ "web-devicons" ]; dependencies.lua = [ "web-devicons" ];
cond = blacklist [
"vscode"
"firenvim"
];
keys = { keys = {
mapping = "<c-s-f>"; mapping = "<c-s-f>";
desc = "[S]earch [F]iles"; desc = "[S]earch [F]iles";
@ -439,6 +429,17 @@ let
opts.mappings.go_in_plus = "l"; opts.mappings.go_in_plus = "l";
}; };
# }}} # }}}
# {{{ quicker.nvim
quicker-nvim = {
package = "stevearc/quicker.nvim";
name = "quicker.nvim";
dependencies.lua = [ "web-devicons" ];
event = "FileType qf";
opts = { };
};
# }}}
# {{{ harpoon # {{{ harpoon
harpoon = { harpoon = {
package = "ThePrimeagen/harpoon"; package = "ThePrimeagen/harpoon";
@ -478,7 +479,6 @@ let
telescope = { telescope = {
package = "nvim-telescope/telescope.nvim"; package = "nvim-telescope/telescope.nvim";
version = "0.1.x"; version = "0.1.x";
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
# {{{ Dependencies # {{{ Dependencies
@ -550,7 +550,6 @@ let
dressing = { dressing = {
package = "stevearc/dressing.nvim"; package = "stevearc/dressing.nvim";
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
opts = { opts = {
@ -572,7 +571,6 @@ let
package = "lukas-reineke/indent-blankline.nvim"; package = "lukas-reineke/indent-blankline.nvim";
main = "ibl"; main = "ibl";
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
config = true; config = true;
@ -624,7 +622,6 @@ let
package = "j-hui/fidget.nvim"; package = "j-hui/fidget.nvim";
tag = "legacy"; tag = "legacy";
cond = blacklist "vscode";
event = "BufReadPre"; event = "BufReadPre";
config = true; config = true;
}; };
@ -644,7 +641,6 @@ let
dependencies.nix = [ pkgs.tree-sitter ]; dependencies.nix = [ pkgs.tree-sitter ];
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
#{{{ Highlighting #{{{ Highlighting
@ -665,7 +661,6 @@ let
flash = { flash = {
package = "folke/flash.nvim"; package = "folke/flash.nvim";
cond = blacklist "vscode";
keys = keys =
let let
nmap = mode: mapping: action: desc: { nmap = mode: mapping: action: desc: {
@ -689,7 +684,6 @@ let
ftft = { ftft = {
package = "gukz/ftFT.nvim"; package = "gukz/ftFT.nvim";
cond = blacklist "vscode";
keys = [ keys = [
"f" "f"
"F" "F"
@ -704,7 +698,6 @@ let
clipboard-image = { clipboard-image = {
package = "postfen/clipboard-image.nvim"; package = "postfen/clipboard-image.nvim";
cond = blacklist "firenvim";
cmd = "PasteImg"; cmd = "PasteImg";
keys = { keys = {
@ -734,7 +727,6 @@ let
lastplace = { lastplace = {
package = "ethanholz/nvim-lastplace"; package = "ethanholz/nvim-lastplace";
cond = blacklist "vscode";
event = "BufReadPre"; event = "BufReadPre";
opts.lastplace_ignore_buftype = [ opts.lastplace_ignore_buftype = [
@ -748,7 +740,6 @@ let
undotree = { undotree = {
package = "mbbill/undotree"; package = "mbbill/undotree";
cond = blacklist "vscode";
cmd = "UndotreeToggle"; cmd = "UndotreeToggle";
keys = nmap "<leader>u" "<cmd>UndoTreeToggle<cr>" "[U]ndo tree"; keys = nmap "<leader>u" "<cmd>UndoTreeToggle<cr>" "[U]ndo tree";
}; };
@ -897,7 +888,6 @@ let
package = "L3MON4D3/LuaSnip"; package = "L3MON4D3/LuaSnip";
version = "v2"; version = "v2";
cond = blacklist "vscode";
config = config =
_: _:
do [ do [
@ -963,7 +953,6 @@ let
dir = miros-nvim; dir = miros-nvim;
dependencies.nix = [ miros ]; dependencies.nix = [ miros ];
cond = blacklist "vscode";
ft = "miros"; ft = "miros";
keys = { keys = {
@ -1018,7 +1007,6 @@ let
]; ];
package = "neovim/nvim-lspconfig"; package = "neovim/nvim-lspconfig";
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
config = config =
@ -1106,7 +1094,6 @@ let
); );
package = "stevearc/conform.nvim"; package = "stevearc/conform.nvim";
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
opts.format_on_save.lsp_fallback = true; opts.format_on_save.lsp_fallback = true;
@ -1165,7 +1152,6 @@ let
dependencies.lua = [ "lspconfig" ]; dependencies.lua = [ "lspconfig" ];
dependencies.nix = lib.lists.optional packedTargets.python pkgs.ruff; dependencies.nix = lib.lists.optional packedTargets.python pkgs.ruff;
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
opts = _: { sources = [ (require "null-ls" /builtins/diagnostics/ruff) ]; }; opts = _: { sources = [ (require "null-ls" /builtins/diagnostics/ruff) ]; };
@ -1187,7 +1173,6 @@ let
"luasnip" "luasnip"
]; ];
cond = blacklist "vscode";
event = [ event = [
"InsertEnter" "InsertEnter"
"CmdlineEnter" "CmdlineEnter"
@ -1207,7 +1192,6 @@ let
"nvim-neotest/nvim-nio" "nvim-neotest/nvim-nio"
]; ];
cond = blacklist "vscode";
config = _: { config = _: {
setup.neotest = { setup.neotest = {
status.virtual_text = true; status.virtual_text = true;
@ -1245,7 +1229,6 @@ let
dependencies.lua = [ "plenary" ]; dependencies.lua = [ "plenary" ];
version = "^2"; version = "^2";
cond = blacklist "vscode";
ft = [ ft = [
"haskell" "haskell"
"lhaskell" "lhaskell"
@ -1276,7 +1259,6 @@ let
pkgs.rustfmt pkgs.rustfmt
]; ];
cond = blacklist "vscode";
lazy = false; # This plugin is already lazy lazy = false; # This plugin is already lazy
config.autocmds = { config.autocmds = {
@ -1296,7 +1278,6 @@ let
package = "saecki/crates.nvim"; package = "saecki/crates.nvim";
dependencies.lua = [ "plenary" ]; dependencies.lua = [ "plenary" ];
cond = blacklist "vscode";
event = "BufReadPost Cargo.toml"; event = "BufReadPost Cargo.toml";
# {{{ Set up null_ls source # {{{ Set up null_ls source
@ -1374,7 +1355,6 @@ let
"lspconfig" "lspconfig"
]; ];
cond = blacklist "vscode";
ft = "lean"; ft = "lean";
opts = { opts = {
@ -1399,7 +1379,6 @@ let
"lspconfig" "lspconfig"
]; ];
cond = blacklist "vscode";
ft = [ ft = [
"idris2" "idris2"
"lidris2" "lidris2"
@ -1436,7 +1415,6 @@ let
github-actions = { github-actions = {
package = "yasuhiroki/github-actions-yaml.vim"; package = "yasuhiroki/github-actions-yaml.vim";
cond = blacklist "vscode";
ft = [ ft = [
"yml" "yml"
"yaml" "yaml"
@ -1452,7 +1430,6 @@ let
upkgs.typstfmt upkgs.typstfmt
]; ];
cond = blacklist "vscode";
ft = "typst"; ft = "typst";
}; };
# }}} # }}}
@ -1460,7 +1437,6 @@ let
purescript = { purescript = {
package = "purescript-contrib/purescript-vim"; package = "purescript-contrib/purescript-vim";
cond = blacklist "vscode";
ft = "purescript"; ft = "purescript";
}; };
# }}} # }}}
@ -1468,7 +1444,6 @@ let
hyprland = { hyprland = {
package = "theRealCarneiro/hyprland-vim-syntax"; package = "theRealCarneiro/hyprland-vim-syntax";
cond = blacklist "vscode";
ft = "hypr"; ft = "hypr";
init.autocmds = { init.autocmds = {
@ -1483,7 +1458,6 @@ let
# Required for yarn PNP to work # Required for yarn PNP to work
rzip = { rzip = {
package = "lbrayner/vim-rzip"; package = "lbrayner/vim-rzip";
cond = blacklist "vscode";
event = "VeryLazy"; event = "VeryLazy";
}; };
# }}} # }}}
@ -1499,7 +1473,6 @@ let
in in
{ {
dir = "${djot}/editors/vim"; dir = "${djot}/editors/vim";
cond = blacklist "vscode";
ft = "djot"; ft = "djot";
config.autocmds = { config.autocmds = {
@ -1518,10 +1491,6 @@ let
package = "wakatime/vim-wakatime"; package = "wakatime/vim-wakatime";
dependencies.nix = [ pkgs.wakatime ]; dependencies.nix = [ pkgs.wakatime ];
cond = blacklist [
"vscode"
"firenvim"
];
event = "VeryLazy"; event = "VeryLazy";
}; };
# }}} # }}}
@ -1531,10 +1500,6 @@ let
package = "andweeb/presence.nvim"; package = "andweeb/presence.nvim";
main = "presence"; main = "presence";
cond = blacklist [
"vscode"
"firenvim"
];
event = "VeryLazy"; event = "VeryLazy";
config = true; config = true;
}; };
@ -1545,10 +1510,6 @@ let
package = "ruifm/gitlinker.nvim"; package = "ruifm/gitlinker.nvim";
dependencies.lua = [ "plenary" ]; dependencies.lua = [ "plenary" ];
cond = blacklist [
"vscode"
"firenvim"
];
opts.mappings = "<leader>yg"; opts.mappings = "<leader>yg";
keys = { keys = {
mapping = opts.mappings; mapping = opts.mappings;
@ -1566,16 +1527,7 @@ let
dependencies.lua = [ "plenary" ]; dependencies.lua = [ "plenary" ];
event = "VeryLazy"; event = "VeryLazy";
cond = [ cond = lua "vim.loop.cwd() == ${encode obsidianVault}";
(blacklist [
"vscode"
"firenvim"
])
(
# lua
lua "vim.loop.cwd() == ${encode obsidianVault}"
)
];
config.keys = config.keys =
let let
@ -1623,11 +1575,7 @@ let
# {{{ navigator # {{{ navigator
navigator = { navigator = {
package = "numToStr/Navigator.nvim"; package = "numToStr/Navigator.nvim";
cond = blacklist [ cond = blacklist [ "neovide" ];
"vscode"
"firenvim"
"neovide"
];
config = true; config = true;
keys = [ keys = [

View file

@ -9,3 +9,4 @@ block auto
abbr lor \/ abbr lor \/
abbr langle ⟨ abbr langle ⟨
abbr rangle \⟩ abbr rangle \⟩
abbr thrf therefore

View file

@ -0,0 +1,23 @@
block !word
for s <- @⟨,s⟩
block
for b <- @⟨b,B⟩
for w <- @⟨w,W⟩
for t <- @⟨w,W⟩
abbr @b⋄cla @b⋄y contradiction let's assume
abbr @w⋄lg @w⋄ithout loss of generality
abbr @t⋄its @t⋄hat is to say,
abbr @w⋄pbd @w⋄e will prove the statement in both directions.
abbr stam@s statement@s
abbr cex@s counterexample@s
for who <- @⟨which, this⟩
for what <- @⟨means, implies⟩
abbr @who@what @⟨@who:which,this⟩@⟨@what:means,implies⟩
for kind <- @⟨parts,substitution⟩
abbr ib@⟨@kind:p,s⟩ integration by @kind

View file

@ -14,6 +14,10 @@ let
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
# }}} # }}}
# {{{ Satellite subprojects
../../../../dns/implementation/nixos-module.nix
../../../../dns/implementation/nixos-module-assertions.nix
# }}}
# {{{ global configuration # {{{ global configuration
./cli/fish.nix ./cli/fish.nix
./services/openssh.nix ./services/openssh.nix

View file

@ -1,11 +1,11 @@
{ config, lib, ... }: { config, ... }:
{ {
sops.secrets.microbin_env.sopsFile = ../secrets.yaml; sops.secrets.microbin_env.sopsFile = ../secrets.yaml;
satellite.cloudflared.at.bin.port = config.satellite.ports.microbin; satellite.cloudflared.at.bin.port = config.satellite.ports.microbin;
services.microbin = { services.microbin = {
enable = true; enable = true;
dataDir = "/var/lib/microbin"; dataDir = "/persist/state/var/lib/microbin";
passwordFile = config.sops.secrets.microbin_env.path; passwordFile = config.sops.secrets.microbin_env.path;
# {{{ Settings # {{{ Settings
@ -39,11 +39,4 @@
}; };
# }}} # }}}
}; };
systemd.services.microbin.serviceConfig = {
# We want to use systemd's `StateDirectory` mechanism to fix permissions
ReadWritePaths = lib.mkForce [ ];
};
environment.persistence."/persist/state".directories = [ "/var/lib/private/microbin" ];
} }

View file

@ -9,15 +9,3 @@ This directory contains custom module definitions used throughout my config.
| [common](./common) | Modules usable in both HM and nixos (and perhaps other places) | | [common](./common) | Modules usable in both HM and nixos (and perhaps other places) |
| [nixos](./nixos) | Nixos specific functionality | | [nixos](./nixos) | Nixos specific functionality |
| [home-manager](./home-manager) | Home manager specific functionality | | [home-manager](./home-manager) | Home manager specific functionality |
## Common modules
| Name | Attribute | Description |
| ----------------------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------- |
| [toggles](./common/toggles.nix) | `satellite.toggles` | Generic interface for feature flags |
| [lua-lib](./common/lua-lib.nix) | `satellite.lib.lua` | Helpers for working with lua code |
| [korora-lua](./common/korora-lua.nix) | - | Nix -> lua encoder typechecked using [korora](https://github.com/adisbladis/korora) |
| [korora-neovim](./common/korora-neovim.nix) | - | Nix -> neovim config helpers typechecked using [korora](https://github.com/adisbladis/korora) |
| [theming](./common/theming.nix) | `satellite.theming` | [stylix](https://github.com/danth/stylix) theming helpers and configuration |
| [lua-colorscheme](./common/lua-colorscheme.nix) | `satellite.colorscheme.lua` | Base16 theme to lua module generation |
| [octodns](./common/octodns.nix) | `satellite.dns.octodns` | Octodns config generation |

View file

@ -10,11 +10,3 @@
| [korora-neovim](korora-neovim.nix) | - | Nix -> neovim config helpers | | [korora-neovim](korora-neovim.nix) | - | Nix -> neovim config helpers |
| [theming](theming.nix) | `satellite.theming` | Stylix theming helpers | | [theming](theming.nix) | `satellite.theming` | Stylix theming helpers |
| [lua-colorscheme](lua-colorscheme.nix) | `satellite.colorscheme.lua` | Base16 theme -> lua | | [lua-colorscheme](lua-colorscheme.nix) | `satellite.colorscheme.lua` | Base16 theme -> lua |
## Other modules
These are special-purpose modules that are used for other purposes
| Name | Attribute | Description |
| ---------------------- | ----------------------- | ------------------------- |
| [octodns](octodns.nix) | `satellite.dns.octodns` | Octodns config generation |

View file

@ -1,48 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
format = pkgs.formats.yaml { };
cfg = config.satellite.dns;
in
{
options.satellite.dns.octodns = lib.mkOption {
description = "Derivation building a directory containing all the zone files";
type = lib.types.path;
};
config.satellite.dns.octodns =
let
grouped = builtins.groupBy (entry: entry.zone) cfg.records;
cpLines = lib.mapAttrsToList (
zone: group:
let
grouped = builtins.groupBy (entry: entry.at) group;
contents = lib.mapAttrs (
at: entries:
lib.lists.forEach entries (
entry:
let
content =
if builtins.typeOf entry.value == "list" then
{ values = entry.value; }
else
{ inherit (entry) value; };
cloudflare = if entry.enableCloudflareProxy then { octodns.cloudflare.proxied = true; } else { };
in
{ inherit (entry) ttl type; } // content // cloudflare
)
) grouped;
file = format.generate "${zone}.yaml" contents;
in
"cp ${file} $out/${zone}.yaml"
) grouped;
in
pkgs.runCommand "octodns-zones" { } ''
mkdir $out
${lib.concatStringsSep "\n" cpLines}
'';
}

View file

@ -1,11 +1,9 @@
# Nixos modules # Nixos modules
| Name | Attribute | Description | | Name | Attribute | Description |
| ------------------------------------ | ----------------------- | ------------------------------------ | | ------------------------------ | ----------------------- | ------------------------------------ |
| [pounce](pounce.nix) | `services.pounce` | Pounce & calico configuration | | [pounce](pounce.nix) | `services.pounce` | Pounce & calico configuration |
| [nginx](nginx.nix) | `satellite.nginx` | Nginx configuration | | [nginx](nginx.nix) | `satellite.nginx` | Nginx configuration |
| [ports](ports.nix) | `satellite.ports` | Global port specification | | [ports](ports.nix) | `satellite.ports` | Global port specification |
| [cloudflared](cloudflared.nix) | `satellite.cloudflared` | Cloudflare tunnel configuration | | [cloudflared](cloudflared.nix) | `satellite.cloudflared` | Cloudflare tunnel configuration |
| [pilot](pilot.nix) | `satellite.pilot` | Defines the concept of a "main user" | | [pilot](pilot.nix) | `satellite.pilot` | Defines the concept of a "main user" |
| [dns](dns.nix) | `satellite.dns` | DNS record creation |
| [dns-assertions](dns-assertions.nix) | `satellite.dns` | DNS record validation |

View file

@ -7,6 +7,4 @@
nginx = ./nginx.nix; nginx = ./nginx.nix;
pilot = ./pilot.nix; pilot = ./pilot.nix;
pounce = ./pounce.nix; pounce = ./pounce.nix;
dns = ./dns.nix;
dns-assertions = ./dns-assertions.nix;
} }

View file

@ -9,21 +9,8 @@
let let
plymouthThemes = pkgs.callPackage (import ./plymouth-themes.nix) { }; plymouthThemes = pkgs.callPackage (import ./plymouth-themes.nix) { };
in in
rec { {
plymouthThemeCutsAlt = plymouthThemes.cuts_alt; plymouthThemeCutsAlt = plymouthThemes.cuts_alt;
vimclip = pkgs.callPackage (import ./vimclip.nix) { }; vimclip = pkgs.callPackage (import ./vimclip.nix) { };
homer = pkgs.callPackage (import ./homer.nix) { }; homer = pkgs.callPackage (import ./homer.nix) { };
octodns = pkgs.octodns.overrideAttrs (_: {
version = "unstable-2024-10-08";
src = pkgs.fetchFromGitHub {
owner = "octodns";
repo = "octodns";
rev = "a1456cb1fcf00916ca06b204755834210a3ea9cf";
sha256 = "192hbxhb0ghcbzqy3h8q194n4iy7bqfj9ra9qqjff3x2z223czxb";
};
});
octodns-cloudflare = pkgs.python3Packages.callPackage (import ./octodns-cloudflare.nix) {
inherit octodns;
};
} }