Skip to content

Add nix flake - #50

Open
r0hitsharma wants to merge 1 commit into
eljulians:masterfrom
r0hitsharma:r0hitsharma/nix-flake
Open

Add nix flake#50
r0hitsharma wants to merge 1 commit into
eljulians:masterfrom
r0hitsharma:r0hitsharma/nix-flake

Conversation

@r0hitsharma

@r0hitsharma r0hitsharma commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

This fixes #21.

Once the PR is merged:

# Direct installation via nix profile
nix profile install github:eljulians/skillfile

# Via home-manager
home.packages = [ inputs.skillfile.packages.${system}.default ];

# Or run directly
nix run github:eljulians/skillfile -- --help

For now you can test with: nix run github:r0hitsharma/skillfile/r0hitsharma/nix-flake -- --version.

For making sure the version and sha's are updated in a consistent manner, the CI process has been updated to have a separate bump, and release step:

flowchart TD                                                                                                                                                                    
      Start[("Last functional commit<br/>on master")] --> Trigger{{"User triggers<br/>bump workflow<br/>(version: 1.4.2)"}}                                                       
                                                                                                                                                                                  
      Trigger --> Bump["<b>Bump Job</b><br/>• Update Cargo.toml<br/>• Update Cargo.lock<br/>• Commit: 'Bump version to v1.4.2'<br/>• Push to master"]                             
                                                                                                                                                                                  
      Bump --> Commit1[("Commit 1:<br/>Version bump")]                                                                                                                            
                                                            
      Commit1 --> Build["<b>Build Job</b><br/>(parallel matrix)<br/>• Build x86_64-linux<br/>• Build aarch64-linux<br/>• Build x86_64-macos<br/>• Build aarch64-macos<br/>• Build 
  x86_64-windows<br/>• Upload artifacts"]                   
                                                                                                                                                                                  
      Build --> CreateRC["<b>Create-RC Job</b><br/>• Download artifacts<br/>• Compute SHA256 hashes<br/>• Update flake.nix<br/>• Commit: 'Update flake.nix to v1.4.2'<br/>• Push  
  to master<br/>• Create v1.4.2-rc tag<br/>• Create pre-release with binaries"]
                                                                                                                                                                                  
      CreateRC --> Commit2[("Commit 2:<br/>flake.nix with hashes<br/><br/><b>Tagged: v1.4.2-rc</b>")]                                                                             
  
      Commit2 -.->|"RC tag triggers<br/>release workflow"| ReleaseStart["<b>Release Workflow Triggered</b>"]                                                                      
                                                            
      ReleaseStart --> CI["<b>CI Job</b><br/>• Run tests<br/>• Run lints"]                                                                                                        
                                                            
      CI -->|"Pass"| Verify["<b>Verify-Install Job</b><br/>• Test install.sh<br/>• Verify binary works"]                                                                          
                                                            
      CI -->|"Fail"| Failed[("❌ Release Aborted<br/>RC remains as pre-release")]                                                                                                 
                                                            
      Verify --> Publish["<b>Publish Job</b><br/>• Publish skillfile-core<br/>• Publish skillfile-sources<br/>• Publish skillfile-deploy<br/>• Publish skillfile"]                
                                                            
      Publish --> Release["<b>Release Job</b><br/>• Download binaries from RC<br/>• Create v1.4.2 tag<br/>• Create full release<br/>• Delete v1.4.2-rc tag<br/>• Delete RC        
  pre-release"]                                             
                                                                                                                                                                                  
      Release --> FinalTag[("Commit 2:<br/>flake.nix with hashes<br/><br/><b>Tagged: v1.4.2</b><br/>(RC tag removed)")]                                                           
  
      FinalTag --> Complete[("✅ Release Complete<br/>• GitHub Release published<br/>• crates.io published<br/>• Nix flake ready")]                                               
                                                            
      style Start fill:#e1f5ff                                                                                                                                                    
      style Commit1 fill:#fff4e1                            
      style Commit2 fill:#e8f5e1                                                                                                                                                  
      style FinalTag fill:#e1ffe8                                                                                                                                                 
      style Complete fill:#d4edda                                                                                                                                                 
      style Failed fill:#f8d7da                                                                                                                                                   
      style Trigger fill:#f0e6ff                                                                                                                                                  
      style ReleaseStart fill:#f0e6ff
Loading

Key Points:

  • 2 commits total: One for Cargo.toml/Cargo.lock, one for flake.nix with correct hashes
  • RC tag is created on the second commit (which has the correct hashes)
  • CI runs on the RC tag before any publishing happens
  • If CI fails: Process stops, RC pre-release remains for debugging
  • If CI passes: Publishes to crates.io, then promotes RC to full release
  • Final state: v1.4.2 tag points to commit with correct hashes, RC is cleaned up

This reverts commit ab10d32.
@eljulians

Copy link
Copy Markdown
Owner

@r0hitsharma thanks for the new PR! I'll be out starting tomorrow for a week and a half; I want to test this thoroughly because I'm interested in the mechanisms, so I'll wait until then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nix flake

2 participants