From 897302b568ce5acd7526fee5c34cff3a0eb80f1b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 22 Jun 2023 14:31:35 +0100 Subject: [PATCH] Add Vanguard config to flake --- flake.nix | 12 +++ hosts/N0245/configuration.nix | 56 +++++++++++++- hosts/N0245/home.nix | 55 +------------ hosts/Vanguard/configuration.nix | 94 +++++++++++++++++++++++ hosts/Vanguard/hardware-configuration.nix | 50 ++++++++++++ machines/Vanguard/default.nix | 44 ----------- machines/Vanguard/xenia.nix | 15 ---- 7 files changed, 212 insertions(+), 114 deletions(-) create mode 100644 hosts/Vanguard/configuration.nix create mode 100644 hosts/Vanguard/hardware-configuration.nix delete mode 100644 machines/Vanguard/default.nix delete mode 100644 machines/Vanguard/xenia.nix diff --git a/flake.nix b/flake.nix index 99cc03f0..271d41e7 100644 --- a/flake.nix +++ b/flake.nix @@ -75,6 +75,18 @@ ./services/Legion.nix ]; }; + Vanguard = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + home-manager.nixosModules.home-manager + common + hardware-audio + hardware-bluetooth + ./hosts/Vanguard/configuration.nix + ./wm/sway.nix + ./services/sshd + ]; + }; N0245 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ diff --git a/hosts/N0245/configuration.nix b/hosts/N0245/configuration.nix index 91658a5d..7c252129 100644 --- a/hosts/N0245/configuration.nix +++ b/hosts/N0245/configuration.nix @@ -63,7 +63,6 @@ extraGroups = ["networkmanager" "wheel"]; shell = pkgs.fish; }; - home-manager.users.elitherl = import ./home.nix; services.greetd = { enable = true; @@ -76,6 +75,61 @@ }; }; + home-manager.users.elitherl = { + imports = [ + ../../home/work.nix + ../../home/gui + ../../home/desktop/swayfx.nix + ]; + home.username = "elitherl"; + home.homeDirectory = "/home/elitherl"; + home.stateVersion = "22.11"; + home.packages = with pkgs; [ + zotero + openfortivpn + nomachine-client + teams-for-linux + zoom-us + ]; + programs.firefox.package = pkgs.firefox-wayland; + + wayland.windowManager.sway.config = { + output = {"Dell Inc. DELL U2417H 5K9YD872FY1L".transform = "270";}; + startup = [{command = "firefox";}]; + workspaceOutputAssign = [ + { + output = "Iiyama North America PLB2403WS 0574281251316"; + workspace = "1"; + } + { + output = "Iiyama North America PLB2403WS 0574281251316"; + workspace = "2"; + } + { + output = "Iiyama North America PLB2403WS 0574281251316"; + workspace = "3"; + } + { + output = "Iiyama North America PLB2403WS 0574281251316"; + workspace = "4"; + } + ]; + }; + programs.waybar.settings = { + main."output" = "!DP-4"; + alt = { + "include" = [ + "~/.config/waybar/modules.json" + "~/.config/waybar/layout.json" + ]; + "output" = "DP-4"; + "modules-left" = ["sway/workspaces"]; + "modules-center" = ["clock#compact"]; + "modules-right" = ["tray"]; + }; + }; + }; + # 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 diff --git a/hosts/N0245/home.nix b/hosts/N0245/home.nix index 8c106948..668312c0 100644 --- a/hosts/N0245/home.nix +++ b/hosts/N0245/home.nix @@ -1,54 +1 @@ -{pkgs, ...}: { - imports = [ - ../../home/work.nix - ../../home/gui - ../../home/desktop/swayfx.nix - ]; - home.username = "elitherl"; - home.homeDirectory = "/home/elitherl"; - home.stateVersion = "22.11"; - home.packages = with pkgs; [ - zotero - openfortivpn - nomachine-client - teams-for-linux - zoom-us - ]; - programs.firefox.package = pkgs.firefox-wayland; - - wayland.windowManager.sway.config = { - output = {"Dell Inc. DELL U2417H 5K9YD872FY1L".transform = "270";}; - startup = [{command = "firefox";}]; - workspaceOutputAssign = [ - { - output = "Iiyama North America PLB2403WS 0574281251316"; - workspace = "1"; - } - { - output = "Iiyama North America PLB2403WS 0574281251316"; - workspace = "2"; - } - { - output = "Iiyama North America PLB2403WS 0574281251316"; - workspace = "3"; - } - { - output = "Iiyama North America PLB2403WS 0574281251316"; - workspace = "4"; - } - ]; - }; - programs.waybar.settings = { - main."output" = "!DP-4"; - alt = { - "include" = [ - "~/.config/waybar/modules.json" - "~/.config/waybar/layout.json" - ]; - "output" = "DP-4"; - "modules-left" = ["sway/workspaces"]; - "modules-center" = ["clock#compact"]; - "modules-right" = ["tray"]; - }; - }; -} +{pkgs, ...}: diff --git a/hosts/Vanguard/configuration.nix b/hosts/Vanguard/configuration.nix new file mode 100644 index 00000000..1998c81b --- /dev/null +++ b/hosts/Vanguard/configuration.nix @@ -0,0 +1,94 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{pkgs, ...}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + services.xserver = { + layout = "gb"; + xkbVariant = ""; + }; + console.keyMap = "uk"; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + networking = { + hostName = "Vanguard"; # Define your hostname. + nameservers = ["192.168.1.230" "9.9.9.9"]; + firewall = {enable = true;}; + }; + environment.systemPackages = with pkgs; [mesa]; + + # Steam + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + }; + hardware.steam-hardware.enable = true; + hardware.opengl.driSupport32Bit = true; + + users.users.xenia = { + isNormalUser = true; + description = "Evie Litherland-Smith"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix; + }; + home-manager.users.xenia = { + imports = [ + ../../home/personal.nix + ../../home/gui + ../../home/desktop/swayfx.nix + ]; + home.username = "xenia"; + home.homeDirectory = "/home/xenia"; + home.stateVersion = "22.11"; + + wayland.windowManager.sway.config = { + output.HDMI-A-2.scale = "2.0"; + startup = [{command = "steam";}]; + }; + }; + + services.greetd = { + enable = true; + settings = rec { + initial_session = { + command = "sway"; + user = "xenia"; + }; + default_session = initial_session; + }; + }; + + # 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/Vanguard/hardware-configuration.nix b/hosts/Vanguard/hardware-configuration.nix new file mode 100644 index 00000000..5ab58140 --- /dev/null +++ b/hosts/Vanguard/hardware-configuration.nix @@ -0,0 +1,50 @@ +# 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" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/5b198ee6-6361-4158-a582-7935da965473"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/4A44-73B5"; + fsType = "vfat"; + }; + + fileSystems."/mnt/primary" = + { device = "/dev/disk/by-uuid/d952e779-0219-405f-b136-bd2c39f7965c"; + fsType = "ext4"; + }; + + fileSystems."/mnt/secondary" = + { device = "/dev/disk/by-uuid/036f1fcb-0674-4ae5-a2fe-cb4f7ada001d"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/1f77203e-a031-4c4a-857e-c2b237ba59ce"; } + ]; + + # 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.enp42s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/machines/Vanguard/default.nix b/machines/Vanguard/default.nix deleted file mode 100644 index 4c95c212..00000000 --- a/machines/Vanguard/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{pkgs, ...}: { - imports = [ - ../../common.nix - ../../hardware/audio.nix - ../../hardware/bluetooth.nix - ../../locales/en_GB.nix - ../../wm/sway.nix - ../../services/sshd - ]; - networking = { - hostName = "Vanguard"; # Define your hostname. - nameservers = ["192.168.1.230" "9.9.9.9"]; - firewall = {enable = true;}; - }; - environment.systemPackages = with pkgs; [mesa]; - - # Steam - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - }; - hardware.steam-hardware.enable = true; - hardware.opengl.driSupport32Bit = true; - - users.users.xenia = { - isNormalUser = true; - description = "Evie Litherland-Smith"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.fish; - openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix; - }; - home-manager.users.xenia = import ./xenia.nix; - - services.greetd = { - enable = true; - settings = rec { - initial_session = { - command = "sway"; - user = "xenia"; - }; - default_session = initial_session; - }; - }; -} diff --git a/machines/Vanguard/xenia.nix b/machines/Vanguard/xenia.nix deleted file mode 100644 index ab37b35c..00000000 --- a/machines/Vanguard/xenia.nix +++ /dev/null @@ -1,15 +0,0 @@ -{...}: { - imports = [ - ../../home/personal.nix - ../../home/gui - ../../home/desktop/swayfx.nix - ]; - home.username = "xenia"; - home.homeDirectory = "/home/xenia"; - home.stateVersion = "22.11"; - - wayland.windowManager.sway.config = { - output.HDMI-A-2.scale = "2.0"; - startup = [{command = "steam";}]; - }; -}