Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e6be20

Browse files
Adiciona suporte a aarch64-linux (#15)
* Inicia suport a aarch64-linux * Usa inherit system; * Add coreutils * Refatora inputs * Refatora outputs e cached devShell * Refatora outputs e cached devShell, fix * Fix echo * Fix devShells.default * Testa instalação igual a do org * Testa instalação igual a do org, 2
1 parent a5876ce commit 7e6be20

File tree

5 files changed

+43
-41
lines changed

5 files changed

+43
-41
lines changed

.github/workflows/push.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,10 @@ jobs:
1818

1919
- name: Instala nix single user
2020
run: |
21-
test -d /nix || sudo mkdir -m 0755 /nix \
22-
&& sudo -k chown "$USER": /nix \
23-
&& BASE_URL='https://raw.githubusercontent.com/ES-Nix/get-nix/' \
24-
&& SHA256=5443257f9e3ac31c5f0da60332d7c5bebfab1cdf \
25-
&& NIX_RELEASE_VERSION='2.10.2' \
26-
&& curl -fsSL "${BASE_URL}""$SHA256"/get-nix.sh | sh -s -- ${NIX_RELEASE_VERSION} \
27-
&& . "$HOME"/.nix-profile/etc/profile.d/nix.sh \
28-
&& . ~/."$(ps -ocomm= -q $$)"rc \
29-
&& export TMPDIR=/tmp \
30-
&& nix flake --version
21+
wget -qO- http://ix.io/4Cj0 | sh \
22+
&& . "$HOME"/."$(basename $SHELL)"rc \
23+
&& nix flake --version \
24+
&& direnv --version
3125
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH
3226
3327
# Remove podman via apt-get

.github/workflows/tests.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@ jobs:
2020

2121
- name: Instala nix single user
2222
run: |
23-
test -d /nix || sudo mkdir -m 0755 /nix \
24-
&& sudo -k chown "$USER": /nix \
25-
&& BASE_URL='https://raw.githubusercontent.com/ES-Nix/get-nix/' \
26-
&& SHA256=5443257f9e3ac31c5f0da60332d7c5bebfab1cdf \
27-
&& NIX_RELEASE_VERSION='2.10.2' \
28-
&& curl -fsSL "${BASE_URL}""$SHA256"/get-nix.sh | sh -s -- ${NIX_RELEASE_VERSION} \
29-
&& . "$HOME"/.nix-profile/etc/profile.d/nix.sh \
30-
&& . ~/."$(ps -ocomm= -q $$)"rc \
31-
&& export TMPDIR=/tmp \
32-
&& nix flake --version
23+
wget -qO- http://ix.io/4Cj0 | sh \
24+
&& . "$HOME"/."$(basename $SHELL)"rc \
25+
&& nix flake --version \
26+
&& direnv --version
3327
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH
3428
3529
# Remove podman via apt-get

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.direnv/
22
.idea/
3+
.profiles/

flake.lock

Lines changed: 7 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,55 @@
22
description = "This is a nix with flakes package";
33

44
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs";
6+
57
flake-utils.url = "github:numtide/flake-utils";
68
podman-rootless.url = "github:ES-Nix/podman-rootless/from-nixpkgs";
9+
10+
podman-rootless.inputs.nixpkgs.follows = "nixpkgs";
11+
flake-utils.inputs.nixpkgs.follows = "nixpkgs";
712
};
813

9-
outputs = { self, nixpkgs, flake-utils, podman-rootless }:
14+
outputs = attrs@{
15+
self,
16+
nixpkgs,
17+
flake-utils,
18+
podman-rootless
19+
}:
1020
flake-utils.lib.eachDefaultSystem (system:
1121
let
1222

1323
pkgsAllowUnfree = import nixpkgs {
14-
system = "x86_64-linux";
24+
inherit system;
1525
config = { allowUnfree = true; };
1626
};
27+
28+
# https://gist.github.com/tpwrules/34db43e0e2e9d0b72d30534ad2cda66d#file-flake-nix-L28
29+
pleaseKeepMyInputs = pkgsAllowUnfree.writeTextDir "bin/.please-keep-my-inputs"
30+
(builtins.concatStringsSep " " (builtins.attrValues attrs));
1731
in
1832
{
1933

20-
devShell = pkgsAllowUnfree.mkShell {
34+
devShells.default = pkgsAllowUnfree.mkShell {
2135
buildInputs = with pkgsAllowUnfree; [
2236
bashInteractive
37+
coreutils
2338
gnumake
2439
podman-rootless.packages.${system}.podman
40+
pleaseKeepMyInputs
2541
];
2642

2743
shellHook = ''
2844
export TMPDIR=/tmp
2945
46+
test -d .profiles || mkdir -v .profiles
47+
48+
test -L .profiles/dev \
49+
|| nix develop .# --profile .profiles/dev --command echo
50+
51+
test -L .profiles/dev-shell-default \
52+
|| nix build $(nix eval --impure --raw .#devShells."$system".default.drvPath) --out-link .profiles/dev-shell-"$system"-default
53+
3054
echo "Entering the nix devShell"
3155
'';
3256
};

0 commit comments

Comments
 (0)