This commit is contained in:
2023-06-10 15:48:42 +00:00
parent f227960a83
commit 72591b23c4
5 changed files with 61 additions and 52 deletions

View File

@@ -1,5 +1,5 @@
{
inputs = { config.url = "./config"; };
inputs = { config.url = "path:config"; };
outputs = { self, config }: config;
outputs = { self, config }: config //. {playground = { port = "8080"; }; };
}

View File

@@ -1,6 +1,6 @@
{
description = "";
inputs = { config.url = "./config"; };
inputs = { config.url = "path:playground/example/config"; };
outputs = { self, config }:
let
version = "0.0.1";
@@ -16,47 +16,16 @@
});
in rec {
packages = forAllSystems (system: {
default = nixpkgsFor.${system}.stdenv.mkDerivation {
name = name;
src = self;
buildPhase = "echo nothing todo";
installPhase = "mkdir -p $out/bin; install -t $out/bin src/hello.sh";
};
default = nixpkgsFor.${system}.writeScript "python-webserver" ''
python -m http.server 8080
'';
});
apps = forAllSystems (system:
let
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 {
apps = forAllSystems (system: {
default = {
type = "app";
program = "${packages.${system}.default}/bin/hello.sh";
program = "${packages.${system}.default}";
};
devTasks = {
updateFlakeLock = {
type = "app";
program = "${updateLockScript}/bin/update_flake_lock.sh";
};
autoTag = {
type = "app";
program = "${devTaskScripts.${system}.autoTag}";
};
};
});
devShells = forAllSystems (system: {
default = nixpkgsFor.${system}.mkShell {
name = "dev-shell";
packages = [ nixpkgsFor.${system}.nixfmt ];
shellHook = ''
. ./alias.sh
'';
};
});
});
};
}