mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2026-02-02 09:25:10 +01:00
remove flake-compat and devshell inputs
This commit is contained in:
parent
21bdcb716b
commit
3b12406285
9 changed files with 37 additions and 158 deletions
9
.envrc
9
.envrc
|
|
@ -1,8 +1 @@
|
||||||
watch_file flake.nix flake.lock \
|
use flake
|
||||||
modules/* \
|
|
||||||
devshell/*
|
|
||||||
|
|
||||||
{
|
|
||||||
mkdir -p "$(direnv_layout_dir)"
|
|
||||||
eval "$(nix print-dev-env --no-update-lock-file --no-write-lock-file --profile $(direnv_layout_dir)/flake-profile)"
|
|
||||||
} || use nix
|
|
||||||
|
|
@ -17,7 +17,7 @@ There's no formal commit process at this time.
|
||||||
|
|
||||||
Do try to format the repo with [treefmt](https://github.com/numtide/treefmt) before submission, however.
|
Do try to format the repo with [treefmt](https://github.com/numtide/treefmt) before submission, however.
|
||||||
|
|
||||||
nix develop -c treefmt
|
nix fmt
|
||||||
|
|
||||||
## Kubernetes versions
|
## Kubernetes versions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ Apply all resources with
|
||||||
|
|
||||||
nix run github:hall/kubenix . -- apply
|
nix run github:hall/kubenix . -- apply
|
||||||
|
|
||||||
> **HINT**: run `nix run github:hall/kubenix . -- --help` for more commands
|
> **HINT**: use ` --help` for more commands
|
||||||
|
|
||||||
A minimal example flake:
|
A minimal example flake:
|
||||||
|
|
||||||
|
|
|
||||||
14
default.nix
14
default.nix
|
|
@ -1,14 +0,0 @@
|
||||||
(
|
|
||||||
import (
|
|
||||||
let
|
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
|
||||||
in
|
|
||||||
fetchTarball {
|
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/${
|
|
||||||
lock.nodes.flake-compat.locked.rev
|
|
||||||
}.tar.gz";
|
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
|
||||||
}
|
|
||||||
) {src = ./.;}
|
|
||||||
)
|
|
||||||
.defaultNix
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
}:
|
|
||||||
pkgs.devshell.mkShell {
|
|
||||||
imports = [(pkgs.devshell.importTOML ./devshell.toml)];
|
|
||||||
|
|
||||||
packages = [
|
|
||||||
pkgs.shfmt
|
|
||||||
pkgs.nodePackages.prettier
|
|
||||||
pkgs.nodePackages.prettier-plugin-toml
|
|
||||||
pkgs.alejandra
|
|
||||||
];
|
|
||||||
commands = [
|
|
||||||
{
|
|
||||||
package = pkgs.treefmt;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
devshell.startup.nodejs-setuphook = pkgs.lib.stringsWithDeps.noDepEntry ''
|
|
||||||
export NODE_PATH=${pkgs.nodePackages.prettier-plugin-toml}/lib/node_modules:$NODE_PATH
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
[[env]]
|
|
||||||
name = "QEMU_NET_OPTS"
|
|
||||||
value = "hostfwd=tcp::5443-:443"
|
|
||||||
|
|
||||||
[[env]]
|
|
||||||
name = "KUBECONFIG"
|
|
||||||
eval = "$DEVSHELL_ROOT/kubeconfig.json"
|
|
||||||
|
|
||||||
[devshell]
|
|
||||||
name = "kubenix"
|
|
||||||
packages = ["fd", "dive", "kube3d", "kubie", "k9s"]
|
|
||||||
|
|
||||||
[[commands]]
|
|
||||||
name = "evalnix"
|
|
||||||
help = "Check Nix parsing"
|
|
||||||
category = "checks"
|
|
||||||
command = "fd --extension nix --exec nix-instantiate --parse --quiet {} >/dev/null"
|
|
||||||
|
|
||||||
# K8s related tools
|
|
||||||
[[commands]]
|
|
||||||
package = "dive"
|
|
||||||
category = "k8s"
|
|
||||||
|
|
||||||
[[commands]]
|
|
||||||
package = "kubie"
|
|
||||||
category = "k8s"
|
|
||||||
|
|
||||||
[[commands]]
|
|
||||||
package = "k9s"
|
|
||||||
category = "k8s"
|
|
||||||
56
flake.lock
generated
56
flake.lock
generated
|
|
@ -1,58 +1,6 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"devshell": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1647857022,
|
|
||||||
"narHash": "sha256-Aw70NWLOIwKhT60MHDGjgWis3DP3faCzr6ap9CSayek=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "devshell",
|
|
||||||
"rev": "0a5ff74dacb9ea22614f64e61aeb3ca0bf0e7311",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "devshell",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1648199409,
|
|
||||||
"narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "64a525ee38886ab9028e6f61790de0832aa3ef03",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1642700792,
|
|
||||||
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1648297722,
|
"lastModified": 1648297722,
|
||||||
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
|
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
|
||||||
|
|
@ -85,9 +33,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell": "devshell",
|
"flake-utils": "flake-utils",
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
46
flake.nix
46
flake.nix
|
|
@ -1,17 +1,12 @@
|
||||||
{
|
{
|
||||||
description = "Kubernetes resource builder using nix";
|
description = "Kubernetes resource management with nix";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-compat.url = "github:edolstra/flake-compat";
|
|
||||||
flake-compat.flake = false;
|
|
||||||
|
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
flake-utils.inputs.nixpkgs.follows = "nixpgks";
|
|
||||||
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
flake-utils = {
|
||||||
devshell.url = "github:numtide/devshell";
|
url = "github:numtide/flake-utils";
|
||||||
devshell.inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
|
@ -25,7 +20,6 @@
|
||||||
pkgs = import inputs.nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
overlays = [
|
overlays = [
|
||||||
self.overlays.default
|
self.overlays.default
|
||||||
inputs.devshell.overlay
|
|
||||||
];
|
];
|
||||||
config.allowUnsupportedSystem = true;
|
config.allowUnsupportedSystem = true;
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
@ -72,10 +66,36 @@
|
||||||
|
|
||||||
jobs = import ./jobs {inherit pkgs;};
|
jobs = import ./jobs {inherit pkgs;};
|
||||||
|
|
||||||
devShells.default = import ./devshell {inherit pkgs inputs;};
|
devShells.default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
# formatters
|
||||||
|
alejandra
|
||||||
|
black
|
||||||
|
nodePackages.prettier
|
||||||
|
nodePackages.prettier-plugin-toml
|
||||||
|
shfmt
|
||||||
|
treefmt
|
||||||
|
|
||||||
|
# extra tools
|
||||||
|
dive
|
||||||
|
fd
|
||||||
|
k9s
|
||||||
|
kube3d
|
||||||
|
kubie
|
||||||
|
];
|
||||||
|
# KUBECONFIG = "kubeconfig.json";
|
||||||
|
NODE_PATH = "${pkgs.nodePackages.prettier-plugin-toml}/lib/node_modules:$NODE_PATH";
|
||||||
|
shellHook = ''
|
||||||
|
# check nix parsing
|
||||||
|
alias evalnix="fd --extension nix --exec nix-instantiate --parse --quiet {} >/dev/null"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
formatter = pkgs.treefmt;
|
||||||
|
|
||||||
packages =
|
packages =
|
||||||
inputs.flake-utils.lib.flattenTree {
|
inputs.flake-utils.lib.flattenTree
|
||||||
|
{
|
||||||
inherit (pkgs) kubernetes kubectl;
|
inherit (pkgs) kubernetes kubectl;
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
14
shell.nix
14
shell.nix
|
|
@ -1,14 +0,0 @@
|
||||||
(
|
|
||||||
import (
|
|
||||||
let
|
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
|
||||||
in
|
|
||||||
fetchTarball {
|
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/${
|
|
||||||
lock.nodes.flake-compat.locked.rev
|
|
||||||
}.tar.gz";
|
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
|
||||||
}
|
|
||||||
) {src = ./.;}
|
|
||||||
)
|
|
||||||
.shellNix
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue