2024-02-29 09:53:34 -05:00
|
|
|
# System options
|
2024-05-22 15:39:57 -04:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-05-07 18:02:59 -04:00
|
|
|
{
|
|
|
|
# Set up the environment
|
|
|
|
environment = {
|
|
|
|
# Install base packages
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
bash
|
|
|
|
dconf # Needed to fix an issue with Home-manager. See https://github.com/nix-community/home-manager/issues/3113
|
|
|
|
direnv
|
|
|
|
git
|
|
|
|
home-manager
|
|
|
|
nano
|
|
|
|
p7zip
|
|
|
|
fastfetch
|
|
|
|
nh # Nix Helper: https://github.com/viperML/nh
|
|
|
|
];
|
2024-05-01 21:10:26 -04:00
|
|
|
|
2024-05-07 18:02:59 -04:00
|
|
|
variables = {
|
|
|
|
EDITOR = "nano"; # Set default editor to nano
|
|
|
|
};
|
|
|
|
};
|
2024-02-29 09:53:34 -05:00
|
|
|
|
2024-05-30 10:31:11 -04:00
|
|
|
# Configure automatic updates. Replaces system.autoUpgrade.
|
|
|
|
systemd.services."nixos-update" = {
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
User = "root";
|
|
|
|
};
|
2024-05-30 12:19:07 -04:00
|
|
|
path = with pkgs; [
|
|
|
|
coreutils
|
|
|
|
gnutar
|
|
|
|
xz.bin
|
|
|
|
gzip
|
|
|
|
git
|
|
|
|
config.nix.package.out
|
|
|
|
nh
|
|
|
|
openssh
|
|
|
|
];
|
2024-05-30 10:31:11 -04:00
|
|
|
script = ''
|
2024-05-30 12:19:07 -04:00
|
|
|
set -eu
|
|
|
|
cd ${config.users.users.aires.home}/Development/nix-configuration
|
|
|
|
sudo -u aires git pull --recurse-submodules
|
|
|
|
nh os switch
|
2024-05-30 10:31:11 -04:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
systemd.timers."nixos-update-timer" = {
|
|
|
|
wants = [ "network-online.target" ];
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "daily";
|
|
|
|
Persistent = "true";
|
|
|
|
Unit = "nixos-update.service";
|
|
|
|
};
|
2024-05-07 18:02:59 -04:00
|
|
|
};
|
2024-04-20 01:01:17 -04:00
|
|
|
|
2024-05-22 15:39:57 -04:00
|
|
|
services = {
|
|
|
|
# Enable fwupd (firmware updater)
|
|
|
|
fwupd.enable = true;
|
|
|
|
|
|
|
|
# Autoscrub BTRFS partitions
|
|
|
|
btrfs.autoScrub = lib.mkIf (config.fileSystems."/".fsType == "btrfs") {
|
|
|
|
enable = true;
|
|
|
|
interval = "weekly";
|
|
|
|
fileSystems = [ "/" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Allow systemd user services to keep running after the user has logged out
|
|
|
|
logind.killUserProcesses = false;
|
|
|
|
|
|
|
|
# Enable disk monitoring
|
|
|
|
smartd = {
|
|
|
|
enable = true;
|
|
|
|
autodetect = true;
|
|
|
|
notifications.wall.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Reduce logout stop timer duration
|
|
|
|
systemd.extraConfig = ''
|
|
|
|
DefaultTimeoutStopSec=30s
|
|
|
|
'';
|
2024-05-01 21:10:26 -04:00
|
|
|
|
2024-05-07 18:02:59 -04:00
|
|
|
# Set your time zone.
|
|
|
|
time.timeZone = "America/New_York";
|
2024-05-01 21:10:26 -04:00
|
|
|
|
2024-05-07 18:02:59 -04:00
|
|
|
# Select internationalisation properties.
|
|
|
|
i18n = {
|
|
|
|
defaultLocale = "en_US.UTF-8";
|
2024-05-01 21:10:26 -04:00
|
|
|
|
2024-05-07 18:02:59 -04:00
|
|
|
extraLocaleSettings = {
|
|
|
|
LC_ADDRESS = "en_US.UTF-8";
|
|
|
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
|
|
|
LC_MEASUREMENT = "en_US.UTF-8";
|
|
|
|
LC_MONETARY = "en_US.UTF-8";
|
|
|
|
LC_NAME = "en_US.UTF-8";
|
|
|
|
LC_NUMERIC = "en_US.UTF-8";
|
|
|
|
LC_PAPER = "en_US.UTF-8";
|
|
|
|
LC_TELEPHONE = "en_US.UTF-8";
|
|
|
|
LC_TIME = "en_US.UTF-8";
|
|
|
|
};
|
|
|
|
};
|
2024-02-29 09:53:34 -05:00
|
|
|
}
|