heavy refactorings

feature/clan.lol
Ingolf Wagner 2024-03-03 14:56:49 +01:00
parent 5361e21b67
commit 68e599367f
Signed by: palo
GPG Key ID: 76BF5F1928B9618B
23 changed files with 126 additions and 176 deletions

View File

@ -322,6 +322,7 @@
sternchen = nixosConfigurationSetup { sternchen = nixosConfigurationSetup {
name = "sternchen"; name = "sternchen";
host = "sternchen.secret"; host = "sternchen.secret";
#host = "192.168.178.25";
modules = [ modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-x220 nixos-hardware.nixosModules.lenovo-thinkpad-x220
homeManagerModules homeManagerModules

View File

@ -0,0 +1,28 @@
{ config, lib, ... }:
with lib;
{
options.components.gui.cups.enable = mkOption {
type = lib.types.bool;
default = config.components.gui.enable;
};
config = mkIf (config.components.gui.cups.enable) {
hardware.printers.ensurePrinters = [
{
description = "Lexmark E350d";
deviceUri = "usb://Lexmark/E350d?serial=622Z9ZC";
location = "office";
name = "Lexmark_E350d";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
job-sheets = "none, none";
media = "na_letter_8.5x11in";
sides = "one-sided";
};
}
];
};
}

View File

@ -9,6 +9,7 @@ with lib;
# todo : structure with home-manager and such is not cool, create another structure # todo : structure with home-manager and such is not cool, create another structure
./audio.nix ./audio.nix
./browser.nix ./browser.nix
./cups.nix
./fonts.nix ./fonts.nix
./home-manager ./home-manager
./kmonad.nix ./kmonad.nix

View File

@ -9,10 +9,11 @@
let let
port = 721; port = 721;
hosts = { hosts = {
sternchen = "10.123.42.25"; cherry = "10.123.42.29";
sterni = "10.123.42.24";
cream = "10.123.42.27"; cream = "10.123.42.27";
robi = "10.123.42.123"; robi = "10.123.42.123";
sternchen = "10.123.42.25";
sterni = "10.123.42.24";
}; };
network = "secret"; network = "secret";
in in
@ -35,6 +36,10 @@ in
subnets = [{ address = hosts.cream; }]; subnets = [{ address = hosts.cream; }];
settings.Ed25519PublicKey = "Y/YRA90mAlNEmdhUWlUTHjjsco6d6hlvW11sPtarIdL"; settings.Ed25519PublicKey = "Y/YRA90mAlNEmdhUWlUTHjjsco6d6hlvW11sPtarIdL";
}; };
cherry = {
subnets = [{ address = hosts.cherry; }];
settings.Ed25519PublicKey = "BsPIrZjbzn0aryC0HO3OXSb4oFCMmzNDmMDQmxUXUuC";
};
sterni = { sterni = {
subnets = [{ address = hosts.sterni; }]; subnets = [{ address = hosts.sterni; }];
settings.Ed25519PublicKey = "r6mRDc814z2YtyG9ev/XXV2SgquqWR8n53V13xNXb7O"; settings.Ed25519PublicKey = "r6mRDc814z2YtyG9ev/XXV2SgquqWR8n53V13xNXb7O";

View File

@ -8,6 +8,9 @@ with lib;
config = mkIf (config.components.terminal.zsh.enable) { config = mkIf (config.components.terminal.zsh.enable) {
# root uses zsh on default
users.users.root.shell = pkgs.zsh;
programs.zsh = { programs.zsh = {
enable = true; enable = true;

View File

@ -9,6 +9,7 @@
./packages ./packages
./ssh.nix ./ssh.nix
./stylix.nix ./stylix.nix
./tmux.nix
./vim.nix ./vim.nix
./yubikey.nix ./yubikey.nix
./zellij.nix ./zellij.nix

View File

@ -7,102 +7,44 @@ with lib;
(mkIf config.gui.enable { (mkIf config.gui.enable {
home.packages = home.packages = [
let
# to make copilot work # general
# jetbrains.pycharm-professional unstable.jetbrains.idea-ultimate
#fhsPyCharm = pkgs.buildFHSUserEnv { #vscode
# name = "pycharm";
# targetPkgs = pkgs: (with pkgs; [
# black
# isort
# #unstable.jetbrains.pycharm-professional
# jetbrains.pycharm-professional
# python311
# pipenv
# zlib # needed for NumPy
# nodejs
# git
# ]);
# runScript = "pycharm-professional";
#};
# jetbrains.datagrip jetbrains.mps
#fhsDataGrip = pkgs.buildFHSUserEnv {
# name = "datagrip";
# targetPkgs = pkgs: (with pkgs; [
# unstable.jetbrains.datagrip
# ]);
# runScript = "datagrip";
#};
#fhsClion = pkgs.buildFHSUserEnv { unstable.jetbrains.datagrip
# name = "clion";
# targetPkgs = pkgs: (with pkgs; [
# unstable.jetbrains.clion
# ]);
# runScript = "clion";
#};
in # Rust
[ # ----
unstable.jetbrains.clion
gcc
rustup
# general # Python
unstable.jetbrains.idea-ultimate # ------
#vscode unstable.jetbrains.pycharm-professional
jetbrains.mps # planing
((ganttproject-bin.override {
jre = pkgs.openjdk11;
}).overrideAttrs (old: {
version = "3.1.3100";
src = pkgs.fetchzip {
url = "https://dl.ganttproject.biz/ganttproject-3.1.3100/ganttproject-3.1.3100.zip";
sha256 = "sha256-hw2paak0P670/kemiuqYHIaN0uUtkVKy+AX2X7OdnJ4=";
};
}))
unstable.jetbrains.datagrip mermaid-cli
#fhsDataGrip
#(pkgs.makeDesktopItem {
# name = "datagrip";
# desktopName = "DataGrip";
# exec = "${fhsDataGrip}/bin/datagrip";
# terminal = false;
#})
# Rust ];
unstable.jetbrains.clion
#fhsClion
#(pkgs.makeDesktopItem {
# name = "clion";
# desktopName = "Clion";
# exec = "${fhsClion}/bin/clion";
# terminal = false;
#})
gcc
rustup
# python
unstable.jetbrains.pycharm-professional
#fhsPyCharm
#(pkgs.makeDesktopItem {
# name = "pycharm";
# desktopName = "PyCharm";
# exec = "${fhsPyCharm}/bin/pycharm";
# terminal = false;
#})
# planing
((ganttproject-bin.override {
jre = pkgs.openjdk11;
}).overrideAttrs (old: {
version = "3.1.3100";
src = pkgs.fetchzip {
url = "https://dl.ganttproject.biz/ganttproject-3.1.3100/ganttproject-3.1.3100.zip";
sha256 = "sha256-hw2paak0P670/kemiuqYHIaN0uUtkVKy+AX2X7OdnJ4=";
};
}))
mermaid-cli
];
}) })
{ {
home.packages = home.packages =
let let
pandocScript = { inputFormat, outputFormat }: pandocScript = { inputFormat, outputFormat }:
@ -116,7 +58,7 @@ with lib;
in in
[ [
# smoke lnav
tmux tmux
@ -160,6 +102,16 @@ with lib;
nixpkgs-fmt nixpkgs-fmt
treefmt treefmt
(pkgs.writers.writeBashBin "ssl-check-cert-of-domain" ''
DOMAIN=$1
echo | \
${pkgs.openssl}/bin/openssl s_client -servername ''${DOMAIN} -connect ''${DOMAIN}:443 2>/dev/null | \
${pkgs.openssl}/bin/openssl x509 -text | \
${pkgs.less}/bin/less
'')
] ++ (map pandocScript (lib.cartesianProductOfSets { ] ++ (map pandocScript (lib.cartesianProductOfSets {
inputFormat = [ "man" "markdown" "mediawiki" "asciidoc" ]; inputFormat = [ "man" "markdown" "mediawiki" "asciidoc" ];
outputFormat = [ "mediawiki" "docbook5" "html5" "man" "jira" "markdown" ]; outputFormat = [ "mediawiki" "docbook5" "html5" "man" "jira" "markdown" ];

14
nixos/homes/palo/tmux.nix Normal file
View File

@ -0,0 +1,14 @@
{ pkgs, ... }:
with pkgs;
{
programs.tmux = {
enable = true;
aggressiveResize = true;
baseIndex = 1;
clock24 = true;
historyLimit = 150000;
keyMode = "vi";
mouse = true;
secureSocket = true;
};
}

View File

@ -4,4 +4,5 @@
../palo/doom-emacs.nix ../palo/doom-emacs.nix
]; ];
gui.enable = false; gui.enable = false;
} }

View File

@ -3,16 +3,13 @@
imports = [ imports = [
../../modules
../../components ../../components
../../modules
./disko-config.nix ./hardware-configuration
./hardware-configuration.nix
./syncthing.nix ./syncthing.nix
./cups.nix
./tinc.nix ./tinc.nix
#./tinc_retiolum.nix
./qemu.nix ./qemu.nix
./wireguard.nix ./wireguard.nix

View File

@ -1,16 +0,0 @@
{
hardware.printers.ensurePrinters = [
{
description = "Lexmark E350d";
deviceUri = "usb://Lexmark/E350d?serial=622Z9ZC";
location = "office";
name = "Lexmark_E350d";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
job-sheets = "none, none";
media = "na_letter_8.5x11in";
sides = "one-sided";
};
}
];
}

View File

@ -0,0 +1,26 @@
{ lib, config, ... }:
{
imports = [
./disko-config.nix
./hardware-configuration.nix
];
boot.tmp.useTmpfs = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# ZFS stuff
# ---------
boot.supportedFilesystems = [ "zfs" ];
# head -c4 /dev/urandom | od -A none -t x4
networking.hostId = "59e38471";
services.zfs.autoSnapshot.enable = true;
# todo not needed anymore if srvos is used
# ZFS already has its own scheduler. Without this my(@Artturin) computer froze for a second when i nix build something.
# copied from : https://github.com/numtide/srvos/blob/main/nixos/common/zfs.nix
services.udev.extraRules = lib.optionalString (config.boot.zfs.enabled) ''
ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="zfs_member", ATTR{../queue/scheduler}="none"
'';
}

View File

@ -1,24 +1,6 @@
# nix run github:nix-community/disko -- --mode zap_create_mount ./disko-config.nix
# nixos-generate-config --no-filesystems --root /mnt
{ config, lib, ... }: { config, lib, ... }:
{ {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.tmp.useTmpfs = true; # make /tmp a tmpfs (performance!)
# ZFS stuff
# ---------
boot.supportedFilesystems = [ "zfs" ];
# head -c4 /dev/urandom | od -A none -t x4
networking.hostId = "59e38471";
services.zfs.autoSnapshot.enable = true;
# ZFS already has its own scheduler. Without this my(@Artturin) computer froze for a second when i nix build something.
# copied from : https://github.com/numtide/srvos/blob/main/nixos/common/zfs.nix
services.udev.extraRules = lib.optionalString (config.boot.zfs.enabled) ''
ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="zfs_member", ATTR{../queue/scheduler}="none"
'';
# disko configuration # disko configuration
# ------------------- # -------------------
disko.devices = { disko.devices = {

View File

@ -84,8 +84,6 @@
networking.hostName = "chungus"; networking.hostName = "chungus";
users.users.root.shell = pkgs.zsh;
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [

View File

@ -9,7 +9,6 @@
./hardware-configuration.nix ./hardware-configuration.nix
./syncthing.nix ./syncthing.nix
./cups.nix
./tinc.nix ./tinc.nix
./tinc_retiolum.nix ./tinc_retiolum.nix

View File

@ -1,16 +0,0 @@
{
hardware.printers.ensurePrinters = [
{
description = "Lexmark E350d";
deviceUri = "usb://Lexmark/E350d?serial=622Z9ZC";
location = "office";
name = "Lexmark_E350d";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
job-sheets = "none, none";
media = "na_letter_8.5x11in";
sides = "one-sided";
};
}
];
}

View File

@ -52,21 +52,17 @@
networking.hostName = "orbi"; networking.hostName = "orbi";
components.terminal.enable = true; components.terminal.enable = true;
components.mainUser.enable = true; components.mainUser.enable = true;
components.gui.enable = false; components.gui.enable = false;
components.network.enable = true; components.network.enable = true;
components.network.wifi.enable = false; components.network.wifi.enable = false;
users.users.root.shell = pkgs.zsh;
security.acme.acceptTerms = true; security.acme.acceptTerms = true;
security.acme.defaults.email = "contact@ingolf-wagner.de"; security.acme.defaults.email = "contact@ingolf-wagner.de";
# todo create your own
sops.defaultSopsFile = ../../secrets/robi.yaml; sops.defaultSopsFile = ../../secrets/robi.yaml;
services.smartd.enable = true;
} }

View File

@ -34,6 +34,8 @@ in
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
services.smartd.enable = true;
# Use GRUB2 as the boot loader. # Use GRUB2 as the boot loader.
# We don't use systemd-boot because Hetzner uses BIOS legacy boot. # We don't use systemd-boot because Hetzner uses BIOS legacy boot.
boot.loader.grub = { boot.loader.grub = {

View File

@ -4,7 +4,6 @@ let
disks = [ "sda" "sdb" ]; disks = [ "sda" "sdb" ];
in in
{ {
disko.devices = { disko.devices = {
disk = disk =
lib.genAttrs disks (disk: { lib.genAttrs disks (disk: {

View File

@ -66,11 +66,6 @@
services.sshguard.enable = true; services.sshguard.enable = true;
# Shell configuration
# -------------------
#programs.custom. zsh.enable = true;
users.users.root.shell = pkgs.zsh;
security.acme.acceptTerms = true; security.acme.acceptTerms = true;
security.acme.defaults.email = "contact@ingolf-wagner.de"; security.acme.defaults.email = "contact@ingolf-wagner.de";

View File

@ -11,8 +11,6 @@
./syncthing.nix ./syncthing.nix
./tinc.nix ./tinc.nix
./cups.nix
]; ];
sops.defaultSopsFile = ../../secrets/sternchen.yaml; sops.defaultSopsFile = ../../secrets/sternchen.yaml;

View File

@ -1,16 +0,0 @@
{
hardware.printers.ensurePrinters = [
{
description = "Lexmark E350d";
deviceUri = "usb://Lexmark/E350d?serial=622Z9ZC";
location = "office";
name = "Lexmark_E350d";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
job-sheets = "none, none";
media = "na_letter_8.5x11in";
sides = "one-sided";
};
}
];
}