mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-13 00:20:07 +01:00
ref: non-flake compatibility
since this is purely a legacy concern (both default.nix and shell.nix), we avoid to include the flake-compat as a flake input. (even though unused inputs are lazily fetched - for style & clarity)
This commit is contained in:
parent
ded0db9e3f
commit
ee9b4adfc8
7 changed files with 36 additions and 70 deletions
8
default.nix
Normal file
8
default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ system ? builtins.currentSystem }:
|
||||||
|
let
|
||||||
|
in (
|
||||||
|
(import ./lib/compat.nix).flake-compat {
|
||||||
|
src = ./.;
|
||||||
|
inherit system;
|
||||||
|
}
|
||||||
|
).defaultNix
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ kubenix ? import ./.. { } }:
|
{ kubenix ? (import ./.. { }).default }:
|
||||||
|
|
||||||
{
|
{
|
||||||
nginx-deployment = import ./nginx-deployment { inherit kubenix; };
|
nginx-deployment = import ./nginx-deployment { inherit kubenix; };
|
||||||
|
|
|
||||||
35
flake.lock
generated
35
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"devshell-flake": {
|
"devshell-flake": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1620641550,
|
"lastModified": 1622013274,
|
||||||
"narHash": "sha256-o359KdI/LNiPL6EbirONff2MOvZHtZr9MgYx3R9oVFk=",
|
"narHash": "sha256-mK/Lv0lCbl07dI5s7tR/7nb79HunKnJik3KyR6yeI2k=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "devshell",
|
"repo": "devshell",
|
||||||
"rev": "a47493423092f6c4c0a7eb605a7cd515a77db4a8",
|
"rev": "e7faf69e6bf8546517cc936c7f6d31c7eb3abcb2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -15,29 +15,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1606424373,
|
|
||||||
"narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1605370193,
|
"lastModified": 1620759905,
|
||||||
"narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=",
|
"narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5021eac20303a61fafe17224c087f5519baed54d",
|
"rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -48,11 +32,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1609233094,
|
"lastModified": 1622230509,
|
||||||
"narHash": "sha256-Ltzng3h4LDNjYAvmoX0kQ3023TvdupwuMvm1D7hZkyY=",
|
"narHash": "sha256-ybr8ufMIE1OVIG+S7cMihx1HlrJgTV3lLr/oW/LplTM=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2b556ea6712cd4fa76a433093df0cb375a267e3d",
|
"rev": "190d0579fbb13e83756dc2e6df49a3b9221fbfa9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -64,7 +48,6 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell-flake": "devshell-flake",
|
"devshell-flake": "devshell-flake",
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
flake.nix
19
flake.nix
|
|
@ -5,12 +5,9 @@
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||||
devshell-flake.url = "github:numtide/devshell";
|
devshell-flake.url = "github:numtide/devshell";
|
||||||
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, devshell-flake, flake-compat }:
|
outputs = { self, nixpkgs, flake-utils, devshell-flake }:
|
||||||
{ modules = import ./modules; }
|
|
||||||
//
|
|
||||||
(flake-utils.lib.eachDefaultSystem
|
(flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let
|
let
|
||||||
|
|
@ -27,29 +24,23 @@
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
devShell = with pkgs; devshell.mkShell
|
devShell = with pkgs; devshell.mkShell
|
||||||
{
|
{ imports = [ (devshell.importTOML ./devshell.toml) ]; };
|
||||||
imports = [
|
|
||||||
(devshell.importTOML ./devshell.toml)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
packages = flake-utils.lib.flattenTree {
|
packages = flake-utils.lib.flattenTree {
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
kubenix
|
|
||||||
kubernetes
|
kubernetes
|
||||||
kubectl
|
kubectl
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
hydraJobs = {
|
defaultPackage = pkgs.kubenix;
|
||||||
inherit packages;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
) //
|
) //
|
||||||
{
|
{
|
||||||
|
modules = import ./src/modules;
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
kubenix = prev.callPackage ./kubenix.nix { };
|
kubenix = prev.callPackage ./src/kubenix.nix { };
|
||||||
# up to date versions of their nixpkgs equivalents
|
# up to date versions of their nixpkgs equivalents
|
||||||
kubernetes = prev.callPackage ./pkgs/applications/networking/cluster/kubernetes
|
kubernetes = prev.callPackage ./pkgs/applications/networking/cluster/kubernetes
|
||||||
{ };
|
{ };
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,6 @@
|
||||||
let
|
{
|
||||||
inherit (builtins)
|
flake-compat = import (builtins.fetchurl {
|
||||||
fetchTarball
|
url = "https://raw.githubusercontent.com/edolstra/flake-compat/99f1c2157fba4bfe6211a321fd0ee43199025dbf/default.nix";
|
||||||
fromJSON
|
sha256 = "1vas5z58901gavy5d53n1ima482yvly405jp9l8g07nr4abmzsyb";
|
||||||
readFile
|
});
|
||||||
;
|
|
||||||
lockfile = fromJSON (readFile ../flake.lock);
|
|
||||||
in
|
|
||||||
input:
|
|
||||||
let
|
|
||||||
locked = lockfile.nodes."${input}".locked;
|
|
||||||
inherit (locked) rev narHash owner repo;
|
|
||||||
in
|
|
||||||
fetchTarball {
|
|
||||||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
|
|
||||||
sha256 = narHash;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
shell.nix
17
shell.nix
|
|
@ -1,13 +1,8 @@
|
||||||
(import
|
{ system ? builtins.currentSystem }:
|
||||||
(
|
|
||||||
let
|
let
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
in (
|
||||||
in
|
(import ./lib/compat.nix).flake-compat {
|
||||||
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 = ./.;
|
src = ./.;
|
||||||
}).shellNix
|
inherit system;
|
||||||
|
}
|
||||||
|
).shellNix
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{ pkgs ? import <nixpkgs> { }
|
{ pkgs ? import <nixpkgs> { }
|
||||||
, lib ? pkgs.lib
|
, lib ? pkgs.lib
|
||||||
, kubenix ? import ../. { inherit pkgs lib; }
|
, kubenix ? (import ../. { }).default
|
||||||
|
|
||||||
, nixosPath ? toString <nixpkgs/nixos>
|
, nixosPath ? toString <nixpkgs/nixos>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue