From 5c4b11bd923200b3420191394d302777e34d25ca Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Mon, 25 Apr 2022 23:27:33 +0200 Subject: [PATCH] Add harrison --- flake.nix | 1 + hosts/harrison/configuration.nix | 45 +++++++++++++++++++ hosts/harrison/default.nix | 6 +++ hosts/harrison/hardware-configuration.nix | 54 +++++++++++++++++++++++ hosts/harrison/harrison.nix | 12 +++++ profiles/server/default.nix | 6 +++ 6 files changed, 124 insertions(+) create mode 100644 hosts/harrison/configuration.nix create mode 100644 hosts/harrison/default.nix create mode 100644 hosts/harrison/hardware-configuration.nix create mode 100644 hosts/harrison/harrison.nix create mode 100644 profiles/server/default.nix diff --git a/flake.nix b/flake.nix index 6dad474c..e3c56cd9 100644 --- a/flake.nix +++ b/flake.nix @@ -123,6 +123,7 @@ norman = hensoko ++ [ graphical virtualisation work ]; redpanda = hensoko; ringo = hensoko-light ++ [ graphical ]; + harrison = hensoko ++ [ graphical server ]; }; }; }; diff --git a/hosts/harrison/configuration.nix b/hosts/harrison/configuration.nix new file mode 100644 index 00000000..11300270 --- /dev/null +++ b/hosts/harrison/configuration.nix @@ -0,0 +1,45 @@ +# 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’). + +{ config, pkgs, lib, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.eno1 = { + useDHCP = true; + wakeOnLan = { + enable = true; + }; + }; + networking.networkmanager.enable = lib.mkForce false; + + # List services that you want to enable: + + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ 22 ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # 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 = "21.05"; # Did you read the comment? +} + diff --git a/hosts/harrison/default.nix b/hosts/harrison/default.nix new file mode 100644 index 00000000..a1d958f0 --- /dev/null +++ b/hosts/harrison/default.nix @@ -0,0 +1,6 @@ +{ suites, ... }: +{ + imports = [ + ./harrison.nix + ] ++ suites.harrison; +} diff --git a/hosts/harrison/hardware-configuration.nix b/hosts/harrison/hardware-configuration.nix new file mode 100644 index 00000000..1d534e69 --- /dev/null +++ b/hosts/harrison/hardware-configuration.nix @@ -0,0 +1,54 @@ +# 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" "ehci_pci" "usb_storage" "usbhid" "sd_mod" "raid1" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + boot.initrd.luks.devices."cryptoroot" = { + device = "/dev/disk/by-uuid/e3a0394d-8bb5-4049-bf65-90d7202163cd"; + keyFile = "/dev/disk/by-id/usb-SanDisk_Cruzer_Blade_04011806021722115743-0:0-part1"; + }; + + fileSystems = { + "/" = + { + device = "/dev/disk/by-uuid/4ad4db6d-543e-4cc5-a781-396e3b527a05"; + fsType = "ext4"; + }; + + "/boot" = + { + device = "/dev/disk/by-uuid/4B4A-B1B4"; + fsType = "vfat"; + }; + + "/boot2" = + { + device = "/dev/disk/by-uuid/4B2C-385A"; + fsType = "vfat"; + }; + + "/home/hensoko/data" = + { + device = "/dev/disk/by-uuid/c307a14c-6e6e-478b-a0e5-4dbd8bdccf32"; + fsType = "ext4"; + }; + }; + + swapDevices = + [{ device = "/dev/disk/by-uuid/51348108-5c29-4251-a087-5a7de2eb97b5"; }]; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # high-resolution display + hardware.video.hidpi.enable = lib.mkDefault true; +} diff --git a/hosts/harrison/harrison.nix b/hosts/harrison/harrison.nix new file mode 100644 index 00000000..871c1277 --- /dev/null +++ b/hosts/harrison/harrison.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: +with lib; +let + psCfg = config.pub-solar; +in +{ + imports = [ + ./configuration.nix + ]; + + pub-solar.nextcloud.enable = lib.mkForce false; +} diff --git a/profiles/server/default.nix b/profiles/server/default.nix new file mode 100644 index 00000000..a8d299cc --- /dev/null +++ b/profiles/server/default.nix @@ -0,0 +1,6 @@ +{ self, config, lib, pkgs, ... }: +let inherit (lib) fileContents; +in +{ + pub-solar.server.enable = true; +}