-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: pull request #62 from
dixslyf/update-flake-inputs-and-npins
Update flake inputs and npins
- Loading branch information
Showing
12 changed files
with
190 additions
and
497 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
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 |
---|---|---|
|
@@ -5,123 +5,66 @@ on: | |
push: | ||
pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
force-rebuild: | ||
description: Force a rebuild by skipping the check for the deployment specification artifact. | ||
type: boolean | ||
deployments: | ||
description: | | ||
JSON array of machines to deploy to. | ||
Each machine should be represented by its hostname. | ||
For example, `[ "alpha", "bravo" ]`. | ||
type: string | ||
|
||
run-name: ${{ inputs.deployments != '' && 'Deploy NixOS configuration' || 'Build flake outputs' }} | ||
run-name: "Build flake outputs" | ||
|
||
# Builds and deployments are in separate concurrency groups. | ||
# Builds can cancel other in-progress builds on the same ref. | ||
# Deployments will not cancel other in-progress deployments (but will cancel existing pending deployments), | ||
# no matter what ref. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ inputs.deployments != '' && 'deploy' || 'build' }}${{ inputs.deployments != '' && '' || format('-{0}', github.ref) }} | ||
cancel-in-progress: ${{ inputs.deployments == '' }} | ||
group: ${{ github.workflow }}-build-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-flake: | ||
runs-on: ubuntu-22.04 | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v26 | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check flake | ||
run: nix flake check --keep-going --impure # devenv requires impure | ||
generate-deploy-spec-matrix: | ||
determine-hosts: | ||
runs-on: ubuntu-22.04 | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
needs: [check-flake] | ||
outputs: | ||
matrix: ${{ steps.generate.outputs.matrix }} | ||
hosts: ${{ steps.generate.outputs.hosts }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v26 | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- id: generate | ||
name: Generate matrix of deploy specs | ||
env: | ||
DEPLOYMENTS: ${{ inputs.deployments }} | ||
name: Generate hosts list | ||
run: | | ||
matrix=$(nix develop .#ci --impure --command generate-deploy-spec-matrix.sh . "$DEPLOYMENTS") | ||
printf '%s' "matrix=$matrix" >> "$GITHUB_OUTPUT" | ||
build-deploy-specs: | ||
hosts=$(nix flake show --impure --json . | jq -c '.nixosConfigurations | keys') | ||
printf '%s' "hosts=$hosts" >> "$GITHUB_OUTPUT" | ||
build-hosts: | ||
runs-on: ubuntu-22.04 | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
needs: [generate-deploy-spec-matrix] | ||
needs: [determine-hosts] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
deploy-spec: ${{ fromJson(needs.generate-deploy-spec-matrix.outputs.matrix) }} | ||
host: ${{ fromJson(needs.determine-hosts.outputs.hosts) }} | ||
steps: | ||
- id: check-deploy-spec-artifact | ||
if: ${{ !inputs.force-rebuild }} | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
name: ${{ matrix.deploy-spec.hash-name }} | ||
workflow_conclusion: "" | ||
search_artifacts: true | ||
if_no_artifact_found: ignore | ||
- uses: jlumbroso/[email protected] | ||
with: | ||
tool-cache: true | ||
swap-storage: false | ||
- if: ${{ inputs.force-rebuild || !fromJSON(steps.check-deploy-spec-artifact.outputs.found_artifact) }} | ||
uses: actions/checkout@v4 | ||
- name: Build deploy specification | ||
if: ${{ inputs.force-rebuild || !fromJSON(steps.check-deploy-spec-artifact.outputs.found_artifact) }} | ||
- uses: actions/checkout@v4 | ||
- name: Build ${{ matrix.host }} | ||
uses: ./.github/actions/build | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
derivation: ".#${{ matrix.deploy-spec.flake-output }}" | ||
derivation: ".#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel" | ||
cachix-extra-pull-names: "nix-gaming, hyprland, nix-community" | ||
- if: ${{ inputs.force-rebuild || !fromJSON(steps.check-deploy-spec-artifact.outputs.found_artifact) }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.deploy-spec.hash-name }} | ||
path: ./result | ||
build-result: # https://github.com/orgs/community/discussions/26822#discussioncomment-5122101 | ||
runs-on: ubuntu-22.04 | ||
needs: [build-deploy-specs] | ||
if: ${{ always() }} | ||
needs: [build-hosts] | ||
if: ${{ (failure() || success()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }} | ||
steps: | ||
- if: ${{ contains(needs.*.result, 'failure') }} | ||
run: exit 1 | ||
deploy: | ||
runs-on: ubuntu-22.04 | ||
needs: [generate-deploy-spec-matrix, build-deploy-specs] | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.deployments != '' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
deploy-spec: ${{ fromJson(needs.generate-deploy-spec-matrix.outputs.matrix) }} | ||
steps: | ||
- id: download-deploy-spec-artifact | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
name: ${{ matrix.deploy-spec.hash-name }} | ||
workflow_conclusion: "" | ||
search_artifacts: true | ||
- uses: cachix/install-nix-action@v26 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: playernamehere-nixos | ||
skipPush: true | ||
- name: Deploy | ||
env: | ||
CACHIX_ACTIVATE_TOKEN: "${{ secrets.CACHIX_ACTIVATE_TOKEN }}" | ||
run: | | ||
cachix deploy activate ./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
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,24 +1,26 @@ | ||
# <h1 align="center">`~/.` `dixslyf/dotfiles`</h1> | ||
|
||
This repository contains my system configurations written in [Nix](https://nixos.org/). | ||
This repository contains [Nix](https://nixos.org/) configuration and dotfiles for my systems. | ||
|
||
Here is an overview of some characteristics and tools you might see in my configurations: | ||
* :snowflake: [NixOS](https://nixos.org/) + [Home Manager](https://github.com/nix-community/home-manager) + [Nix flakes](https://www.tweag.io/blog/2020-05-25-flakes/) + [flake-parts](https://github.com/hercules-ci/flake-parts) | ||
* :floppy_disk: Opt-in persistence using [tmpfs](https://en.wikipedia.org/wiki/Tmpfs) as root + [Impermanence](https://github.com/nix-community/impermanence) | ||
* :minidisc: [btrfs](https://btrfs.readthedocs.io/en/latest/Introduction.html) with [zstd](https://en.wikipedia.org/wiki/Zstd) compression + full disk encryption via [LUKS](https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup) | ||
* :key: [sops](https://github.com/mozilla/sops) + [sops-nix](https://github.com/Mic92/sops-nix) for secrets provisioning | ||
* :cloud: Deployments with [Cachix](https://www.cachix.org/) + [GitHub Actions](https://docs.github.com/en/actions) | ||
* :office: [devenv](https://devenv.sh/) + [direnv](https://direnv.net/) for local shell environment | ||
Overview: | ||
|
||
Application software I use include: | ||
* **Window Manager:** [bspwm](https://github.com/baskerville/bspwm) | ||
* **Compositor:** [picom](https://github.com/yshui/picom) | ||
* **Launcher:** [Rofi](https://github.com/davatorium/rofi) | ||
* **Bar:** [Polybar](https://github.com/polybar/polybar) | ||
* **Shell:** [fish](https://github.com/fish-shell/fish-shell) :fish: | ||
* **Terminal:** [wezterm](https://github.com/wez/wezterm) | ||
* **Editor:** [Neovim](https://github.com/neovim/neovim) | ||
* **File Manager:** [zoxide](https://github.com/ajeetdsouza/zoxide), [fzf](https://github.com/junegunn/fzf), `ls`, `cd`, `mv`, `cp`, `rm`; sometimes [Thunar](https://gitlab.xfce.org/xfce/thunar) | ||
* **Web Browsers:** [Firefox](https://www.mozilla.org/en-US/firefox/browsers/), [qutebrowser](https://github.com/qutebrowser/qutebrowser) | ||
* **Color scheme:** [Catppuccin](https://github.com/catppuccin/catppuccin) | ||
* **Fonts:** [Iosevka](https://github.com/be5invis/Iosevka), [Material Design Icons](https://github.com/Templarian/MaterialDesign), [Mali](https://fonts.google.com/specimen/Mali) | ||
- :snowflake: [NixOS](https://nixos.org/) + [Home Manager](https://github.com/nix-community/home-manager) + [Nix flakes](https://www.tweag.io/blog/2020-05-25-flakes/) + [flake-parts](https://github.com/hercules-ci/flake-parts) | ||
- :floppy_disk: Opt-in persistence using [tmpfs](https://en.wikipedia.org/wiki/Tmpfs) as root + [Impermanence](https://github.com/nix-community/impermanence) | ||
- :minidisc: [btrfs](https://btrfs.readthedocs.io/en/latest/Introduction.html) with [zstd](https://en.wikipedia.org/wiki/Zstd) compression + full disk encryption via [LUKS](https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup) | ||
- :key: [sops](https://github.com/mozilla/sops) + [sops-nix](https://github.com/Mic92/sops-nix) for secrets provisioning | ||
- :hammer: [GitHub Actions](https://docs.github.com/en/actions) + [Cachix](https://www.cachix.org/) for building and caching | ||
- :office: [devenv](https://devenv.sh/) + [direnv](https://direnv.net/) for local shell environment | ||
|
||
Software I use includes: | ||
|
||
- **Window Manager:** [bspwm](https://github.com/baskerville/bspwm) | ||
- **Compositor:** [picom](https://github.com/yshui/picom) | ||
- **Launcher:** [Rofi](https://github.com/davatorium/rofi) | ||
- **Bar:** [Polybar](https://github.com/polybar/polybar) | ||
- **Shell:** [fish](https://github.com/fish-shell/fish-shell) :fish: | ||
- **Terminal:** [wezterm](https://github.com/wez/wezterm) + [Zellij](https://zellij.dev/) | ||
- **Editor:** [Neovim](https://github.com/neovim/neovim) | ||
- **File Manager:** [zoxide](https://github.com/ajeetdsouza/zoxide), [fzf](https://github.com/junegunn/fzf), `ls`, `cd`, `mv`, `cp`, `rm`; sometimes [Thunar](https://gitlab.xfce.org/xfce/thunar) | ||
- **Web Browsers:** [Firefox](https://www.mozilla.org/en-US/firefox/browsers/), [qutebrowser](https://github.com/qutebrowser/qutebrowser) | ||
- **Color scheme:** [Catppuccin](https://github.com/catppuccin/catppuccin) | ||
- **Fonts:** [Iosevka](https://github.com/be5invis/Iosevka), [Material Design Icons](https://github.com/Templarian/MaterialDesign), [Mali](https://fonts.google.com/specimen/Mali) |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.