server | cleanup

This commit is contained in:
Don Harper 2024-01-06 10:07:26 -06:00
parent 1309d19b2e
commit 26379c87ed

View file

@ -31,41 +31,22 @@ in
./upgrade-diff.nix ./upgrade-diff.nix
]; ];
# Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.enableIPv6 = true; networking.enableIPv6 = true;
networking.networkmanager.wifi.powersave = true;
networking.useDHCP = false; networking.useDHCP = false;
# Set your time zone.
time = { time = {
timeZone = "America/Chicago"; timeZone = "America/Chicago";
hardwareClockInLocalTime = false; hardwareClockInLocalTime = false;
}; };
# Select internationalisation properties.
i18n.defaultLocale = "en_US.utf8"; i18n.defaultLocale = "en_US.utf8";
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
];
};
# Bootloader.
boot = { boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [ "consoleblank=60" ]; kernelParams = [ "consoleblank=60" ];
loader = { loader = {
grub = {
enable = true;
configurationLimit = 10;
device = "/dev/sda";
};
systemd-boot = { systemd-boot = {
enable = false; enable = true;
}; };
efi = { efi = {
canTouchEfiVariables = true; canTouchEfiVariables = true;
@ -82,9 +63,6 @@ in
}; };
security = { security = {
polkit = {
enable = true;
};
sudo.enable = false; sudo.enable = false;
doas = { doas = {
enable = true; enable = true;
@ -97,47 +75,18 @@ in
}; };
services = { services = {
#udev = {
#extraRules = ''
#KERNEL=="card0", SUBSYSTEM=="drm", RUN+=""${pkgs.kanshi-fix}"/bin/kanshi-fix"
#'';
#};
pcscd = { pcscd = {
enable = true; enable = true;
}; };
avahi = {
enable = true;
nssmdns4 = true;
};
printing = {
enable = true;
};
udisks2 = { udisks2 = {
enable = true; enable = true;
}; };
nscd = { nscd = {
enableNsncd = true; enableNsncd = true;
}; };
flatpak = {
enable = true;
};
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse = {
enable = true;
};
};
tailscale = { tailscale = {
enable = true; enable = true;
}; };
logind = {
lidSwitchExternalPower = "ignore";
lidSwitchDocked = "ignore";
};
locate = { locate = {
enable = true; enable = true;
package = pkgs.mlocate; package = pkgs.mlocate;
@ -148,98 +97,60 @@ in
settings = { settings = {
PasswordAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;
#permitRootLogin = "yes"; permitRootLogin = "yes";
}; };
}; };
}; };
# Enable sound with pipewire.
sound.enable = true;
hardware.bluetooth.enable = true;
hardware.pulseaudio.enable = false;
hardware.sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
security.rtkit.enable = true; security.rtkit.enable = true;
xdg.portal = { users.users = {
enable = true; don = {
wlr.enable = true; isNormalUser = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; initialPassword = "changeme";
#gtkUsePortal = true; description = "Don Harper";
extraGroups = [ "networkmanager" "wheel" "scanner" "lp" "video" "mlocate" "disk" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINd8AdVbQQ/Fmw+b9mI8EMYqIoRkwmSwAOtmlte3incL don@loki"
];
};
root = {
initialPassword = "changeme";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINd8AdVbQQ/Fmw+b9mI8EMYqIoRkwmSwAOtmlte3incL don@loki"
];
};
}; };
users.users.don = { #nixpkgs.config.allowUnfree = true;
isNormalUser = true;
description = "Don Harper";
extraGroups = [ "networkmanager" "wheel" "scanner" "lp" "video" "mlocate" "disk" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINd8AdVbQQ/Fmw+b9mI8EMYqIoRkwmSwAOtmlte3incL don@loki"
];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [ "electron-21.4.0" "electron-25.9.0" ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
#(callPackage ../mypackages/kanshi-fix/default.nix {})
python-with-my-packages python-with-my-packages
acpi
aspell aspell
aspellDicts.en aspellDicts.en
bash-completion bash-completion
nix-bash-completions nix-bash-completions
btop btop
espeak-classic
# fwup
# fwupd
# fwupd-efi
git-crypt git-crypt
gitFull gitFull
headsetcontrol
home-manager home-manager
hunspell hunspell
hunspellDicts.en_US hunspellDicts.en_US
imagemagick
isync isync
libsForQt5.qtkeychain
lsb-release lsb-release
pkg-config pkg-config
playerctl
poppler_utils poppler_utils
pulseaudio
ruby ruby
steam
udiskie udiskie
wireplumber
wlsunset
xdg-utils
xfce.thunar
zathura
]; ];
programs = { programs = {
steam = {
enable = true;
# Open ports in the firewall for Steam Remote Play
remotePlay.openFirewall = true;
# Open ports in the firewall for Source Dedicated Server
dedicatedServer.openFirewall = true;
};
dconf = { dconf = {
enable = true; enable = true;
}; };
light = {
enable = true;
};
mtr = { mtr = {
enable = true; enable = true;
}; };
kdeconnect = {
enable = true;
};
gnupg = { gnupg = {
agent = { agent = {
enable = true; enable = true;
@ -251,39 +162,20 @@ in
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { qutebrowser = prev.qutebrowser.override { enableWideVine = true; }; })
(final: super:{ khal = super.khal.overridePythonAttrs (_: { doCheck = false; }); }) (final: super:{ khal = super.khal.overridePythonAttrs (_: { doCheck = false; }); })
]; ];
# Open ports in the firewall. # Open ports in the firewall.
networking.firewall = { networking.firewall = {
enable = true; enable = false;
# always allow traffic from your Tailscale network
trustedInterfaces = [ "tailscale0" ]; trustedInterfaces = [ "tailscale0" ];
checkReversePath = "loose"; checkReversePath = "loose";
# allow the Tailscale UDP port through the firewall
allowedUDPPorts = [ config.services.tailscale.port ]; allowedUDPPorts = [ config.services.tailscale.port ];
#allowedUDPPortRanges = [ { from = 1714 ; to = 1764; }];
# allow you to SSH in over the public internet
allowedTCPPorts = [ 22 ]; allowedTCPPorts = [ 22 ];
#allowedTCPPortRanges = [ { from = 1714 ; to = 1764; } ];
interfaces = {
"tailscale0" = {
allowedTCPPorts = [ 22 8080 8443 ];
};
};
}; };
# This value determines the NixOS release from which the default system.stateVersion = "23.11";
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leavecatenate(variables, "bootdev", bootdev)
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
programs.msmtp = { programs.msmtp = {
enable = true; enable = true;
accounts = { accounts = {
@ -298,13 +190,4 @@ in
}; };
}; };
}; };
xdg.mime.enable = true;
xdg.mime.defaultApplications = {
"text/html" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop";
"x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop";
};
environment.sessionVariables.DEFAULT_BROWSER = "${pkgs.qutebrowser}/bin/qutebrowser";
} }