From ec81b6a28d52d191a3443b113f554e7ecd5be71a Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 22 Feb 2021 13:21:31 +0100 Subject: [PATCH] Flakify pulsebert --- flake.nix | 26 ++++++++++---- host-registry.nix | 7 ++-- .../{configuration.nix => default.nix} | 35 ++----------------- 3 files changed, 26 insertions(+), 42 deletions(-) rename hosts/pulsebert/{configuration.nix => default.nix} (83%) diff --git a/flake.nix b/flake.nix index 2e68876e..d98ccbde 100644 --- a/flake.nix +++ b/flake.nix @@ -37,20 +37,24 @@ ${self}#nixosConfigurations.${name}.config.system.build.toplevel \ --command switch-to-configuration $@ ''; + mkWake = name: + pkgs.writeScriptBin "${name}-wake" '' + #!${pkgs.runtimeShell} + exec ${pkgs.wol}/bin/wol ${hostRegistry.hosts.${name}.ether} + ''; in { glotzbert-nixos-rebuild = mkDeploy "glotzbert" "glotzbert.hq.c3d2.de"; - glotzbert-wake = pkgs.writeScriptBin "glotzbert-wake" '' - #!${pkgs.runtimeShell} - exec ${pkgs.wol}/bin/wol ${hostRegistry.hosts.glotzbert.ether} - ''; + glotzbert-wake = mkWake "glotzbert"; + + pulsebert-nixos-rebuild = mkDeploy "pulsebert" "pulsebert.hq.c3d2.de"; + pulsebert-wake = mkWake "pulsebert"; }); nixosConfigurations = let nixosSystem' = # Our custom NixOS builder - { system ? "x86_64-linux", ... }@args: + { ... }@args: nixpkgs.lib.nixosSystem (args // { - inherit system; extraModules = [ self.nixosModules.c3d2 ({ pkgs, ... }: { @@ -63,7 +67,15 @@ }); in { - glotzbert = nixosSystem' { modules = [ ./hosts/glotzbert ]; }; + glotzbert = nixosSystem' { + modules = [ ./hosts/glotzbert ]; + system = "x86_64-linux"; + }; + + pulsebert = nixosSystem' { + modules = [ ./hosts/pulsebert ]; + system = "aarch64-linux"; + }; }; diff --git a/host-registry.nix b/host-registry.nix index 4adbfc5c..64555691 100644 --- a/host-registry.nix +++ b/host-registry.nix @@ -21,8 +21,11 @@ rec { nfs = { }; ncdc.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzWhy2T7avsFf+ZS8R99kah2wPQs7MYWUP+t4VBi28a"; - pulsebert.publicKey = - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAnEWn/8CKIiCtehh6Ha3XUQqjODj0ygyo3aGAsFWgfG"; + pulsebert = { + ether = "dc:a6:32:31:b6:32"; + publicKey = + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAnEWn/8CKIiCtehh6Ha3XUQqjODj0ygyo3aGAsFWgfG"; + }; samba = { }; storage-ng.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMeg5ojU7U8+Lx824y+brazVJ007mEJDM7C7aUruOWGP"; diff --git a/hosts/pulsebert/configuration.nix b/hosts/pulsebert/default.nix similarity index 83% rename from hosts/pulsebert/configuration.nix rename to hosts/pulsebert/default.nix index fc2afc4d..e6815b22 100644 --- a/hosts/pulsebert/configuration.nix +++ b/hosts/pulsebert/default.nix @@ -9,7 +9,7 @@ let espCam = "http://172.20.78.164:81"; in { imports = [ # Include the results of the hardware scan. - + ./hardware-configuration.nix ]; boot.loader.grub.enable = false; @@ -27,7 +27,6 @@ in { nix.maxJobs = 4; networking.hostName = "pulsebert"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config @@ -36,33 +35,10 @@ in { networking.interfaces.eth0.useDHCP = true; networking.interfaces.wlan0.useDHCP = true; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # }; - - # Set your time zone. - # time.timeZone = "Europe/Amsterdam"; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ wget vim git raspberrypi-tools ]; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # pinentryFlavor = "gnome3"; - # }; - # List services that you want to enable: # Do not log to flash: @@ -83,15 +59,8 @@ in { extraGroups = [ "wheel" "audio" ]; }; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. networking.firewall.enable = false; - # Enable CUPS to print documents. - # services.printing.enable = true; - # Enable sound. sound.enable = true; hardware.bluetooth = { @@ -196,7 +165,7 @@ in { [ "dialout" "gpio" ]; systemd.services.mjpeg-stream = - let mjpeg-proxy = pkgs.callPackage { }; + let mjpeg-proxy = pkgs.callPackage ../../lib/pkgs/mjpeg-proxy.nix { }; in { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ];