Skip to content

Commit

Permalink
Simplify CI workflow and flake.nix (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella authored Jul 6, 2023
1 parent 80ac51f commit 2a44ae3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 46 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- run: nix build .#ci
# TODO: Fix issue running darwin-rebuild
# - run: ./result/sw/bin/darwin-rebuild switch --flake .
- run: nix build .#darwinConfigurations.ci.system
# FIXME: error: Directory /run does not exist, aborting activation
# - run: ./result/sw/bin/darwin-rebuild switch --flake .#ci
2 changes: 1 addition & 1 deletion bin/switch
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
./result/sw/bin/darwin-rebuild switch --flake .
./result/sw/bin/darwin-rebuild switch --flake .#work
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 27 additions & 32 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,34 @@
}
];
};
darwinConfigurations = {
"ec-2022-127-lp-sestrella" = mkDarwinSystem "aarch64-darwin";
"ghactions" = mkDarwinSystem "x86_64-darwin";
};
in
{
inherit darwinConfigurations;
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
({ pkgs, ... }: {
packages = [
pkgs.gitleaks
];

pre-commit.hooks = {
luacheck.enable = true;
nixpkgs-fmt.enable = true;
stylua.enable = true;
yamllint.enable = true;
};
})
];
};
darwinConfigurations = {
ci = mkDarwinSystem "x86_64-darwin";
work = mkDarwinSystem "aarch64-darwin";
};
} // flake-utils.lib.eachSystem [ "aarch64-darwin" "x86_64-darwin" ]
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
({ pkgs, ... }: {
packages = [
pkgs.gitleaks
];

packages = {
ci = darwinConfigurations."ghactions".system;
default = darwinConfigurations."ec-2022-127-lp-sestrella".system;
};
});
pre-commit.hooks = {
luacheck.enable = true;
nixpkgs-fmt.enable = true;
stylua.enable = true;
yamllint.enable = true;
};
})
];
};
});
}
2 changes: 1 addition & 1 deletion home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
pkgs.aws-vault
pkgs.awscli2
pkgs.btop
pkgs.circleci-cli
pkgs.jq
pkgs.nix-prefetch-git
pkgs.pstree
pkgs.tmate
pkgs.tree
pkgs.watch
pkgs.wget
pkgs.yq
];

programs.autojump.enable = true;
Expand Down

0 comments on commit 2a44ae3

Please sign in to comment.