Skip to content

Commit 98d0d72

Browse files
committed
move files
1 parent beb6643 commit 98d0d72

File tree

14 files changed

+37
-165
lines changed

14 files changed

+37
-165
lines changed

.github/workflows/release-nixos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- main
66
paths:
7-
- 'playbook/**.yml'
7+
- 'nixos/**.yml'
88
- '!**.md'
99
- '!playbook/roles/paas/molecule/**'
1010
- 'packer/**'

flake.lock

+21-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+5-3
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@
7070
};
7171

7272
darwinModules = {
73-
base = ./nixos/darwin.nix;
73+
config = ./nixos-config/default.nix;
74+
os = ./nixos-darwin/configuration.nix;
7475
};
7576

7677
nixosModules = {
7778
common = srvos.nixosModules.common;
7879
server = srvos.nixosModules.server;
7980
home-manager = inputs.home-manager.nixosModules.home-manager;
80-
configuration = ./nixos/configuration.nix;
81+
os = ./nixos/configuration.nix;
82+
config = ./nixos-config/default.nix;
8183
};
8284

8385
darwinConfigurations = {
@@ -172,7 +174,7 @@
172174
packages = attrValues {
173175
inherit (pkgs) bashInteractive kubectl nil pebble jq grpcurl
174176
e2fsprogs coreutils libvirt qemu tailscale kubernetes-helm docker-client;
175-
inherit (stablePkgs) terraform nix-tree waypoint;
177+
inherit (stablePkgs) terraform nix-tree waypoint mitmproxy;
176178
};
177179
shellHook = ''
178180
export DOCKER_HOST=tcp://127.0.0.1:2375

k8s/waypoint/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,3 @@ output "token" {
102102
sensitive = true
103103
value = data.kubernetes_secret.waypoint_token.data.token
104104
}
105-

nixos/k3s-paas.nix nixos-config/default.nix

+3-10
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
options.k3s-paas = {
55

66
letsencrypt.crt = lib.mkOption {
7-
default = ./certs/local.pem;
8-
type = lib.types.path;
9-
description = "Lets encrypt root ca";
7+
default = ["https://localhost:15000/intermediates/0"] ;
8+
type = lib.types.list (lib.types.str);
9+
description = "Ca url to fetch and trust";
1010
};
1111

1212
dns.name = lib.mkOption {
@@ -51,17 +51,10 @@
5151
description = "K3s token";
5252
};
5353

54-
dex.http_scheme = lib.mkOption {
55-
default = "https";
56-
type = lib.types.str;
57-
description = "Http protocol for Dex in k3s-paas.";
58-
};
59-
6054
dex.dex_client_id = lib.mkOption {
6155
default = "client-id";
6256
type = lib.types.str;
6357
description = "Client ID for Dex";
6458
};
65-
6659
};
6760
}
File renamed without changes.
File renamed without changes.

nixos/darwin.nix nixos-darwin/configuration.nix

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{ pkgs, lib, config, ... }:
22
{
3-
imports = [
4-
"${builtins.toString ./.}/k3s-paas.nix"
5-
];
63
programs.fish.enable = true;
74
programs.bash.enable = true;
85
environment.systemPackages = [ pkgs.bashInteractive ];
@@ -70,8 +67,8 @@
7067
pebble = {
7168
listenAddress = "0.0.0.0:14000";
7269
managementListenAddress = "0.0.0.0:15000";
73-
certificate = pkgs.writeText "pebble-cert" (builtins.readFile ./certs/local.pem);
74-
privateKey = pkgs.writeText "pebble-key" (builtins.readFile ./certs/local-key.pem);
70+
certificate = pkgs.writeText "pebble-cert" (builtins.readFile ./certs/cert.pem);
71+
privateKey = pkgs.writeText "pebble-key" (builtins.readFile ./certs/key.pem);
7572
httpPort = 80;
7673
tlsPort = 443;
7774
ocspResponderURL = "";
@@ -98,7 +95,7 @@
9895
{
9996
virtualisation.docker.enable = true;
10097
virtualisation.docker.daemon.settings = {
101-
hosts = [ "tcp://127.0.0.1:2375" ];
98+
hosts = [ "tcp://0.0.0.0:2375" ];
10299
};
103100
networking.firewall.enable = lib.mkForce false;
104101
virtualisation.forwardPorts = lib.mkForce [

nixos/bashrc

-44
This file was deleted.

nixos/cert-manager.yaml

-16
This file was deleted.

nixos/certs/staging.pem

-32
This file was deleted.

nixos/configuration.nix

+4-9
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
}:
77

88
let
9-
dex_hostname = "${config.k3s-paas.dex.http_scheme}://dex.${config.k3s-paas.dns.name}";
9+
dex_hostname = "https://dex.${config.k3s-paas.dns.name}";
1010
k3sTokenFile = pkgs.writeText "token" config.k3s-paas.k3s.token;
11-
letsEncryptCa = with config.k3s-paas.letsencrypt; if crt != "" then [crt] else [];
11+
certs = builtins.map (url: builtins.fetchurl { url = url; }) config.k3s-paas.certs;
1212
certManagerCrds = builtins.fetchurl {
1313
url = "https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.crds.yaml";
1414
sha256 = "060bn3gvrr5jphaig1g195prip5rn0x1s7qrp09q47719fgc6636";
1515
};
1616
manifests = builtins.filter (d: d != "") [certManagerCrds];
1717
in {
18-
imports = [ ./k3s-paas.nix ];
19-
2018
console = {
2119
earlySetup = true;
2220
keyMap = "fr";
@@ -77,16 +75,13 @@ in {
7775
home-manager.users.${config.k3s-paas.user.name} = {
7876
xdg.enable = true;
7977
home.stateVersion = "23.05";
80-
home.file.".bashrc".source = lib.mkForce ./bashrc;
81-
home.file.".inputrc".source = ./inputrc;
8278
home.sessionVariables = {
8379
EDITOR = "vim";
8480
PAGER = "less -FirSwX";
8581
};
8682
programs.bash = {
8783
enable = true;
8884
historyControl = [ "ignoredups" "ignorespace" ];
89-
initExtra = "/home/${config.k3s-paas.user.name}/bashrc";
9085
};
9186
};
9287

@@ -145,7 +140,7 @@ in {
145140
useDHCP = false;
146141
firewall = {
147142
enable = true;
148-
allowedTCPPorts = lib.mkForce [80 443 22 6443 32701 9701];
143+
allowedTCPPorts = lib.mkForce [80 443 22 6443];
149144
};
150145
nftables.enable = true;
151146
networkmanager.enable = true;
@@ -157,7 +152,7 @@ in {
157152
wait-online.anyInterface = true;
158153
};
159154

160-
security.pki.certificateFiles = letsEncryptCa;
155+
security.pki.certificateFiles = certs;
161156

162157
nixpkgs = {
163158
config = {

nixos/inputrc

-22
This file was deleted.

outputs.tf

Whitespace-only changes.

0 commit comments

Comments
 (0)