From 7ff389b92cfb40b170ea440b05962502ea181a00 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Mon, 3 May 2021 14:10:55 +0200 Subject: [PATCH] Add speer --- defaults/user-configuration/fhauser/sway.nix | 9 +++++ hardware/amd-board.nix | 20 ++++++++++ host/lindberg/filesystems.nix | 1 + host/speer/default.nix | 42 ++++++++++++++++++++ host/speer/filesystems.nix | 28 +++++++++++++ host/speer/networking.nix | 26 ++++++++++++ host/speer/printing.nix | 16 ++++++++ 7 files changed, 142 insertions(+) create mode 100644 hardware/amd-board.nix create mode 100644 host/speer/default.nix create mode 100644 host/speer/filesystems.nix create mode 100644 host/speer/networking.nix create mode 100644 host/speer/printing.nix diff --git a/defaults/user-configuration/fhauser/sway.nix b/defaults/user-configuration/fhauser/sway.nix index 2c05936..23b0315 100644 --- a/defaults/user-configuration/fhauser/sway.nix +++ b/defaults/user-configuration/fhauser/sway.nix @@ -181,6 +181,15 @@ position = "4480,0"; }) ]; + home-pc.outputs = [ + (mkScreen "Dell Inc. DELL P2720DC 22JPK53" // { + position = "0,0"; + }) + (mkScreen "Unknown HP Z27 CN482201RP" // { + position = "2560,0"; + scale = 1.5; + }) + ]; }; }; # TODO: Move these services elsewhere diff --git a/hardware/amd-board.nix b/hardware/amd-board.nix new file mode 100644 index 0000000..29d3cf1 --- /dev/null +++ b/hardware/amd-board.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, modulesPath, ... }: { + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + "xhci_pci" + "ahci" + "virtio-pci" + "igb" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + hardware.cpu.amd.updateMicrocode = true; + nix.maxJobs = lib.mkDefault 24; +} diff --git a/host/lindberg/filesystems.nix b/host/lindberg/filesystems.nix index cfa0323..99aa799 100644 --- a/host/lindberg/filesystems.nix +++ b/host/lindberg/filesystems.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: { + boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.initrd.luks.devices = { "system".device = "/dev/disk/by-uuid/ba646016-2618-4d9b-acf2-41986ab76f7e"; "data".device = "/dev/disk/by-uuid/6cfe504d-992f-4b11-be3e-31d00c3e108d"; diff --git a/host/speer/default.nix b/host/speer/default.nix new file mode 100644 index 0000000..03fb0c2 --- /dev/null +++ b/host/speer/default.nix @@ -0,0 +1,42 @@ +{ config, pkgs, ... }: { + + imports = [ + ./filesystems.nix + ./networking.nix + #./printing.nix + #./backup.nix #TODO: Extract applications from desktop role + + ../../hardware/amd-board.nix + + ../../defaults/base + ../../defaults/cifs-auth-fix + ../../defaults/desktop + ../../defaults/games + ../../defaults/user-configuration + ../../defaults/user-configuration/fhauser + #../../defaults/printing + ]; + + #TODO: Clean up next section + #services.xserver.dpi = 180; + + virtualisation = { # TODO: This should probably be somewhere else. + docker = { + enable = true; + enableOnBoot = false; + }; + libvirtd.enable = true; + }; + + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; + + # This value determines the NixOS release from which the default + # settings for stateful data, like fi:le 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 = "20.09"; # Did you read the comment? + +} diff --git a/host/speer/filesystems.nix b/host/speer/filesystems.nix new file mode 100644 index 0000000..1e207a1 --- /dev/null +++ b/host/speer/filesystems.nix @@ -0,0 +1,28 @@ +{ config, pkgs, lib, ... }: { + boot.initrd.luks.devices.system.device = "/dev/disk/by-uuid/bf353bb1-43bf-453f-ae7e-0fa9b4d8778c"; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/661ad230-72da-4326-bb3a-4965006475f8"; + fsType = "btrfs"; + options = [ "subvol=nixos" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/661ad230-72da-4326-bb3a-4965006475f8"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/A5C5-1372"; + fsType = "vfat"; + }; + + swapDevices = []; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + +} diff --git a/host/speer/networking.nix b/host/speer/networking.nix new file mode 100644 index 0000000..6e1de0d --- /dev/null +++ b/host/speer/networking.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: + +{ + + networking = { + networkmanager.enable = true; + useDHCP = false; + #wireless.enable = true; # Enables wireless support via wpa_supplicant. + hostName = "speer"; + }; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + #networking.wireguard.enable = true; + #networking.wireguard.interfaces = let + # meta = import ../../meta; + # vnetworks = meta.network.virtual; + # vnetworkName = "mgmt"; + #in { + # "wg-${vnetworkName}" = + # pkgs.lib.qois.wireguard.makeInterface config.networking.hostName + # vnetworkName vnetworks.${vnetworkName}; + #}; +} diff --git a/host/speer/printing.nix b/host/speer/printing.nix new file mode 100644 index 0000000..bb07603 --- /dev/null +++ b/host/speer/printing.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ + hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261"; + hardware.printers.ensurePrinters = [{ + name = "hsr-mfp-8261"; + deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp"; + location = "HSR 8.261"; + model = "HP/hp-color_laserjet_mfp_m577-ps.ppd.gz"; + ppdOptions = { + Duplex = "DuplexNoTumble"; + PageSize = "A4"; + auth-info-required = "username,password"; + }; + }]; +}