-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Victor Hang <vhvictorhang@gmail.com>
- Loading branch information
Showing
7 changed files
with
125 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build Gojo | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
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=${{ env.url }} | ||
- uses: cachix/cachix-action@v15 | ||
with: | ||
name: didactiklabs | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- name: Create /etc/nixos and copy hardware config | ||
run: | | ||
sudo mkdir -p /etc/nixos | ||
sudo sh -c 'cat > /etc/nixos/hardware-configuration.nix <<EOF | ||
{ | ||
fileSystems."/" = { | ||
device = "/dev/disk/by-uuid/dummy"; | ||
fsType = "ext4"; | ||
}; | ||
} | ||
EOF' | ||
- name: Build | ||
run: nix-build '<nixpkgs/nixos>' -A config.system.build.toplevel -I nixos-config=profiles/gojo/configuration.nix | ||
- name: Push | ||
# if: github.ref == 'refs/heads/main' | ||
run: | | ||
cachix push didactiklabs ./result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
let | ||
sources = import ./npins; | ||
pkgs = import sources.nixpkgs { | ||
config = { | ||
allowUnfree = true; | ||
allowUnfreePredicate = true; | ||
}; | ||
}; | ||
createConfiguration = parent: { | ||
networking.hostName = parent.hostName; | ||
deployment = { | ||
buildOnTarget = true; | ||
# Allow local deployment with `colmena apply-local` | ||
allowLocalDeployment = true; | ||
targetUser = builtins.getEnv "USER"; | ||
targetHost = parent.host; | ||
}; | ||
imports = [ ./profiles/${parent.hostName}/configuration.nix ]; | ||
}; | ||
in | ||
{ | ||
meta = { | ||
nixpkgs = pkgs; | ||
}; | ||
gojo = createConfiguration { | ||
hostName = "gojo"; | ||
host = "10.207.7.2"; | ||
}; | ||
frieren = createConfiguration { | ||
hostName = "frieren"; | ||
host = "10.254.0.5"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
args@{ ... }: | ||
args: | ||
let | ||
# Get the current directory's name | ||
currentDir = builtins.toString ./.; | ||
hostname = builtins.baseNameOf currentDir; | ||
# Import the base configuration with the dynamic hostname | ||
base = import ../../base.nix (args // { inherit hostname; }); | ||
hostname = "frieren"; | ||
in | ||
base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
args@{ ... }: | ||
args: | ||
let | ||
# Get the current directory's name | ||
currentDir = builtins.toString ./.; | ||
hostname = builtins.baseNameOf currentDir; | ||
# Import the base configuration with the dynamic hostname | ||
base = import ../../base.nix (args // { inherit hostname; }); | ||
hostname = "generic"; | ||
in | ||
base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
args@{ ... }: | ||
args: | ||
let | ||
# Get the current directory's name | ||
currentDir = builtins.toString ./.; | ||
hostname = builtins.baseNameOf currentDir; | ||
# Import the base configuration with the dynamic hostname | ||
base = import ../../base.nix (args // { inherit hostname; }); | ||
hostname = "gojo"; | ||
in | ||
base |