-
Notifications
You must be signed in to change notification settings - Fork 12
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 #108 from akirak/flake-parts
Add flake-parts
- Loading branch information
Showing
4 changed files
with
96 additions
and
0 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,36 @@ | ||
name: Check flake-parts | ||
|
||
on: | ||
push: | ||
paths: | ||
# Set this to the directory of the template | ||
- flake-parts/** | ||
- .github/workflows/check-flake-parts.yml | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
concurrency: | ||
group: check-flake-parts-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: cachix/install-nix-action@v30 | ||
with: | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: ./tmp | ||
- run: nix flake new -t ./tmp#flake-parts ./work | ||
- name: Prepare the project | ||
working-directory: work | ||
run: | | ||
git init | ||
git add . | ||
- run: nix flake show | ||
working-directory: work |
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,44 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
systems.url = "github:nix-systems/default"; | ||
# treefmt-nix.url = "github:numtide/treefmt-nix"; | ||
}; | ||
|
||
outputs = | ||
inputs@{ flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = import inputs.systems; | ||
|
||
imports = [ | ||
# inputs.flake-parts.flakeModules.partitions | ||
# inputs.treefmt-nix.flakeModule | ||
]; | ||
|
||
# partitions.dev = { | ||
# extraInputsFlake = ./dev; | ||
# module = { | ||
# imports = [ ./dev/flake-module.nix ]; | ||
# }; | ||
# }; | ||
|
||
# partitionedAttrs = { | ||
# checks = "dev"; | ||
# devShells = "dev"; | ||
# }; | ||
|
||
perSystem = | ||
{ | ||
system, | ||
pkgs, | ||
inputs', | ||
... | ||
}: | ||
{ | ||
# You can use `extend' to extend the packages with an overlay (or use | ||
# `import inputs.nixpkgs { ... }`). | ||
_module.args.pkgs = inputs'.nixpkgs.legacyPackages; | ||
}; | ||
}; | ||
} |
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