Add HTPC
This commit is contained in:
parent
54d91634cb
commit
f27a46d2e9
5 changed files with 80 additions and 25 deletions
|
@ -116,6 +116,11 @@
|
|||
defaultLocale = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
programs.mosh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
layout = "us";
|
||||
|
@ -127,6 +132,8 @@
|
|||
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
settings.PermitRootLogin = true;
|
||||
};
|
||||
|
||||
openFirewall = lib.mkDefault false;
|
||||
|
@ -176,7 +183,7 @@
|
|||
firewall = {
|
||||
enable = lib.mkDefault true;
|
||||
allowPing = lib.mkDefault true;
|
||||
allowedTCPPorts = lib.mkDefault [];
|
||||
allowedTCPPorts = lib.mkDefault [22];
|
||||
allowedUDPPorts = lib.mkDefault [];
|
||||
};
|
||||
|
||||
|
@ -292,5 +299,7 @@
|
|||
# };
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
||||
system.stateVersion = lib.mkDefault "23.11";
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{...}: {
|
||||
sound.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
||||
|
@ -14,12 +16,13 @@
|
|||
|
||||
hardware = {
|
||||
pulseaudio = {
|
||||
enable = false;
|
||||
support32Bit = true;
|
||||
};
|
||||
};
|
||||
|
||||
security = {
|
||||
# I forget why I need these...
|
||||
# I forget why I need these exactly...
|
||||
polkit.enable = true;
|
||||
rtkit.enable = true;
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@ with builtins; (listToAttrs (map (name: {
|
|||
};
|
||||
}) [
|
||||
"base"
|
||||
"htpc"
|
||||
"beefcake"
|
||||
"dragon"
|
||||
"foxtrot"
|
||||
|
|
65
nixos/htpc.nix
Normal file
65
nixos/htpc.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
lib,
|
||||
outputs,
|
||||
config,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
networking.hostName = "htpc";
|
||||
|
||||
imports = with outputs.nixosModules; [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
desktop-usage
|
||||
gnome
|
||||
wifi
|
||||
flanfam
|
||||
flanfamkiosk
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
home-manager.users.daniel = {
|
||||
imports = with outputs.homeManagerModules; [linux-desktop];
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
#with pkgs;
|
||||
[];
|
||||
|
||||
programs.steam.enable = true;
|
||||
programs.steam.remotePlay.openFirewall = true;
|
||||
|
||||
services.xserver.displayManager.autoLogin.enable = true;
|
||||
services.xserver.displayManager.autoLogin.user = "daniel";
|
||||
|
||||
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
|
||||
systemd.services."getty@tty1".enable = false;
|
||||
systemd.services."autovt@tty1".enable = false;
|
||||
|
||||
# hardware
|
||||
systemd.targets.sleep.enable = false;
|
||||
systemd.targets.suspend.enable = false;
|
||||
systemd.targets.hibernate.enable = false;
|
||||
systemd.targets.hybrid-sleep.enable = false;
|
||||
|
||||
powerManagement.enable = false;
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-intel" "acpi_call"];
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [acpi_call];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/0f4e5814-0002-43f0-bfab-8368e3fe5b8a";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
|
@ -27,27 +27,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
outputs.overlays.unstable-packages
|
||||
];
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
|
||||
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
||||
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
services.fprintd = {
|
||||
|
@ -87,8 +66,6 @@
|
|||
boot.kernelModules = ["kvm-intel" "acpi_call"];
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [acpi_call];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
|
Loading…
Reference in a new issue