Add dev flake

This commit is contained in:
Sridhar Ratnakumar 2023-06-21 16:07:19 -04:00
parent 0844c73ae7
commit 9cbc82078f
4 changed files with 134 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake ./dev

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.direnv

96
dev/flake.lock Normal file
View File

@ -0,0 +1,96 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1685662779,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-root": {
"locked": {
"lastModified": 1680964220,
"narHash": "sha256-dIdTYcf+KW9a4pKHsEbddvLVSfR1yiAJynzg2x0nfWg=",
"owner": "srid",
"repo": "flake-root",
"rev": "f1c0b93d05bdbea6c011136ba1a135c80c5b326c",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"mission-control": {
"locked": {
"lastModified": 1683658484,
"narHash": "sha256-JkGnWyYZxOnyOhztrxLSqaod6+O/3rRypq0dAqA/zn0=",
"owner": "Platonic-Systems",
"repo": "mission-control",
"rev": "a0c93bd764a3c25e6999397e9f5f119c1b124e38",
"type": "github"
},
"original": {
"owner": "Platonic-Systems",
"repo": "mission-control",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687274257,
"narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1685564631,
"narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"flake-root": "flake-root",
"mission-control": "mission-control",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

36
dev/flake.nix Normal file
View File

@ -0,0 +1,36 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
mission-control.url = "github:Platonic-Systems/mission-control";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.flake-root.flakeModule
inputs.mission-control.flakeModule
];
perSystem = { pkgs, lib, config, ... }: {
mission-control.scripts = {
ex = {
description = "Run example";
exec = "cd ./example && nix run . --override-input services-flake ..";
};
test = {
description = "Run test";
exec = "./test.sh";
};
fmt = {
description = "Format the top-level Nix files";
exec = "${lib.getExe pkgs.nixpkgs-fmt} ./*.nix";
};
};
devShells.default = pkgs.mkShell {
# cf. https://haskell.flake.page/devshell#composing-devshells
inputsFrom = [ config.mission-control.devShell ];
};
};
};
}