From 030e5c00584f5a8f3d8c57e242c1eb2c994609fd Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sat, 13 Aug 2022 18:08:27 +0200 Subject: [PATCH 1/3] 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 From f764cfa36de3c0b38c920a432666e4cdbec1f151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 13 Aug 2022 18:53:50 +0200 Subject: [PATCH 2/3] Add server specific user --- flake.nix | 3 ++- users/yule/default.nix | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 users/yule/default.nix diff --git a/flake.nix b/flake.nix index 0b64905..c67df6f 100644 --- a/flake.nix +++ b/flake.nix @@ -128,7 +128,8 @@ biolimo = b12f ++ [ graphical ]; chocolatebar = b12f ++ [ graphical virtualisation ]; - droppie = b12f ++ [ ]; + yule = pubsolaros ++ [ users.yule ]; + droppie = yule ++ [ ]; }; }; }; diff --git a/users/yule/default.nix b/users/yule/default.nix new file mode 100644 index 0000000..a4940c6 --- /dev/null +++ b/users/yule/default.nix @@ -0,0 +1,23 @@ +{ config, hmUsers, pkgs, lib, ... }: +let + psCfg = config.pub-solar; +in +{ + config = { + home-manager.users = { inherit (hmUsers) yule; }; + + pub-solar = { + # These are your personal settings + # The only required settings are `name` and `password`, + # The rest is used for programs like git + user = { + name = "yule"; + description = "b12f"; + password = "$6$LO2YoaHwuRQhUoSz$iHw9avM887eJg9cIty2nmG4Ibkol3YpviEhYpivVQP31VrnihFz/6LyugxD7X4VmXx9nxvcYIZnN90rlGxwjT."; + fullName = "Benjamin Bädorf"; + email = "hello@benjaminbaedorf.eu"; + gpgKeyId = "4406E80E13CD656C"; + }; + }; + }; +} From ad4a5149347fc8f293d321b59dee09ae1624ba73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 13 Aug 2022 18:58:51 +0200 Subject: [PATCH 3/3] Add pubkeys to yule --- users/yule/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/users/yule/default.nix b/users/yule/default.nix index a4940c6..7f57a68 100644 --- a/users/yule/default.nix +++ b/users/yule/default.nix @@ -17,6 +17,12 @@ in fullName = "Benjamin Bädorf"; email = "hello@benjaminbaedorf.eu"; gpgKeyId = "4406E80E13CD656C"; + publicKeys = [ + "ssh-rsa AAAhAB3NzaC1yc2EAAAADAQABAAACAQCmXpOU6vzQiVSSYCoxHYv7wDxC63Qg3dxlAMR6AOzwIABCU5PFFNcO0NWYms/YR7MOViorl+19LCLRABar9JgHU1n+uqxKV6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