From 7620fb3dee148cada03c68962d41750702107d58 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 26 Mar 2023 04:21:03 +0200 Subject: [PATCH] move jokum to nixos bicep --- flake.nix | 2 +- hosts/bicep/configuration.nix | 14 ++++++++------ hosts/bicep/services/jokum.nix | 10 ++++++++++ hosts/jokum/configuration.nix | 7 ++----- 4 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 hosts/bicep/services/jokum.nix diff --git a/flake.nix b/flake.nix index a900009..170e2f0 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,7 @@ nixosConfigurations = let nixosConfig = name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate config - { + rec { system = "x86_64-linux"; specialArgs = { inherit unstable inputs; diff --git a/hosts/bicep/configuration.nix b/hosts/bicep/configuration.nix index 20f20a6..ad7e107 100644 --- a/hosts/bicep/configuration.nix +++ b/hosts/bicep/configuration.nix @@ -6,6 +6,7 @@ ../../base.nix ./services/postgres.nix + ./services/jokum.nix ]; sops.defaultSopsFile = ../../secrets/bicep/bicep.yaml; @@ -13,15 +14,16 @@ sops.age.keyFile = "/var/lib/sops-nix/key.txt"; sops.age.generateKey = true; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/disk/by-id/scsi-3600508b1001cb1a8751c137b30610682"; networking.hostName = "bicep"; - # systemd.network.networks."30-ens33" = values.defaultNetworkConfig // { - # matchConfig.Name = "ens33"; - # address = with values.hosts.bekkalokk; [ (ipv4 + "/25") (ipv6 + "/64") ]; - # }; + systemd.network.networks."30-enp6s0f0" = values.defaultNetworkConfig // { + matchConfig.Name = "enp6s0f0"; + address = with values.hosts.bicep; [ (ipv4 + "/25") (ipv6 + "/64") ]; + }; # Do not change, even during upgrades. # See https://search.nixos.org/options?show=system.stateVersion diff --git a/hosts/bicep/services/jokum.nix b/hosts/bicep/services/jokum.nix new file mode 100644 index 0000000..0219be3 --- /dev/null +++ b/hosts/bicep/services/jokum.nix @@ -0,0 +1,10 @@ +{config, lib, pkgs, inputs, values, ...}: + +{ + # lfmao + containers.jokum = { + interfaces = [ "ens10f1" ]; + # wtf + path = inputs.self.nixosConfigurations.jokum.config.system.build.toplevel; + }; +} diff --git a/hosts/jokum/configuration.nix b/hosts/jokum/configuration.nix index 55e66cd..5b75a15 100644 --- a/hosts/jokum/configuration.nix +++ b/hosts/jokum/configuration.nix @@ -13,15 +13,13 @@ sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; sops.age.keyFile = "/var/lib/sops-nix/key.txt"; sops.age.generateKey = true; - - boot.kernel.enable = false; + boot.isContainer = true; networking.useHostResolvConf = false; - boot.loader.initScript.enable = true; networking.hostName = "jokum"; # Define your hostname. - systemd.network.networks."30-ens10f1" = values.defaultNetworkConfig // { + systemd.network.networks."30-enp6s0f1" = values.defaultNetworkConfig // { matchConfig.Name = "ens10f1"; address = with values.hosts.jokum; [ (ipv4 + "/25") (ipv6 + "/64") ] ++ (with values.services.turn; [ (ipv4 + "/25") (ipv6 + "/64") ]); @@ -40,5 +38,4 @@ # 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.05"; # Did you read the comment? - }