add example

This commit is contained in:
2023-06-10 18:08:31 +00:00
parent 72591b23c4
commit 23173d0875
11 changed files with 64 additions and 115 deletions

View File

@@ -1,34 +1,46 @@
{
description = "";
inputs = {
config.url = "path:config";
playground.url = "path:playground/example/service";
nixpkgs.url = "nixpkgs/nixos-23.05";
};
outputs = { self, config, playground }:
outputs = { self, nixpkgs }:
let
version = "0.0.1";
name = "develnixos";
forAllSystems = config.forAllSystems;
nixpkgsFor = config.nixpkgsFor;
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
devTaskScripts = forAllSystems (system: {
autoTag = nixpkgsFor.${system}.writeScript "auto_tag.sh" ''
git tag --force v${version}
git push origin v${version}
'';
});
in rec {
packages = playground.packages;
space = forAllSystems (system: rec {
config = import ./config { nixpkgs = nixpkgsFor.${system}; };
playground = import ./playground/example { config = config; };
});
in rec {
packages = forAllSystems (system: {
default = space.${system}.playground.package;
});
apps = forAllSystems (system:
let
testConfig = import ./config { nixpkgs = nixpkgsFor.${system}; };
testapp = import ./playground/example { config = testConfig; };
updateLockScript =
nixpkgsFor.${system}.writeShellScriptBin "update_flake_lock.sh" ''
nix --experimental-features 'nix-command flakes' flake lock --update-input nixpkgs
nix --experimental-features 'nix-command flakes' build
'';
in {
default = playground.apps.default;
default = space.${system}.playground.app;
devTasks = {
updateFlakeLock = {
type = "app";