Skip to content

Commit

Permalink
feat ✨: ci pin nixpkgs
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Hang <vhvictorhang@gmail.com>
  • Loading branch information
Banh-Canh committed Sep 29, 2024
1 parent fc3ef95 commit d4d3689
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build-anya.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ jobs:
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout code
uses: actions/checkout@v3
- name: Get Nixpkgs revision for nixfmt
run: |
# This should not be a URL, because it would allow PRs to run arbitrary code in CI!
url=$(jq -r .pins.nixpkgs.url npins/sources.json)
echo "url=$url" >> "$GITHUB_ENV"
- uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
with:
nix_path: nixpkgs=channel:nixos-24.05
nix_path: nixpkgs=${{ env.url }}
- uses: cachix/cachix-action@v15
with:
name: didactiklabs
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Checkout code
uses: actions/checkout@v3
- name: Create /etc/nixos and copy hardware config
run: |
sudo mkdir -p /etc/nixos
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/build-nishinoya.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ jobs:
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout code
uses: actions/checkout@v3
- name: Get Nixpkgs revision for nixfmt
run: |
# This should not be a URL, because it would allow PRs to run arbitrary code in CI!
url=$(jq -r .pins.nixpkgs.url npins/sources.json)
echo "url=$url" >> "$GITHUB_ENV"
- uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
with:
nix_path: nixpkgs=channel:nixos-24.05
nix_path: nixpkgs=${{ env.url }}
- uses: cachix/cachix-action@v15
with:
name: didactiklabs
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Checkout code
uses: actions/checkout@v3
- name: Create /etc/nixos and copy hardware config
run: |
sudo mkdir -p /etc/nixos
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/build-totoro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ jobs:
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout code
uses: actions/checkout@v3
- name: Get Nixpkgs revision for nixfmt
run: |
# This should not be a URL, because it would allow PRs to run arbitrary code in CI!
url=$(jq -r .pins.nixpkgs.url npins/sources.json)
echo "url=$url" >> "$GITHUB_ENV"
- uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
with:
nix_path: nixpkgs=channel:nixos-24.05
nix_path: nixpkgs=${{ env.url }}
- uses: cachix/cachix-action@v15
with:
name: didactiklabs
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Checkout code
uses: actions/checkout@v3
- name: Create /etc/nixos and copy hardware config
run: |
sudo mkdir -p /etc/nixos
Expand Down
3 changes: 1 addition & 2 deletions base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ let
allowUnfree = true;
};
};
inherit (sources) lix-module lix;
hostProfile = import ./profiles/${hostname} {
inherit
lib
Expand All @@ -41,7 +40,6 @@ in
(import ./nixosModules/networkManager.nix { inherit lib config pkgs; })
(import ./nixosModules/sunshine.nix { inherit lib config pkgs; })
(import "${sources.home-manager}/nixos")
(import "${lix-module}/module.nix" { inherit lix; })
hostProfile
];
# Bootloader.
Expand Down Expand Up @@ -180,6 +178,7 @@ in
inherit pkgs;
};
nix = {
package = pkgs.lix;
gc = {
automatic = true;
dates = "weekly";
Expand Down

0 comments on commit d4d3689

Please sign in to comment.