-
Notifications
You must be signed in to change notification settings - Fork 54
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 #46 from gytis-ivaskevicius/staging
Release 1.2.0
- Loading branch information
Showing
45 changed files
with
1,514 additions
and
761 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 |
---|---|---|
|
@@ -6,46 +6,30 @@ on: | |
types: [opened] | ||
|
||
jobs: | ||
quality-gate: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: cachix/install-nix-action@v13 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-3.0pre20201007_5257a25/install | ||
install_url: https://github.com/numtide/nix-unstable-installer/releases/download/nix-2.4pre20210604_8e6ee1b/install | ||
extra_nix_config: experimental-features = nix-command flakes | ||
|
||
- name: Check Nix parsing | ||
run: find . -name "*.nix" -exec nix-instantiate --parse --quiet {} >/dev/null + | ||
# Quick eval | ||
- run: nix develop --command evalnix | ||
|
||
- name: Run `nix flake check` | ||
run: cd examples/fully-featured && nix flake check --show-trace | ||
# Execute /tests/* | ||
- run: nix develop --command check-derivation-outputs | ||
- run: nix develop --command check-derivation-outputs-old | ||
- run: nix develop --command check-channel-patching | ||
- run: nix develop --command check-overlays-flow | ||
- run: nix develop --command check-hosts-config | ||
|
||
- name: Run `nix flake show` | ||
run: cd examples/fully-featured && nix flake show --show-trace | ||
|
||
- name: Build Morty configuration | ||
run: cd examples/fully-featured && nix build .#nixosConfigurations.Morty.config.system.build.toplevel --dry-run | ||
|
||
- name: Build Rick configuration | ||
run: cd examples/fully-featured && nix build .#someConfigurations.Rick.config.system.build.toplevel --dry-run | ||
|
||
- name: Build Summer checks | ||
run: cd examples/fully-featured && nix build .#checks.x86_64-linux.summerHasUnfreeConfigured && nix build .#checks.x86_64-linux.summerHasPackageOverridesConfigured && nix build .#checks.x86_64-linux.summerHasCustomModuleConfigured | ||
|
||
- name: Run `nix flake check` | ||
run: cd examples/somewhat-realistic && nix flake check --show-trace | ||
|
||
- name: Run `nix flake show` | ||
run: cd examples/somewhat-realistic && nix flake show --show-trace | ||
|
||
- name: Build HostnameOne configuration | ||
run: cd examples/somewhat-realistic && nix build .#nixosConfigurations.HostnameOne.config.system.build.toplevel --dry-run | ||
|
||
- name: Check Nix formatting | ||
run: nix shell nixpkgs\#nixpkgs-fmt -c nixpkgs-fmt --check . | ||
|
||
- name: Build HostnameThree configuration | ||
run: cd examples/somewhat-realistic && nix build .#darwinConfigurations.HostnameThree.config.system.build.toplevel --dry-run | ||
# Build /examples/* | ||
- run: nix develop --command build-home-manager+nur+neovim-Rick | ||
- run: nix develop --command build-minimal-multichannel-Hostname1 | ||
- run: nix develop --command build-minimal-multichannel-Hostname2 | ||
- run: nix develop --command build-exporters-Morty | ||
|
||
# Check formatting | ||
- run: nix develop --command fmt --check |
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 +1,2 @@ | ||
examples/*/flake.lock | ||
examples/*/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,86 @@ | ||
{ system ? builtins.currentSystem }: | ||
let | ||
# nixpkgs / devshell is only used for development. Don't add it to the flake.lock. | ||
nixpkgsGitRev = "82d05e980543e1703cbfd3b5ccd1fdcd4b0f1f00"; | ||
devshellGitRev = "26f25a12265f030917358a9632cd600b51af1d97"; | ||
|
||
nixpkgsSrc = fetchTarball { | ||
url = "https://github.com/NixOS/nixpkgs/archive/${nixpkgsGitRev}.tar.gz"; | ||
sha256 = "02yqgivv8kxksv7n6vmh22qxprlfjh4rfkgf98w46nssq5ahdb1q"; | ||
}; | ||
|
||
devshellSrc = fetchTarball { | ||
url = "https://github.com/numtide/devshell/archive/${devshellGitRev}.tar.gz"; | ||
sha256 = "sha256:0f6fph5gahm2bmzd399mba6b0h6wp6i1v3gryfmgwp0as7mwqpj7"; | ||
}; | ||
|
||
pkgs = import nixpkgsSrc { inherit system; }; | ||
devshell = import devshellSrc { inherit system pkgs; }; | ||
|
||
withCategory = category: attrset: attrset // { inherit category; }; | ||
util = withCategory "utils"; | ||
|
||
test = name: withCategory "tests" { | ||
name = "check-${name}"; | ||
help = "Checks ${name} testcases"; | ||
command = '' | ||
set -e | ||
echo -e "\n\n##### Building ${name}\n" | ||
cd $DEVSHELL_ROOT/tests/${name} | ||
nix flake show --no-write-lock-file "$@" | ||
nix flake check --no-write-lock-file "$@" | ||
''; | ||
}; | ||
|
||
dry-nixos-build = example: host: withCategory "dry-build" { | ||
name = "build-${example}-${host}"; | ||
command = '' | ||
set -e | ||
echo -e "\n\n##### Building ${example}-${host}\n" | ||
cd $DEVSHELL_ROOT/examples/${example} | ||
nix flake show --no-write-lock-file "$@" | ||
nix build .#nixosConfigurations.${host}.config.system.build.toplevel --no-write-lock-file --no-link "$@" | ||
''; | ||
}; | ||
|
||
in | ||
devshell.mkShell { | ||
name = "flake-utils-plus"; | ||
packages = with pkgs; [ | ||
fd | ||
nixpkgs-fmt | ||
]; | ||
|
||
commands = [ | ||
{ | ||
command = "git rm --ignore-unmatch -f $DEVSHELL_ROOT/{tests,examples}/*/flake.lock"; | ||
help = "Remove all lock files"; | ||
name = "rm-locks"; | ||
} | ||
{ | ||
name = "fmt"; | ||
help = "Check Nix formatting"; | ||
command = "nixpkgs-fmt \${@} $DEVSHELL_ROOT"; | ||
} | ||
{ | ||
name = "evalnix"; | ||
help = "Check Nix parsing"; | ||
command = "fd --extension nix --exec nix-instantiate --parse --quiet {} >/dev/null"; | ||
} | ||
|
||
(test "channel-patching") | ||
(test "derivation-outputs") | ||
(test "derivation-outputs-old") | ||
(test "hosts-config") | ||
(test "overlays-flow") | ||
(test "all" // { command = "check-channel-patching && check-derivation-outputs && check-derivation-outputs-old && check-hosts-config && check-overlays-flow"; }) | ||
|
||
(dry-nixos-build "minimal-multichannel" "Hostname1") | ||
(dry-nixos-build "minimal-multichannel" "Hostname2") | ||
(dry-nixos-build "home-manager+nur+neovim" "Rick") | ||
(dry-nixos-build "exporters" "Morty") | ||
(withCategory "dry-build" { name = "build-all"; command = "build-exporters-Morty && build-home-manager+nur+neovim-Rick && build-minimal-multichannel-Hostname1 && build-minimal-multichannel-Hostname2"; }) | ||
|
||
]; | ||
|
||
} |
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,49 @@ | ||
{ | ||
description = "FUP exporters demo"; | ||
|
||
inputs = { | ||
nixpkgs.url = github:nixos/nixpkgs/release-21.05; | ||
unstable.url = github:nixos/nixpkgs/nixos-unstable-small; | ||
utils.url = path:../../; | ||
}; | ||
|
||
|
||
outputs = inputs@{ self, nixpkgs, utils, ... }: | ||
let | ||
inherit (utils.lib) exportOverlays exportPackages exportModules; | ||
in | ||
utils.lib.systemFlake { | ||
inherit self inputs; | ||
|
||
# Channel specific overlays. Overlays `coreutils` from `unstable` channel. | ||
channels.nixpkgs.overlaysBuilder = channels: [ | ||
(final: prev: { inherit (channels.unstable) ranger; }) | ||
]; | ||
|
||
# Propagates to channels.<name>.overlaysBuilder | ||
sharedOverlays = [ | ||
self.overlay | ||
]; | ||
|
||
hosts.Morty.modules = with self.nixosModules; [ | ||
Morty | ||
]; | ||
|
||
nixosModules = exportModules [ | ||
./hosts/Morty.nix | ||
]; | ||
|
||
# export overlays automatically for all packages defined in overlaysBuilder of each channel | ||
overlays = exportOverlays { | ||
inherit (self) pkgs inputs; | ||
}; | ||
|
||
outputsBuilder = channels: { | ||
# construct packagesBuilder to export all packages defined in overlays | ||
packages = exportPackages self.overlays channels; | ||
}; | ||
|
||
overlay = import ./overlays; | ||
|
||
}; | ||
} |
File renamed without changes.
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,3 @@ | ||
final: prev: { | ||
inherit (prev) coreutils; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.