From aa6f4fa0d87677c6b62b52595e7e3f29b2e06380 Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Mon, 27 Nov 2023 08:59:40 +0100 Subject: Create underworld host --- hosts/underworld/default.nix | 95 +++++++++++++++++++++++++++++++++++++++++++ hosts/underworld/disko.nix | 45 ++++++++++++++++++++ hosts/underworld/hardware.nix | 26 ++++++++++++ hosts/underworld/home.nix | 23 +++++++++++ 4 files changed, 189 insertions(+) create mode 100644 hosts/underworld/default.nix create mode 100644 hosts/underworld/disko.nix create mode 100644 hosts/underworld/hardware.nix create mode 100644 hosts/underworld/home.nix (limited to 'hosts') diff --git a/hosts/underworld/default.nix b/hosts/underworld/default.nix new file mode 100644 index 0000000..d900560 --- /dev/null +++ b/hosts/underworld/default.nix @@ -0,0 +1,95 @@ +{ config, pkgs, flakeRoot, inputs, ... }: { + imports = [ + # Include the results of the hardware scan. + ./hardware.nix + ./disko.nix + + ./home.nix + (flakeRoot + /share/system/steam.nix) + (flakeRoot + /share/system/hyprland.nix) + #(flakeRoot + /share/system/spotifyd.nix) + { _module.args = { inherit inputs; }; } + ]; + + nixpkgs.config.allowUnfree = true; + nix.gc = { + dates = "weekly"; + automatic = true; + persistent = true; + randomizedDelaySec = "15min"; + }; + + # Using grub because the disko docs tell me to use it + boot = { + supportedFilesystems = [ "bacachefs" ]; + loader.grub = { + enable = true; + efiSupport = true; + efiInstallAsRemovable = true; + }; + }; + + networking = { + hostName = "underworld"; + useNetworkd = true; + + firewall = { + enable = true; + allowedTCPPorts = [ 80 443 34197 ]; + }; + }; + + time.timeZone = "Europe/Zagreb"; + i18n.defaultLocale = "en_US.UTF-8"; + + # Enable sound. + sound.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + virtualisation.podman = { + enable = true; + dockerCompat = true; + autoPrune.enable = true; + }; + + users.users = { + osiris = { + isNormalUser = true; + extraGroups = [ "wheel" "video" "network" "podman" ]; + }; + guest = { + isNormalUser = true; + extraGroups = [ "video" "network" ]; + }; + }; + + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + + fonts.packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + proggyfonts + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + overpass + inter + ]; + + # 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.11"; # Did you read the comment? +} diff --git a/hosts/underworld/disko.nix b/hosts/underworld/disko.nix new file mode 100644 index 0000000..e713323 --- /dev/null +++ b/hosts/underworld/disko.nix @@ -0,0 +1,45 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-id/ata-WDC_WDS240G2G0B-00EPW0_194176803299"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + name = "root"; + end = "-20G"; + content = { + type = "filesystem"; + format = "bcachefs"; + mountpoint = "/"; + }; + }; + encryptedSwap = { + size = "100%"; + content = { + type = "swap"; + randomEncryption = true; + resumeDevice = true; # resume from hibernation from this device + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/underworld/hardware.nix b/hosts/underworld/hardware.nix new file mode 100644 index 0000000..305d6ce --- /dev/null +++ b/hosts/underworld/hardware.nix @@ -0,0 +1,26 @@ +# 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, modulesPath, ... }: + +{ + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + # 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.enp9s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/underworld/home.nix b/hosts/underworld/home.nix new file mode 100644 index 0000000..42061ef --- /dev/null +++ b/hosts/underworld/home.nix @@ -0,0 +1,23 @@ +{ flakeRoot +, inputs +, ... +}: { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = [{ imports = [ (flakeRoot + /share/home/hyprdesktop.nix) ]; }]; + extraSpecialArgs = { inherit inputs; }; + }; + + home-manager.users.osiris = { + imports = [ + (flakeRoot + /share/home/gallery-dl.nix) + ]; + + home.stateVersion = "23.11"; + }; + + home-manager.users.root = { + home.stateVersion = "23.11"; + }; +} -- cgit v1.3.1