From 169f774e81af4e3cc04b7c96634cc09cee1e94e0 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 26 Mar 2023 01:09:44 +0100 Subject: [PATCH] bicep dead, but maybe soon bicep alive --- flake.nix | 1 + hosts/bicep/configuration.nix | 29 +++++++++++++++++++++ hosts/bicep/hardware-configuration.nix | 36 ++++++++++++++++++++++++++ hosts/bicep/services/postgres.nix | 6 +++++ 4 files changed, 72 insertions(+) create mode 100644 hosts/bicep/configuration.nix create mode 100644 hosts/bicep/hardware-configuration.nix create mode 100644 hosts/bicep/services/postgres.nix diff --git a/flake.nix b/flake.nix index db082648..a900009e 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,7 @@ }); in { + bicep = nixosConfig "bicep" { }; bekkalokk = nixosConfig "bekkalokk" { }; greddost = nixosConfig "greddost" { }; ildkule = nixosConfig "ildkule" { }; diff --git a/hosts/bicep/configuration.nix b/hosts/bicep/configuration.nix new file mode 100644 index 00000000..20f20a6b --- /dev/null +++ b/hosts/bicep/configuration.nix @@ -0,0 +1,29 @@ +{ pkgs, values, ... }: +{ + imports = [ + ./hardware-configuration.nix + + ../../base.nix + + ./services/postgres.nix + ]; + + sops.defaultSopsFile = ../../secrets/bicep/bicep.yaml; + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + sops.age.keyFile = "/var/lib/sops-nix/key.txt"; + sops.age.generateKey = true; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "bicep"; + + # systemd.network.networks."30-ens33" = values.defaultNetworkConfig // { + # matchConfig.Name = "ens33"; + # address = with values.hosts.bekkalokk; [ (ipv4 + "/25") (ipv6 + "/64") ]; + # }; + + # Do not change, even during upgrades. + # See https://search.nixos.org/options?show=system.stateVersion + system.stateVersion = "22.11"; +} diff --git a/hosts/bicep/hardware-configuration.nix b/hosts/bicep/hardware-configuration.nix new file mode 100644 index 00000000..200875a4 --- /dev/null +++ b/hosts/bicep/hardware-configuration.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, modulesPath, ... }: + +# FIXME: please don't use me, I'm from bekkalokk + +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "mptspi" "uhci_hcd" "ehci_pci" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/cdcafe3a-01d8-4bdf-9a3d-78705b581090"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1CB4-280D"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/3eaace48-91ec-4d46-be86-fd26877d8b86"; } + ]; + + # 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.ens33.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/bicep/services/postgres.nix b/hosts/bicep/services/postgres.nix new file mode 100644 index 00000000..4e95fa8e --- /dev/null +++ b/hosts/bicep/services/postgres.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + services.postgresql = { + enable = true; + }; +}