1
0
Fork 0

Compare commits

...

2 commits

Author SHA1 Message Date
Aires e3b7fe55cf Clean up unused modules 2024-06-24 14:31:13 -04:00
Aires 39ea6b199f Tweak autoupgrade script 2024-06-24 14:26:41 -04:00
6 changed files with 32 additions and 112 deletions

View file

@ -12,16 +12,13 @@
aux.system = { aux.system = {
apps.tmux.enable = true; apps.tmux.enable = true;
boot = { bootloader.enable = false; # Bootloader configured in hardware-configuration.nix
enable = true;
secureboot.enable = false;
};
packages = with pkgs; [ packages = with pkgs; [
libraspberrypi libraspberrypi
raspberrypifw raspberrypifw
raspberrypi-eeprom raspberrypi-eeprom
linuxKernel.kernels.linux_rpi4 linuxKernel.kernels.linux_rpi4
]; ];
services.ssh = { services.ssh = {
enable = true; enable = true;
ports = [ config.secrets.hosts.haven.ssh.port ]; ports = [ config.secrets.hosts.haven.ssh.port ];

View file

@ -5,6 +5,9 @@
... ...
}: }:
let let
# Do not change this value! This tracks when NixOS was installed on your system.
stateVersion = "24.05";
# Copy bluetooth device configs # Copy bluetooth device configs
shure-aonic-bluetooth = pkgs.writeText "info" ( shure-aonic-bluetooth = pkgs.writeText "info" (
builtins.readFile ./bluetooth/shure-aonic-bluetooth-params builtins.readFile ./bluetooth/shure-aonic-bluetooth-params
@ -26,7 +29,7 @@ in
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
system.stateVersion = "24.05"; system.stateVersion = stateVersion;
aux.system = { aux.system = {
apps = { apps = {
@ -42,9 +45,28 @@ in
languagetool.enable = true; languagetool.enable = true;
}; };
}; };
# Configure the bootloader.
bootloader = {
enable = true;
secureboot.enable = true;
tpm2.enable = true;
};
# Change the default text editor. Options are "emacs", "nano", or "vim".
editor = "nano";
# Enable GPU support.
gpu.amd.enable = true; gpu.amd.enable = true;
packages = with pkgs; [ boinc ];
packages = with pkgs; [
boinc # Boinc client
];
# Keep old generations for one week.
retentionPeriod = "7d"; retentionPeriod = "7d";
# Run daily automatic updates.
services.autoUpgrade = { services.autoUpgrade = {
enable = true; enable = true;
configDir = config.secrets.nixConfigFolder; configDir = config.secrets.nixConfigFolder;

View file

@ -1,35 +0,0 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.aux.system.apps.kdeconnect;
in
with lib;
{
options = {
aux.system.apps.kdeconnect.enable = mkEnableOption (mdDoc "Enables KDE Connect");
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ gnomeExtensions.gsconnect ];
networking.firewall = {
allowedTCPPortRanges = [
{
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
from = 1714;
to = 1764;
}
];
};
};
}

View file

@ -26,11 +26,7 @@ in
{ {
options = { options = {
aux.system.services.autoUpgrade = { aux.system.services.autoUpgrade = {
enable = lib.mkOption { enable = lib.mkEnableOption (lib.mdDoc "Enables automatic system updates.");
default = true;
type = lib.types.bool;
description = "Enables automatic system updates.";
};
branches = lib.mkOption { branches = lib.mkOption {
type = lib.types.attrs; type = lib.types.attrs;
description = "Which local and remote branches to compare."; description = "Which local and remote branches to compare.";

View file

@ -1,60 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.aux.system.services.k3s;
in
with lib;
{
options = {
aux.system.services.k3s = {
enable = mkEnableOption (mdDoc "Enables K3s");
role = mkOption {
default = "server";
type = types.enum [
"agent"
"server"
];
description = "Which K3s role to use";
};
serverAddr = mkOption {
default = "";
type = types.str;
description = "If an agent, this is the address of the server.";
};
};
};
config = mkIf cfg.enable {
# Add packages for developing with K3s.
# For details, see https://nixos.wiki/wiki/K3s
environment.systemPackages = with pkgs; [ k3s ];
networking.firewall = {
allowedTCPPorts = [
6443 # k3s: required so that pods can reach the API server (running on port 6443 by default)
# 2379 # k3s, etcd clients: required if using a "High Availability Embedded etcd" configuration
# 2380 # k3s, etcd peers: required if using a "High Availability Embedded etcd" configuration
];
allowedUDPPorts = [
# 8472 # k3s, flannel: required if using multi-node for inter-node networking
];
};
services.k3s = {
enable = true;
inherit (cfg) role;
extraFlags = toString [
# "--kubelet-arg=v=4" # Optionally add additional args to k3s
];
} // optionalAttrs (cfg.role == "agent") { inherit (cfg) serverAddr; };
# Increase number of open file handlers so K3s doesn't exhaust them...again.
systemd.extraConfig = ''
DefaultLimitNOFILE=8192:1048576
'';
};
}

View file

@ -12,7 +12,7 @@ in
{ {
options = { options = {
aux.system.services.virtualization = { aux.system.services.virtualization = {
enable = lib.mkEnableOption (lib.mdDoc "Enables virtualization hosting tools on this aux.system."); enable = lib.mkEnableOption (lib.mdDoc "Enables virtualization hosting tools on this host.");
user = lib.mkOption { user = lib.mkOption {
default = ""; default = "";
type = lib.types.str; type = lib.types.str;