From 3201fd5a96a7932b0e7701388b2166869bcddf77 Mon Sep 17 00:00:00 2001 From: emily Date: Mon, 29 Apr 2024 15:22:48 +0200 Subject: [PATCH] added integra --- config/hosts/integra/configuration.nix | 29 ++++++++++++ config/hosts/integra/disko.nix | 45 +++++++++++++++++++ .../hosts/integra/hardware-configuration.nix | 10 +++++ config/hosts/seras/configuration.nix | 21 +-------- config/profiles/builder.nix | 20 +++++++++ flake.nix | 1 + lib/shinyflakes/default.nix | 4 +- 7 files changed, 108 insertions(+), 22 deletions(-) create mode 100644 config/hosts/integra/configuration.nix create mode 100644 config/hosts/integra/disko.nix create mode 100644 config/hosts/integra/hardware-configuration.nix create mode 100644 config/profiles/builder.nix diff --git a/config/hosts/integra/configuration.nix b/config/hosts/integra/configuration.nix new file mode 100644 index 0000000..fa437d0 --- /dev/null +++ b/config/hosts/integra/configuration.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: { + imports = [ + ../../common + ../../profiles/builder.nix + ../../profiles/headless.nix + ./hardware-configuration.nix + ./disko.nix + ]; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + kyouma.machine-type.physical = true; + + networking = { + hostName = "integra"; + useDHCP = false; + }; + + systemd.network.networks."98-eth-default" = { + matchConfig.Type = "ether"; + matchConfig.Name = "e*"; + networkConfig = { + DHCP = "yes"; + }; + }; +} diff --git a/config/hosts/integra/disko.nix b/config/hosts/integra/disko.nix new file mode 100644 index 0000000..f8d67cb --- /dev/null +++ b/config/hosts/integra/disko.nix @@ -0,0 +1,45 @@ +{ config, inputs, ... }: { + imports = [ + inputs.disko.nixosModules.disko + ]; + disko.devices.disk.root = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + BOOT = { + type = "EF00"; + size = "512M"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" "defaults" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "nixos" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/config/hosts/integra/hardware-configuration.nix b/config/hosts/integra/hardware-configuration.nix new file mode 100644 index 0000000..8f25c7e --- /dev/null +++ b/config/hosts/integra/hardware-configuration.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, modulesPath, ... }: { + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_scsi" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; +} diff --git a/config/hosts/seras/configuration.nix b/config/hosts/seras/configuration.nix index 02452c7..92d8d5f 100644 --- a/config/hosts/seras/configuration.nix +++ b/config/hosts/seras/configuration.nix @@ -1,6 +1,7 @@ { config, inputs, lib, pkgs, ... }: { imports = [ ../../common + ../../profiles/builder.nix ../../profiles/headless.nix ../../profiles/kartoffel.nix ../../profiles/lxc.nix @@ -9,30 +10,10 @@ networking = { hostName = "seras"; - nftables.enable = lib.mkForce false; }; - nix.gc.options = lib.mkForce "--delete-older-than 60d"; - nix.settings.trusted-users = [ "build" ]; - nix.extraOptions = '' - min-free = ${builtins.toString (4096 * 1024 * 1024)} - max-free = ${builtins.toString (8192 * 1024 * 1024)} - max-substitution-jobs = 20 - max-silent-time = 900 - ''; - systemd.network.networks."98-eth-default" = { address = [ "2a0f:be01:0:100::169/128" ]; }; - users.users.build = { - isNormalUser = true; - shell = pkgs.fish; - ignoreShellProgramCheck = true; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA/+iN407+HsfHbbC3tfdA8Yf4TZ08qXQMb4tb/SDAs+ emily@card" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICT0dGyLUjxFnvqUmex+5xUGQ7D4yGHKo267JgApcq0k root@ryuuko" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIDTwCSWYODyvTJxwB6Rahuy0j6s/YYwtQta8bjzG/We root@ryuuko-arch" - ]; - }; } diff --git a/config/profiles/builder.nix b/config/profiles/builder.nix new file mode 100644 index 0000000..48e8861 --- /dev/null +++ b/config/profiles/builder.nix @@ -0,0 +1,20 @@ +{ lib, pkgs, ... }: { + nix.gc.options = lib.mkForce "--delete-older-than 60d"; + nix.settings.trusted-users = [ "build" ]; + nix.extraOptions = '' + min-free = ${builtins.toString (4096 * 1024 * 1024)} + max-free = ${builtins.toString (8192 * 1024 * 1024)} + max-substitution-jobs = 20 + max-silent-time = 900 + ''; + users.users.build = { + isNormalUser = true; + shell = pkgs.bash; + ignoreShellProgramCheck = true; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA/+iN407+HsfHbbC3tfdA8Yf4TZ08qXQMb4tb/SDAs+ emily@card" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICT0dGyLUjxFnvqUmex+5xUGQ7D4yGHKo267JgApcq0k root@ryuuko" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIDTwCSWYODyvTJxwB6Rahuy0j6s/YYwtQta8bjzG/We root@ryuuko-arch" + ]; + }; +} diff --git a/flake.nix b/flake.nix index 76d1ecd..1342ea5 100644 --- a/flake.nix +++ b/flake.nix @@ -52,6 +52,7 @@ shinyflakes = import ./lib/shinyflakes inputs; in { hosts = shinyflakes.mapHosts { + integra = { system = "aarch64-linux"; }; lain = { system = "aarch64-linux"; }; }; diff --git a/lib/shinyflakes/default.nix b/lib/shinyflakes/default.nix index 0201d9b..1cf37e9 100644 --- a/lib/shinyflakes/default.nix +++ b/lib/shinyflakes/default.nix @@ -21,8 +21,8 @@ genNixosCfg = { hostname, system ? "x86_64-linux" - }: - nixpkgs.lib.nixosSystem { + }: + nixpkgs.lib.nixosSystem { system = system; specialArgs = { inherit inputs; }; modules = [