diff --git a/flake.nix b/flake.nix index 93b6e2b0..676e437a 100644 --- a/flake.nix +++ b/flake.nix @@ -44,47 +44,6 @@ ... } @ inputs: let inherit (nixpkgs.lib) nixosSystem; - basic-config = { - pkgs, - lib, - ... - }: { - users.users.root.initialPassword = "root"; - networking = { - hostName = "raspberry"; - firewall.enable = false; - wireless = { - enable = true; - }; - }; - environment.systemPackages = with pkgs; [bluez bluez-tools neovim git]; - nix = { - package = pkgs.nixFlakes; - extraOptions = "experimental-features = nix-command flakes"; - }; - time.timeZone = "America/Bahia"; - console = {keyMap = "br-abnt2";}; - i18n = { - defaultLocale = "pt_BR.UTF-8"; - }; - hardware = { - bluetooth.enable = true; - raspberry-pi = { - config = { - all = { - base-dt-params = { - # enable autoprobing of bluetooth driver - # https://github.com/raspberrypi/linux/blob/c8c99191e1419062ac8b668956d19e788865912a/arch/arm/boot/dts/overlays/README#L222-L224 - krnbt = { - enable = true; - value = "on"; - }; - }; - }; - }; - }; - }; - }; supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. @@ -122,14 +81,13 @@ disko.nixosModules.disko ]; }; - # nix build '.#nixosConfigurations.selene.config.system.build.sdImage' + # nix build '.#nixosConfigurations.selene.config.system.build.sdImage' to build the image for the raspberry-pi selene = nixosSystem { system = "aarch64-linux"; modules = [ - ./hosts/selene/configuration.nix - raspberry-pi-nix.nixosModules.raspberry-pi - # basic-config - ]; + ./hosts/selene/configuration.nix + raspberry-pi-nix.nixosModules.raspberry-pi + ]; }; }; devShells = forAllSystems (system: let diff --git a/hosts/selene/configuration.nix b/hosts/selene/configuration.nix index 3de5bc76..e4ae8be4 100644 --- a/hosts/selene/configuration.nix +++ b/hosts/selene/configuration.nix @@ -6,7 +6,10 @@ }: { imports = [./hardware-configuration.nix]; + raspberry-pi-nix.uboot.enable = true; + networking = { + enable = true; hostName = "raspberry"; # Define your hostname. firewall.enable = false; wireless = { @@ -14,8 +17,12 @@ }; }; - services.openssh.enable = true; - services.openssh.settings.PermitRootLogin = "yes"; + services = { + openssh = { + enable = true; + settings.PermitRootLogin = "yes"; + }; + }; environment.systemPackages = with pkgs; [ neovim @@ -49,16 +56,19 @@ }; }; - users.users.selene = { - isNormalUser = true; - description = "My RaspberryPI Host"; - initialPassword = "123456"; - shell = pkgs.zsh; - extraGroups = ["networkmanager" "wheel" "input" "docker" "kvm" "libvirtd"]; + users.users = { + root.initialPassword = "root"; + selene = { + isNormalUser = true; + description = "My RaspberryPI Host"; + initialPassword = "123456"; + shell = pkgs.zsh; + extraGroups = ["networkmanager" "wheel" "input" "docker" "kvm" "libvirtd"]; + }; }; programs = { - zsh.enable = true; + zsh.enable = true; }; time.timeZone = "America/Bahia";