144 lines
3.6 KiB
Nix
144 lines
3.6 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
./hardware-configuration.nix
|
|
|
|
../../modules/site/blog.nix
|
|
../../modules/site/code.nix
|
|
../../modules/site/mail.nix
|
|
../../modules/site/music.nix
|
|
../../modules/site/photo.nix
|
|
|
|
../../modules/ssh.nix
|
|
];
|
|
|
|
networking.hostName = "desktop";
|
|
|
|
users.users.lilac = {
|
|
isNormalUser = true;
|
|
group = "lilac";
|
|
extraGroups = [ "wheel" "render" "video" "input" "uinput" ];
|
|
};
|
|
users.groups.lilac = {};
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
|
|
users.lilac = import ../../home/lilac.nix;
|
|
};
|
|
programs.zsh.enable = true;
|
|
users.users.lilac.shell = pkgs.zsh;
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
time.timeZone = "America/Toronto";
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
i18n.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";
|
|
};
|
|
|
|
services.xserver.enable = true;
|
|
services.displayManager.sddm.enable = true;
|
|
services.desktopManager.plasma6.enable = true;
|
|
services.xserver.xkb = {
|
|
layout = "us";
|
|
variant = "";
|
|
};
|
|
|
|
services.pulseaudio.enable = false;
|
|
security.rtkit.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
};
|
|
|
|
services.sunshine = {
|
|
enable = true;
|
|
autoStart = true;
|
|
capSysAdmin = true;
|
|
openFirewall = true;
|
|
};
|
|
networking.firewall.interfaces.wg0.allowedTCPPorts = [ 47984 47989 47990 48010 ];
|
|
networking.firewall.interfaces.wg0.allowedUDPPorts = [ 47998 47999 48000 48002 48010 ];
|
|
services.displayManager.autoLogin.enable = true;
|
|
services.displayManager.autoLogin.user = "lilac";
|
|
|
|
systemd.sleep.settings.Sleep = {
|
|
AllowSuspend = "no";
|
|
AllowHibernation = "no";
|
|
AllowHybridSleep = "no";
|
|
AllowSuspendThenHibernate = "no";
|
|
};
|
|
|
|
systemd.services.amdgpu-performance = {
|
|
description = "Force AMD GPU performance level to high";
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = ''
|
|
${pkgs.bash}/bin/bash -c '
|
|
for gpu in /sys/class/drm/card*/device; do
|
|
if [ -f "$gpu/vendor" ] && [ "$(cat "$gpu/vendor")" = "0x1002" ]; then
|
|
echo high > "$gpu/power_dpm_force_performance_level"
|
|
fi
|
|
done
|
|
'
|
|
'';
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
whipper
|
|
flac
|
|
tor-browser
|
|
restic
|
|
];
|
|
|
|
programs.steam.enable = true;
|
|
|
|
networking = {
|
|
firewall = {
|
|
enable = true;
|
|
allowedUDPPorts = [ 51820 ];
|
|
trustedInterfaces = [ "wg0" ];
|
|
};
|
|
|
|
wireguard.interfaces."wg0" = {
|
|
ips = [ "10.0.0.2/24" ];
|
|
generatePrivateKeyFile = true;
|
|
privateKeyFile = "/var/lib/wireguard/wg0.key";
|
|
peers = [{
|
|
publicKey = "Tst6SiqoGLSoOAF9l5vT2vvR2RGJ/mFcoBL3BL5n90k=";
|
|
allowedIPs = [ "10.0.0.0/24" ];
|
|
endpoint = "216.128.177.13:51820";
|
|
persistentKeepalive = 25;
|
|
}];
|
|
};
|
|
};
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
system.stateVersion = "26.05";
|
|
|
|
services.restic.backups.backup = {
|
|
repository = "rest:http://10.0.0.4:8000/backup";
|
|
initialize = true;
|
|
passwordFile = "/home/lilac/test-password";
|
|
paths = [ "/var/lib/immich" "/var/lib/music" "/var/lib/gitea" ];
|
|
timerConfig.OnCalendar = "03:30";
|
|
pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ];
|
|
};
|
|
}
|