From f89384cbf0aa9e071956d4c7d1a0de13738b2927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 4 Sep 2021 15:56:44 +0200 Subject: [PATCH] Works for chocolatebar --- flake.nix | 1 + hosts/biolimo/biolimo.nix | 4 +-- hosts/chocolatebar/chocolatebar.nix | 31 +++++++++++++++++ hosts/chocolatebar/configuration.nix | 26 +++++++++++++++ hosts/chocolatebar/default.nix | 28 ++-------------- hosts/chocolatebar/hardware-configuration.nix | 33 +++++++++++++++++++ 6 files changed, 95 insertions(+), 28 deletions(-) create mode 100644 hosts/chocolatebar/chocolatebar.nix create mode 100644 hosts/chocolatebar/configuration.nix create mode 100644 hosts/chocolatebar/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index b6b0aee7..c298cc4b 100644 --- a/flake.nix +++ b/flake.nix @@ -136,6 +136,7 @@ anonymous = pubsolaros ++ [ users.nixos ]; b12f = pubsolaros ++ [ users.ben ]; biolimo = b12f ++ [ graphical ]; + chocolatebar = b12f ++ [ graphical ]; }; }; }; diff --git a/hosts/biolimo/biolimo.nix b/hosts/biolimo/biolimo.nix index 51f2e763..25e247c4 100644 --- a/hosts/biolimo/biolimo.nix +++ b/hosts/biolimo/biolimo.nix @@ -14,9 +14,7 @@ in hardware.cpu.intel.updateMicrocode = true; - networking.firewall.allowedTCPPorts = [ - 5000 - ]; + networking.firewall.allowedTCPPorts = [ 5000 ]; home-manager.users."${psCfg.user.name}".xdg.configFile = mkIf psCfg.sway.enable { "sway/config.d/10-screens.conf".source = ./.config/sway/config.d/screens.conf; diff --git a/hosts/chocolatebar/chocolatebar.nix b/hosts/chocolatebar/chocolatebar.nix new file mode 100644 index 00000000..76175878 --- /dev/null +++ b/hosts/chocolatebar/chocolatebar.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: +with lib; +let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in +{ + imports = [ + ./configuration.nix + ./virtualisation + ]; + + config = { + pub-solar.x-os.keyfile = "/etc/nixos/hosts/chocolatebar/secrets/keyfile.bin"; + + pub-solar.virtualisation.isolateGPU = "rx550x"; + + hardware.cpu.amd.updateMicrocode = true; + + hardware.opengl.extraPackages = with pkgs; [ + rocm-opencl-icd + rocm-opencl-runtime + ]; + + home-manager.users."${psCfg.user.name}".xdg.configFile = mkIf psCfg.sway.enable { + "sway/config.d/10-autostart.conf".source = ./.config/sway/config.d/autostart.conf; + "sway/config.d/10-input-defaults.conf".source = ./.config/sway/config.d/input-defaults.conf; + "sway/config.d/10-screens.conf".source = ./.config/sway/config.d/screens.conf; + }; + }; +} diff --git a/hosts/chocolatebar/configuration.nix b/hosts/chocolatebar/configuration.nix new file mode 100644 index 00000000..9f4a341a --- /dev/null +++ b/hosts/chocolatebar/configuration.nix @@ -0,0 +1,26 @@ +# 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, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # 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 = "20.09"; # Did you read the comment? +} + diff --git a/hosts/chocolatebar/default.nix b/hosts/chocolatebar/default.nix index 8f25b802..d7548796 100644 --- a/hosts/chocolatebar/default.nix +++ b/hosts/chocolatebar/default.nix @@ -1,28 +1,6 @@ -{ config, pkgs, lib, ... }: -with lib; -let - psCfg = config.pub-solar; - xdg = config.home-manager.users."${psCfg.user.name}".xdg; -in +{ suites, ... }: { imports = [ - ./virtualisation - ]; - - config = { - pub-solar.virtualisation.enable = true; - - hardware.cpu.amd.updateMicrocode = true; - - hardware.opengl.extraPackages = with pkgs; [ - rocm-opencl-icd - rocm-opencl-runtime - ]; - - home-manager.users."${psCfg.user.name}".xdg.configFile = mkIf psCfg.sway.enable { - "sway/config.d/10-autostart.conf".source = ./.config/sway/config.d/autostart.conf; - "sway/config.d/10-input-defaults.conf".source = ./.config/sway/config.d/input-defaults.conf; - "sway/config.d/10-screens.conf".source = ./.config/sway/config.d/screens.conf; - }; - }; + ./chocolatebar.nix + ] ++ suites.chocolatebar; } diff --git a/hosts/chocolatebar/hardware-configuration.nix b/hosts/chocolatebar/hardware-configuration.nix new file mode 100644 index 00000000..0c623c23 --- /dev/null +++ b/hosts/chocolatebar/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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 = [ "nvme" "xhci_pci" "ahci" "usbcore" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/a3a74208-b244-4268-b374-e58265810fce"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/afcde41f-9811-4ac8-bb7b-a683844acc5c"; + + fileSystems."/boot/efi" = + { + device = "/dev/disk/by-uuid/12FD-62A8"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + +}