remove flake-compat and devshell inputs

This commit is contained in:
Bryton Hall 2022-08-13 00:09:36 -04:00
parent 21bdcb716b
commit 3b12406285
9 changed files with 37 additions and 158 deletions

9
.envrc
View file

@ -1,8 +1 @@
watch_file flake.nix flake.lock \
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
use flake

View file

@ -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.
nix develop -c treefmt
nix fmt
## Kubernetes versions

View file

@ -14,7 +14,7 @@ Apply all resources with
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:

View file

@ -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

View file

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

View file

@ -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
View file

@ -1,58 +1,6 @@
{
"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": {
"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": {
"lastModified": 1648297722,
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
@ -85,9 +33,7 @@
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}

View file

@ -1,17 +1,12 @@
{
description = "Kubernetes resource builder using nix";
description = "Kubernetes resource management with nix";
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";
devshell.url = "github:numtide/devshell";
devshell.inputs.nixpkgs.follows = "nixpkgs";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
@ -25,7 +20,6 @@
pkgs = import inputs.nixpkgs {
overlays = [
self.overlays.default
inputs.devshell.overlay
];
config.allowUnsupportedSystem = true;
inherit system;
@ -72,10 +66,36 @@
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 =
inputs.flake-utils.lib.flattenTree {
inputs.flake-utils.lib.flattenTree
{
inherit (pkgs) kubernetes kubectl;
}
// {

View file

@ -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