mirror of
https://github.com/0xbbjubjub/miniguest.git
synced 2024-09-11 05:55:35 +03:00
add devShell
This commit is contained in:
parent
fccb9b58ba
commit
fdd4a3ae54
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.direnv
|
11
devshell.toml
Normal file
11
devshell.toml
Normal file
@ -0,0 +1,11 @@
|
||||
imports = [ "git.hooks" ]
|
||||
|
||||
[devshell]
|
||||
name = "miniguest"
|
||||
|
||||
[[commands]]
|
||||
package = "nixpkgs-fmt"
|
||||
category = "formatters"
|
||||
|
||||
[git.hooks]
|
||||
enable = true
|
16
flake.lock
16
flake.lock
@ -1,5 +1,20 @@
|
||||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"locked": {
|
||||
"lastModified": 1624738949,
|
||||
"narHash": "sha256-62pEoJ1jQARZ/fAuTw67j8MqTShd8BBm+ZoSs7aeJus=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "d4be23644b0b6471d556503e03cae3215d3f9cf6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1623875721,
|
||||
@ -31,6 +46,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
|
30
flake.nix
30
flake.nix
@ -1,21 +1,27 @@
|
||||
{
|
||||
description = "guest NixOS images with minimal footprint";
|
||||
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, flake-utils }:
|
||||
outputs = inputs@{ self, nixpkgs, devshell, flake-utils }:
|
||||
with flake-utils.lib;
|
||||
{
|
||||
nixosModules.miniguest = import modules/miniguest.nix inputs;
|
||||
} //
|
||||
eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
miniguest = pkgs.callPackage ./miniguest { };
|
||||
in
|
||||
rec {
|
||||
defaultPackage = miniguest;
|
||||
packages = { inherit miniguest; };
|
||||
defaultApp = mkApp { drv = miniguest; };
|
||||
});
|
||||
} // simpleFlake {
|
||||
inherit self nixpkgs;
|
||||
name = "miniguest";
|
||||
systems = defaultSystems;
|
||||
preOverlays = [ devshell.overlay ];
|
||||
overlay = final: prev: {
|
||||
miniguest = rec {
|
||||
miniguest = final.callPackage ./miniguest { };
|
||||
defaultPackage = miniguest;
|
||||
defaultApp = mkApp { drv = miniguest; };
|
||||
devShell = final.devshell.mkShell {
|
||||
imports = [ (final.devshell.importTOML ./devshell.toml) ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user