Skip to content

Commit

Permalink
Introduce NixOS and devShells (#19)
Browse files Browse the repository at this point in the history
* initial functional flake with inputs and s

* added devshell and nixos config

* Fixed nixos config (probably)

* Nix config finally works

* set up deploy-rs

* added nix fmt to CI

* added nix build to CI
  • Loading branch information
TheButlah authored Nov 18, 2024
1 parent 3b7e57f commit ed4b8cd
Show file tree
Hide file tree
Showing 13 changed files with 697 additions and 2 deletions.
1 change: 1 addition & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ jobs:
with:
cargo-profile: ${{ needs.check-inputs.outputs.cargo-profile }}

nix:
name: Nix
needs: check-inputs
uses: ./.github/workflows/nix.yaml
with:
deploy: ${{ needs.check-inputs.outputs.is-default-branch == 'true' }}

container:
name: Container
needs: [rust, check-inputs]
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Nix CI
on:
workflow_call:
inputs:
deploy:
required: true
type: boolean

jobs:
fmt:
name: Check Nix Formatting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: nexus-ci
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix develop -c nixpkgs-fmt --check .

build:
name: Build NixOS config
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: nexus-ci
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build NixOS machines
run: |
nix build .#nixosConfigurations.servers-us-east-1.config.formats.linode
- name: Run Flake Checks
run: nix flake check
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Editor stuff
/.idea
/.vscode
*.swp

# Build artifacts
/target
**/artifacts
.intentionally-empty-file.o

*.swp
# Macos BS
.DS_Store

# For local development
# Nix stuff
.direnv
.envrc
result

# For local development
my-config.toml

# SQLite
Expand Down
281 changes: 281 additions & 0 deletions flake.lock

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

Loading

0 comments on commit ed4b8cd

Please sign in to comment.