Files
NixConfigs/hosts/xps/configuration.nix
2025-01-02 23:29:54 -06:00

184 lines
4.1 KiB
Nix

{
config,
pkgs,
lib,
inputs,
username,
stylix,
...
}: {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/gnome.nix
inputs.sops-nix.nixosModules.sops
];
sops.defaultSopsFile = ../../secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/home/${username}/.config/sops/age/keys.txt";
sops.secrets."protonvpn/norway_config" = {};
sops.secrets."protonvpn/us_config" = {};
sops.secrets."protonvpn/auth-user-pass" = {};
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
kernelPackages = pkgs.linuxPackages_latest;
kernel.sysctl = {
"vm.swappiness" = 10;
};
};
networking = {
hostName = "xps";
networkmanager.enable = true;
};
services = {
printing.enable = true;
openssh.enable = true;
tailscale.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
environment.etc."openvpn/update-resolv-conf".source = "${pkgs.update-resolv-conf}/libexec/openvpn/update-resolv-conf";
services.openvpn.servers = {
proton-norway = {
autoStart = false;
config = ''
config ${config.sops.secrets."protonvpn/norway_config".path}
auth-user-pass ${config.sops.secrets."protonvpn/auth-user-pass".path}
'';
};
proton-united-states = {
autoStart = false;
config = ''
config ${config.sops.secrets."protonvpn/us_config".path}
auth-user-pass ${config.sops.secrets."protonvpn/auth-user-pass".path}
'';
};
};
programs = {
nh = {
enable = true;
flake = "/home/${username}/nix-config";
};
};
hardware.bluetooth.enable = true;
virtualisation.docker.enable = true;
users.users.${username} = {
isNormalUser = true;
extraGroups = [
"networkmanager"
"wheel"
"audio"
"video"
"input"
"docker"
];
};
# Enable the X11 windowing system.
#services.xserver.enable = true;
# Enable the Pantheon Desktop Environment.
#services.xserver.displayManager.lightdm.enable = true;
#services.xserver.desktopManager.pantheon.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "jared";
environment.systemPackages = with pkgs; [
git
neovim
gcc
tailscale
firefox
htop
nerdfonts
kitty
yazi
nodejs
openvpn
audio-recorder
qemu
qemu_kvm
spotify
strawberry
unzip
libation
nodePackages.prettier
update-resolv-conf
dconf2nix
libation
sops
];
environment.variables = {
EDITOR = "nvim";
};
services.flatpak.enable = true;
stylix.enable = true;
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/solarflare.yaml";
stylix.image = /home/jared/Pictures/SupermassiveBinaryBlackHoles.png;
stylix.cursor.package = pkgs.vimix-cursor-theme;
stylix.cursor.name = "Vimix-Cursors";
stylix.targets.gnome.enable = true;
# stylix.targets.kitty.enable = true;
system.stateVersion = "23.11"; # Did you read the comment?
networking.nameservers = [
"192.168.1.3"
"1.1.1.1"
"9.9.9.9"
];
# Set your time zone.
time.timeZone = "America/Chicago";
# Select internationalisation properties.
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";
};
#sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
}