hosts.garp: init

This commit is contained in:
Peder Bergebakken Sundt 2023-09-29 15:59:42 +02:00
parent 5be8f1f32e
commit 1b659e1fbe
3 changed files with 155 additions and 1 deletions

View File

@ -139,7 +139,8 @@
bolle = mkConfig "bolle" "pbsds.net" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel ]);
nord = mkConfig "nord" "pbsds.net" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-cpu-intel-sandy-bridge common-gpu-amd common-hidpi ]);
sopp = mkConfig "sopp" "pbsds.net" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]);
garp = mkConfig "garp" "pbsds.net" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia ]);
#garp = mkConfig "garp" "pbsds.net" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]);
garp = mkConfig "garp" "pbsds.net" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel ]);
#gomperud smattkuken skrytebiffen skalkesnerken
};

115
hosts/garp/default.nix Normal file
View File

@ -0,0 +1,115 @@
{ config, pkgs, lib, ... }:
{
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "pbsds";
# tmp: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
#boot.kernelPackages = pkgs.linuxPackages_latest;
#hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
#hardware.nvidia.modesetting.enable = false; # makes atom behave, but mpv refuses to start
# PRIME: (lspci)
#hardware.nvidia.prime.intelBusId = "PCI:0:02:0";
#hardware.nvidia.prime.nvidiaBusId = "PCI:1:00:0";
imports = [
./hardware-configuration.nix
#../../hardware/gpu/cuda.nix
../../hardware/gpu/intel.nix
../../profiles/auto-upgrade.nix
../../profiles/upgrade-diff.nix
../../profiles/sshd.nix
../../profiles/no-suspend.nix
../../profiles/podman.nix
../../profiles/docker.nix
../../users # home-manager
../../users/pbsds
../../profiles/shell/base.nix
../../profiles/shell/archives.nix
../../profiles/shell/nix-utils.nix
#../../profiles/shell/binfmt-emu.nix # qemu won't compile...
../../profiles/desktop/base.nix
../../profiles/desktop/gnome # configures gdm
#../../profiles/desktop/sound/alsa.nix
#../../profiles/desktop/sound/pulseaudio.nix
../../profiles/desktop/sound/pipewire.nix
];
networking.firewall.allowedTCPPorts = [ 57621 ]; # spotify local discovery
# Networking
networking.networkmanager.enable = true;
# Installed system packages
environment.systemPackages = with pkgs; [
cage
weston
];
# TODO: remove? Move?
programs.dconf.enable = true;
# System fonts
fonts.fontDir.enable = true; # creates /run/current-system/sw/share/X11/fonts
fonts.enableDefaultFonts = true; # dejavu, freefont, gyre, liberation, unifont, noto-fonts-emoji
fonts.fonts = with pkgs; [
noto-fonts # includes Cousine
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
];
# nvidia bad
#nixpkgs.config.packageOverrides = lib.mkIf (!config.hardware.nvidia.prime.offload.enable) (pkgs: {
nixpkgs.config.packageOverrides = (pkgs: {
teams = pkgs.teams.overrideAttrs (old: rec {
postInstall = (old.postInstall or "") + ''
substituteInPlace $out/share/applications/teams.desktop \
--replace 'Exec=teams' 'Exec=teams --disable-gpu'
'';
});
discord = pkgs.discord.overrideAttrs (old: rec {
desktopItem = old.desktopItem.override (old: {
#exec = "${pkgs.coreutils}/bin/env NIXOS_OZONE_WL=1 ${old.exec}";
exec = "${pkgs.coreutils-full}/bin/env NIXOS_OZONE_WL=1 Discord";
});
postInstall = ''
ln -sf "${desktopItem}/share/applications" $out/share/
'' + old.postInstall;
});
slack = pkgs.slack.overrideAttrs (old: {
postInstall = old.postInstall or "" + ''
substituteInPlace $out/share/applications/slack.desktop \
--replace "$out/bin/slack " "$out/bin/slack --disable-gpu --in-process-gpu "
'';
});
element-desktop = pkgs.element-desktop.overrideAttrs (old: {
desktopItem = old.desktopItem.override (old: {
exec = "element-desktop --disable-gpu --in-process-gpu %u";
});
});
});
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's 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.05"; # Did you read the comment?
}

View File

@ -0,0 +1,38 @@
# 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 = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a489fe59-1f67-46a0-8c7a-91adbac021e0";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2663-B2BA";
fsType = "vfat";
};
swapDevices = [ ];
# 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.enp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}