config-perso/kat/default.nix

104 lines
2.4 KiB
Nix
Raw Normal View History

2024-09-26 11:51:04 +02:00
{
lib,
config,
pkgs,
2024-10-26 18:29:35 +02:00
sources,
2024-12-15 16:19:19 +01:00
self-meta,
2024-09-26 11:51:04 +02:00
...
}:
with lib;
{
imports = [
./users
2024-10-20 18:52:05 +02:00
./proxies
2024-09-26 11:51:04 +02:00
./root.nix
2024-12-15 16:19:19 +01:00
self-meta.home-manager
2024-10-26 18:29:35 +02:00
"${sources.disko}/module.nix"
2024-09-26 11:51:04 +02:00
];
options.kat = {
2024-10-27 09:16:42 +01:00
addArgs = mkEnableOption "the extra arguments" // {
default = true;
};
wireguardPubKey = mkOption {
type = types.str;
};
2024-10-20 18:52:05 +02:00
fqdn = mkOption {
type = types.str;
};
2024-09-26 11:51:04 +02:00
anywhere = lib.mkOption {
type = lib.types.package;
readOnly = true;
};
};
2024-10-27 09:16:42 +01:00
config = mkMerge [
(mkIf config.kat.addArgs {
_module.args = {
ssh-keys = import ./ssh-keys { inherit lib; };
};
})
{
kat = {
anywhere = pkgs.writeShellApplication {
2024-10-28 11:15:27 +01:00
name = "anywhere-deploy_${config.networking.hostName}.sh";
2024-10-27 09:16:42 +01:00
runtimeInputs = [ pkgs.nixos-anywhere ];
# --kexec ${nodes.kat-kexec.config.system.build.kexecTarball}/${nodes.kat-kexec.config.system.kexec-installer.name}-${pkgs.stdenv.hostPlatform.system}.tar.gz
text = ''
2024-10-28 11:15:27 +01:00
nixos-anywhere --no-substitute-on-destination --store-paths ${config.system.build.diskoScriptNoDeps} ${config.system.build.toplevel} ${config.deployment.targetHost}
2024-10-27 09:16:42 +01:00
'';
};
2024-09-26 11:51:04 +02:00
};
2024-10-03 17:42:38 +02:00
2024-10-27 09:16:42 +01:00
boot = {
tmp.useTmpfs = true;
supportedFilesystems.bcachefs = mkDefault true;
kernelPackages = pkgs.linuxPackages_latest;
};
2024-10-03 17:42:38 +02:00
2024-10-27 09:16:42 +01:00
networking = {
useNetworkd = true;
nftables.enable = true;
};
systemd.network.enable = true;
2024-10-03 17:42:38 +02:00
2024-12-15 16:19:19 +01:00
nixpkgs.overlays = map import self-meta.overlay-paths;
2024-10-27 09:16:42 +01:00
nix = {
nixPath = [
2024-12-15 16:19:19 +01:00
"nixpkgs=${self-meta.nixpkgs-paths.nixpkgs}"
"nixos=${self-meta.nixpkgs-paths.nixpkgs}"
2024-10-27 09:16:42 +01:00
];
channel.enable = false;
settings.nix-path = config.nix.nixPath;
package = pkgs.lix;
};
2024-10-03 17:42:38 +02:00
2024-10-27 09:16:42 +01:00
time.timeZone = mkDefault "Europe/Paris";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = mkDefault "fr";
};
2024-10-03 17:42:38 +02:00
2024-10-27 09:16:42 +01:00
environment.systemPackages = with pkgs; [
tree
ranger
ripgrep
wget
git
lazygit
btop
screen
nix-search-cli
nix-output-monitor
];
2024-10-03 17:42:38 +02:00
2024-10-27 09:16:42 +01:00
services = {
resolved.enable = !config.boot.isContainer;
openssh.settings = {
ClientAliveInterval = 60;
ClientAliveCountMax = 1;
};
2024-09-26 11:51:04 +02:00
};
2024-10-27 09:16:42 +01:00
}
];
2024-09-26 11:51:04 +02:00
}