-
Notifications
You must be signed in to change notification settings - Fork 1
Re:Add nix flake support for the script. #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@akileshas can you test the changes in ur system and verify once before merging? |
akileshas
left a comment
There was a problem hiding this 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 "$@" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
build.shfile executableNo Testing is done, since I dont have sudo permissions.