Added configuration for desktop
This commit is contained in:
parent
4fdc520c13
commit
7ab4886e90
19
flake.nix
19
flake.nix
@ -42,7 +42,7 @@
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
laptop = nixpkgs.lib.nixosSystem {
|
||||
xv-laptop = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
@ -58,5 +58,22 @@
|
||||
];
|
||||
};
|
||||
};
|
||||
nixosConfigurations = {
|
||||
xv-desktop = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
|
||||
|
||||
./hosts/desktop
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs nix-colors; };
|
||||
home-manager.users.xeovalyte.imports = [ ./hosts/desktop/home.nix ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
42
hosts/desktop/default.nix
Normal file
42
hosts/desktop/default.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
#../../modules/system/desktop/hyprland.nix
|
||||
../../modules/system/desktop/plasma.nix
|
||||
../../modules/system/desktop/nvidia.nix
|
||||
../../modules/system/programs/sunshine.nix
|
||||
#../../modules/system/programs/syncthing.nix
|
||||
../../modules/system/programs/thunar.nix
|
||||
../../modules/system/utils/common.nix
|
||||
../../modules/system/utils/firewall.nix
|
||||
../../modules/system/utils/fprint.nix
|
||||
../../modules/system/utils/garbage-collection.nix
|
||||
../../modules/system/utils/locale.nix
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
};
|
||||
|
||||
networking.hostName = "xv-desktop"; # Define your hostname.
|
||||
networking.interfaces.enp7s0.wakeOnLan.enable = true;
|
||||
|
||||
users.users.xeovalyte = {
|
||||
isNormalUser = true;
|
||||
description = "Timo Boomers";
|
||||
extraGroups = [ "networkmanager" "wheel" "dialout" ];
|
||||
};
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
||||
}
|
39
hosts/desktop/hardware-configuration.nix
Normal file
39
hosts/desktop/hardware-configuration.nix
Normal file
@ -0,0 +1,39 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/66480545-d8cb-4853-be36-bb52526a2293";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/1F0A-7888";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/e67f24cf-f7a6-4a92-87cc-0ae047dbb4df"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp7s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
30
hosts/desktop/home.nix
Normal file
30
hosts/desktop/home.nix
Normal file
@ -0,0 +1,30 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
#../../modules/home/desktop/hyprland
|
||||
../../modules/home/programs/common.nix
|
||||
../../modules/home/programs/firefox.nix
|
||||
../../modules/home/programs/kitty.nix
|
||||
../../modules/home/programs/neovim
|
||||
../../modules/home/programs/git.nix
|
||||
../../modules/home/programs/ssh.nix
|
||||
../../modules/home/theme
|
||||
../../modules/home/theme/blueish.nix
|
||||
../../modules/home/utils/fonts.nix
|
||||
];
|
||||
|
||||
home = {
|
||||
username = "xeovalyte";
|
||||
homeDirectory = "/home/xeovalyte";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# Desktop Applications
|
||||
kdenlive
|
||||
gthumb
|
||||
unstable.arduino-ide
|
||||
];
|
||||
|
||||
home.stateVersion = "23.11";
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../modules/home/desktop/hyprland
|
||||
#../../modules/home/desktop/hyprland
|
||||
../../modules/home/programs/common.nix
|
||||
../../modules/home/programs/firefox.nix
|
||||
../../modules/home/programs/kitty.nix
|
||||
|
38
modules/system/desktop/nvidia.nix
Normal file
38
modules/system/desktop/nvidia.nix
Normal file
@ -0,0 +1,38 @@
|
||||
{ config, lib, pkgs, nixpkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
];
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
|
||||
|
||||
hardware.nvidia = {
|
||||
|
||||
modesetting.enable = true;
|
||||
|
||||
powerManagement.enable = false;
|
||||
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
}
|
19
modules/system/desktop/plasma.nix
Normal file
19
modules/system/desktop/plasma.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
}
|
25
modules/system/programs/sunshine.nix
Normal file
25
modules/system/programs/sunshine.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
unstable.sunshine
|
||||
];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
|
||||
'';
|
||||
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 48010 ];
|
||||
allowedTCPPortRanges = [
|
||||
{ from = 47984; to = 47990; }
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{ from = 47998; to = 48000; }
|
||||
];
|
||||
};
|
||||
}
|
7
modules/system/utils/firewall.nix
Normal file
7
modules/system/utils/firewall.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user