Skip to content

Conversation

@Sarguru02
Copy link
Contributor

  • Added flake.nix and flake.lock files. Used flake-parts for making it run in all systems.
  • Made the build.sh file executable
  • Nix run command gave shellcheck errors -> suppressed them.

No Testing is done, since I dont have sudo permissions.

@Sarguru02
Copy link
Contributor Author

@akileshas can you test the changes in ur system and verify once before merging?

@Sarguru02 Sarguru02 marked this pull request as draft August 26, 2025 10:29
@Sarguru02 Sarguru02 marked this pull request as ready for review August 26, 2025 10:29
Copy link
Owner

@akileshas akileshas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good.

if ! sync; then
__logger.error "failed to sync filesystems."
__M.util.cleanup
__M.util.cleanup "$@"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are u passing "$@" bro ?
i just used the method suffixed with __ as a private method
and the method suffixed with _ as a public method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done for clarity, and ensuring that it is a function by the linter.

description = "Install ArchLinux ARM in Raspberry pi 5";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flakes-parts seems bloated for this @Sarguru02.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it helps in adding more flakes on top of it in modular way. And it seems convenient to read all the flakes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think that flakes-parts makes this more heavier even for the basic gnu tools.
i think just the nixpkgs are more than enough for it.

here is a sample code of flakes.nix which i think is enough for it and
main thing i see here is it is minimal and so light.

{
  description = "Install ArchLinux ARM in Raspberry pi 5";
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  outputs = {nixpkgs, ...}: let
    forAllSystems = nixpkgs.lib.genAttrs [
        "x86_64-linux"
        "aarch64-linux"
        "aarch64-darwin"
        "x86_64-darwin"
    ];
  in {
    packages = forAllSystems (system: let
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      default = pkgs.writeShellApplication {
        name = "alarm.sh";
        runtimeInputs = with pkgs; [
          aria2
          dosfstools
          e2fsprogs
          libarchive
          fzf
          gawk
          findutils
          curl
          gnugrep
          coreutils
          util-linux
          parted
        ];
      };
    });
    devShells = forAllSystems (system: let
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      default = pkgs.mkShell {
        name = "alarm";
        packages = with pkgs; [
          aria2
          dosfstools
          e2fsprogs
          libarchive
          fzf
          gawk
          findutils
          curl
          gnugrep
          coreutils
          util-linux
          parted
        ];
      };
    });
  };
}

also @Sarguru02 bro can you review whether their is any issues in my nix code ?

@akileshas akileshas merged commit 717a265 into akileshas:master Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants