Compare commits
5 Commits
24d89ed704
...
1b34841921
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1b34841921 | ||
![]() |
611904761e | ||
![]() |
f843b7924f | ||
![]() |
7bb7b89b82 | ||
![]() |
c1103775b6 |
@ -39,6 +39,8 @@
|
|||||||
./roles/bsnes
|
./roles/bsnes
|
||||||
./roles/ssh
|
./roles/ssh
|
||||||
./roles/python
|
./roles/python
|
||||||
|
./roles/docker
|
||||||
|
./roles/kubernetes
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
@ -92,7 +94,7 @@
|
|||||||
# Runs nix-collect-garbage --delete-older-than 5d
|
# Runs nix-collect-garbage --delete-older-than 5d
|
||||||
automatic = true;
|
automatic = true;
|
||||||
randomizedDelaySec = "14m";
|
randomizedDelaySec = "14m";
|
||||||
options = "--delete-older-than 5d";
|
options = "--delete-older-than 30d";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Use doas instead of sudo
|
# Use doas instead of sudo
|
||||||
|
39
nix/configuration/roles/docker/default.nix
Normal file
39
nix/configuration/roles/docker/default.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
virtualisation.docker.rootless = {
|
||||||
|
enable = true;
|
||||||
|
setSocketVariable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
directory = "/var/lib/docker";
|
||||||
|
user = "root";
|
||||||
|
group = "root";
|
||||||
|
mode = "0740";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
directory = ".local/share/docker";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0740";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -96,4 +96,16 @@
|
|||||||
# })
|
# })
|
||||||
# ];
|
# ];
|
||||||
|
|
||||||
|
# nixpkgs.overlays = [
|
||||||
|
# (final: prev: {
|
||||||
|
# gnupg = prev.gnupg.overrideAttrs (old: rec {
|
||||||
|
# version = "2.4.7";
|
||||||
|
# src = prev.fetchurl {
|
||||||
|
# url = "https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-${version}.tar.bz2";
|
||||||
|
# hash = "sha256-eyRwbk2n4OOwbKBoIxAnQB8jgQLEHJCWMTSdzDuF60Y=";
|
||||||
|
# };
|
||||||
|
# });
|
||||||
|
# })
|
||||||
|
# ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
43
nix/configuration/roles/kubernetes/default.nix
Normal file
43
nix/configuration/roles/kubernetes/default.nix
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
alias_kx = pkgs.writeShellScriptBin "kx" ''
|
||||||
|
exec ${pkgs.kubeswitch}/bin/switcher "''${@}"
|
||||||
|
'';
|
||||||
|
alias_ks = pkgs.writeShellScriptBin "ks" ''
|
||||||
|
exec ${pkgs.kubeswitch}/bin/switcher namespace "''${@}"
|
||||||
|
'';
|
||||||
|
alias_k = pkgs.writeShellScriptBin "k" ''
|
||||||
|
exec ${pkgs.kubectl}/bin/kubectl "''${@}"
|
||||||
|
'';
|
||||||
|
alias_ka = pkgs.writeShellScriptBin "ka" ''
|
||||||
|
exec ${pkgs.kubectl}/bin/kubectl "''${@}" --all-namespaces
|
||||||
|
'';
|
||||||
|
alias_kdel = pkgs.writeShellScriptBin "kdel" ''
|
||||||
|
exec ${pkgs.kubectl}/bin/kubectl delete --all "''${@}"
|
||||||
|
'';
|
||||||
|
alias_kd = pkgs.writeShellScriptBin "kd" ''
|
||||||
|
export KUBECTL_EXTERNAL_DIFF="${pkgs.colordiff}/bin/colordiff -N -u"
|
||||||
|
exec ${pkgs.kubectl}/bin/kubectl diff "''${@}"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
kubectl
|
||||||
|
kubeswitch
|
||||||
|
stern
|
||||||
|
alias_kx
|
||||||
|
alias_ks
|
||||||
|
alias_k
|
||||||
|
alias_ka
|
||||||
|
alias_kdel
|
||||||
|
alias_kd
|
||||||
|
];
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user