From 030e5c00584f5a8f3d8c57e242c1eb2c994609fd Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 13 Aug 2022 18:08:27 +0200 Subject: [PATCH] Add droppie --- flake.nix | 6 ++- hosts/droppie/configuration.nix | 22 ++++++++++ hosts/droppie/default.nix | 6 +++ hosts/droppie/droppie.nix | 16 +++++++ hosts/droppie/hardware-configuration.nix | 53 ++++++++++++++++++++++++ modules/docker/default.nix | 1 - modules/x-os/boot.nix | 10 ++--- overlays/overrides.nix | 2 +- 8 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 hosts/droppie/configuration.nix create mode 100644 hosts/droppie/default.nix create mode 100644 hosts/droppie/droppie.nix create mode 100644 hosts/droppie/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 6881562..0b64905 100644 --- a/flake.nix +++ b/flake.nix @@ -127,6 +127,8 @@ b12f = pubsolaros ++ [ users.ben social gaming mobile ]; biolimo = b12f ++ [ graphical ]; chocolatebar = b12f ++ [ graphical virtualisation ]; + + droppie = b12f ++ [ ]; }; }; }; @@ -150,7 +152,9 @@ homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; - deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; + deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { + droppie = { }; + }; } ; } diff --git a/hosts/droppie/configuration.nix b/hosts/droppie/configuration.nix new file mode 100644 index 0000000..e392cfe --- /dev/null +++ b/hosts/droppie/configuration.nix @@ -0,0 +1,22 @@ +# 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 + ]; + + # 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.11"; # Did you read the comment? +} + diff --git a/hosts/droppie/default.nix b/hosts/droppie/default.nix new file mode 100644 index 0000000..87c64f2 --- /dev/null +++ b/hosts/droppie/default.nix @@ -0,0 +1,6 @@ +{ suites, ... }: +{ + imports = [ + ./droppie.nix + ] ++ suites.droppie; +} diff --git a/hosts/droppie/droppie.nix b/hosts/droppie/droppie.nix new file mode 100644 index 0000000..22159f7 --- /dev/null +++ b/hosts/droppie/droppie.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: +with lib; +let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in +{ + imports = [ + ./configuration.nix + ]; + + config = { + + hardware.cpu.intel.updateMicrocode = true; + }; +} diff --git a/hosts/droppie/hardware-configuration.nix b/hosts/droppie/hardware-configuration.nix new file mode 100644 index 0000000..9c1fa07 --- /dev/null +++ b/hosts/droppie/hardware-configuration.nix @@ -0,0 +1,53 @@ +# 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 = [ "ahci" "usbhid" "uas" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/1dca9d02-555c-4b23-9450-8f3413fa7694"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/A24C-F252"; + fsType = "vfat"; + }; + + fileSystems."/media/internal" = + { + device = "/dev/disk/by-uuid/5cf314a8-82f4-4037-a724-62d2ff226cff"; + fsType = "ext4"; + }; + + fileSystems."/home" = + { + device = "/dev/disk/by-uuid/2ef980f1-1f27-4d2a-9789-00f45e791fcc"; + fsType = "xfs"; + }; + + swapDevices = + [{ device = "/dev/disk/by-uuid/0203b641-280f-4a3d-971d-fd32a666c852"; }]; + + # 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.enp2s0f0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/docker/default.nix b/modules/docker/default.nix index 9209768..668c400 100644 --- a/modules/docker/default.nix +++ b/modules/docker/default.nix @@ -17,7 +17,6 @@ in environment.systemPackages = with pkgs; [ docker-compose - docker-compose_2 ]; }; } diff --git a/modules/x-os/boot.nix b/modules/x-os/boot.nix index f0e97c9..dfc6a86 100644 --- a/modules/x-os/boot.nix +++ b/modules/x-os/boot.nix @@ -16,11 +16,11 @@ with lib; # Mount / luks device in initrd # Allow fstrim to work on it. # The ! makes this enabled by default - boot.initrd = mkIf (!cfg.iso-options.enable) { - luks.devices."cryptroot" = { - allowDiscards = true; - }; - }; + #boot.initrd = mkIf (!cfg.iso-options.enable) { + # luks.devices."cryptroot" = { + # allowDiscards = true; + # }; + #}; boot.loader.systemd-boot.enable = true; }; diff --git a/overlays/overrides.nix b/overlays/overrides.nix index a23cff0..4a85b71 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -5,7 +5,7 @@ channels: final: prev: { inherit (channels.latest) cachix docker - docker-compose_2 + docker-compose dhall discord element-desktop