all repos — dotfiles @ 14174aaef3c10c6d9dd14cfc877e8fd0707c43dc

my *nix dotfiles

nix/denna: add host
Anirudh Oppiliappan x@icyphox.sh
Sat, 06 Jul 2024 23:04:48 +0300
commit

14174aaef3c10c6d9dd14cfc877e8fd0707c43dc

parent

3962a87fb513e27841b9e995feaeee4fd2e7609a

2 files changed, 137 insertions(+), 0 deletions(-)

jump to
A hosts/denna/configuration.nix

@@ -0,0 +1,93 @@

+{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "denna"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Helsinki"; + + 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"; + }; + + sound.enable = true; + hardware.pulseaudio.enable = true; + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + intel-compute-runtime + ]; + }; + + security = { + doas.enable = true; + sudo.enable = true; + doas.extraConfig = '' + permit nopass :wheel + ''; + doas.extraRules = [{ + users = [ "icy" ]; + }]; + }; + + users.users.icy = { + isNormalUser = true; + description = "icy"; + extraGroups = [ "networkmanager" "wheel" "docker" ]; + packages = with pkgs; [ ]; + }; + + users.users.git = { + isNormalUser = true; + description = "git"; + extraGroups = [ "networkmanager" "wheel" ]; + homeMode = "755"; + packages = with pkgs; [ ]; + }; + + + nixpkgs.config.allowUnfree = true; + environment.systemPackages = with pkgs; [ + vim + wget + git + ]; + + services = { + openssh.enable = true; + tailscale.enable = true; + # nix-snapshotter.enable = true; + }; + + # services.k3s = { + # enable = true; + # role = "agent"; + # extraFlags = "--disable=traefik --disable=servicelb --disable=metrics-server --bind-address=100.85.88.64 --node-ip=100.85.88.64 --node-external-ip=100.85.88.64"; + # }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + system.stateVersion = "24.05"; +} +
A hosts/denna/hardware-configuration.nix

@@ -0,0 +1,44 @@

+# 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" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/92a27eb2-9814-48fd-8f76-cc152d5a8700"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/219A-16D2"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + 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.enp0s20f0u3u1u2.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} +