fix infinite recursion
This commit is contained in:
parent
c43390b443
commit
78dfe88c65
45
flake.nix
45
flake.nix
|
@ -44,16 +44,8 @@
|
||||||
vault-unseal.url = "git+https://git.0x76.dev/v/vault-unseal.git";
|
vault-unseal.url = "git+https://git.0x76.dev/v/vault-unseal.git";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = { self, nixpkgs, nixpkgs_22-11, vault-secrets, colmena
|
||||||
{ self
|
, nixos-generators, nur, nixvim, ... }@inputs:
|
||||||
, nixpkgs
|
|
||||||
, nixpkgs_22-11
|
|
||||||
, vault-secrets
|
|
||||||
, colmena
|
|
||||||
, nixos-generators
|
|
||||||
, nur
|
|
||||||
, ...
|
|
||||||
}@inputs:
|
|
||||||
let
|
let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
|
@ -87,8 +79,7 @@
|
||||||
source /etc/set-environment
|
source /etc/set-environment
|
||||||
nix repl --file "${./.}/repl.nix" $@
|
nix repl --file "${./.}/repl.nix" $@
|
||||||
'';
|
'';
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
# Make the nixosConfigurations for compat reasons (e.g. vault)
|
# Make the nixosConfigurations for compat reasons (e.g. vault)
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
(import (inputs.colmena + "/src/nix/hive/eval.nix") {
|
(import (inputs.colmena + "/src/nix/hive/eval.nix") {
|
||||||
|
@ -100,34 +91,20 @@
|
||||||
}).nodes;
|
}).nodes;
|
||||||
|
|
||||||
# Make the colmena configuration
|
# Make the colmena configuration
|
||||||
colmena = lib.foldr (el: acc: acc // util.mkColmenaHost el)
|
colmena = lib.foldr (el: acc: acc // util.mkColmenaHost el) {
|
||||||
{
|
meta = {
|
||||||
meta = {
|
inherit specialArgs;
|
||||||
inherit specialArgs;
|
nixpkgs = pkgs;
|
||||||
nixpkgs = pkgs;
|
};
|
||||||
};
|
} nixHosts;
|
||||||
}
|
|
||||||
nixHosts;
|
|
||||||
|
|
||||||
packages.${system} = {
|
packages.${system} = {
|
||||||
inherit apply-local;
|
inherit apply-local;
|
||||||
|
|
||||||
default = colmena.packages.${system}.colmena;
|
default = colmena.packages.${system}.colmena;
|
||||||
|
|
||||||
iso = nixos-generators.nixosGenerate {
|
|
||||||
inherit system pkgs;
|
|
||||||
format = "install-iso";
|
|
||||||
modules = [ (import ./nixos/templates/iso.nix) ];
|
|
||||||
};
|
|
||||||
|
|
||||||
iso-graphical = nixos-generators.nixosGenerate {
|
|
||||||
inherit system pkgs;
|
|
||||||
format = "install-iso";
|
|
||||||
modules = [ (import ./nixos/templates/iso-graphical.nix) ];
|
|
||||||
};
|
|
||||||
|
|
||||||
proxmox-lxc = nixos-generators.nixosGenerate {
|
proxmox-lxc = nixos-generators.nixosGenerate {
|
||||||
inherit pkgs;
|
inherit system pkgs specialArgs;
|
||||||
format = "proxmox-lxc";
|
format = "proxmox-lxc";
|
||||||
modules = util.base_imports
|
modules = util.base_imports
|
||||||
++ [ (import ./nixos/templates/proxmox-lxc.nix) ];
|
++ [ (import ./nixos/templates/proxmox-lxc.nix) ];
|
||||||
|
@ -135,7 +112,7 @@
|
||||||
|
|
||||||
# Broken
|
# Broken
|
||||||
# proxmox-vm = nixos-generators.nixosGenerate {
|
# proxmox-vm = nixos-generators.nixosGenerate {
|
||||||
# inherit system pkgs;
|
# inherit system pkgs specialArgs;
|
||||||
# format = "proxmox";
|
# format = "proxmox";
|
||||||
# modules = util.base_imports
|
# modules = util.base_imports
|
||||||
# ++ [ (import ./nixos/templates/proxmox-vm.nix) ];
|
# ++ [ (import ./nixos/templates/proxmox-vm.nix) ];
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }: {
|
|
||||||
imports = [ ./users ./modules ];
|
|
||||||
|
|
||||||
# Clean /tmp on boot.
|
|
||||||
boot.tmp.cleanOnBoot = true;
|
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = lib.mkDefault "Europe/Amsterdam";
|
|
||||||
|
|
||||||
# Systemd OOMd
|
|
||||||
# Fedora enables these options by default. See the 10-oomd-* files here:
|
|
||||||
# https://src.fedoraproject.org/rpms/systemd/tree/acb90c49c42276b06375a66c73673ac3510255
|
|
||||||
systemd.oomd = {
|
|
||||||
enableRootSlice = true;
|
|
||||||
enableUserServices = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Nix Settings
|
|
||||||
nix = {
|
|
||||||
package = pkgs.nixUnstable;
|
|
||||||
settings = {
|
|
||||||
auto-optimise-store = true;
|
|
||||||
trusted-users = [ "root" "victor" ];
|
|
||||||
substituters = [
|
|
||||||
"https://cachix.cachix.org"
|
|
||||||
"https://nix-community.cachix.org"
|
|
||||||
"https://nixpkgs-review-bot.cachix.org"
|
|
||||||
"https://colmena.cachix.org"
|
|
||||||
"https://cache.garnix.io"
|
|
||||||
"https://0x76-infra.cachix.org"
|
|
||||||
"https://webcord.cachix.org"
|
|
||||||
];
|
|
||||||
trusted-public-keys = [
|
|
||||||
"cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM="
|
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
||||||
"nixpkgs-review-bot.cachix.org-1:eppgiDjPk7Hkzzz7XlUesk3rcEHqNDozGOrcLc8IqwE="
|
|
||||||
"colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg="
|
|
||||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
|
||||||
"0x76-infra.cachix.org-1:dC1qp+VEN3jj5pdK4URlXR9hf3atT+MnpKGu6PZjMc8="
|
|
||||||
"webcord.cachix.org-1:l555jqOZGHd2C9+vS8ccdh8FhqnGe8L78QrHNn+EFEs="
|
|
||||||
];
|
|
||||||
};
|
|
||||||
optimise = {
|
|
||||||
automatic = true;
|
|
||||||
dates = [ "weekly" ];
|
|
||||||
};
|
|
||||||
gc = {
|
|
||||||
automatic = true;
|
|
||||||
dates = "weekly";
|
|
||||||
randomizedDelaySec = "3h";
|
|
||||||
options = "--delete-older-than 7d";
|
|
||||||
};
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
nixpkgs.config.permittedInsecurePackages =
|
|
||||||
[ "nodejs-14.21.3" "openssl-1.1.1t" "nodejs-16.20.0" ];
|
|
||||||
|
|
||||||
# Limit the systemd journal to 100 MB of disk or the
|
|
||||||
# last 7 days of logs, whichever happens first.
|
|
||||||
services.journald.extraConfig = ''
|
|
||||||
SystemMaxUse=100M
|
|
||||||
MaxFileSec=7day
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Enable SSH
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
PasswordAuthentication = lib.mkDefault false;
|
|
||||||
PermitRootLogin = lib.mkDefault "no";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Debloat
|
|
||||||
documentation = {
|
|
||||||
enable = lib.mkForce false;
|
|
||||||
doc.enable = lib.mkForce false;
|
|
||||||
man.enable = lib.mkForce false;
|
|
||||||
info.enable = lib.mkForce false;
|
|
||||||
nixos.enable = lib.mkForce false;
|
|
||||||
};
|
|
||||||
|
|
||||||
system.disableInstallerTools = lib.mkDefault true;
|
|
||||||
}
|
|
|
@ -1,17 +1,6 @@
|
||||||
{ inputs, lib, config, ... }: {
|
{ lib, pkgs, inputs, config, ... }: {
|
||||||
# This file deals with everything requiring `inputs`, the rest being delagated to `common.nix`
|
imports =
|
||||||
# this is because we can't import inputs from all contexts as that can lead to infinite recursion.
|
[ ./users ./modules inputs.vault-secrets.nixosModules.vault-secrets ];
|
||||||
imports = [ ./common.nix inputs.vault-secrets.nixosModules.vault-secrets ];
|
|
||||||
|
|
||||||
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
|
||||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
extraSpecialArgs = { inherit inputs; };
|
|
||||||
sharedModules = [ ./hm-modules inputs.nixvim.homeManagerModules.nixvim ];
|
|
||||||
};
|
|
||||||
|
|
||||||
vault-secrets = let
|
vault-secrets = let
|
||||||
inherit (config.networking) domain hostName;
|
inherit (config.networking) domain hostName;
|
||||||
|
@ -21,4 +10,99 @@
|
||||||
vaultAddress = "http://${server}.${domain}:8200/";
|
vaultAddress = "http://${server}.${domain}:8200/";
|
||||||
approlePrefix = "${domain}-${hostName}";
|
approlePrefix = "${domain}-${hostName}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
extraSpecialArgs = { inherit inputs; };
|
||||||
|
sharedModules = [ ./hm-modules inputs.nixvim.homeManagerModules.nixvim ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Clean /tmp on boot.
|
||||||
|
boot.tmp.cleanOnBoot = true;
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = lib.mkDefault "Europe/Amsterdam";
|
||||||
|
|
||||||
|
# Systemd OOMd
|
||||||
|
# Fedora enables these options by default. See the 10-oomd-* files here:
|
||||||
|
# https://src.fedoraproject.org/rpms/systemd/tree/acb90c49c42276b06375a66c73673ac3510255
|
||||||
|
systemd.oomd = {
|
||||||
|
enableRootSlice = true;
|
||||||
|
enableUserServices = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Nix Settings
|
||||||
|
nix = {
|
||||||
|
registry.nixpkgs.flake = inputs.nixpkgs;
|
||||||
|
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||||
|
package = pkgs.nixUnstable;
|
||||||
|
settings = {
|
||||||
|
auto-optimise-store = true;
|
||||||
|
trusted-users = [ "root" "victor" ];
|
||||||
|
substituters = [
|
||||||
|
"https://cachix.cachix.org"
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
"https://nixpkgs-review-bot.cachix.org"
|
||||||
|
"https://colmena.cachix.org"
|
||||||
|
"https://cache.garnix.io"
|
||||||
|
"https://0x76-infra.cachix.org"
|
||||||
|
"https://webcord.cachix.org"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM="
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
"nixpkgs-review-bot.cachix.org-1:eppgiDjPk7Hkzzz7XlUesk3rcEHqNDozGOrcLc8IqwE="
|
||||||
|
"colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg="
|
||||||
|
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||||
|
"0x76-infra.cachix.org-1:dC1qp+VEN3jj5pdK4URlXR9hf3atT+MnpKGu6PZjMc8="
|
||||||
|
"webcord.cachix.org-1:l555jqOZGHd2C9+vS8ccdh8FhqnGe8L78QrHNn+EFEs="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
optimise = {
|
||||||
|
automatic = true;
|
||||||
|
dates = [ "weekly" ];
|
||||||
|
};
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
randomizedDelaySec = "3h";
|
||||||
|
options = "--delete-older-than 7d";
|
||||||
|
};
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
nixpkgs.config.permittedInsecurePackages =
|
||||||
|
[ "nodejs-14.21.3" "openssl-1.1.1t" "nodejs-16.20.0" ];
|
||||||
|
|
||||||
|
# Limit the systemd journal to 100 MB of disk or the
|
||||||
|
# last 7 days of logs, whichever happens first.
|
||||||
|
services.journald.extraConfig = ''
|
||||||
|
SystemMaxUse=100M
|
||||||
|
MaxFileSec=7day
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Enable SSH
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PasswordAuthentication = lib.mkDefault false;
|
||||||
|
PermitRootLogin = lib.mkDefault "no";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Debloat
|
||||||
|
documentation = {
|
||||||
|
enable = lib.mkForce false;
|
||||||
|
doc.enable = lib.mkForce false;
|
||||||
|
man.enable = lib.mkForce false;
|
||||||
|
info.enable = lib.mkForce false;
|
||||||
|
nixos.enable = lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
system.disableInstallerTools = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ pkgs, modulesPath, lib, ... }: {
|
|
||||||
imports = [
|
|
||||||
"${modulesPath}/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix"
|
|
||||||
];
|
|
||||||
|
|
||||||
# use the latest Linux kernel
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ git ];
|
|
||||||
|
|
||||||
# Needed for https://github.com/NixOS/nixpkgs/issues/58959
|
|
||||||
boot.supportedFilesystems = lib.mkForce [ "btrfs" "ext4" ];
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
{ pkgs, modulesPath, lib, ... }: {
|
|
||||||
imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" ];
|
|
||||||
|
|
||||||
# use the latest Linux kernel
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ git ];
|
|
||||||
|
|
||||||
# Needed for https://github.com/NixOS/nixpkgs/issues/58959
|
|
||||||
boot.supportedFilesystems =
|
|
||||||
lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ];
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ lib, ... }: {
|
{ lib, ... }: {
|
||||||
imports = [ ../common/common.nix ../common/generic-lxc.nix ];
|
imports = [ ../common ../common/generic-lxc.nix ];
|
||||||
|
|
||||||
proxmoxLXC = {
|
proxmoxLXC = {
|
||||||
manageNetwork = true;
|
manageNetwork = true;
|
||||||
|
|
Loading…
Reference in a new issue