move some common stuff to shared files
This commit is contained in:
109
modules/common.nix
Normal file
109
modules/common.nix
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
stylix,
|
||||
username,
|
||||
ghostty,
|
||||
...
|
||||
}:
|
||||
{
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernel.sysctl = {
|
||||
"vm.swappiness" = 10;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
printing.enable = true;
|
||||
openssh.enable = true;
|
||||
tailscale.enable = true;
|
||||
flatpak.enable = true;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
# Configure keymap in X11
|
||||
xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
||||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
neovim
|
||||
gcc
|
||||
tailscale
|
||||
firefox
|
||||
htop
|
||||
nerdfonts
|
||||
kitty
|
||||
yazi
|
||||
nodejs
|
||||
openvpn
|
||||
audio-recorder
|
||||
qemu
|
||||
qemu_kvm
|
||||
unzip
|
||||
libation
|
||||
nodePackages.prettier
|
||||
dconf2nix
|
||||
libation
|
||||
sops
|
||||
ghostty.packages.x86_64-linux.default
|
||||
];
|
||||
|
||||
programs = {
|
||||
nh = {
|
||||
enable = true;
|
||||
flake = "/home/${username}/nix-config";
|
||||
};
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
{ config, pkgs, stylix, ... }:
|
||||
{
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
|
||||
# stylix.targets.gnome.enable = true;
|
||||
# Enable the GNOME Desktop Environment.
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
# Enable the GNOME Desktop Environment.
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
}
|
||||
|
||||
|
||||
26
modules/protonvpn.nix
Normal file
26
modules/protonvpn.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
sops.secrets."protonvpn/norway_config" = {};
|
||||
sops.secrets."protonvpn/us_config" = {};
|
||||
sops.secrets."protonvpn/auth-user-pass" = {};
|
||||
environment.systemPackages = with pkgs; [
|
||||
update-resolv-conf
|
||||
];
|
||||
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}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user