clean up even more boilerplate

This commit is contained in:
Daylin Morgan 2024-03-21 11:04:01 -05:00
parent 55f2e625ec
commit 7facf2e749
Signed by: daylin
GPG key ID: 950D13E9719334AD
7 changed files with 62 additions and 83 deletions

View file

@ -1,10 +1,12 @@
{lib, ...}: { {lib, ...}: let
inherit (lib) enabled;
in {
users.motd = lib.mkRune { users.motd = lib.mkRune {
number = "6"; number = "6";
rune = "algiz"; rune = "algiz";
}; };
services.resolved.enable = true; services.resolved = enabled;
services.fail2ban = { services.fail2ban = {
enable = true; enable = true;
@ -19,13 +21,15 @@
# networking.nameservers = [ "8.8.8.8"]; # networking.nameservers = [ "8.8.8.8"];
# allow tcp connections for revsere proxy # allow tcp connections for revsere proxy
networking.firewall = { networking.firewall =
enable = true; enabled
allowedTCPPorts = [80 443]; // {
}; allowedTCPPorts = [80 443];
};
services.openssh.enable = true; services.openssh =
services.openssh.settings.PasswordAuthentication = false; enabled
// {settings.PasswordAuthentication = false;};
# users.mutableUsers = false; # users.mutableUsers = false;
@ -33,11 +37,6 @@
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
# This value determines the NixOS release from which the default # don't delete this you foo bar
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# 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? system.stateVersion = "23.11"; # Did you read the comment?
} }

View file

@ -3,7 +3,9 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }: let
inherit (lib) enabled;
in {
users.motd = lib.mkRune { users.motd = lib.mkRune {
number = "2"; number = "2";
rune = "mannaz"; rune = "mannaz";
@ -11,7 +13,7 @@
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader = { boot.loader = {
systemd-boot.enable = true; systemd-boot = enabled;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
@ -26,27 +28,31 @@
} }
]; ];
hardware.opengl = { hardware.opengl =
enable = true; enabled
driSupport = true; // {
driSupport32Bit = true; driSupport = true;
extraPackages = with pkgs; [ driSupport32Bit = true;
libGL extraPackages = with pkgs; [
]; libGL
setLdLibraryPath = true; ];
}; setLdLibraryPath = true;
};
# Load nvidia driver for Xorg and Wayland # Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"]; services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = { hardware.nvidia = {
# Modesetting is required. # Modesetting is required.
modesetting.enable = true; modesetting = enabled;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail. # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false; powerManagement =
# Fine-grained power management. Turns off GPU when not in use. enabled
# Experimental and only works on modern Nvidia GPUs (Turing or newer). // {
powerManagement.finegrained = false; # Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
finegrained = false;
};
# Use the NVidia open source kernel module (not to be confused with the # Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver). # independent third-party "nouveau" open source driver).
@ -65,8 +71,8 @@
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.stable;
}; };
programs.nix-ld.enable = true; programs.nix-ld = enabled;
services.openssh.enable = true; services.openssh = enabled;
networking.hostName = "mannaz"; networking.hostName = "mannaz";
# networking.wireless.enable = true; # networking.wireless.enable = true;
@ -80,21 +86,6 @@
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
# This option defines the first version of NixOS you have installed on this particular machine, # don't delete this you foo bar
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?
} }

View file

@ -2,26 +2,27 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }: let
networking.networkmanager.enable = true; inherit (lib) enabled;
services.printing.enable = true; in {
services.fwupd.enable = true; networking.networkmanager = enabled;
hardware.bluetooth.enable = true; services.printing = enabled;
hardware.bluetooth.powerOnBoot = true; services.fwupd = enabled;
hardware.bluetooth = enabled // {powerOnBoot = true;};
# https://github.com/NixOS/nixos-hardware/blob/c478b3d56969006e015e55aaece4931f3600c1b2/lenovo/thinkpad/x1/9th-gen/default.nix # https://github.com/NixOS/nixos-hardware/blob/c478b3d56969006e015e55aaece4931f3600c1b2/lenovo/thinkpad/x1/9th-gen/default.nix
# https://github.com/NixOS/nixos-hardware/blob/c478b3d56969006e015e55aaece4931f3600c1b2/common/pc/ssd/default.nix # https://github.com/NixOS/nixos-hardware/blob/c478b3d56969006e015e55aaece4931f3600c1b2/common/pc/ssd/default.nix
services.fstrim.enable = true; services.fstrim = enabled;
# rtkit is optional but recommended # rtkit is optional but recommended
security.rtkit.enable = true; security.rtkit = enabled;
services.pipewire = { services.pipewire =
enable = true; enabled
audio.enable = true; // {
pulse.enable = true; audio = enabled;
alsa.enable = true; pulse = enabled;
alsa.support32Bit = true; alsa = enabled // {support32Bit = true;};
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pamixer pamixer
@ -46,21 +47,6 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# boot.kernelPackages = pkgs.linuxPackages_latest; # boot.kernelPackages = pkgs.linuxPackages_latest;
# This option defines the first version of NixOS you have installed on this particular machine, # don't delete this you foo bar
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?
} }

View file

@ -13,7 +13,8 @@
swaylock -c 1e1e2e swaylock -c 1e1e2e
''; '';
}; };
in mkOizysModule config "hyprland" { in
mkOizysModule config "hyprland" {
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};
# Optional, hint electron apps to use wayland: # Optional, hint electron apps to use wayland:
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";

View file

@ -5,6 +5,7 @@
... ...
}: let }: let
inherit (lib) mkOizysModule; inherit (lib) mkOizysModule;
in mkOizysModule config "vpn" { in
mkOizysModule config "vpn" {
environment.systemPackages = [pkgs.openconnect]; environment.systemPackages = [pkgs.openconnect];
} }

View file

@ -5,7 +5,8 @@
... ...
}: let }: let
inherit (lib) mkOizysModule; inherit (lib) mkOizysModule;
in mkOizysModule config "chrome" { in
mkOizysModule config "chrome" {
programs.chromium = { programs.chromium = {
enable = true; enable = true;