This commit is contained in:
GTrunSec 2022-04-02 13:18:09 -07:00
parent 60592d3096
commit 2f2a3be87d
No known key found for this signature in database
GPG key ID: 2368FAFA4ABDD2A0
4 changed files with 72 additions and 37 deletions

8
.envrc
View file

@ -1,2 +1,6 @@
watch_file devshell.toml flake.nix
use flake || use nix
watch_file flake.nix flake.lock \
modules/*
{
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

62
flake.lock generated
View file

@ -1,12 +1,16 @@
{
"nodes": {
"devshell-flake": {
"devshell": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1622013274,
"narHash": "sha256-mK/Lv0lCbl07dI5s7tR/7nb79HunKnJik3KyR6yeI2k=",
"lastModified": 1647857022,
"narHash": "sha256-Aw70NWLOIwKhT60MHDGjgWis3DP3faCzr6ap9CSayek=",
"owner": "numtide",
"repo": "devshell",
"rev": "e7faf69e6bf8546517cc936c7f6d31c7eb3abcb2",
"rev": "0a5ff74dacb9ea22614f64e61aeb3ca0bf0e7311",
"type": "github"
},
"original": {
@ -17,11 +21,26 @@
},
"flake-utils": {
"locked": {
"lastModified": 1620759905,
"narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=",
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1648297722,
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
"type": "github"
},
"original": {
@ -32,24 +51,41 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1622230509,
"narHash": "sha256-ybr8ufMIE1OVIG+S7cMihx1HlrJgTV3lLr/oW/LplTM=",
"lastModified": 1643381941,
"narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "190d0579fbb13e83756dc2e6df49a3b9221fbfa9",
"rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1648219316,
"narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devshell-flake": "devshell-flake",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"devshell": "devshell",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
}
}
},

View file

@ -3,33 +3,28 @@
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
devshell-flake.url = "github:numtide/devshell";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devshell.url = "github:numtide/devshell";
};
outputs = {
self,
nixpkgs,
flake-utils,
devshell-flake,
}:
(flake-utils.lib.eachDefaultSystem (
...
} @ inputs:
(inputs.flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlay
devshell-flake.overlay
];
config = {allowUnsupportedSystem = true;};
};
pkgs = inputs.nixpkgs.legacyPackages."${system}".appendOverlays [
self.overlay
inputs.devshell.overlay
];
lib = pkgs.lib;
kubenix = {
lib = import ./lib {inherit lib pkgs;};
evalModules = self.evalModules.${system};
modules = self.modules;
modules = self.nixosModules.kubenix;
};
# evalModules with same interface as lib.evalModules and kubenix as
@ -61,7 +56,7 @@
devshell.mkShell
{imports = [(devshell.importTOML ./devshell.toml)];};
packages = flake-utils.lib.flattenTree {
packages = inputs.flake-utils.lib.flattenTree {
inherit (pkgs) kubernetes kubectl;
};
@ -86,14 +81,14 @@
}
))
// {
modules = import ./modules;
nixosModules.kubenix = import ./modules;
overlay = final: prev: {
kubenix.evalModules = self.evalModules.${prev.system};
# up to date versions of their nixpkgs equivalents
kubernetes =
prev.callPackage ./pkgs/applications/networking/cluster/kubernetes
{};
kubectl = prev.callPackage ./pkgs/applications/networking/cluster/kubectl {};
# kubernetes =
# prev.callPackage ./pkgs/applications/networking/cluster/kubernetes
# {};
# kubectl = prev.callPackage ./pkgs/applications/networking/cluster/kubectl {};
};
};
}

View file

@ -40,7 +40,7 @@ let
in "${prefix}_${t.name}_test.py";
});
in pkgs.linkFarm "${testing.name}-tests" (
lib.imap0 op allEligibleTests;
lib.imap0 op allEligibleTests
);
testScript = pkgs.writeScript "test-${testing.name}.sh" ''