diff --git a/flake.nix b/flake.nix index 6f8b154..f28927f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,19 +35,35 @@ outputs = inputs@{ self, ... }: let - config-Styx = import ./system/flakes/Styx.nix { + Styx = import ./system/flakes/Styx.nix { inherit (inputs) nixpkgs; inherit (inputs) home-manager; inherit (inputs) darwin; inherit inputs; }; - config-sail = import ./system/flakes/sail.nix { + sail = import ./system/flakes/sail.nix { + inherit (inputs) nixpkgs; + inherit (inputs) home-manager; + inherit (inputs) arion; + inherit inputs; + }; + + adsb-antenna = import ./system/flakes/adsb-antenna.nix { inherit (inputs) nixpkgs; inherit (inputs) home-manager; inherit (inputs) arion; inherit inputs; }; in - config-Styx // config-sail; + { + darwinConfigurations = { + "Styx" = Styx.system; + }; + + nixosConfigurations = { + sail = sail.system; + adsb-antenna = adsb-antenna.system; + }; + }; } diff --git a/hardware/hosts/adsb-antenna.nix b/hardware/hosts/adsb-antenna.nix new file mode 100644 index 0000000..d1b6f93 --- /dev/null +++ b/hardware/hosts/adsb-antenna.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot = { + initrd = { + availableKernelModules = [ "xhci_pci" "usbhid" ]; + kernelModules = [ ]; + }; + + kernelModules = [ ]; + extraModulePackages = [ ]; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eth0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +} diff --git a/home/hosts/adsb-antenna.nix b/home/hosts/adsb-antenna.nix new file mode 100644 index 0000000..abf2c8d --- /dev/null +++ b/home/hosts/adsb-antenna.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: + +{ + imports = [ + ../programs/fish.nix + ../programs/starship.nix + + ../programs/nvim + + ../programs/git.nix + + ../programs/bat.nix + + ../programs/fzf.nix + + ../programs/jq.nix + ]; + + home = { + stateVersion = "22.11"; + + packages = with pkgs; [ + ripgrep + ]; + }; +} diff --git a/secret/hosts/adsb-antenna.nix b/secret/hosts/adsb-antenna.nix new file mode 100644 index 0000000..4f35ed4 Binary files /dev/null and b/secret/hosts/adsb-antenna.nix differ diff --git a/system/flakes/Styx.nix b/system/flakes/Styx.nix index 2b2953a..17e9287 100644 --- a/system/flakes/Styx.nix +++ b/system/flakes/Styx.nix @@ -21,7 +21,7 @@ let }; in { - darwinConfigurations."Styx" = darwin.lib.darwinSystem { + system = darwin.lib.darwinSystem { system = "aarch64-darwin"; modules = [ ../hosts/Styx.nix diff --git a/system/flakes/adsb-antenna.nix b/system/flakes/adsb-antenna.nix new file mode 100644 index 0000000..18bd3f8 --- /dev/null +++ b/system/flakes/adsb-antenna.nix @@ -0,0 +1,46 @@ +{ nixpkgs, home-manager, arion, inputs, ... }: + +let + overlay-arion = arion.overlay; + overlay-neovim = inputs.neovim-nightly-overlay.overlay; + overlay-zig = _: prev: { zigpkgs = inputs.zig-overlay.packages.${prev.system}; }; + overlay-nifoc = inputs.nifoc-overlay.overlay; + + nixpkgsConfig = { + overlays = [ + overlay-arion + overlay-neovim + overlay-zig + overlay-nifoc + ]; + + config = { + allowUnfree = true; + allowBroken = true; + }; + }; +in +{ + system = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = [ + ({ + nixpkgs.overlays = nixpkgsConfig.overlays; + nixpkgs.config = nixpkgsConfig.config; + }) + + arion.nixosModules.arion + + ../hosts/adsb-antenna.nix + + home-manager.nixosModules.home-manager + { + nixpkgs = nixpkgsConfig; + nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.daniel = import ../../home/hosts/adsb-antenna.nix; + } + ]; + }; +} diff --git a/system/flakes/sail.nix b/system/flakes/sail.nix index 7a1b944..adfa911 100644 --- a/system/flakes/sail.nix +++ b/system/flakes/sail.nix @@ -21,7 +21,7 @@ let }; in { - nixosConfigurations.sail = nixpkgs.lib.nixosSystem { + system = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ({ diff --git a/system/hosts/adsb-antenna.nix b/system/hosts/adsb-antenna.nix new file mode 100644 index 0000000..489ba9f --- /dev/null +++ b/system/hosts/adsb-antenna.nix @@ -0,0 +1,73 @@ +{ pkgs, ... }: + +let + secret = import ../../secret/hosts/adsb-antenna.nix; + ssh-keys = import ../shared/ssh-keys.nix; +in +{ + imports = [ + ../../hardware/hosts/adsb-antenna.nix + ../nixos/ssh.nix + + ../nixos/git.nix + ]; + + nix = { + package = pkgs.nixFlakes; + + binaryCaches = [ + "https://nix-community.cachix.org" + ]; + + binaryCachePublicKeys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + + extraOptions = '' + experimental-features = nix-command flakes + keep-derivations = true + keep-outputs = true + auto-optimise-store = true + ''; + }; + + boot = { + loader = { + grub.enable = false; + generic-extlinux-compatible.enable = true; + }; + + cleanTmpDir = true; + }; + + networking = { + hostName = "adsb-antenna"; + + dhcpcd.denyInterfaces = [ "veth*" ]; + + timeServers = [ + "ntp1.hetzner.de" + "ntp2.hetzner.com" + "ntp3.hetzner.net" + "time.cloudflare.com" + ]; + }; + + programs.fish.enable = true; + + users.users = { + root = { + openssh.authorizedKeys.keys = [ ssh-keys.LAN ]; + }; + + daniel = { + hashedPassword = secret.users.daniel.hashedPassword; + isNormalUser = true; + home = "/home/daniel"; + description = "Daniel"; + extraGroups = [ "wheel" ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ ssh-keys.LAN ]; + }; + }; +}