From b880388efb33a0cd83172739e9c901fcbf0685c3 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 25 Oct 2023 19:57:12 +0200 Subject: [PATCH] hosts: add eple --- flake.nix | 1 + hosts/eple/default.nix | 66 +++++++++++++++++++++++++++ hosts/eple/hardware-configuration.nix | 41 +++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 hosts/eple/default.nix create mode 100644 hosts/eple/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 39996b5..913a7f8 100644 --- a/flake.nix +++ b/flake.nix @@ -161,6 +161,7 @@ nord = mk "nord" "pbsds.net" "x86_64-linux" [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-cpu-intel-sandy-bridge common-gpu-amd common-hidpi ]; sopp = mk "sopp" "pbsds.net" "x86_64-linux" [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]; bolle = mk "bolle" "pbsds.net" "x86_64-linux" [ common-pc common-pc-ssd common-cpu-intel ]; + eple = mk "eple" "pbsds.net" "x86_64-linux" [ common-pc common-pc-ssd common-cpu-intel ]; garp = mk "garp" "pbsds.net" "x86_64-linux" [ common-pc common-pc-ssd common-cpu-intel ]; # TODO: common-gpu-nvidia-nonprime ]; #gomperud smattkuken skrytebiffen skalkesnerken balleby brumlebasse bingus skjrlaltatjlstad #bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke eple hasselknippe pytte uddu imdorf rosenqvist diff --git a/hosts/eple/default.nix b/hosts/eple/default.nix new file mode 100644 index 0000000..09dab63 --- /dev/null +++ b/hosts/eple/default.nix @@ -0,0 +1,66 @@ +{ config, pkgs, lib, ... }: +{ + # Bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + imports = [ + ./hardware-configuration.nix + ../../profiles/auto-upgrade.nix + ../../profiles/upgrade-diff.nix + ../../profiles/sshd.nix + + ../../users/pbsds + ../../users/daniel + + ../../profiles/shell/base.nix + ../../profiles/shell/archives.nix + ../../profiles/shell/nix-utils.nix + #../../profiles/shell/binfmt-emu.nix # qemu won't compile... + + ../../profiles/domeneshop-dyndns # TODO: secrets + #../../profiles/code-remote + #../../profiles/remote-builders + #../../profiles/autossh-reverse-tunnels + ]; + services.domeneshop-updater.targets = [ config.networking.fqdn ]; + + # Networking + networking.networkmanager.enable = true; + + /** / + #networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + #networking.iwd.enable = true + networking.interfaces.eno1.ipv4.addresses = [ + { address = "129.241.105.252"; prefixLength = 23; } + ]; + networking.defaultGateway.address = "192.241.104.1"; + networking.defaultGateway.interface = "eno1"; + networking.nameservers = [ + "129.241.0.200" + "129.241.0.201" + #"2001:700:300::200" + #"2001:700:300::201" + "8.8.8.8" + "1.1.1.1" + ]; + /**/ + + # Installed system packages + environment.systemPackages = with pkgs; [ + cage + weston + ]; + + # TODO: remove? Move? + programs.dconf.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? +} diff --git a/hosts/eple/hardware-configuration.nix b/hosts/eple/hardware-configuration.nix new file mode 100644 index 0000000..e54d4a4 --- /dev/null +++ b/hosts/eple/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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-path/pci-0000:01:00.0-nvme-2"; + # device = "/dev/disk/by-uuid/a0d75d1f-82be-4ae5-aaed-26cd25a30dd1"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-path/pci-0000:01:00.0-nvme-1"; + # device = "/dev/disk/by-uuid/C52A-54B5"; + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.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; +}