run nixfmt

This commit is contained in:
Joakim Repomaa
2025-03-01 13:23:01 +02:00
parent a93d4afbcf
commit 8dfc9b5a6d
51 changed files with 1611 additions and 778 deletions

View File

@@ -1 +1,5 @@
{ util, inputs, ... }: util.vimPlugin { name = "commander.nvim"; source = inputs.commander-nvim; } { util, inputs, ... }:
util.vimPlugin {
name = "commander.nvim";
source = inputs.commander-nvim;
}

View File

@@ -2,15 +2,13 @@
let let
inherit (pkgs) crystal libffi; inherit (pkgs) crystal libffi;
in in
crystal.overrideAttrs (oldAttrs: crystal.overrideAttrs (oldAttrs: {
{ makeFlags = oldAttrs.makeFlags ++ [
makeFlags = oldAttrs.makeFlags ++ [ "interpreter=1"
"interpreter=1" ];
]; buildInputs = oldAttrs.buildInputs ++ [
buildInputs = oldAttrs.buildInputs ++ [ libffi
libffi ];
]; FLAGS = [ "--single-module" ];
FLAGS = ["--single-module"]; doCheck = false;
doCheck = false; })
}
)

View File

@@ -2,8 +2,18 @@
let let
inherit (builtins) attrNames filter readDir; inherit (builtins) attrNames filter readDir;
dirs = dirs =
let files = readDir ./.; let
in filter (name: files."${name}" == "directory") (attrNames files); files = readDir ./.;
in
filter (name: files."${name}" == "directory") (attrNames files);
util = import ./util.nix; util = import ./util.nix;
in in
lib.composeManyExtensions (map (dir: import ./${dir} { util = util dir; inherit inputs; }) dirs) lib.composeManyExtensions (
map (
dir:
import ./${dir} {
util = util dir;
inherit inputs;
}
) dirs
)

View File

@@ -1,4 +1,10 @@
{ lib, stdenv, fetchurl, python3, ... }: {
lib,
stdenv,
fetchurl,
python3,
...
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fb-client"; pname = "fb-client";
version = "2.3.0"; version = "2.3.0";
@@ -8,8 +14,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-EWTsoG7qy0IQ1GLEuvHEAEJyphl9hz1hFm53k1OdGYM="; sha256 = "sha256-EWTsoG7qy0IQ1GLEuvHEAEJyphl9hz1hFm53k1OdGYM=";
}; };
buildInputs = buildInputs = [
[ (python3.withPackages (pyPkgs: with pyPkgs; [ pycurl pyxdg ])) ]; (python3.withPackages (
pyPkgs: with pyPkgs; [
pycurl
pyxdg
]
))
];
makeFlags = [ "PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];

View File

@@ -1 +1,5 @@
{ inputs, util, ... }: util.vimPlugin { name = "gen.nvim"; source = inputs.gen-nvim; } { inputs, util, ... }:
util.vimPlugin {
name = "gen.nvim";
source = inputs.gen-nvim;
}

View File

@@ -1,6 +1,6 @@
dir: dir: {
{ vimPlugin =
vimPlugin = { name, source }: { name, source }:
final: prev: { final: prev: {
vimPlugins = prev.vimPlugins // { vimPlugins = prev.vimPlugins // {
"${dir}" = prev.vimUtils.buildVimPlugin { "${dir}" = prev.vimUtils.buildVimPlugin {
@@ -12,5 +12,7 @@ dir:
}; };
}; };
package = attrs: final: prev: { "${dir}" = final.callPackage ./${dir}/package.nix (attrs // { pkgs = prev; }); }; package = attrs: final: prev: {
"${dir}" = final.callPackage ./${dir}/package.nix (attrs // { pkgs = prev; });
};
} }

View File

@@ -1 +1,5 @@
{ inputs, util, ... }: util.vimPlugin { name = "vimpeccable"; source = inputs.vimpeccable; } { inputs, util, ... }:
util.vimPlugin {
name = "vimpeccable";
source = inputs.vimpeccable;
}

View File

@@ -1 +1,5 @@
{ inputs, util, ... }: util.vimPlugin { name = "windline.nvim"; source = inputs.windline-nvim; } { inputs, util, ... }:
util.vimPlugin {
name = "windline.nvim";
source = inputs.windline-nvim;
}

View File

@@ -73,7 +73,15 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { flake-parts, agenix, nixpkgs, self, colmena, ... }@inputs: outputs =
{
flake-parts,
agenix,
nixpkgs,
self,
colmena,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } ( flake-parts.lib.mkFlake { inherit inputs; } (
let let
ssh.publicKeys.yubikey = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLIUkESu5NnBi1M0+ZjYrkp6/rIFuwc3aguspf98jmOydNce6l65cnS3GRzc9oWx4lu11ahi87ZuE+pYV+gaHm4="; ssh.publicKeys.yubikey = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLIUkESu5NnBi1M0+ZjYrkp6/rIFuwc3aguspf98jmOydNce6l65cnS3GRzc9oWx4lu11ahi87ZuE+pYV+gaHm4=";
@@ -81,25 +89,32 @@
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
in in
{ {
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; systems = [
perSystem = { pkgs, system, ... }: { "x86_64-linux"
devShells.default = pkgs.mkShell { "x86_64-darwin"
packages = with pkgs; [ "aarch64-linux"
agenix.packages.${system}.default "aarch64-darwin"
colmena.packages.${system}.colmena ];
colmena.packages.${system}.manual perSystem =
(pkgs.writeShellScriptBin "build" '' { pkgs, system, ... }:
colmena --experimental-flake-eval build --keep-result "$@" {
'') devShells.default = pkgs.mkShell {
(pkgs.writeShellScriptBin "apply" '' packages = with pkgs; [
colmena --experimental-flake-eval apply --keep-result "$@" agenix.packages.${system}.default
'') colmena.packages.${system}.colmena
(pkgs.writeShellScriptBin "apply-local" '' colmena.packages.${system}.manual
colmena --experimental-flake-eval apply-local --sudo "$@" (pkgs.writeShellScriptBin "build" ''
'') colmena --experimental-flake-eval build --keep-result "$@"
]; '')
(pkgs.writeShellScriptBin "apply" ''
colmena --experimental-flake-eval apply --keep-result "$@"
'')
(pkgs.writeShellScriptBin "apply-local" ''
colmena --experimental-flake-eval apply-local --sudo "$@"
'')
];
};
}; };
};
flake = { flake = {
colmenaHive = colmena.lib.makeHive self.outputs.colmena; colmenaHive = colmena.lib.makeHive self.outputs.colmena;
@@ -113,16 +128,23 @@
}; };
}; };
defaults = { name, ... }: { defaults =
imports = [ ./modules ./hosts/${name} ]; { name, ... }:
}; {
imports = [
radish = { ... }: { ./modules
deployment = { ./hosts/${name}
allowLocalDeployment = true; ];
targetHost = null; };
radish =
{ ... }:
{
deployment = {
allowLocalDeployment = true;
targetHost = null;
};
}; };
};
freun-dev = { ... }: { }; freun-dev = { ... }: { };

View File

@@ -1,4 +1,12 @@
{ config, lib, pkgs, inputs, self, ... }: { {
config,
lib,
pkgs,
inputs,
self,
...
}:
{
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
imports = [ imports = [
../gnome ../gnome
@@ -83,7 +91,10 @@
home-manager.enable = true; home-manager.enable = true;
bat = { bat = {
enable = true; enable = true;
extraPackages = with pkgs.bat-extras; [ batdiff batwatch ]; extraPackages = with pkgs.bat-extras; [
batdiff
batwatch
];
config = { config = {
pager = "less -FR"; pager = "less -FR";
}; };
@@ -277,8 +288,13 @@
bright_white = "#ffffff"; bright_white = "#ffffff";
}; };
component_style = { component_style = {
playback_metadata = { fg = "#8abeb7"; }; playback_metadata = {
playback_progress_bar = { bg = "#1d1f21"; fg = "#c5c8c6"; }; fg = "#8abeb7";
};
playback_progress_bar = {
bg = "#1d1f21";
fg = "#c5c8c6";
};
}; };
} }
]; ];
@@ -299,6 +315,39 @@
host = "https://bin.freun.dev"; host = "https://bin.freun.dev";
auth_token_file = "${config.xdg.configHome}/hastebin/auth_token"; auth_token_file = "${config.xdg.configHome}/hastebin/auth_token";
clipboard_command = "${pkgs.wl-copy-both}/bin/wl-copy"; clipboard_command = "${pkgs.wl-copy-both}/bin/wl-copy";
default_renderers =
let
code = [
"js"
"ts"
"jsx"
"tsx"
"rs"
"nix"
"cr"
"ecr"
"rb"
"erb"
"yaml"
"yml"
"json"
"toml"
"html"
"xml"
"css"
"scss"
"sass"
"less"
"sql"
"sh"
];
in
lib.listToAttrs (
lib.map (name: {
inherit name;
value = "hl";
}) code
);
}; };
}; };
zed-editor = { zed-editor = {
@@ -334,23 +383,68 @@
paperwm = { paperwm = {
enable = true; enable = true;
winprops = [ winprops = [
{ wm_class = "vivaldi-stable"; preferredWidth = "67%"; } {
{ wm_class = "yubioath-flutter"; scratch_layer = true; } wm_class = "vivaldi-stable";
{ wm_class = "signal"; scratch_layer = true; } preferredWidth = "67%";
{ wm_class = "Slack"; scratch_layer = true; } }
{ wm_class = "Supersonic"; scratch_layer = true; } {
{ wm_class = "io.github.seadve.Kooha"; scratch_layer = true; } wm_class = "yubioath-flutter";
{ wm_class = "/.*/"; preferredWidth = "33"; } scratch_layer = true;
}
{
wm_class = "signal";
scratch_layer = true;
}
{
wm_class = "Slack";
scratch_layer = true;
}
{
wm_class = "Supersonic";
scratch_layer = true;
}
{
wm_class = "io.github.seadve.Kooha";
scratch_layer = true;
}
{
wm_class = "/.*/";
preferredWidth = "33";
}
]; ];
keybindings = { keybindings = {
move-down = [ "<Control><Super>Down" "<Shift><Super>j" ]; move-down = [
move-left = [ "<Control><Super>Left" "<Shift><Super>h" ]; "<Control><Super>Down"
move-right = [ "<Control><Super>Right" "<Shift><Super>l" ]; "<Shift><Super>j"
move-up = [ "<Control><Super>Up" "<Shift><Super>k" ]; ];
switch-down = [ "<Super>Down" "<Super>j" ]; move-left = [
switch-left = [ "<Super>Left" "<Super>h" ]; "<Control><Super>Left"
switch-right = [ "<Super>Right" "<Super>l" ]; "<Shift><Super>h"
switch-up = [ "<Super>Up" "<Super>k" ]; ];
move-right = [
"<Control><Super>Right"
"<Shift><Super>l"
];
move-up = [
"<Control><Super>Up"
"<Shift><Super>k"
];
switch-down = [
"<Super>Down"
"<Super>j"
];
switch-left = [
"<Super>Left"
"<Super>h"
];
switch-right = [
"<Super>Right"
"<Super>l"
];
switch-up = [
"<Super>Up"
"<Super>k"
];
}; };
}; };
freon = { freon = {

View File

@@ -1,8 +1,17 @@
{ inputs, lib, pkgs, config, ... }: {
inputs,
lib,
pkgs,
config,
...
}:
let let
completion = pkgs.stdenv.mkDerivation { completion = pkgs.stdenv.mkDerivation {
name = "dnote-completion"; name = "dnote-completion";
phases = [ "unpackPhase" "installPhase" ]; phases = [
"unpackPhase"
"installPhase"
];
src = inputs.dnote; src = inputs.dnote;
installPhase = '' installPhase = ''
mkdir -p $out/lib/dnote/zsh-completion/completions mkdir -p $out/lib/dnote/zsh-completion/completions

View File

@@ -5,7 +5,13 @@
programs.neovim = programs.neovim =
let let
toLua = lib.generators.toLua { }; toLua = lib.generators.toLua { };
luaMap = rhs: { rhs = rhs; lua = true; options = { silent = true; }; }; luaMap = rhs: {
rhs = rhs;
lua = true;
options = {
silent = true;
};
};
in in
{ {
enable = true; enable = true;
@@ -50,7 +56,10 @@
filetypes = [ "crystal" ]; filetypes = [ "crystal" ];
globs = [ "*.cr" ]; globs = [ "*.cr" ];
exe = "${pkgs.crystal}/bin/crystal"; exe = "${pkgs.crystal}/bin/crystal";
args = file: [ "tool" "format" ]; args = file: [
"tool"
"format"
];
stdin = false; stdin = false;
} }
]; ];
@@ -69,7 +78,11 @@
} }
{ {
event = "FileType"; event = "FileType";
pattern = [ "gitcommit" "gitrebase" "gitconfig" ]; pattern = [
"gitcommit"
"gitrebase"
"gitconfig"
];
command = "set bufhidden=delete"; command = "set bufhidden=delete";
} }
{ {
@@ -111,17 +124,41 @@
vim-crystal vim-crystal
{ {
plugin = telescope-nvim; plugin = telescope-nvim;
dependencies = [ plenary-nvim telescope-file-browser-nvim commander-nvim telescope-ui-select-nvim ]; dependencies = [
plenary-nvim
telescope-file-browser-nvim
commander-nvim
telescope-ui-select-nvim
];
config = config =
let let
commands = [ commands = [
{ cmd = "<cmd>!rails db:migrate<cr>"; desc = "Run rails migrations"; } {
{ cmd = "<cmd>!yarn codegen --no-watch<cr>"; desc = "Run yarn codegen"; } cmd = "<cmd>!rails db:migrate<cr>";
{ cmd = "<cmd>!rails translations:update<cr>"; desc = "Update i18n translations"; } desc = "Run rails migrations";
{ cmd = "<cmd>!deploy staging-v6 -t $(git branch --show-current)<cr>"; desc = "Deploy to staging"; } }
{ cmd = "<cmd>!db-restore -d db-prod-inc<cr>"; desc = "Restore db from prod-inc"; } {
cmd = "<cmd>!yarn codegen --no-watch<cr>";
desc = "Run yarn codegen";
}
{
cmd = "<cmd>!rails translations:update<cr>";
desc = "Update i18n translations";
}
{
cmd = "<cmd>!deploy staging-v6 -t $(git branch --show-current)<cr>";
desc = "Deploy to staging";
}
{
cmd = "<cmd>!db-restore -d db-prod-inc<cr>";
desc = "Restore db from prod-inc";
}
]; ];
mappings = { i = { "<c-h>" = "which_key"; }; }; mappings = {
i = {
"<c-h>" = "which_key";
};
};
in in
'' ''
local telescope = require('telescope') local telescope = require('telescope')
@@ -146,27 +183,21 @@
}) })
''; '';
mappings = { mappings = {
normal = ( normal =
lib.attrsets.mapAttrs (lib.attrsets.mapAttrs (key: value: luaMap "require('telescope.builtin').${value}") {
(key: value: luaMap "require('telescope.builtin').${value}") "<leader>f" = "find_files";
{ "<leader>r" = "live_grep";
"<leader>f" = "find_files"; "<leader>b" = "buffers";
"<leader>r" = "live_grep"; "<leader>h" = "help_tags";
"<leader>b" = "buffers"; "<leader>o" = "oldfiles";
"<leader>h" = "help_tags"; "<leader>s" = "git_status";
"<leader>o" = "oldfiles"; "<leader>/" = "current_buffer_fuzzy_find";
"<leader>s" = "git_status"; "<leader>c" = "git_branches";
"<leader>/" = "current_buffer_fuzzy_find"; })
"<leader>c" = "git_branches"; // (lib.attrsets.mapAttrs (key: value: luaMap "require('telescope').extensions.${value}") {
} "<leader>n" = "file_browser.file_browser";
) // ( "<leader>:" = "commander.filter";
lib.attrsets.mapAttrs });
(key: value: luaMap "require('telescope').extensions.${value}")
{
"<leader>n" = "file_browser.file_browser";
"<leader>:" = "commander.filter";
}
);
}; };
} }
{ {
@@ -176,17 +207,25 @@
vim.cmd('colorscheme base16-tomorrow-night') vim.cmd('colorscheme base16-tomorrow-night')
''; '';
} }
{ plugin = octo-nvim; config = "require('octo').setup()"; } {
plugin = octo-nvim;
config = "require('octo').setup()";
}
{ {
plugin = gitsigns-nvim; plugin = gitsigns-nvim;
dependencies = [ plenary-nvim ]; dependencies = [ plenary-nvim ];
config = '' config = ''
require('gitsigns').setup(${toLua { require('gitsigns').setup(${
current_line_blame = true; toLua {
}}) current_line_blame = true;
}
})
''; '';
} }
{ plugin = windline-nvim; config = "require('wlsample.airline')"; } {
plugin = windline-nvim;
config = "require('wlsample.airline')";
}
{ {
plugin = luasnip; plugin = luasnip;
config = '' config = ''
@@ -252,7 +291,10 @@
} }
{ {
plugin = toggleterm-nvim; plugin = toggleterm-nvim;
dependencies = [ plenary-nvim pkgs.lazygit ]; dependencies = [
plenary-nvim
pkgs.lazygit
];
config = '' config = ''
local Terminal = require('toggleterm.terminal').Terminal local Terminal = require('toggleterm.terminal').Terminal
local lazygit = Terminal:new({ local lazygit = Terminal:new({
@@ -277,16 +319,18 @@
} }
{ {
plugin = copilot-cmp; plugin = copilot-cmp;
dependencies = [{ dependencies = [
plugin = copilot-lua; {
config = '' plugin = copilot-lua;
require('copilot').setup({ config = ''
suggestion = { enabled = false }, require('copilot').setup({
panel = { enajkbled = false }, suggestion = { enabled = false },
copilot_node_command = '${pkgs.nodejs}/bin/node', panel = { enajkbled = false },
}) copilot_node_command = '${pkgs.nodejs}/bin/node',
''; })
}]; '';
}
];
config = '' config = ''
require('copilot_cmp').setup() require('copilot_cmp').setup()
''; '';
@@ -318,9 +362,11 @@
'' ''
require('bufferline').setup({ options = ${toLua options} }) require('bufferline').setup({ options = ${toLua options} })
''; '';
dependencies = [{ dependencies = [
plugin = nvim-web-devicons; {
}]; plugin = nvim-web-devicons;
}
];
} }
]; ];
lsp = { lsp = {
@@ -342,7 +388,11 @@
name = "yamlls"; name = "yamlls";
config = { config = {
settings = { settings = {
redhat = { telemetry = { enabled = false; }; }; redhat = {
telemetry = {
enabled = false;
};
};
yaml = { yaml = {
schemas = { schemas = {
"https://json.schemastore.org/github-workflow" = ".github/workflows/*.yml"; "https://json.schemastore.org/github-workflow" = ".github/workflows/*.yml";
@@ -351,7 +401,10 @@
"https://json.schemastore.org/prettierrc.yaml" = ".prettierrc.yaml"; "https://json.schemastore.org/prettierrc.yaml" = ".prettierrc.yaml";
"https://json.schemastore.org/prettier.config.yml" = "prettier.config.yml"; "https://json.schemastore.org/prettier.config.yml" = "prettier.config.yml";
"https://json.schemastore.org/prettier.config.yaml" = "prettier.config.yaml"; "https://json.schemastore.org/prettier.config.yaml" = "prettier.config.yaml";
"https://schema.jokke.space/caddy.json" = [ "*caddy*.yml" "*caddy*.yaml" ]; "https://schema.jokke.space/caddy.json" = [
"*caddy*.yml"
"*caddy*.yaml"
];
}; };
}; };
}; };
@@ -363,7 +416,10 @@
config = { config = {
settings = { settings = {
tailwindCSS = { tailwindCSS = {
classAttributes = [ "class" "className" ]; classAttributes = [
"class"
"className"
];
}; };
}; };
}; };
@@ -377,8 +433,14 @@
}; };
rootPattern = [ "package.json" ]; rootPattern = [ "package.json" ];
} }
{ name = "eslint"; package = vscode-langservers-extracted; } {
{ name = "nixd"; package = nixd; } name = "eslint";
package = vscode-langservers-extracted;
}
{
name = "nixd";
package = nixd;
}
{ {
name = "bashls"; name = "bashls";
package = nodePackages.bash-language-server.overrideAttrs (oldAttrs: { package = nodePackages.bash-language-server.overrideAttrs (oldAttrs: {

View File

@@ -2,8 +2,10 @@
let let
inherit (builtins) attrNames filter readDir; inherit (builtins) attrNames filter readDir;
dirs = dirs =
let files = readDir ./.; let
in filter (name: files."${name}" == "directory") (attrNames files); files = readDir ./.;
in
filter (name: files."${name}" == "directory") (attrNames files);
in in
{ {
imports = map (dir: ./${dir}) dirs; imports = map (dir: ./${dir}) dirs;

View File

@@ -1,19 +1,28 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
...
}:
let let
cfg = config.programs.fb-client; cfg = config.programs.fb-client;
in in
{ {
options.programs.fb-client = let inherit (lib) mkEnableOption mkOption types; in { options.programs.fb-client =
enable = mkEnableOption { }; let
pastebin = mkOption { inherit (lib) mkEnableOption mkOption types;
type = types.str; in
default = "https://paste.xinu.at"; {
enable = mkEnableOption { };
pastebin = mkOption {
type = types.str;
default = "https://paste.xinu.at";
};
clipboard_cmd = mkOption {
type = types.pathInStore;
default = "${pkgs.wl-clipboard}/bin/wl-copy";
};
}; };
clipboard_cmd = mkOption {
type = types.pathInStore;
default = "${pkgs.wl-clipboard}/bin/wl-copy";
};
};
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = [ pkgs.fb-client ]; home.packages = [ pkgs.fb-client ];

View File

@@ -1,4 +1,9 @@
{ config, lib, osConfig, ... }: {
config,
lib,
osConfig,
...
}:
let let
cfg = config.gnome; cfg = config.gnome;
in in
@@ -38,7 +43,12 @@ in
}; };
power = { power = {
powerButton = lib.mkOption { powerButton = lib.mkOption {
type = enum [ "suspend" "interactive" "hibernate" "nothing" ]; type = enum [
"suspend"
"interactive"
"hibernate"
"nothing"
];
default = "interactive"; default = "interactive";
}; };
}; };
@@ -75,56 +85,66 @@ in
}; };
config = { config = {
dconf.settings = with lib.hm.gvariant; { dconf.settings =
"org/gnome/shell/keybindings" = cfg.keybindings.builtin; with lib.hm.gvariant;
"org/gnome/settings-daemon/plugins/media-keys" = { {
custom-keybindings = ( "org/gnome/shell/keybindings" = cfg.keybindings.builtin;
lib.lists.imap0 "org/gnome/settings-daemon/plugins/media-keys" = {
(i: _: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}/") custom-keybindings = (
cfg.keybindings.custom lib.lists.imap0 (
); i: _: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}/"
}; ) cfg.keybindings.custom
"org/gnome/desktop/input-sources" = { );
sources = map (source: mkTuple [ "xkb" source ]) cfg.keyboard.sources; };
}; "org/gnome/desktop/input-sources" = {
"org/gnome/mutter" = { sources = map (
experimental-features = [ "scale-monitor-framebuffer" ]; source:
}; mkTuple [
"org/gnome/settings-daemon/plugins/xsettings" = { "xkb"
overrides = [ (mkTuple [ "GdkWindowScalingFactor" cfg.scalingFactor ]) ]; source
}; ]
"org/gnome/desktop/interface" = { ) cfg.keyboard.sources;
scaling-factor = cfg.scalingFactor; };
}; "org/gnome/mutter" = {
"org/gnome/settings-daemon/plugins/power" = { experimental-features = [ "scale-monitor-framebuffer" ];
"power-button-action" = cfg.power.powerButton; };
}; "org/gnome/settings-daemon/plugins/xsettings" = {
"org/gnome/settings-daemon/plugins/color" = with cfg.nightLight; { overrides = [
night-light-enabled = enable; (mkTuple [
night-light-temperature = temperature; "GdkWindowScalingFactor"
night-light-schedule-automatic = isNull schedule; cfg.scalingFactor
night-light-schedule-from = lib.mkIf (!isNull schedule) schedule.from; ])
night-light-schedule-to = lib.mkIf (!isNull schedule) schedule.to; ];
}; };
"org/gnome/desktop/calendar" = { "org/gnome/desktop/interface" = {
show-weekdate = cfg.calendar.showWeekNumbers; scaling-factor = cfg.scalingFactor;
}; };
"org/gnome/desktop/datetime" = { "org/gnome/settings-daemon/plugins/power" = {
automatic-timezone = cfg.automaticTimeZone; "power-button-action" = cfg.power.powerButton;
}; };
"system/locale" = { "org/gnome/settings-daemon/plugins/color" = with cfg.nightLight; {
region = cfg.region; night-light-enabled = enable;
}; night-light-temperature = temperature;
} // ( night-light-schedule-automatic = isNull schedule;
builtins.listToAttrs ( night-light-schedule-from = lib.mkIf (!isNull schedule) schedule.from;
lib.lists.imap0 night-light-schedule-to = lib.mkIf (!isNull schedule) schedule.to;
(i: keybinding: { };
name = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}"; "org/gnome/desktop/calendar" = {
value = keybinding; show-weekdate = cfg.calendar.showWeekNumbers;
}) };
cfg.keybindings.custom "org/gnome/desktop/datetime" = {
) automatic-timezone = cfg.automaticTimeZone;
); };
"system/locale" = {
region = cfg.region;
};
}
// (builtins.listToAttrs (
lib.lists.imap0 (i: keybinding: {
name = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}";
value = keybinding;
}) cfg.keybindings.custom
));
home.file.".face".source = lib.mkIf (!isNull cfg.profilePicture) cfg.profilePicture; home.file.".face".source = lib.mkIf (!isNull cfg.profilePicture) cfg.profilePicture;
}; };
} }

View File

@@ -2,9 +2,11 @@
let let
inherit (builtins) attrNames filter readDir; inherit (builtins) attrNames filter readDir;
dirs = dirs =
let files = readDir ./.; let
in filter (name: files."${name}" == "directory") (attrNames files); files = readDir ./.;
in
filter (name: files."${name}" == "directory") (attrNames files);
in in
{ {
imports = map (dir: ./${dir}) dirs; imports = map (dir: ./${dir}) dirs;
} }

View File

@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.gnome.extensions.freon; cfg = config.gnome.extensions.freon;
in in

View File

@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.gnome.extensions; cfg = config.gnome.extensions;
in in
@@ -10,18 +15,52 @@ in
type = package; type = package;
default = pkgs.gnomeExtensions.paperwm; default = pkgs.gnomeExtensions.paperwm;
}; };
cycle-height-steps = lib.mkOption { type = listOf numbers.nonnegative; default = [ 0.33 0.5 0.67 1.0 ]; }; cycle-height-steps = lib.mkOption {
cycle-width-steps = lib.mkOption { type = listOf numbers.nonnegative; default = [ 0.33 0.5 0.67 1.0 ]; }; type = listOf numbers.nonnegative;
horizontal-margin = lib.mkOption { type = ints.unsigned; default = 5; }; default = [
vertical-margin = lib.mkOption { type = ints.unsigned; default = 5; }; 0.33
window-gap = lib.mkOption { type = ints.unsigned; default = 5; }; 0.5
0.67
1.0
];
};
cycle-width-steps = lib.mkOption {
type = listOf numbers.nonnegative;
default = [
0.33
0.5
0.67
1.0
];
};
horizontal-margin = lib.mkOption {
type = ints.unsigned;
default = 5;
};
vertical-margin = lib.mkOption {
type = ints.unsigned;
default = 5;
};
window-gap = lib.mkOption {
type = ints.unsigned;
default = 5;
};
winprops = lib.mkOption { winprops = lib.mkOption {
type = listOf (submodule { type = listOf (submodule {
options = { options = {
wm_class = lib.mkOption { type = str; default = ""; }; wm_class = lib.mkOption {
title = lib.mkOption { type = str; default = ""; }; type = str;
default = "";
};
title = lib.mkOption {
type = str;
default = "";
};
scratch_layer = lib.mkEnableOption { }; scratch_layer = lib.mkEnableOption { };
preferredWidth = lib.mkOption { type = nullOr str; default = null; }; preferredWidth = lib.mkOption {
type = nullOr str;
default = null;
};
}; };
}); });
default = [ ]; default = [ ];
@@ -36,13 +75,23 @@ in
config = lib.mkIf cfg.paperwm.enable { config = lib.mkIf cfg.paperwm.enable {
home.packages = [ cfg.paperwm.package ]; home.packages = [ cfg.paperwm.package ];
dconf.settings = { dconf.settings = {
"org/gnome/shell".enabled-extensions = "org/gnome/shell".enabled-extensions = lib.mkIf cfg.paperwm.enable [
lib.mkIf cfg.paperwm.enable [ cfg.paperwm.package.extensionUuid ]; cfg.paperwm.package.extensionUuid
"org/gnome/shell/extensions/paperwm" = with cfg.paperwm; lib.mkIf cfg.paperwm.enable { ];
inherit cycle-height-steps cycle-width-steps horizontal-margin vertical-margin window-gap; "org/gnome/shell/extensions/paperwm" =
winprops = map (props: builtins.toJSON props) winprops; with cfg.paperwm;
}; lib.mkIf cfg.paperwm.enable {
"org/gnome/shell/extensions/paperwm/keybindings" = lib.mkIf cfg.paperwm.enable cfg.paperwm.keybindings; inherit
cycle-height-steps
cycle-width-steps
horizontal-margin
vertical-margin
window-gap
;
winprops = map (props: builtins.toJSON props) winprops;
};
"org/gnome/shell/extensions/paperwm/keybindings" =
lib.mkIf cfg.paperwm.enable cfg.paperwm.keybindings;
}; };
}; };
} }

View File

@@ -40,17 +40,32 @@
]; ];
formatters = [ formatters = [
{ {
filetypes = [ "typescript" "typescriptreact" "svelte" ]; filetypes = [
globs = [ "*.ts" "*.tsx" "*.svelte" ]; "typescript"
"typescriptreact"
"svelte"
];
globs = [
"*.ts"
"*.tsx"
"*.svelte"
];
exe = "npx"; exe = "npx";
args = file: [ "prettier" "--stdin-filepath" file ]; args = file: [
"prettier"
"--stdin-filepath"
file
];
stdin = true; stdin = true;
} }
{ {
filetypes = [ "prisma" ]; filetypes = [ "prisma" ];
globs = [ "*.prisma" ]; globs = [ "*.prisma" ];
exe = "${pkgs.nodePackages.prisma}/bin/prisma"; exe = "${pkgs.nodePackages.prisma}/bin/prisma";
args = file: [ "format" "--schema" ]; args = file: [
"format"
"--schema"
];
stdin = false; stdin = false;
} }
]; ];
@@ -67,13 +82,21 @@
{ {
name = "prismals"; name = "prismals";
package = nodePackages."@prisma/language-server"; package = nodePackages."@prisma/language-server";
rootPattern = [ "package.json" "deno.json" ]; rootPattern = [
"package.json"
"deno.json"
];
} }
{ {
name = "graphql"; name = "graphql";
package = nodePackages.graphql-language-service-cli; package = nodePackages.graphql-language-service-cli;
config = { config = {
filetypes = [ "typescript" "typescriptreact" "graphql" "svelte" ]; filetypes = [
"typescript"
"typescriptreact"
"graphql"
"svelte"
];
}; };
} }
]; ];

View File

@@ -38,7 +38,10 @@ in
profilePicture = ../assets/profile-pictures/moco.png; profilePicture = ../assets/profile-pictures/moco.png;
calendar.showWeekNumbers = true; calendar.showWeekNumbers = true;
extensions.paperwm.winprops = [ extensions.paperwm.winprops = [
{ wm_class = "gnome-pomodoro"; scratch_layer = true; } {
wm_class = "gnome-pomodoro";
scratch_layer = true;
}
]; ];
}; };
@@ -77,16 +80,40 @@ in
formatters = [ formatters = [
{ {
filetypes = [ "ruby" ]; filetypes = [ "ruby" ];
globs = [ "*.rb" "Gemfile" "*.rake" ]; globs = [
"*.rb"
"Gemfile"
"*.rake"
];
exe = "bundle"; exe = "bundle";
args = file: [ "exec" "rufo" "-x" "--filename" file ]; args = file: [
"exec"
"rufo"
"-x"
"--filename"
file
];
stdin = true; stdin = true;
} }
{ {
filetypes = [ "javascript" "typescript" "javascriptreact" "typescriptreact" ]; filetypes = [
globs = [ "*.js" "*.jsx" "*.ts" "*.tsx" ]; "javascript"
"typescript"
"javascriptreact"
"typescriptreact"
];
globs = [
"*.js"
"*.jsx"
"*.ts"
"*.tsx"
];
exe = "npx"; exe = "npx";
args = file: [ "prettier" "--stdin-filepath" file ]; args = file: [
"prettier"
"--stdin-filepath"
file
];
stdin = true; stdin = true;
} }
]; ];
@@ -109,14 +136,21 @@ in
programs.ssh.matchBlocks = programs.ssh.matchBlocks =
let let
aliases = [ "moco" "mocoapp" "mocoapp.com" ]; aliases = [
matcher = subdomains: "moco"
"mocoapp"
"mocoapp.com"
];
matcher =
subdomains:
builtins.concatStringsSep " " ( builtins.concatStringsSep " " (
map map (
(alias: builtins.concatStringsSep " " ( alias:
builtins.concatStringsSep " " (
map (subdomain: "*.${subdomain}.${alias} ${subdomain}.${alias}") subdomains map (subdomain: "*.${subdomain}.${alias} ${subdomain}.${alias}") subdomains
)) )
aliases); ) aliases
);
in in
{ {
"console.*.moco" = { "console.*.moco" = {
@@ -126,69 +160,97 @@ in
}; };
}; };
"${matcher ["reto" "reto.intern"]}" = { "${matcher [
hostname = "reto.intern.mocoapp.com"; "reto"
user = "jokke"; "reto.intern"
}; ]}" =
{
hostname = "reto.intern.mocoapp.com";
user = "jokke";
};
"${matcher ["web"]}" = { "${matcher [ "web" ]}" = {
hostname = "mocoapp.com"; hostname = "mocoapp.com";
}; };
"${matcher ["prod-inc"]}" = { "${matcher [ "prod-inc" ]}" = {
hostname = "prod-inc.mocoapp.com"; hostname = "prod-inc.mocoapp.com";
}; };
"${matcher ["prod"]}" = { "${matcher [ "prod" ]}" = {
hostname = "web02.mocoapp"; hostname = "web02.mocoapp";
}; };
"${matcher ["pfg" "primeforcegroup"]}" = { "${matcher [
hostname = "primeforcegroup.mocoapp.com"; "pfg"
}; "primeforcegroup"
"${matcher ["crafft"]}" = { ]}" =
{
hostname = "primeforcegroup.mocoapp.com";
};
"${matcher [ "crafft" ]}" = {
hostname = "crafft.mocoapp.com"; hostname = "crafft.mocoapp.com";
}; };
"${matcher ["bd" "businessdecision"]}" = { "${matcher [
hostname = "businessdecision.mocoapp.com"; "bd"
}; "businessdecision"
"${matcher ["festland"]}" = { ]}" =
{
hostname = "businessdecision.mocoapp.com";
};
"${matcher [ "festland" ]}" = {
hostname = "festland.mocoapp.com"; hostname = "festland.mocoapp.com";
}; };
"${matcher ["oi" "one-inside"]}" = { "${matcher [
hostname = "one-inside.mocoapp.com"; "oi"
}; "one-inside"
"${matcher ["se" "scope-engineering"]}" = { ]}" =
hostname = "scope-engineering.mocoapp.com"; {
}; hostname = "one-inside.mocoapp.com";
"${matcher ["cpc" "cpc-ag"]}" = { };
hostname = "cpc-ag.mocoapp.com"; "${matcher [
}; "se"
"${matcher ["weareact3"]}" = { "scope-engineering"
]}" =
{
hostname = "scope-engineering.mocoapp.com";
};
"${matcher [
"cpc"
"cpc-ag"
]}" =
{
hostname = "cpc-ag.mocoapp.com";
};
"${matcher [ "weareact3" ]}" = {
hostname = "weareact3.mocoapp.com"; hostname = "weareact3.mocoapp.com";
}; };
"${matcher ["avenit"]}" = { "${matcher [ "avenit" ]}" = {
hostname = "avenit.mocoapp.com"; hostname = "avenit.mocoapp.com";
}; };
"${matcher ["staging"]}" = { "${matcher [ "staging" ]}" = {
hostname = "staging.mocoapp.com"; hostname = "staging.mocoapp.com";
}; };
"${matcher ["staging-v2"]}" = { "${matcher [ "staging-v2" ]}" = {
hostname = "staging-v2.mocoapp.com"; hostname = "staging-v2.mocoapp.com";
}; };
"${matcher ["staging-v3"]}" = { "${matcher [ "staging-v3" ]}" = {
hostname = "staging-v3.mocoapp.com"; hostname = "staging-v3.mocoapp.com";
}; };
"${matcher ["staging-v4"]}" = { "${matcher [ "staging-v4" ]}" = {
hostname = "staging-v4.mocoapp.com"; hostname = "staging-v4.mocoapp.com";
}; };
"${matcher ["staging-v5"]}" = { "${matcher [ "staging-v5" ]}" = {
hostname = "staging-v5.mocoapp.com"; hostname = "staging-v5.mocoapp.com";
}; };
"${matcher ["staging-v6"]}" = { "${matcher [ "staging-v6" ]}" = {
hostname = "staging-v6.mocoapp.com"; hostname = "staging-v6.mocoapp.com";
}; };
"${matcher ["prod-db" "production-db"]}" = { "${matcher [
hostname = "production-db.mocoapp"; "prod-db"
}; "production-db"
"${matcher ["pdf-renderer"]}" = { ]}" =
{
hostname = "production-db.mocoapp";
};
"${matcher [ "pdf-renderer" ]}" = {
hostname = "mocoapp-pdf-renderer01.mocoapp.com"; hostname = "mocoapp-pdf-renderer01.mocoapp.com";
}; };
"*.moco *.mocoapp *.mocoapp.com" = { "*.moco *.mocoapp *.mocoapp.com" = {

View File

@@ -1,14 +1,24 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.programs.neovim; cfg = config.programs.neovim;
toLua = lib.generators.toLua { }; toLua = lib.generators.toLua { };
buildPluginConfig = p: buildPluginConfig =
p:
let let
pluginConfig = if builtins.hasAttr "plugin" p then p else { plugin = p; }; pluginConfig = if builtins.hasAttr "plugin" p then p else { plugin = p; };
name = pluginConfig.plugin.name; name = pluginConfig.plugin.name;
config = if (builtins.isNull pluginConfig.config or null) then "" else pluginConfig.config; config = if (builtins.isNull pluginConfig.config or null) then "" else pluginConfig.config;
mappings = if (builtins.isNull pluginConfig.mappings or null) then "" else generateMappings pluginConfig.mappings; mappings =
if (builtins.isNull pluginConfig.mappings or null) then
""
else
generateMappings pluginConfig.mappings;
mergedConfig = config + mappings; mergedConfig = config + mappings;
in in
[ [
@@ -17,9 +27,10 @@ let
config = lib.modules.mkIf (mergedConfig != "") '' config = lib.modules.mkIf (mergedConfig != "") ''
Plugins[${toLua name}] = {} Plugins[${toLua name}] = {}
Plugins[${toLua name}].setup = function() Plugins[${toLua name}].setup = function()
${lib.strings.concatMapStrings ${
(line: if line == "" then "" else " ${line}\n") lib.strings.concatMapStrings (line: if line == "" then "" else " ${line}\n") (
(lib.strings.splitString "\n" mergedConfig) lib.strings.splitString "\n" mergedConfig
)
} }
end end
@@ -28,9 +39,8 @@ let
''; '';
type = "lua"; type = "lua";
} }
] ++ ( ]
lib.lists.concatMap buildPluginConfig pluginConfig.dependencies or [ ] ++ (lib.lists.concatMap buildPluginConfig pluginConfig.dependencies or [ ]);
);
lspPluginConfig = with pkgs.vimPlugins; { lspPluginConfig = with pkgs.vimPlugins; {
plugin = nvim-lspconfig; plugin = nvim-lspconfig;
@@ -41,76 +51,100 @@ let
luasnip luasnip
]; ];
config = (builtins.readFile ./lsp-config.lua) + '' config =
local capabilities = vim.lsp.protocol.make_client_capabilities() (builtins.readFile ./lsp-config.lua)
capabilities.workspace.didChangeWatchedFiles.dynamicRegistration = true + ''
local lspconfig = require('lspconfig') local capabilities = vim.lsp.protocol.make_client_capabilities()
local util = require('lspconfig.util') capabilities.workspace.didChangeWatchedFiles.dynamicRegistration = true
local lspconfig = require('lspconfig')
local util = require('lspconfig.util')
local on_attach = function (client, bufnr) local on_attach = function (client, bufnr)
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
local map = function (lhs, rhs) local map = function (lhs, rhs)
print('set mapping ' .. lhs) print('set mapping ' .. lhs)
end
-- Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
${lib.strings.concatLines (lib.attrsets.mapAttrsToList (name: value: ''
local buf_${name} = vim.lsp.buf[${toLua name}]
if buf_${name} then
vim.keymap.set('n', ${toLua value}, buf_${name}, { buffer = bufnr })
end end
''
) cfg.lsp.mappings.buf)}
${lib.strings.concatLines (lib.attrsets.mapAttrsToList (name: value: ''
local diagnostic_${name} = vim.lsp.buf[${toLua name}]
if diagnostic_${name} then
vim.keymap.set('n', ${toLua value}, diagnostic_${name}, { buffer = bufnr })
end
'') cfg.lsp.mappings.diagnostic)}
end
vim.env.PATH = ${toLua (lib.makeBinPath (map (s: s.package) (builtins.filter (s: builtins.hasAttr "package" s) cfg.lsp.servers)) + ":")} .. vim.env.PATH -- Enable completion triggered by <c-x><c-o>
local servers = ${toLua (map ( buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
{ name, config ? {}, rootPattern ? null, ... }: {
inherit name;
config = config // (if (builtins.isNull rootPattern) then {} else { inherit rootPattern; });
}
) cfg.lsp.servers)}
for _, server in ipairs(servers) do -- Mappings.
local server_config = server.config -- See `:help vim.lsp.*` for documentation on any of the below functions
server_config.on_attach = on_attach
server_config.capabilities = capabilities
server_config.flags = {
debounce_text_changes = 150
}
if server_config.rootPattern then ${lib.strings.concatLines (
server_config.root_dir = util.root_pattern( lib.attrsets.mapAttrsToList (name: value: ''
unpack(server_config.rootPattern) local buf_${name} = vim.lsp.buf[${toLua name}]
if buf_${name} then
vim.keymap.set('n', ${toLua value}, buf_${name}, { buffer = bufnr })
end
'') cfg.lsp.mappings.buf
)}
${lib.strings.concatLines (
lib.attrsets.mapAttrsToList (name: value: ''
local diagnostic_${name} = vim.lsp.buf[${toLua name}]
if diagnostic_${name} then
vim.keymap.set('n', ${toLua value}, diagnostic_${name}, { buffer = bufnr })
end
'') cfg.lsp.mappings.diagnostic
)}
end
vim.env.PATH = ${
toLua (
lib.makeBinPath (
map (s: s.package) (builtins.filter (s: builtins.hasAttr "package" s) cfg.lsp.servers)
) )
end + ":"
)
} .. vim.env.PATH
local servers = ${
toLua (
map (
{
name,
config ? { },
rootPattern ? null,
...
}:
{
inherit name;
config = config // (if (builtins.isNull rootPattern) then { } else { inherit rootPattern; });
}
) cfg.lsp.servers
)
}
lspconfig[server.name].setup(server_config) for _, server in ipairs(servers) do
end local server_config = server.config
''; server_config.on_attach = on_attach
server_config.capabilities = capabilities
server_config.flags = {
debounce_text_changes = 150
}
if server_config.rootPattern then
server_config.root_dir = util.root_pattern(
unpack(server_config.rootPattern)
)
end
lspconfig[server.name].setup(server_config)
end
'';
}; };
treesitterPluginConfig = with pkgs.vimPlugins; { treesitterPluginConfig = with pkgs.vimPlugins; {
plugin = nvim-treesitter.withPlugins cfg.withTreesitterPlugins; plugin = nvim-treesitter.withPlugins cfg.withTreesitterPlugins;
config = '' config = ''
require('nvim-treesitter.configs').setup(${toLua { require('nvim-treesitter.configs').setup(${
highlight = { toLua {
enable = true; highlight = {
additional_vim_regex_highlighting = false; enable = true;
}; additional_vim_regex_highlighting = false;
}}); };
}
});
''; '';
}; };
@@ -122,17 +156,24 @@ let
formatter.setup({ formatter.setup({
filetype = { filetype = {
${lib.strings.concatMapStringsSep ",\n " ({ exe, args, stdin, no_append, filetypes, ... }: ${lib.strings.concatMapStringsSep ",\n " (
{
exe,
args,
stdin,
no_append,
filetypes,
...
}:
lib.strings.concatMapStringsSep ",\n " (filetype: '' lib.strings.concatMapStringsSep ",\n " (filetype: ''
[${toLua filetype}] = { [${toLua filetype}] = {
function () function ()
return { return {
exe = ${toLua exe}, exe = ${toLua exe},
args = { args = {
${lib.strings.concatMapStringsSep ",\n " (arg: ${lib.strings.concatMapStringsSep ",\n " (
if arg == "<<FILE>>" arg:
then "util.escape_path(util.get_current_buffer_file_path())" if arg == "<<FILE>>" then "util.escape_path(util.get_current_buffer_file_path())" else toLua arg
else toLua arg
) (args "<<FILE>>")} ) (args "<<FILE>>")}
}, },
stdin = ${toLua stdin}, stdin = ${toLua stdin},
@@ -153,137 +194,218 @@ let
''; '';
}; };
customTypes = let inherit (lib) mkOption mkEnableOption types; in { customTypes =
mapping = types.submodule { let
options = { inherit (lib) mkOption mkEnableOption types;
rhs = mkOption { type = types.str; }; in
lua = mkEnableOption { }; {
options = mkOption { mapping = types.submodule {
type = types.nullOr ( options = {
types.submodule { rhs = mkOption { type = types.str; };
options = { lua = mkEnableOption { };
buffer = mkOption { type = types.nullOr (types.either types.int types.bool); default = null; }; options = mkOption {
nowait = mkOption { type = types.nullOr types.bool; default = null; }; type = types.nullOr (
silent = mkOption { type = types.nullOr types.bool; default = null; }; types.submodule {
expr = mkOption { type = types.nullOr types.bool; default = null; }; options = {
script = mkOption { type = types.nullOr types.bool; default = null; }; buffer = mkOption {
unique = mkOption { type = types.nullOr types.bool; default = null; }; type = types.nullOr (types.either types.int types.bool);
replace_keycodes = mkOption { type = types.nullOr types.bool; default = null; }; default = null;
}; };
} nowait = mkOption {
); type = types.nullOr types.bool;
default = { }; default = null;
};
silent = mkOption {
type = types.nullOr types.bool;
default = null;
};
expr = mkOption {
type = types.nullOr types.bool;
default = null;
};
script = mkOption {
type = types.nullOr types.bool;
default = null;
};
unique = mkOption {
type = types.nullOr types.bool;
default = null;
};
replace_keycodes = mkOption {
type = types.nullOr types.bool;
default = null;
};
};
}
);
default = { };
};
};
};
modeMappings = types.attrsOf (types.either types.str customTypes.mapping);
mappings = types.submodule {
options = {
normal = mkOption {
type = customTypes.modeMappings;
default = { };
};
insert = mkOption {
type = customTypes.modeMappings;
default = { };
};
visual = mkOption {
type = customTypes.modeMappings;
default = { };
};
command = mkOption {
type = customTypes.modeMappings;
default = { };
};
select = mkOption {
type = customTypes.modeMappings;
default = { };
};
};
};
plugin = types.either types.package (
types.submodule {
options = {
plugin = mkOption { type = types.package; };
dependencies = mkOption {
type = types.listOf customTypes.plugin;
default = [ ];
};
mappings = mkOption {
type = customTypes.mappings;
default = { };
};
config = mkOption {
type = types.nullOr types.str;
default = null;
};
};
}
);
autoCommand = types.submodule {
options = {
event = mkOption { type = types.either types.str (types.listOf types.str); };
pattern = mkOption { type = types.either types.str (types.listOf types.str); };
command = mkOption { type = types.str; };
};
};
lspServer = types.submodule {
options = {
name = mkOption { type = types.str; };
config = mkOption {
type = types.attrs;
default = { };
};
package = mkOption {
type = types.nullOr types.package;
default = null;
};
rootPattern = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
};
};
formatter = types.submodule {
options = {
filetypes = mkOption { type = types.listOf types.str; };
globs = mkOption { type = types.listOf types.str; };
exe = mkOption { type = types.either types.path types.str; };
args = mkOption {
type = types.functionTo (types.listOf types.str);
default = _: [ ];
};
stdin = mkEnableOption { };
no_append = mkEnableOption { };
}; };
}; };
}; };
modeMappings = types.attrsOf (types.either types.str customTypes.mapping); generateMappings =
mappings:
mappings = types.submodule { lib.strings.concatLines (
options = { lib.attrsets.mapAttrsToList (
normal = mkOption { type = customTypes.modeMappings; default = { }; }; mode: modeMappings:
insert = mkOption { type = customTypes.modeMappings; default = { }; };
visual = mkOption { type = customTypes.modeMappings; default = { }; };
command = mkOption { type = customTypes.modeMappings; default = { }; };
select = mkOption { type = customTypes.modeMappings; default = { }; };
};
};
plugin = types.either types.package (types.submodule {
options = {
plugin = mkOption { type = types.package; };
dependencies = mkOption {
type = types.listOf customTypes.plugin;
default = [ ];
};
mappings = mkOption { type = customTypes.mappings; default = { }; };
config = mkOption { type = types.nullOr types.str; default = null; };
};
});
autoCommand = types.submodule {
options = {
event = mkOption { type = types.either types.str (types.listOf types.str); };
pattern = mkOption { type = types.either types.str (types.listOf types.str); };
command = mkOption { type = types.str; };
};
};
lspServer = types.submodule {
options = {
name = mkOption { type = types.str; };
config = mkOption { type = types.attrs; default = { }; };
package = mkOption { type = types.nullOr types.package; default = null; };
rootPattern = mkOption { type = types.nullOr (types.listOf types.str); default = null; };
};
};
formatter = types.submodule {
options = {
filetypes = mkOption { type = types.listOf types.str; };
globs = mkOption { type = types.listOf types.str; };
exe = mkOption { type = types.either types.path types.str; };
args = mkOption { type = types.functionTo (types.listOf types.str); default = _: [ ]; };
stdin = mkEnableOption { };
no_append = mkEnableOption { };
};
};
};
generateMappings = mappings: lib.strings.concatLines (
lib.attrsets.mapAttrsToList
(mode: modeMappings:
lib.strings.concatLines ( lib.strings.concatLines (
lib.attrsets.mapAttrsToList lib.attrsets.mapAttrsToList (
(name: value: name: value:
let let
mapping = { lhs = name; lua = false; options = { }; } // (if builtins.isString value then { rhs = value; } else value); mapping = {
args = [ lhs = name;
(toLua (builtins.substring 0 1 mode)) lua = false;
(toLua mapping.lhs) options = { };
(if mapping.lua then mapping.rhs else toLua mapping.rhs) } // (if builtins.isString value then { rhs = value; } else value);
( args = [
toLua ( (toLua (builtins.substring 0 1 mode))
builtins.listToAttrs ( (toLua mapping.lhs)
builtins.filter ({ value, ... }: !isNull (value)) (lib.attrsets.attrsToList mapping.options) (if mapping.lua then mapping.rhs else toLua mapping.rhs)
) (toLua (
) builtins.listToAttrs (
builtins.filter ({ value, ... }: !isNull (value)) (lib.attrsets.attrsToList mapping.options)
) )
]; ))
in ];
"vim.keymap.set(${lib.strings.concatStringsSep ", " args})" in
) "vim.keymap.set(${lib.strings.concatStringsSep ", " args})"
modeMappings ) modeMappings
) )
) ) mappings
mappings );
);
generateAutoCommand = { event, pattern, command, group ? null }: '' generateAutoCommand =
vim.api.nvim_create_autocmd(${toLua event}, { {
pattern = ${toLua pattern}, event,
command = ${toLua command}, pattern,
group = ${if isNull group then toLua group else '' command,
vim.api.nvim_create_augroup(${toLua group}, { clear = true }) group ? null,
''}, }:
}) ''
''; vim.api.nvim_create_autocmd(${toLua event}, {
pattern = ${toLua pattern},
command = ${toLua command},
group = ${
if isNull group then
toLua group
else
''
vim.api.nvim_create_augroup(${toLua group}, { clear = true })
''
},
})
'';
generateAutoCommands = autoCommands: lib.strings.concatLines ( generateAutoCommands = autoCommands: lib.strings.concatLines (map generateAutoCommand autoCommands);
map generateAutoCommand autoCommands
);
generateSignDefinitions = signs: lib.strings.concatLines ( generateSignDefinitions =
lib.attrsets.mapAttrsToList signs:
(name: value: lib.strings.concatLines (
lib.attrsets.mapAttrsToList (
name: value:
let let
hl = "DiagnosticSign${lib.strings.toUpper (builtins.substring 0 1 name)}${builtins.substring 1 (-1) name}"; hl = "DiagnosticSign${
lib.strings.toUpper (builtins.substring 0 1 name)
}${builtins.substring 1 (-1) name}";
in in
"vim.fn.sign_define(${toLua hl}, ${toLua { text = value; texthl = hl; numhl = ""; }})" "vim.fn.sign_define(${toLua hl}, ${
) toLua {
signs text = value;
); texthl = hl;
numhl = "";
}
})"
) signs
);
in in
{ {
options.programs.neovim = options.programs.neovim =
@@ -291,12 +413,18 @@ in
inherit (lib) mkOption types; inherit (lib) mkOption types;
in in
{ {
mappings = mkOption { type = customTypes.mappings; default = { }; }; mappings = mkOption {
type = customTypes.mappings;
default = { };
};
plug = mkOption { plug = mkOption {
type = types.listOf customTypes.plugin; type = types.listOf customTypes.plugin;
default = [ ]; default = [ ];
}; };
leader = mkOption { type = types.str; default = "\\"; }; leader = mkOption {
type = types.str;
default = "\\";
};
options = mkOption { options = mkOption {
type = types.attrs; type = types.attrs;
default = { }; default = { };
@@ -314,10 +442,22 @@ in
default = { }; default = { };
}; };
signs = { signs = {
error = mkOption { type = types.str; default = ""; }; error = mkOption {
warning = mkOption { type = types.str; default = ""; }; type = types.str;
info = mkOption { type = types.str; default = ""; }; default = "";
hint = mkOption { type = types.str; default = ""; }; };
warning = mkOption {
type = types.str;
default = "";
};
info = mkOption {
type = types.str;
default = "";
};
hint = mkOption {
type = types.str;
default = "";
};
}; };
lsp = { lsp = {
servers = mkOption { servers = mkOption {
@@ -325,8 +465,14 @@ in
default = [ ]; default = [ ];
}; };
mappings = { mappings = {
buf = mkOption { type = types.attrsOf types.str; default = { }; }; buf = mkOption {
diagnostic = mkOption { type = types.attrsOf types.str; default = { }; }; type = types.attrsOf types.str;
default = { };
};
diagnostic = mkOption {
type = types.attrsOf types.str;
default = { };
};
}; };
}; };
withTreesitterPlugins = mkOption { withTreesitterPlugins = mkOption {
@@ -345,22 +491,30 @@ in
"local Plugins = {}" "local Plugins = {}"
(generateMappings cfg.mappings) (generateMappings cfg.mappings)
(generateAutoCommands cfg.autoCommands) (generateAutoCommands cfg.autoCommands)
(lib.strings.concatLines (lib.attrsets.mapAttrsToList (name: value: "vim.env.${name} = ${toLua value}") cfg.env)) (lib.strings.concatLines (
(lib.strings.concatLines (lib.attrsets.mapAttrsToList (name: value: "vim.opt.${name} = ${toLua value}") cfg.options)) lib.attrsets.mapAttrsToList (name: value: "vim.env.${name} = ${toLua value}") cfg.env
))
(lib.strings.concatLines (
lib.attrsets.mapAttrsToList (name: value: "vim.opt.${name} = ${toLua value}") cfg.options
))
(generateSignDefinitions cfg.signs) (generateSignDefinitions cfg.signs)
"vim.g.mapleader = ${toLua cfg.leader}" "vim.g.mapleader = ${toLua cfg.leader}"
'' ''
local undodir = ${toLua ( local undodir = ${
if builtins.hasAttr "undodir" cfg.options toLua (
then cfg.options.undodir if builtins.hasAttr "undodir" cfg.options then
else "${config.xdg.cacheHome}/nvim/undo" cfg.options.undodir
)} else
"${config.xdg.cacheHome}/nvim/undo"
)
}
vim.opt.undodir = undodir vim.opt.undodir = undodir
vim.fn.mkdir(undodir, 'p') vim.fn.mkdir(undodir, 'p')
'' ''
]; ];
plugins = lib.lists.concatMap buildPluginConfig ( plugins = lib.lists.concatMap buildPluginConfig (
cfg.plug ++ [ cfg.plug
++ [
lspPluginConfig lspPluginConfig
treesitterPluginConfig treesitterPluginConfig
formatterPluginConfig formatterPluginConfig
@@ -371,12 +525,12 @@ in
}; };
xdg.configFile = ( xdg.configFile = (
lib.attrsets.mapAttrs' lib.attrsets.mapAttrs' (name: value: {
(name: value: { name = "nvim/${name}";
name = "nvim/${name}"; value = {
value = { source = value; }; source = value;
}) };
cfg.snippets }) cfg.snippets
); );
home.shellAliases = home.shellAliases =

View File

@@ -2,7 +2,13 @@
# your system. Help is availanodev"; # your system. Help is availanodev";
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ ssh, pkgs, config, lib, ... }: {
ssh,
pkgs,
config,
lib,
...
}:
{ {
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; boot.loader.grub.device = "/dev/sda";
@@ -12,7 +18,10 @@
nix = { nix = {
settings = { settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true; auto-optimise-store = true;
}; };
@@ -63,11 +72,28 @@
modules.firewall = { modules.firewall = {
enable = true; enable = true;
interfaces = { interfaces = {
koti = [ "dhcp" "dns" "ssh" "web" ]; koti = [
gast = [ "dhcp" "dns" ]; "dhcp"
iot = [ "dhcp" "dns" ]; "dns"
cfg = [ "dhcp" "dns" ]; "ssh"
"tailscale*" = [ "ssh" "web" ]; "web"
];
gast = [
"dhcp"
"dns"
];
iot = [
"dhcp"
"dns"
];
cfg = [
"dhcp"
"dns"
];
"tailscale*" = [
"ssh"
"web"
];
}; };
allInterfaces = [ ]; allInterfaces = [ ];
}; };
@@ -146,7 +172,9 @@
onState = [ "routable" ]; onState = [ "routable" ];
script = '' script = ''
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}
${pkgs.ethtool}/bin/ethtool -K ${config.systemd.network.links."10-extern0".linkConfig.Name} rx-udp-gro-forwarding on rx-gro-list off ${pkgs.ethtool}/bin/ethtool -K ${
config.systemd.network.links."10-extern0".linkConfig.Name
} rx-udp-gro-forwarding on rx-gro-list off
''; '';
}; };
}; };
@@ -187,13 +215,14 @@
enable = true; enable = true;
settings = { settings = {
server = { server = {
interface = (lib.map interface =
(name: config.systemd.network.networks."30-${name}".dhcpServerConfig.DNS) (lib.map (name: config.systemd.network.networks."30-${name}".dhcpServerConfig.DNS) (
(lib.attrNames config.modules.vlans.networks) lib.attrNames config.modules.vlans.networks
) ++ [ ))
"127.0.0.1" ++ [
"::1" "127.0.0.1"
]; "::1"
];
access-control = [ access-control = [
"10.0.0.0/8 allow" "10.0.0.0/8 allow"
"127.0.0.0/8 allow" "127.0.0.0/8 allow"
@@ -224,10 +253,11 @@
"xiaomi_aqara" "xiaomi_aqara"
"shelly" "shelly"
]; ];
extraPackages = python3Packages: with python3Packages; [ extraPackages =
gtts python3Packages: with python3Packages; [
numpy gtts
]; numpy
];
config = { config = {
homeassistant = { homeassistant = {
name = "Koti"; name = "Koti";

View File

@@ -1,41 +1,57 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"ehci_pci"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/f221c6a7-e05e-40dc-bc85-7970d7c8f22b"; device = "/dev/disk/by-uuid/f221c6a7-e05e-40dc-bc85-7970d7c8f22b";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" ]; options = [ "subvol=@" ];
}; };
fileSystems."/var/log" = fileSystems."/var/log" = {
{ device = "/dev/disk/by-uuid/f221c6a7-e05e-40dc-bc85-7970d7c8f22b"; device = "/dev/disk/by-uuid/f221c6a7-e05e-40dc-bc85-7970d7c8f22b";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@var_log" ]; options = [ "subvol=@var_log" ];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/14D2-F8F4"; device = "/dev/disk/by-uuid/14D2-F8F4";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [
}; "fmask=0022"
"dmask=0022"
];
};
fileSystems."/swap" = fileSystems."/swap" = {
{ device = "/dev/disk/by-uuid/f221c6a7-e05e-40dc-bc85-7970d7c8f22b"; device = "/dev/disk/by-uuid/f221c6a7-e05e-40dc-bc85-7970d7c8f22b";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@swap" ]; options = [ "subvol=@swap" ];
}; };
swapDevices = [ ]; swapDevices = [ ];

View File

@@ -2,7 +2,12 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`). # and in the NixOS manual (accessible by running `nixos-help`).
{ config, pkgs, ssh, ... }: {
config,
pkgs,
ssh,
...
}:
let let
ipv4Address = "65.21.145.150"; ipv4Address = "65.21.145.150";
ipv6Address = "2a01:4f9:c011:9ac1::1"; ipv6Address = "2a01:4f9:c011:9ac1::1";
@@ -10,7 +15,10 @@ in
{ {
nix = { nix = {
settings = { settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true; auto-optimise-store = true;
}; };
gc = { gc = {
@@ -95,7 +103,6 @@ in
# useXkbConfig = true; # use xkbOptions in tty. # useXkbConfig = true; # use xkbOptions in tty.
# }; # };
# Configure keymap in X11 # Configure keymap in X11
services.xserver.xkb.layout = "us"; services.xserver.xkb.layout = "us";
services.xserver.xkb.options = "eurosign:e,caps:escape"; services.xserver.xkb.options = "eurosign:e,caps:escape";

View File

@@ -1,34 +1,43 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/profiles/qemu-guest.nix")
(modulesPath + "/profiles/qemu-guest.nix") ];
];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_scsi" "sr_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"virtio_scsi"
"sr_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/f594ffbc-4553-42e4-8206-4d762c94b4c3";
device = "/dev/disk/by-uuid/f594ffbc-4553-42e4-8206-4d762c94b4c3"; fsType = "ext4";
fsType = "ext4"; };
};
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/46F1-18E3";
device = "/dev/disk/by-uuid/46F1-18E3"; fsType = "vfat";
fsType = "vfat"; options = [
options = [ "fmask=0077" "dmask=0077" ]; "fmask=0077"
}; "dmask=0077"
];
};
swapDevices = swapDevices = [ { device = "/dev/disk/by-uuid/d9955575-d4e0-4a49-a3c5-41f54110d12b"; } ];
[{ device = "/dev/disk/by-uuid/d9955575-d4e0-4a49-a3c5-41f54110d12b"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -1,34 +1,38 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
age.secrets = lib.listToAttrs age.secrets =
( lib.listToAttrs (
map (secret: { name = secret; value = { file = ../../secrets/${secret}.age; }; }) [ map
"gotosocial" (secret: {
"immich" name = secret;
"readeck" value = {
"storage-box-credentials" file = ../../secrets/${secret}.age;
"vaultwarden" };
"donetick" })
"dnote" [
"octodns" "gotosocial"
"mealie" "immich"
] "readeck"
) // { "storage-box-credentials"
smtp-password = { "vaultwarden"
file = ../../secrets/smtp-password.age; "donetick"
owner = "dnote"
if (config.services.grafana.enable) then "octodns"
config.systemd.services.grafana.serviceConfig.User "mealie"
else ]
"root"; )
// {
smtp-password = {
file = ../../secrets/smtp-password.age;
owner =
if (config.services.grafana.enable) then
config.systemd.services.grafana.serviceConfig.User
else
"root";
};
hastebin-tokens = {
file = ../../secrets/hastebin-tokens.age;
owner = if (config.services.hastebin.enable) then config.users.users.hastebin.name else "root";
};
}; };
hastebin-tokens = {
file = ../../secrets/hastebin-tokens.age;
owner =
if (config.services.hastebin.enable) then
config.users.users.hastebin.name
else
"root";
};
};
} }

View File

@@ -1,4 +1,9 @@
{ pkgs, config, inputs, ... }: {
pkgs,
config,
inputs,
...
}:
let let
immichDataDir = "/mnt/storage/immich"; immichDataDir = "/mnt/storage/immich";
syncthingDataDir = "/mnt/storage/syncthing"; syncthingDataDir = "/mnt/storage/syncthing";
@@ -37,7 +42,7 @@ in
enable = true; enable = true;
records."".MX = { records."".MX = {
ttl = 86400; ttl = 86400;
values = [{ exchange = "${smtp.host}."; }]; values = [ { exchange = "${smtp.host}."; } ];
}; };
defaults.CNAME.ttl = 60; defaults.CNAME.ttl = 60;
}; };
@@ -45,7 +50,8 @@ in
hastebin = { hastebin = {
enable = true; enable = true;
subdomain = "bin"; subdomain = "bin";
renderers = with pkgs; renderers =
with pkgs;
let let
hl = rustPlatform.buildRustPackage { hl = rustPlatform.buildRustPackage {
name = "syntax-renderer"; name = "syntax-renderer";
@@ -143,7 +149,11 @@ in
smtp-port = smtp.port; smtp-port = smtp.port;
smtp-username = smtp.username; smtp-username = smtp.username;
smtp-from = smtp.from; smtp-from = smtp.from;
instance-languages = [ "de" "fi" "en" ]; instance-languages = [
"de"
"fi"
"en"
];
}; };
}; };

View File

@@ -2,7 +2,10 @@
{ {
nix = { nix = {
settings = { settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true; auto-optimise-store = true;
}; };

View File

@@ -1,6 +1,11 @@
{ inputs, ... }: { inputs, ... }:
let let
inherit (inputs) lanzaboote nixos-hardware auto-cpufreq home-manager; inherit (inputs)
lanzaboote
nixos-hardware
auto-cpufreq
home-manager
;
in in
{ {
imports = [ imports = [

View File

@@ -1,56 +1,70 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689"; device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" ]; options = [ "subvol=@" ];
}; };
boot.initrd.luks.devices."cryptroot" = { boot.initrd.luks.devices."cryptroot" = {
device = "/dev/disk/by-uuid/43895585-8899-4e94-a413-889127c214f8"; device = "/dev/disk/by-uuid/43895585-8899-4e94-a413-889127c214f8";
allowDiscards = true; allowDiscards = true;
}; };
fileSystems."/var/log" = fileSystems."/var/log" = {
{ device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689"; device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@var_log" ]; options = [ "subvol=@var_log" ];
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689"; device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@home" ]; options = [ "subvol=@home" ];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/01E6-6258"; device = "/dev/disk/by-uuid/01E6-6258";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/swap" = fileSystems."/swap" = {
{ device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689"; device = "/dev/disk/by-uuid/a331b669-f5c5-42f7-be58-434873c1b689";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@swap" ]; options = [ "subvol=@swap" ];
}; };
swapDevices = [ { swapDevices = [
device = "/swap/swapfile"; {
size = 64*1024; device = "/swap/swapfile";
} ]; size = 64 * 1024;
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -1,4 +1,10 @@
{ pkgs, inputs, lib, config, ... }: {
pkgs,
inputs,
lib,
config,
...
}:
let let
pkgsUnstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}; pkgsUnstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system};
in in

View File

@@ -3,7 +3,12 @@
networking.hostName = "radish"; networking.hostName = "radish";
time.timeZone = lib.mkForce null; # allow TZ to be set by desktop user time.timeZone = lib.mkForce null; # allow TZ to be set by desktop user
i18n.defaultLocale = "de_DE.UTF-8"; i18n.defaultLocale = "de_DE.UTF-8";
i18n.supportedLocales = map (locale: "${locale}.UTF-8/UTF-8") [ "C" "en_US" "de_DE" "fi_FI" ]; i18n.supportedLocales = map (locale: "${locale}.UTF-8/UTF-8") [
"C"
"en_US"
"de_DE"
"fi_FI"
];
i18n.extraLocaleSettings.LANG = "en_US.UTF-8"; i18n.extraLocaleSettings.LANG = "en_US.UTF-8";
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";

View File

@@ -1,9 +1,15 @@
{ lib, ... }: { lib, ... }:
{ {
age.secrets = lib.listToAttrs age.secrets = lib.listToAttrs (
( map
map (secret: { name = secret; value = { file = ../../secrets/${secret}.age; }; }) [ (secret: {
name = secret;
value = {
file = ../../secrets/${secret}.age;
};
})
[
"borgbackup-radish" "borgbackup-radish"
] ]
); );
} }

View File

@@ -11,7 +11,17 @@
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
shell = pkgs.zsh; shell = pkgs.zsh;
subUidRanges = [{ startUid = 10000; count = 65536; }]; subUidRanges = [
subGidRanges = [{ startGid = 10000; count = 65536; }]; {
startUid = 10000;
count = 65536;
}
];
subGidRanges = [
{
startGid = 10000;
count = 65536;
}
];
}; };
} }

View File

@@ -1,19 +1,48 @@
{ lib, config, ... }: { lib, config, ... }:
let let
services = { services = {
ssh = { tcp = [ 22 ]; }; ssh = {
dhcp = { udp = [ 67 68 ]; }; tcp = [ 22 ];
dns = { udp = [ 53 853 ]; tcp = [ 53 853 ]; }; };
web = { tcp = [ 80 443 ]; }; dhcp = {
udp = [
67
68
];
};
dns = {
udp = [
53
853
];
tcp = [
53
853
];
};
web = {
tcp = [
80
443
];
};
}; };
rulesForServices = enabledServices: rulesForServices =
enabledServices:
lib.foldr lib.foldr
(service: { allowedUDPPorts, allowedTCPPorts }: { (
allowedUDPPorts = allowedUDPPorts ++ services.${service}.udp or [ ]; service:
allowedTCPPorts = allowedTCPPorts ++ services.${service}.tcp or [ ]; { allowedUDPPorts, allowedTCPPorts }:
}) {
{ allowedUDPPorts = [ ]; allowedTCPPorts = [ ]; } allowedUDPPorts = allowedUDPPorts ++ services.${service}.udp or [ ];
allowedTCPPorts = allowedTCPPorts ++ services.${service}.tcp or [ ];
}
)
{
allowedUDPPorts = [ ];
allowedTCPPorts = [ ];
}
enabledServices; enabledServices;
cfg = config.modules.firewall; cfg = config.modules.firewall;

View File

@@ -1,4 +1,10 @@
{ lib, inputs, config, pkgs, ... }: {
lib,
inputs,
config,
pkgs,
...
}:
let let
cfg = config.services.dnote; cfg = config.services.dnote;
fqdn = "${cfg.subdomain}.${config.networking.domain}"; fqdn = "${cfg.subdomain}.${config.networking.domain}";
@@ -40,10 +46,8 @@ let
WebURL = "https://${fqdn}"; WebURL = "https://${fqdn}";
}; };
serializeEnvVar = value: serializeEnvVar =
if (lib.isBool value) value: if (lib.isBool value) then if value then "true" else "false" else toString value;
then if value then "true" else "false"
else toString value;
in in
{ {
options.services.dnote = { options.services.dnote = {
@@ -81,7 +85,9 @@ in
systemd.services.dnote = { systemd.services.dnote = {
enable = true; enable = true;
description = "Dnote server"; description = "Dnote server";
environment = lib.mapAttrs (_: value: serializeEnvVar value) (cfg.environment // immutableEnvironment); environment = lib.mapAttrs (_: value: serializeEnvVar value) (
cfg.environment // immutableEnvironment
);
after = [ "postgresql.service" ]; after = [ "postgresql.service" ];
requires = [ "postgresql.service" ]; requires = [ "postgresql.service" ];
serviceConfig = { serviceConfig = {
@@ -113,10 +119,12 @@ in
postgresql = { postgresql = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
ensureDatabases = [ cfg.environment.DBName ]; ensureDatabases = [ cfg.environment.DBName ];
ensureUsers = [{ ensureUsers = [
name = cfg.user; {
ensureDBOwnership = true; name = cfg.user;
}]; ensureDBOwnership = true;
}
];
}; };
webserver = { webserver = {

View File

@@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }: {
lib,
pkgs,
config,
...
}:
let let
types = { types = {
jwtSettings = { jwtSettings = {
@@ -206,7 +211,7 @@ in
services.webserver = { services.webserver = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
vHosts.${fqdn}.locations."/" .proxyPort = cfg.settings.server.port; vHosts.${fqdn}.locations."/".proxyPort = cfg.settings.server.port;
}; };
}; };
} }

View File

@@ -38,11 +38,12 @@ in
value.extraConfig = '' value.extraConfig = ''
rewrite ^.*$ https://${fqdn}/.well-known/${path} permanent; rewrite ^.*$ https://${fqdn}/.well-known/${path} permanent;
''; '';
}) [ })
"host-meta" [
"webfinger" "host-meta"
"nodeinfo" "webfinger"
] "nodeinfo"
]
); );
"${fqdn}".locations."/".proxyPort = port; "${fqdn}".locations."/".proxyPort = port;

View File

@@ -50,10 +50,12 @@ in
postgresql = { postgresql = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
ensureDatabases = [ "grafana" ]; ensureDatabases = [ "grafana" ];
ensureUsers = [{ ensureUsers = [
name = "grafana"; {
ensureDBOwnership = true; name = "grafana";
}]; ensureDBOwnership = true;
}
];
}; };
}; };
}; };

View File

@@ -1,4 +1,9 @@
{ lib, config, inputs, ... }: {
lib,
config,
inputs,
...
}:
let let
cfg = config.services.gtrackmap; cfg = config.services.gtrackmap;
fqdn = "${cfg.subdomain}.${config.networking.domain}"; fqdn = "${cfg.subdomain}.${config.networking.domain}";

View File

@@ -1,4 +1,9 @@
{ lib, config, inputs, ... }: {
lib,
config,
inputs,
...
}:
let let
cfg = config.services.hastebin; cfg = config.services.hastebin;
secrets = config.age.secrets; secrets = config.age.secrets;

View File

@@ -25,10 +25,12 @@ in
postgresql = { postgresql = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
ensureDatabases = [ "mealie" ]; ensureDatabases = [ "mealie" ];
ensureUsers = [{ ensureUsers = [
name = "mealie"; {
ensureDBOwnership = true; name = "mealie";
}]; ensureDBOwnership = true;
}
];
}; };
}; };
}; };

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
let let
cfg = config.services.octodns; cfg = config.services.octodns;
secrets = config.age.secrets; secrets = config.age.secrets;
@@ -125,37 +130,46 @@ let
yamlFormat = pkgs.formats.yaml { }; yamlFormat = pkgs.formats.yaml { };
zoneFile = yamlFormat.generate "octodns-zone" zoneFile = yamlFormat.generate "octodns-zone" (
( lib.filterAttrs (_: records: (lib.length records) > 0) (
lib.filterAttrs (_: records: (lib.length records) > 0) lib.mapAttrs (
(lib.mapAttrs _: types:
(_: types: lib.filter
lib.filter (
({ values ? [ ], value ? null, ... }: (lib.length values) > 0 || !(builtins.isNull value)) {
(lib.mapAttrsToList values ? [ ],
(type: { ttl, ... }@options: value ? null,
if (type == "CNAME") ...
then }:
let (lib.length values) > 0 || !(builtins.isNull value)
inherit (options) target toRoot;
value = if toRoot then "${config.networking.domain}." else target;
in
{ inherit type ttl value; }
else
{ inherit type ttl; inherit (options) values; }
)
types
)
) )
cfg.records (
) lib.mapAttrsToList (
); type:
{ ttl, ... }@options:
if (type == "CNAME") then
let
inherit (options) target toRoot;
value = if toRoot then "${config.networking.domain}." else target;
in
{
inherit type ttl value;
}
else
{
inherit type ttl;
inherit (options) values;
}
) types
)
) cfg.records
)
);
zonesDir = pkgs.linkFarm "octodns-zones" { zonesDir = pkgs.linkFarm "octodns-zones" {
"${config.networking.domain}.yaml" = zoneFile; "${config.networking.domain}.yaml" = zoneFile;
}; };
configFile = yamlFormat.generate "octodns-config.yaml" { configFile = yamlFormat.generate "octodns-config.yaml" {
providers = { providers = {
config = { config = {

View File

@@ -1,4 +1,10 @@
{ lib, inputs, config, pkgs, ... }: {
lib,
inputs,
config,
pkgs,
...
}:
let let
cfg = config.services.readeck; cfg = config.services.readeck;
secrets = config.age.secrets; secrets = config.age.secrets;
@@ -40,10 +46,12 @@ in
postgresql = { postgresql = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
ensureDatabases = [ "readeck" ]; ensureDatabases = [ "readeck" ];
ensureUsers = [{ ensureUsers = [
name = "readeck"; {
ensureDBOwnership = true; name = "readeck";
}]; ensureDBOwnership = true;
}
];
}; };
}; };
}; };

View File

@@ -36,10 +36,12 @@ in
postgresql = { postgresql = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
ensureDatabases = [ "vaultwarden" ]; ensureDatabases = [ "vaultwarden" ];
ensureUsers = [{ ensureUsers = [
name = "vaultwarden"; {
ensureDBOwnership = true; name = "vaultwarden";
}]; ensureDBOwnership = true;
}
];
}; };
}; };
}; };

View File

@@ -69,8 +69,10 @@ in
virtualHosts = tailscaleAuthVhosts; virtualHosts = tailscaleAuthVhosts;
}; };
virtualHosts = lib.mapAttrs virtualHosts = lib.mapAttrs (
(_: { proxyBuffering, locations, ... }: { _:
{ proxyBuffering, locations, ... }:
{
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
http2 = true; http2 = true;
@@ -79,26 +81,33 @@ in
(lib.optionalString (!proxyBuffering) "proxy_buffering off;") (lib.optionalString (!proxyBuffering) "proxy_buffering off;")
"charset utf-8;" "charset utf-8;"
]; ];
locations = lib.mapAttrs locations = lib.mapAttrs (
(_: { proxyPort, extraConfig }: lib.mergeAttrsList [ _:
{ proxyPort, extraConfig }:
lib.mergeAttrsList [
{ inherit extraConfig; } { inherit extraConfig; }
(if (lib.isInt proxyPort) then { (
proxyWebsockets = true; if (lib.isInt proxyPort) then
proxyPass = "http://localhost:${toString proxyPort}"; {
} else { }) proxyWebsockets = true;
]) proxyPass = "http://localhost:${toString proxyPort}";
locations; }
}) else
cfg.vHosts; { }
)
]
) locations;
}
) cfg.vHosts;
}; };
octodns.records = lib.filterAttrs (name: _: name != config.networking.domain) ( octodns.records = lib.filterAttrs (name: _: name != config.networking.domain) (
lib.mapAttrs' lib.mapAttrs' (fqdn: _: {
(fqdn: _: { name = lib.removeSuffix ".${config.networking.domain}" fqdn;
name = lib.removeSuffix ".${config.networking.domain}" fqdn; value = {
value = { CNAME.toRoot = true; }; CNAME.toRoot = true;
}) };
cfg.vHosts }) cfg.vHosts
); );
}; };

View File

@@ -1,4 +1,10 @@
{ pkgs, inputs, config, lib, ... }: {
pkgs,
inputs,
config,
lib,
...
}:
let let
cfg = config.services.workout-sync; cfg = config.services.workout-sync;
fqdn = "${cfg.subdomain}.${config.networking.domain}"; fqdn = "${cfg.subdomain}.${config.networking.domain}";

View File

@@ -1,4 +1,10 @@
{ pkgs, config, lib, inputs, ... }: {
pkgs,
config,
lib,
inputs,
...
}:
let let
cfg = config.services.workout-tracker; cfg = config.services.workout-tracker;
fqdn = "${cfg.subdomain}.${config.networking.domain}"; fqdn = "${cfg.subdomain}.${config.networking.domain}";

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
let let
types = { types = {
mount = lib.types.submodule { mount = lib.types.submodule {
@@ -25,17 +30,17 @@ let
cfg = config.modules.storageBoxMounts; cfg = config.modules.storageBoxMounts;
secrets = config.age.secrets; secrets = config.age.secrets;
mountOptions = { uid, gid, ... }: [ mountOptions =
"x-systemd.automount" { uid, gid, ... }:
"auto" [
"x-systemd.device-timeout=5s" "x-systemd.automount"
"x-systemd.mount-timeout=5s" "auto"
"credentials=${secrets.storage-box-credentials.path}" "x-systemd.device-timeout=5s"
] ++ ( "x-systemd.mount-timeout=5s"
if (uid != null) then [ "uid=${toString uid}" ] else [ ] "credentials=${secrets.storage-box-credentials.path}"
) ++ ( ]
if (gid != null) then [ "gid=${toString gid}" ] else [ ] ++ (if (uid != null) then [ "uid=${toString uid}" ] else [ ])
); ++ (if (gid != null) then [ "gid=${toString gid}" ] else [ ]);
in in
{ {
options.modules.storageBoxMounts = lib.mkOption { options.modules.storageBoxMounts = lib.mkOption {
@@ -44,13 +49,15 @@ in
}; };
config = { config = {
fileSystems = lib.mapAttrs fileSystems = lib.mapAttrs (
(_: { path, user, ... }@options: { _:
{ path, user, ... }@options:
{
device = "//${user}.your-storagebox.de${path}"; device = "//${user}.your-storagebox.de${path}";
fsType = "cifs"; fsType = "cifs";
options = mountOptions options; options = mountOptions options;
}) }
cfg; ) cfg;
environment.systemPackages = lib.mkIf ((lib.length (lib.attrNames cfg)) > 0) [ pkgs.cifs-utils ]; environment.systemPackages = lib.mkIf ((lib.length (lib.attrNames cfg)) > 0) [ pkgs.cifs-utils ];
}; };

View File

@@ -50,20 +50,39 @@ let
}; };
cfg = config.modules.vlans; cfg = config.modules.vlans;
vlans = lib.mapAttrsToList (attrName: { name ? attrName, ... }@vlan: ({ inherit name; } // vlan)) cfg.networks; vlans = lib.mapAttrsToList (
vlanAttrs = lib.listToAttrs (lib.map ({ name, ... }@value: { inherit name value; }) vlans); attrName:
{
name ? attrName,
...
}@vlan:
({ inherit name; } // vlan)
) cfg.networks;
vlanAttrs = lib.listToAttrs (
lib.map (
{ name, ... }@value:
{
inherit name value;
}
) vlans
);
buildNetdev = name: { id, ... }: { buildNetdev =
name = "20-${name}"; name:
value = { { id, ... }:
netdevConfig = { {
Name = name; name = "20-${name}";
Kind = "vlan"; value = {
MACAddress = "00:0d:b9:49:d2:${toString id}"; netdevConfig = {
Name = name;
Kind = "vlan";
MACAddress = "00:0d:b9:49:d2:${toString id}";
};
vlanConfig = {
Id = id;
};
}; };
vlanConfig = { Id = id; };
}; };
};
buildStaticLease = macAddress: address: '' buildStaticLease = macAddress: address: ''
[DHCPServerStaticLease] [DHCPServerStaticLease]
@@ -71,27 +90,35 @@ let
Address=${address} Address=${address}
''; '';
buildNetwork = name: { id, ipv6, staticLeases, ... }: { buildNetwork =
name = "30-${name}"; name:
value = { {
matchConfig = { id,
Name = name; ipv6,
staticLeases,
...
}:
{
name = "30-${name}";
value = {
matchConfig = {
Name = name;
};
networkConfig = {
Address = "10.${toString id}.0.1/23";
IPMasquerade = "ipv4";
DHCPServer = true;
IPv6AcceptRA = false;
IPv6SendRA = ipv6;
DHCPPrefixDelegation = ipv6;
};
dhcpServerConfig = {
PoolOffset = 255;
DNS = "10.${toString id}.0.1";
};
extraConfig = lib.concatLines (lib.mapAttrsToList buildStaticLease staticLeases);
}; };
networkConfig = {
Address = "10.${toString id}.0.1/23";
IPMasquerade = "ipv4";
DHCPServer = true;
IPv6AcceptRA = false;
IPv6SendRA = ipv6;
DHCPPrefixDelegation = ipv6;
};
dhcpServerConfig = {
PoolOffset = 255;
DNS = "10.${toString id}.0.1";
};
extraConfig = lib.concatLines (lib.mapAttrsToList buildStaticLease staticLeases);
}; };
};
vlanIds = lib.mapAttrsToList (_: { id, ... }: id) vlanAttrs; vlanIds = lib.mapAttrsToList (_: { id, ... }: id) vlanAttrs;
@@ -108,25 +135,39 @@ let
''; '';
bridgeNetDev = bridgeNetDev =
if (cfg.bridge.enable) then { if (cfg.bridge.enable) then
"${cfg.bridge.netdev}".bridgeConfig = { {
VLANFiltering = true; "${cfg.bridge.netdev}".bridgeConfig = {
DefaultPVID = cfg.bridge.pvid; VLANFiltering = true;
}; DefaultPVID = cfg.bridge.pvid;
} else { }; };
}
else
{ };
bridgeBindNetwork = bridgeBindNetwork =
if (cfg.bridge.enable) then { if (cfg.bridge.enable) then
${cfg.bridge.bindNetwork}.extraConfig = bridgeVLANConfig; {
} else { }; ${cfg.bridge.bindNetwork}.extraConfig = bridgeVLANConfig;
}
else
{ };
bridgeNetwork = bridgeNetwork =
if (cfg.bridge.enable) then { if (cfg.bridge.enable) then
"${cfg.bridge.network}" = { {
vlan = lib.map ({ name, ... }: name) vlans; "${cfg.bridge.network}" = {
bridgeVLANs = lib.map ({ id, ... }: { VLAN = id; }) vlans; vlan = lib.map ({ name, ... }: name) vlans;
}; bridgeVLANs = lib.map (
} else { }; { id, ... }:
{
VLAN = id;
}
) vlans;
};
}
else
{ };
netdevs = lib.mergeAttrsList [ netdevs = lib.mergeAttrsList [
(lib.mapAttrs' buildNetdev vlanAttrs) (lib.mapAttrs' buildNetdev vlanAttrs)

View File

@@ -1,13 +1,20 @@
let let
moco = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDRXRJUwX98l2Vl4bUZdyHGhLjlf1RGAA5VCa4dmEJdU"; moco = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDRXRJUwX98l2Vl4bUZdyHGhLjlf1RGAA5VCa4dmEJdU";
jokke = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC7UDcuAbvp8mXIPl4M8MkM1X78YfXm50SLmSY3boL9Z"; jokke = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC7UDcuAbvp8mXIPl4M8MkM1X78YfXm50SLmSY3boL9Z";
users = [ moco jokke ]; users = [
moco
jokke
];
apu = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICAZkIuXtpP9a9bHkBl+MJI//q3ClMqzx03Rd/Xe4rjc"; apu = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICAZkIuXtpP9a9bHkBl+MJI//q3ClMqzx03Rd/Xe4rjc";
freun-dev = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEvCSjIjipog1Xf9mPc683r5VSGSjVc8v1UZg5VrbbxM"; freun-dev = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEvCSjIjipog1Xf9mPc683r5VSGSjVc8v1UZg5VrbbxM";
radish = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIQ0fy4n3yyD64+g55eZazeI5g9FurJnlC6fRiOXbbks"; radish = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIQ0fy4n3yyD64+g55eZazeI5g9FurJnlC6fRiOXbbks";
hosts = [ apu freun-dev radish ]; hosts = [
apu
freun-dev
radish
];
in in
{ {
"gotosocial.age".publicKeys = users ++ [ freun-dev ]; "gotosocial.age".publicKeys = users ++ [ freun-dev ];