From a531a27be521a635d349118b247e2535a471f109 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Wed, 4 Aug 2021 19:17:15 +0200 Subject: [PATCH] hosts: Move host configuration into its own directory --- ayame.nix => hosts/ayame.nix | 20 ++++---- generic.nix => hosts/generic.nix | 2 +- hosts/isla.nix | 78 ++++++++++++++++++++++++++++++++ miku.nix => hosts/miku.nix | 22 ++++----- modules/users/alexander.nix | 2 +- 5 files changed, 101 insertions(+), 23 deletions(-) rename ayame.nix => hosts/ayame.nix (74%) rename generic.nix => hosts/generic.nix (97%) create mode 100644 hosts/isla.nix rename miku.nix => hosts/miku.nix (85%) diff --git a/ayame.nix b/hosts/ayame.nix similarity index 74% rename from ayame.nix rename to hosts/ayame.nix index c5f81e1..11aa660 100644 --- a/ayame.nix +++ b/hosts/ayame.nix @@ -1,17 +1,17 @@ { config, pkgs, modulesPath, lib, ... }: let - customPkgs = import ./packages/overlay.nix; - unstable = (import ./modules/unstable.nix config); + customPkgs = import ../packages/overlay.nix; + unstable = (import ../modules/unstable.nix config); in { imports = [ - ./generic.nix - ./modules/hardware/generic.nix ./modules/hardware/bluetooth.nix ./modules/hardware/wifi.nix ./modules/hardware/video.nix ./modules/hardware/mobile.nix - ./modules/fonts.nix - ./modules/users - ./modules/users/alexander.nix - ./modules/programs/zsh ./modules/programs/mpv ./modules/programs/git ./modules/programs/tmux ./modules/programs/firefox ./modules/programs/gnome-terminal ./modules/programs/gnome ./modules/programs/nonvm - ./modules/programs/distributed-build/offload.nix + ../generic.nix + ../modules/hardware/generic.nix ../modules/hardware/bluetooth.nix ../modules/hardware/wifi.nix ../modules/hardware/video.nix ../modules/hardware/mobile.nix + ../modules/fonts.nix + ../modules/users + ../modules/users/alexander.nix + ../modules/programs/zsh ../modules/programs/mpv ../modules/programs/git ../modules/programs/tmux ../modules/programs/firefox ../modules/programs/gnome-terminal ../modules/programs/gnome ../modules/programs/nonvm + ../modules/programs/distributed-build/offload.nix ]; nixpkgs.overlays = [ @@ -19,7 +19,7 @@ in { ]; nixpkgs.config.packageOverrides = pkgs: { - nur = (import ./modules/nur.nix pkgs); + nur = (import ../modules/nur.nix pkgs); unstable = unstable; }; diff --git a/generic.nix b/hosts/generic.nix similarity index 97% rename from generic.nix rename to hosts/generic.nix index 8142bf7..1779a2c 100644 --- a/generic.nix +++ b/hosts/generic.nix @@ -11,7 +11,7 @@ in # Install home-manager imports = [ "${home-manager}/nixos" - ./modules/users # For system.singleUser + ../modules/users # For system.singleUser ]; home-manager.useGlobalPkgs = true; diff --git a/hosts/isla.nix b/hosts/isla.nix new file mode 100644 index 0000000..87c0ad5 --- /dev/null +++ b/hosts/isla.nix @@ -0,0 +1,78 @@ +{ config, pkgs, modulesPath, lib, ... }: + +let + unstable = (import ../modules/unstable.nix config); + customPkgs = import ../packages/overlay.nix; +in { + imports = [ + ../generic.nix + ../modules/hardware/generic.nix ../modules/hardware/video.nix + ../modules/users/fuck-xi.nix + ../modules/programs/zsh ../modules/programs/tmux ../modules/programs/emacs ../modules/programs/firefox ../modules/programs/gnome-terminal ../modules/programs/gnome + ]; + + nixpkgs.overlays = [ + (import (builtins.fetchGit { + url = "https://github.com/nix-community/emacs-overlay.git"; + ref = "master"; + rev = "ce0e9482d53d69bedc8416d8a984d00e17607826"; + })) + customPkgs + ]; + + nixpkgs.config.packageOverrides = pkgs: { + nur = (import ../modules/nur.nix pkgs); + unstable = unstable; + }; + + environment = { + systemPackages = with pkgs; [ + emacsPgtkGcc + ]; + + sessionVariables = { + # Prevent us from having to always type it out + #NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/hosts/isla.nix"; + }; + }; + + networking = { + interfaces.enp6s0.useDHCP = false; + hostName = "isla"; + # Nix otherwise has a conflict with this option + wireless.enable = lib.mkForce false; + + # Allow scream to connect to this host + firewall.allowedUDPPorts = [ 4010 ]; + }; + + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + extraModprobeConfig = ""; + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "amdgpu" "vendor-reset" ]; + kernelModules = []; + }; + kernelParams = []; + kernelModules = []; + extraModulePackages = []; + kernelPackages = pkgs.linuxPackages_zen; + }; + + services = { + emacs.package = pkgs.emacsPgtkGcc; + }; + + systemd.services.NetworkManager-wait-online.enable = false; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/root"; + fsType = "btrfs"; + }; + }; + swapDevices = [ ]; +} diff --git a/miku.nix b/hosts/miku.nix similarity index 85% rename from miku.nix rename to hosts/miku.nix index bb7e02d..2779e64 100644 --- a/miku.nix +++ b/hosts/miku.nix @@ -1,17 +1,17 @@ { config, pkgs, modulesPath, lib, ... }: let - unstable = (import ./modules/unstable.nix config); - customPkgs = import ./packages/overlay.nix; - gamemode = pkgs.callPackage ./packages/gamemode {}; + unstable = (import ../modules/unstable.nix config); + customPkgs = import ../packages/overlay.nix; + gamemode = pkgs.callPackage ../packages/gamemode {}; in { imports = [ - ./generic.nix - ./modules/hardware/generic.nix ./modules/hardware/video.nix - ./modules/fonts.nix - ./modules/users/alexander.nix - ./modules/programs/zsh ./modules/programs/git ./modules/programs/mpv ./modules/programs/tmux ./modules/programs/emacs ./modules/programs/firefox ./modules/programs/gnome-terminal ./modules/programs/gnome ./modules/programs/i18n.nix ./modules/programs/gamemode ./modules/programs/nonvm - ./modules/programs/distributed-build/builder.nix + ../generic.nix + ../modules/hardware/generic.nix ../modules/hardware/video.nix + ../modules/fonts.nix + ../modules/users/alexander.nix + ../modules/programs/zsh ../modules/programs/git ../modules/programs/mpv ../modules/programs/tmux ../modules/programs/emacs ../modules/programs/firefox ../modules/programs/gnome-terminal ../modules/programs/gnome ../modules/programs/i18n.nix ../modules/programs/gamemode ../modules/programs/nonvm + ../modules/programs/distributed-build/builder.nix #./modules/programs/music ]; @@ -25,7 +25,7 @@ in { ]; nixpkgs.config.packageOverrides = pkgs: { - nur = (import ./modules/nur.nix pkgs); + nur = (import ../modules/nur.nix pkgs); unstable = unstable; }; @@ -43,7 +43,7 @@ in { sessionVariables = { # Prevent us from having to always type it out - #NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/miku.nix"; + #NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/hosts/miku.nix"; }; }; diff --git a/modules/users/alexander.nix b/modules/users/alexander.nix index a74345c..771a286 100644 --- a/modules/users/alexander.nix +++ b/modules/users/alexander.nix @@ -21,7 +21,7 @@ home-manager.users.alexander = { # TODO: Move into a generic pam.sessionVariables = { - NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/${config.networking.hostName}.nix"; + NIXOS_CONFIG = "\${HOME}/Development/Personal/nixos-config/hosts/${config.networking.hostName}.nix"; }; programs.home-manager.enable = true;