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

52
flake.lock generated
View File

@@ -7,11 +7,26 @@
"locked": {
"lastModified": 1,
"narHash": "sha256-x1tXOK1tiPQabKK5TOzHQ0HxtFobkEoxwWPvuo6YYvc=",
"path": "/nix/store/1cvr44p1k6r0qq7fydsp7x3yhpwgm0v9-source/config",
"path": "config",
"type": "path"
},
"original": {
"path": "/nix/store/1cvr44p1k6r0qq7fydsp7x3yhpwgm0v9-source/config",
"path": "config",
"type": "path"
}
},
"config_2": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-x1tXOK1tiPQabKK5TOzHQ0HxtFobkEoxwWPvuo6YYvc=",
"path": "config",
"type": "path"
},
"original": {
"path": "config",
"type": "path"
}
},
@@ -30,9 +45,40 @@
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1686331006,
"narHash": "sha256-hElRDWUNG655aqF0awu+h5cmDN+I/dQcChRt2tGuGGU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "85bcb95aa83be667e562e781e9d186c57a07d757",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.05",
"type": "indirect"
}
},
"playground": {
"inputs": {
"config": "config_2"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-6/SzH0gS563+ouSexLKi3gmTlyOsgg3Ps/plwn8IhnE=",
"path": "playground/example/service",
"type": "path"
},
"original": {
"path": "playground/example/service",
"type": "path"
}
},
"root": {
"inputs": {
"config": "config"
"config": "config",
"playground": "playground"
}
}
},

View File

@@ -1,8 +1,8 @@
{
description = "";
inputs = {
config.url = "./config";
playground.url = "./playground/example/service";
config.url = "path:config";
playground.url = "path:playground/example/service";
};
outputs = { self, config, playground }:
let
@@ -28,10 +28,7 @@
nix --experimental-features 'nix-command flakes' build
'';
in {
default = {
type = "app";
program = "${packages.${system}.default}/bin/hello.sh";
};
default = playground.apps.default;
devTasks = {
updateFlakeLock = {
type = "app";

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
'';
};
});
});
};
}

View File

@@ -1,3 +0,0 @@
#!/bin/env bash
echo "hello world"