Moved hosts configurations to instances

This commit is contained in:
Filippo Berto 2023-07-19 11:04:29 +01:00
parent 4d706138d6
commit cbe62f3201
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
24 changed files with 344 additions and 344 deletions

View file

@ -0,0 +1,282 @@
{ pkgs, config, ... }: {
boot = {
growPartition = true;
kernelParams = [ "console=ttyS0" "panic=1" "boot.panic_on_fail" ];
initrd.kernelModules = [ "virtio_scsi" ];
kernelModules = [ "virtio_pci" "virtio_net" ];
loader = {
grub.device = "/dev/vda";
timeout = 0;
grub.configurationLimit = 0;
};
};
console = {
font = "Lat2-Terminus16";
keyMap = "it";
};
environment = {
pathsToLink = [ "/share/zsh" ];
systemPackages =
builtins.attrValues { inherit (pkgs) helix kitty tmux vim; };
};
i18n.defaultLocale = "it_IT.UTF-8";
programs = {
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
zsh.enable = true;
};
networking.hostName = "baldur";
time.timeZone = "Europe/Rome";
services = {
avahi = {
enable = true;
openFirewall = true;
allowInterfaces = [ "ztmjfdwjkp" ];
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
userServices = true;
workstation = true;
};
extraServiceFiles = {
ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
};
fail2ban = {
enable = true;
bantime-increment.enable = true;
jails = {
"nginx-botsearch" = ''
filter = nginx-botsearch
action = nftables-multiport[name=HTTP, port="http,https"]
logpath = /var/log/nginx/error.log*
backend = auto
'';
"nginx-http-auth" = ''
filter = nginx-http-auth
action = nftables-multiport[name=HTTP, port="http,https"]
logpath = /var/log/nginx/error.log*
backend = auto
'';
};
};
nginx = {
enable = true;
recommendedProxySettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedTlsSettings = true;
virtualHosts =
let
ssl = {
enableACME = true;
forceSSL = true;
};
loki_ipv4 = "172.23.254.55";
freya_ipv4 = "172.23.18.147";
in
{
"unimi.bertof.net" = ssl // {
locations."/".extraConfig =
"rewrite ^/(.*)$ https://homes.di.unimi.it/berto/$1 redirect ;";
};
"home-assistant.bertof.net" = ssl // {
locations."/" = {
proxyPass = "http://${loki_ipv4}:8123/";
proxyWebsockets = true;
};
extraConfig = ''
proxy_pass_header Authorization;
proxy_buffering off;
'';
};
"radarr.bertof.net" = ssl // {
locations."/" = {
proxyPass = "http://${loki_ipv4}:7878/";
proxyWebsockets = true;
};
};
"sonarr.bertof.net" = ssl // {
locations."/" = {
proxyPass = "http://${loki_ipv4}:8989/";
proxyWebsockets = true;
};
};
"jellyfin.bertof.net" = ssl // {
locations."/" = {
proxyPass = "http://${loki_ipv4}:8096/";
proxyWebsockets = true;
};
};
"my-nextcloud.bertof.net" = ssl // {
locations."/" = {
proxyPass = "http://${freya_ipv4}:80/";
proxyWebsockets = true;
};
};
};
};
openssh = {
enable = true;
openFirewall = true;
};
# wgautomesh = {
# enable = true;
# settings = {
# interface = "wg0";
# };
# };
};
security.acme = {
acceptTerms = true;
defaults.email = "filippo.berto95@gmail.com";
};
users.users.bertof = {
isNormalUser = true;
extraGroups = [
"audio"
"input"
"docker"
"libvirtd"
"network"
"networkmanager"
"usb"
"video"
"wheel"
];
shell = pkgs.zsh;
};
boot.kernel.sysctl = {
"net.ipv4.conf.all.forwarding" = true;
"net.ipv4.conf.default.forwarding" = true;
};
services.dnsmasq = {
enable = true;
settings = {
server = [ "1.1.1.1" "8.8.8.8" ];
interface = "wg0";
};
# extraConfig = ''
# interface=wg0
# '';
};
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [ 80 443 53 ];
allowedUDPPorts = [ 53 51820 ];
# interfaces.ens3.allowedTCPPorts = [ 52123 53 ];
# interfaces.ens3.allowedUDPPorts = [ 53 ];
# extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns'';
};
nat = {
enable = true;
enableIPv6 = true;
externalInterface = "ens3";
internalInterfaces = [ "wg0" ];
};
# wireguard = {
# enable = true;
# interfaces.wg0 = {
# privateKeyFile = config.age.secrets.baldur_wg_priv.path;
# ips = [ "10.10.10.1/24" "fc10:10:10::1/64" ];
# listenPort = 52123;
# # # This allows the wireguard server to route your traffic to the internet and hence be like a VPN
# # postSetup = ''
# # ${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -j ACCEPT
# # ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.10.10.1/24 -o ens3 -j MASQUERADE
# # ${pkgs.iptables}/bin/ip6tables -A FORWARD -i wg0 -j ACCEPT
# # ${pkgs.iptables}/bin/ip6tables -t nat -A POSTROUTING -s fc10:10:10::1/64 -o ens3 -j MASQUERADE
# # '';
# # # Undo the above
# # postShutdown = ''
# # ${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -j ACCEPT
# # ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.10.10.1/24 -o ens3 -j MASQUERADE
# # ${pkgs.iptables}/bin/ip6tables -D FORWARD -i wg0 -j ACCEPT
# # ${pkgs.iptables}/bin/ip6tables -t nat -D POSTROUTING -s fc10:10:10::1/64 -o ens3 -j MASQUERADE
# # '';
# peers = [
# # {
# # # baldur
# # allowedIPs = [ "10.10.10.2/32" "fc10:10:10::2/128" ];
# # publicKey = "K57ikgFSR1O0CXWBxfQEu7uxSOsp3ePj/NMRets5pVc=";
# # presharedKeyFile = config.age.secrets.baldur_wg_psk.path;
# # }
# {
# # odin
# allowedIPs = [ "10.10.10.2/32" "fc10:10:10::2/128" ];
# publicKey = "LDBhvzeYmHJ0z5ch+N559GWjT3It1gZvGR/9WtCfURw=";
# # presharedKeyFile = config.age.secrets.odin_wg_psk.path;
# }
# ];
# };
# };
wg-quick.interfaces.wg0 = {
address = [ "10.0.0.1/24" "fdc9:281f:04d7:9ee9::1/64" ];
listenPort = 51820;
privateKeyFile = config.age.secrets.baldur_wg_priv.path;
# This allows the wireguard server to route your traffic to the internet and hence be like a VPN
postUp = ''
${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.0.0.1/24 -o ens3 -j MASQUERADE
${pkgs.iptables}/bin/ip6tables -A FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/ip6tables -t nat -A POSTROUTING -s fdc9:281f:04d7:9ee9::1/64 -o ens3 -j MASQUERADE
'';
# Undo the above
preDown = ''
${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.0.0.1/24 -o ens3 -j MASQUERADE
${pkgs.iptables}/bin/ip6tables -D FORWARD -i wg0 -j ACCEPT
${pkgs.iptables}/bin/ip6tables -t nat -D POSTROUTING -s fdc9:281f:04d7:9ee9::1/64 -o ens3 -j MASQUERADE
'';
peers = [
{
# odin
publicKey = "LDBhvzeYmHJ0z5ch+N559GWjT3It1gZvGR/9WtCfURw=";
presharedKeyFile = config.age.secrets.wg_psk.path;
allowedIPs = [ "10.0.0.2/32" "fdc9:281f:04d7:9ee9::2/128" ];
}
{
# oppo
publicKey = "OBk6bHKuIYLwD7cwjmAuMn57jXqbDwCL52jhQxiHnnA=";
presharedKeyFile = config.age.secrets.wg_psk.path;
allowedIPs = [ "10.0.0.3/32" "fdc9:281f:04d7:9ee9::3/128" ];
}
{
# thor
publicKey = "rpwR6n4IE96VZAmQDBufsWE/a9G7d8fpkvY1OwsbOhk=";
presharedKeyFile = config.age.secrets.wg_psk.path;
allowedIPs = [ "10.0.0.4/32" "fdc9:281f:04d7:9ee9::4/128" ];
}
];
};
};
system.stateVersion = "22.11";
}

View file

@ -0,0 +1,19 @@
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/7fa05ac4-8e10-4994-bb7d-4be88e4a6696";
fsType = "ext4";
};
swapDevices = [ ];
}

30
instances/baldur/hm.nix Normal file
View file

@ -0,0 +1,30 @@
{ pkgs, ... }: {
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" "grp:menu_toggle" ];
};
packages = builtins.attrValues { inherit (pkgs) nix-prefetch-scripts; };
};
imports = [
../../modules/hm/__basic.nix
# ../../modules/hm/development/cpp.nix
# ../../modules/hm/development/data.nix
# ../../modules/hm/development/go.nix
# ../../modules/hm/development/javascript.nix
# ../../modules/hm/development/latex.nix
# ../../modules/hm/development/python.nix
# ../../modules/hm/development/rust.nix
# ../../modules/hm/fonts.nix
../../modules/hm/helix.nix
# ../../modules/hm/kitty.nix
# ../../modules/hm/lf.nix
# ../../modules/hm/megasync.nix
# ../../modules/hm/noti.nix
];
home.stateVersion = "22.05";
}

View file

@ -0,0 +1,97 @@
{ pkgs, ... }: {
console = { font = "Lat2-Terminus16"; keyMap = "it"; };
environment = {
pathsToLink = [ "/share/zsh" ];
systemPackages = builtins.attrValues { inherit (pkgs) helix tmux vim; };
};
hardware = {
bluetooth = { enable = true; package = pkgs.bluezFull; };
opengl = { enable = true; driSupport = true; };
raspberry-pi."4" = {
# audio.enable = true; # AUDIO
# fkms-3d.enable = true; # GPU
};
};
i18n.defaultLocale = "it_IT.UTF-8";
networking.hostName = "freya";
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
# 445 # SAMBA
# 139 # SAMBA
# 5357 # SAMBA-WSDD
# 8123 # HOME ASSISTANT
8384 # SYNCTHING
# 8385 # SYNCTHING
];
allowedUDPPorts = [
137 # SYNCTHING
138 # SYNCTHING
# 3702 # SAMBA-WSDD
];
# extraCommands =
# "iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
};
programs = {
dconf.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
zsh.enable = true;
};
security.sudo.extraConfig = ''
Defaults pwfeedback
'';
services = {
avahi = {
enable = true;
openFirewall = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
userServices = true;
workstation = true;
};
extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
blueman.enable = true;
dbus.packages = [ pkgs.dconf ];
gnome.gnome-keyring.enable = true;
openssh = { enable = true; openFirewall = true; };
# xserver = {
# enable = true;
# desktopManager.retroarch = { enable = true; package = pkgs.retroarchFull; };
# };
};
time.timeZone = "Europe/Rome";
users.users = {
bertof = {
isNormalUser = true;
extraGroups = [
"audio"
"input"
"docker"
"libvirtd"
"network"
"networkmanager"
"usb"
"video"
"wheel"
];
shell = pkgs.zsh;
};
};
system.stateVersion = "22.11";
}

View file

@ -0,0 +1,31 @@
{ lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "uas" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.networkmanager.enable = lib.mkDefault true;
# networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
# networking.interfaces.ztmjfdwjkp.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
}

27
instances/freya/hm.nix Normal file
View file

@ -0,0 +1,27 @@
{ pkgs, ... }: {
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
};
packages = builtins.attrValues {
inherit (pkgs)
cava gallery-dl procps wireguard-tools httpie;
};
};
imports = [
../../modules/hm/__basic.nix
../../modules/hm/cava.nix
../../modules/hm/dunst.nix
../../modules/hm/helix.nix
../../modules/hm/kitty.nix
../../modules/hm/lf.nix
../../modules/hm/spotifyd.nix
../../modules/hm/syncthing.nix
# ../../modules/hm/xidlehook.nix
];
home.stateVersion = "22.11";
}

View file

@ -0,0 +1,527 @@
{ pkgs, lib, ... }:
with lib; {
boot = {
binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
# kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
console = {
font = "Lat2-Terminus16";
keyMap = "it";
};
environment = {
pathsToLink = [ "/share/zsh" ];
systemPackages = builtins.attrValues { inherit (pkgs) kakoune tmux vim; };
};
hardware = {
enableRedistributableFirmware = true;
# nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
# nvidia.nvidiaPersistenced = true; # HEADLESS
# nvidia.prime = {
# offload.enable = false;
# sync.enable = true;
# intelBusId = "PCI:0:2:0";
# nvidiaBusId = "PCI:1:0:0";
# };
opengl = {
enable = true;
extraPackages = builtins.attrValues {
inherit (pkgs) intel-media-driver libvdpau-va-gl vaapiIntel vaapiVdpau;
};
};
bluetooth = { enable = true; package = pkgs.bluezFull; };
};
i18n.defaultLocale = "it_IT.UTF-8";
programs = {
dconf.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
zsh.enable = true;
};
networking = {
hostName = "loki";
interfaces.eno1.useDHCP = true;
# networkmanager.enable = true;
# useDHCP = false;
};
time.timeZone = "Europe/Rome";
services = {
avahi = {
enable = true;
openFirewall = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
userServices = true;
workstation = true;
};
extraServiceFiles = {
ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
};
bazarr = {
enable = true;
openFirewall = true;
group = "users";
};
blueman.enable = true;
dbus = {
packages = [ pkgs.dconf ];
implementation = "broker";
};
esphome = {
enable = true;
openFirewall = true;
};
fail2ban = {
enable = true;
bantime-increment.enable = true;
};
gnome.gnome-keyring.enable = true;
gvfs.enable = true;
jackett = {
enable = true;
# package = pkgs.unstable_pkgs.jackett;
openFirewall = true;
group = "users";
};
jellyfin = {
enable = true;
# package = pkgs.unstable_pkgs.jellyfin;
openFirewall = true;
group = "users";
};
logind.lidSwitch = "ignore";
# node-red = { enable = true; openFirewall = true; withNpmAndGcc = true; };
openssh = {
enable = true;
openFirewall = true;
};
# plex = { enable = true; openFirewall = true; group = "users"; };
power-profiles-daemon.enable = true;
radarr = {
enable = true;
openFirewall = true;
group = "users";
};
samba-wsdd = {
enable = true;
discovery = true;
};
samba = {
enable = true;
enableNmbd = true;
enableWinbindd = true;
nsswins = true;
extraConfig = ''
workgroup = WORKGROUP
load printers = no
smb encrypt = required
'';
shares =
let
common = {
"public" = "no";
"writeable" = "yes";
"create mask" = "0700";
"directory mask" = "2700";
"browseable" = "yes";
"guest ok" = "no";
"read only" = "no";
"force group" = "users";
};
in
{
bertof = recursiveUpdate common {
path = "/home/bertof/";
comment = "Bertof samba share";
"force user" = "bertof";
"valid users" = "bertof";
};
tiziano = recursiveUpdate common {
path = "/home/tiziano/";
comment = "Tiziano samba share";
"force user" = "tiziano";
"valid users" = "tiziano";
};
condiviso = recursiveUpdate common {
path = "/mnt/condiviso";
comment = "Samba share condiviso";
"valid users" = "bertof tiziano";
"create mask" = "0770";
"directory mask" = "2770";
"force create mode" = "0660";
"force directory mode" = "2770";
};
};
};
smartd.enable = true;
sonarr = {
enable = true;
openFirewall = true;
group = "users";
};
thermald.enable = true;
transmission = {
enable = true;
openFirewall = true;
group = "users";
settings = {
download-dir = "/mnt/condiviso/Torrent";
incomplete-dir = "/mnt/condiviso/Torrent/.incomplete";
};
};
xserver = {
# enable = true;
# videoDrivers = [ "nvidia" ];
# layout = "it";
# xkbOptions = "eurosign:e;";
# libinput.enable = true;
};
# zoneminder = {
# enable = true;
# openFirewall = true;
# cameras = 3;
# hostname = "0.0.0.0";
# database = {
# username = "zoneminder";
# createLocally = true;
# };
# };
# mysql = {
# # enable = true;
# ensureUsers = [{
# name = "bertof";
# ensurePermissions = { "*.*" = "ALL PRIVILEGES"; };
# }];
# };
};
users.users = {
bertof = {
isNormalUser = true;
extraGroups = [
"audio"
"input"
# "docker"
"libvirtd"
"network"
"networkmanager"
"usb"
"video"
"wheel"
];
shell = pkgs.zsh;
};
tiziano = {
isNormalUser = true;
extraGroups = [ "audio" "input" "video" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMExwtJFk6HjySrTZwJH67SOHC3hlL28NO4oe2GXsv6k"
];
shell = pkgs.zsh;
};
# jellyfin.extraGroups = [ "video" ];
};
services.snapper = {
configs =
let
common = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
};
in
{
bertof = recursiveUpdate common {
SUBVOLUME = "/home/bertof/";
ALLOW_USERS = [ "bertof" ];
};
tiziano = recursiveUpdate common {
SUBVOLUME = "/home/tiziano/";
ALLOW_USERS = [ "tiziano" ];
};
condiviso = recursiveUpdate common {
SUBVOLUME = "/mnt/condiviso";
ALLOW_USERS = [ "bertof" "tiziano" ];
};
};
};
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
445 # SAMBA
139 # SAMBA
5357 # SAMBA-WSDD
8123 # HOME ASSISTANT
8384 # SYNCTHING
8385 # SYNCTHING
];
allowedUDPPorts = [
137 # SYNCTHING
138 # SYNCTHING
3702 # SAMBA-WSDD
];
extraCommands =
"iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
};
virtualisation = {
# docker.enable = true;
# kvmgt.enable = true;
# libvirtd.enable = true;
podman.enable = true;
# virtualbox.host.enable = true;
# oci-containers.containers = {
# # hass = {
# # image = "ghcr.io/home-assistant/home-assistant:stable";
# # environment = { TZ = "Europe/Rome"; };
# # extraOptions = [ "--privileged" "--network=host" "--pull=always" ];
# # ports = [ "8123:8123" ];
# # volumes = [ "/var/lib/hass:/config" "/mnt/raid0/condiviso:/media" ];
# # };
# };
};
services.home-assistant = {
enable = true;
openFirewall = true;
config = {
default_config = { };
homeassistant = {
name = "Casa";
latitude = "!secret home-latitude";
longitude = "!secret home-longitude";
country = "IT";
elevation = 17;
unit_system = "metric";
time_zone = "Europe/Rome";
external_url = "https://home-assistant.bertof.net";
};
http = {
use_x_forwarded_for = true;
trusted_proxies = [ "172.23.4.159" "::1" "127.0.0.1" ];
};
automation = "!include automations.yaml";
scene = "!include scenes.yaml";
assist_pipeline = { };
# bluetooth = { };
cloud = { };
config = { };
# device_tracker = [{
# platform = "bluetooth_tracker";
# request_rssi = true;
# }];
esphome = { };
frontend = { };
google_assistant = {
project_id = "home-assistant-390217";
report_state = true;
service_account = "!include google-service-account.json";
exposed_domains = [
"alarm_control_panel"
"button"
"camera"
"climate"
"cover"
"fan"
"group"
"humidifier"
"input_boolean"
"input_button"
"input_select"
"light"
"lock"
"media_player"
"scene"
"script"
"select"
"sensor"
"switch"
"vacuum"
];
};
history = { };
logbook = { };
# logger.default = "debug";
logger.default = "info";
"map" = { };
mobile_app = { };
notify = [
{
platform = "telegram";
name = "t_filippo";
chat_id = "!secret filippo_t_chat_id";
}
{
platform = "telegram";
name = "t_famiglia";
chat_id = "!secret famiglia_t_chat_id";
}
];
recorder.purge_keep_days = 30;
script = "!include scripts.yaml";
sensor = [{
platform = "systemmonitor";
resources = [
{ type = "disk_use_percent"; }
{ type = "disk_use"; }
{ type = "disk_free"; }
{ type = "memory_use_percent"; }
{ type = "memory_use"; }
{ type = "memory_free"; }
{ type = "swap_use_percent"; }
{ type = "swap_use"; }
{ type = "swap_free"; }
{ type = "load_1m"; }
{ type = "load_5m"; }
{ type = "load_15m"; }
{ type = "network_in"; arg = "eno1"; }
{ type = "network_out"; arg = "eno1"; }
{ type = "throughput_network_in"; arg = "eno1"; }
{ type = "throughput_network_out"; arg = "eno1"; }
{ type = "packets_in"; arg = "eno1"; }
{ type = "packets_out"; arg = "eno1"; }
{ type = "ipv4_address"; arg = "eno1"; }
{ type = "ipv6_address"; arg = "eno1"; }
{ type = "network_in"; arg = "ztmjfdwjkp"; }
{ type = "network_out"; arg = "ztmjfdwjkp"; }
{ type = "throughput_network_in"; arg = "ztmjfdwjkp"; }
{ type = "throughput_network_out"; arg = "ztmjfdwjkp"; }
{ type = "packets_in"; arg = "ztmjfdwjkp"; }
{ type = "packets_out"; arg = "ztmjfdwjkp"; }
{ type = "ipv4_address"; arg = "ztmjfdwjkp"; }
{ type = "ipv6_address"; arg = "ztmjfdwjkp"; }
{ type = "processor_use"; }
{ type = "processor_temperature"; }
# { type = "process"; arg = "octave-cli"; }
{ type = "last_boot"; }
];
}];
shopping_list = { };
sun = { };
system_health = { };
telegram_bot = [{
# platform = "polling";
platform = "webhooks";
api_key = "!secret telegram_api_key";
allowed_chat_ids = [
"!secret filippo_t_chat_id"
"!secret famiglia_t_chat_id"
];
}];
tts = [{
platform = "google_translate";
language = "it";
# tld = "it";
}];
};
configDir = "/var/lib/hass";
configWritable = true;
extraPackages = ps: with ps; [ securetar ];
extraComponents = [
"default_config"
"accuweather"
"alert"
"analytics"
"bayesian"
"binary_sensor"
"blueprint"
# "bluetooth_le_tracker"
# "bluetooth_tracker"
"button"
"camera"
"cast"
"caldav"
"calendar"
"citybikes"
"configurator"
# "coronavirus"
"cover"
"default_config"
"derivative"
"device_automation"
"device_sun_light_trigger"
"device_tracker"
"dlib_face_detect"
"dlib_face_identify"
"dlna_dmr"
"dlna_dms"
"esphome"
"flux"
"gdacs"
"google"
"google_translate"
"group"
"hassio"
"jellyfin"
"local_file"
"media_player"
"met"
"meteoalarm"
"network"
"nextcloud"
"nmap_tracker"
"notify"
"ping"
"plex"
"proximity"
"radarr"
"radio_browser"
"random"
"scene"
"schedule"
"script"
"sonarr"
"speedtestdotnet"
"spotify"
"tcp"
"telegram"
"telegram_bot"
"template"
"threshold"
"transmission"
"tod" # times of the day
"trend"
"upnp"
"wake_on_lan"
"workday"
"zha"
"zoneminder"
];
};
security.sudo.extraConfig = ''
Defaults pwfeedback
'';
system.stateVersion = "22.11";
}

View file

@ -0,0 +1,71 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "uas" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/44c53e75-a00d-47bc-a99b-2544fe513e51";
fsType = "btrfs";
options = [ "compress=lzo" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/8A71-E5EB";
fsType = "vfat";
};
fileSystems."/home/bertof" = {
device = "/dev/disk/by-uuid/2e897ea5-c8f9-4fa8-9cc6-3f5807ba8afc";
fsType = "btrfs";
options = [ "subvol=@bertof" "compress=lzo" ];
};
fileSystems."/home/tiziano" = {
device = "/dev/disk/by-uuid/2e897ea5-c8f9-4fa8-9cc6-3f5807ba8afc";
fsType = "btrfs";
options = [ "subvol=@tiziano" "compress=lzo" ];
};
fileSystems."/mnt/condiviso" = {
device = "/dev/disk/by-uuid/2e897ea5-c8f9-4fa8-9cc6-3f5807ba8afc";
fsType = "btrfs";
options = [ "subvol=@condiviso" "compress=lzo" ];
};
fileSystems."/var/lib/garage/data" = {
device = "/dev/disk/by-uuid/2e897ea5-c8f9-4fa8-9cc6-3f5807ba8afc";
fsType = "btrfs";
options = [ "subvol=@garage" "compress=lzo" ];
};
fileSystems."/var/lib/garage/meta" = {
device = "/dev/disk/by-uuid/2e897ea5-c8f9-4fa8-9cc6-3f5807ba8afc";
fsType = "btrfs";
options = [ "subvol=@garage-metadata" "compress=lzo" ];
};
swapDevices = [{
device = "/swapfile";
size = 1024 * 4;
}];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true;
# networking.interfaces.ztmjfdwjkp.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

32
instances/loki/hm.nix Normal file
View file

@ -0,0 +1,32 @@
{
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
};
};
imports = [
../../modules/hm/__basic.nix
# ../../modules/hm/development/cpp.nix
# ../../modules/hm/development/data.nix
# ../../modules/hm/development/go.nix
# ../../modules/hm/development/javascript.nix
# ../../modules/hm/development/latex.nix
# ../../modules/hm/development/nix.nix
# ../../modules/hm/development/python.nix
# ../../modules/hm/development/rust.nix
../../modules/hm/helix.nix
../../modules/hm/kakoune.nix
../../modules/hm/kitty.nix
../../modules/hm/lf.nix
../../modules/hm/megasync.nix
../../modules/hm/syncthing.nix
../../modules/hm/shell_aliases.nix
];
home.stateVersion = "22.11";
}

View file

@ -0,0 +1,23 @@
{
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
};
};
imports = [
../../modules/hm/__basic.nix
../../modules/hm/helix.nix
../../modules/hm/kakoune.nix
../../modules/hm/kitty.nix
../../modules/hm/lf.nix
../../modules/hm/megasync.nix
../../modules/hm/syncthing_tiziano.nix
../../modules/hm/shell_aliases.nix
];
home.stateVersion = "21.11";
}

View file

@ -0,0 +1,333 @@
{ config, pkgs, lib, ... }:
with lib; {
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.checkJournalingFS = true;
# boot.kernelPackages = pkgs.linuxPackages_latest;
# boot.kernelPackages = pkgs.linuxPackages_6_1;
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
# # Cross-build arm
boot.binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
hardware.enableRedistributableFirmware = true;
# Enable opengl support
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = builtins.attrValues {
inherit (pkgs) intel-media-driver vaapiIntel vaapiVdpau libvdpau-va-gl;
};
};
# Use same ACPI identifier as Dell Ubuntu
boot.kernelParams = [ "acpi_osi=Linux-Dell-Video" ];
networking = {
hostName = "odin";
networkmanager.enable = true;
# networkmanager.wifi.backend = "iwd";
# Configure network proxy if necessary
# proxy.default = "http://user:password@proxy:port/";
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Open ports in the firewall.
# firewall.allowedTCPPorts = [ ... ];
# firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# firewall.enable = false;
wg-quick.interfaces = {
wg0 = {
autostart = false;
address = [ "10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/64" ];
dns = [ "10.0.0.1" "fdc9:281f:04d7:9ee9::1" ];
privateKeyFile = config.age.secrets.odin_wg_priv.path;
peers = [
{
# baldur
# allowedIPs = [ "10.0.0.3/32" "fdc9:281f:04d7:9ee9::3/128" ];
allowedIPs = [ "0.0.0.0/0" "::/0" ];
endpoint = "baldur.bertof.net:51820";
presharedKeyFile = config.age.secrets.wg_psk.path;
publicKey = "K57ikgFSR1O0CXWBxfQEu7uxSOsp3ePj/NMRets5pVc=";
}
{
# odin
publicKey = "LDBhvzeYmHJ0z5ch+N559GWjT3It1gZvGR/9WtCfURw=";
presharedKeyFile = config.age.secrets.wg_psk.path;
allowedIPs = [ "10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/128" ];
}
{
# oppo
publicKey = "OBk6bHKuIYLwD7cwjmAuMn57jXqbDwCL52jhQxiHnnA=";
presharedKeyFile = config.age.secrets.wg_psk.path;
allowedIPs = [ "10.0.0.3/24" "fdc9:281f:04d7:9ee9::3/128" ];
}
{
# thor
publicKey = "rpwR6n4IE96VZAmQDBufsWE/a9G7d8fpkvY1OwsbOhk=";
presharedKeyFile = config.age.secrets.wg_psk.path;
allowedIPs = [ "10.0.0.4/24" "fdc9:281f:04d7:9ee9::4/128" ];
}
];
};
};
};
services.hardware.bolt.enable = true;
# Set your time zone.
time.timeZone = "Europe/Dublin";
# Select internationalisation properties.
i18n.defaultLocale = "it_IT.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "it";
};
# X11 windowing system.
services.xserver = {
enable = true;
# Enable the GNOME 3 Desktop Environment.
# desktopManager.gnome.enable = true;
# desktopManager.plasma5 = {
# enable = true;
# runUsingSystemd = true;
# };
windowManager.bspwm.enable = true;
# Configure keymap in X11
layout = "it,us";
xkbOptions = "eurosign:e,terminate:ctrl_alt_bksp,compose:rctrl,grp:menu_toggle";
libinput.enable = true;
displayManager.sddm = {
enable = true;
autoNumlock = true;
theme =
"${pkgs.sddm-theme-clairvoyance}/usr/share/sddm/themes/clairvoyance";
};
};
# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = [
pkgs.gutenprint
# pkgs.cups-kyocera
pkgs.unstable_pkgs.cups-kyodialog
];
};
# Disable auto handling of power button
services.logind.extraConfig = ''
HandlePowerKey=ignore
'';
services.keybase.enable = true;
# Enable sound.
# PULSE
# sound.enable = true;
# hardware.pulseaudio.enable = true;
# PIPEWIRE
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
jack.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
# media-session.enable = true;
};
environment.sessionVariables.LD_LIBRARY_PATH = lib.mkForce
"${config.services.pipewire.package.jack}/lib"; # Temporary fix for WebKitGTK
# # Tablet
# hardware.opentabletdriver = {
# enable = true;
# daemon.enable = true;
# };
# Define a user account. Don't forget to set a password with passwd.
users.users.bertof = {
isNormalUser = true;
extraGroups = [
"audio"
"input"
"docker"
"flashrom"
"libvirtd"
"network"
"networkmanager"
"usb"
"video"
"wheel"
];
shell = pkgs.zsh;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages =
builtins.attrValues { inherit (pkgs) tmux helix vim git ntfs3g; };
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.flashrom.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.steam = {
enable = true;
package = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [ icu ];
extraProfile = ''
export GSETTINGS_SCHEMA_DIR="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas/"
'';
};
};
# services.joycond.enable = true;
programs.dconf.enable = true;
programs.zsh = { enable = true; };
services.onedrive = { enable = true; package = pkgs.unstable_pkgs.onedrive; };
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
openFirewall = true;
};
# Cooling management
services.thermald.enable = true;
services.smartd.enable = true;
services.snapper = {
configs =
let
common = {
ALLOW_USERS = [ "bertof" ];
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
};
in
{
bertof_home = recursiveUpdate common { SUBVOLUME = "/home/bertof"; };
bertof_music = recursiveUpdate common { SUBVOLUME = "/home/bertof/Musica"; };
bertof_downloads = recursiveUpdate common { SUBVOLUME = "/home/bertof/Scaricati"; };
bertof_images = recursiveUpdate common { SUBVOLUME = "/home/bertof/Immagini"; };
bertof_videos = recursiveUpdate common { SUBVOLUME = "/home/bertof/Video"; };
bertof_documents = recursiveUpdate common { SUBVOLUME = "/home/bertof/Documenti"; };
bertof_games_ssd = recursiveUpdate common { SUBVOLUME = "/home/bertof/Giochi/SSD"; };
bertof_games_sata = recursiveUpdate common { SUBVOLUME = "/home/bertof/Giochi/SATA"; };
# bertof_games_hdd = recursiveUpdate common { SUBVOLUME = "/home/bertof/Giochi/HDD"; };
bertof_git = recursiveUpdate common { SUBVOLUME = "/home/bertof/Documenti/Git"; };
};
};
services.dbus = {
packages = [ pkgs.dconf ];
implementation = "broker";
};
services.gnome.gnome-keyring.enable = true;
hardware.steam-hardware.enable = true;
hardware.bluetooth = {
enable = true;
package = pkgs.bluezFull;
};
services.blueman.enable = true;
services.gvfs = {
enable = true;
# package = lib.mkForce pkgs.gnome3.gvfs;
};
services.tumbler.enable = true;
# services.tlp.enable = false;
services.avahi = {
enable = true;
openFirewall = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
userServices = true;
workstation = true;
};
extraServiceFiles = {
ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
};
# FPRINTD
# services.fprintd = {
# enable = true;
# tod = { enable = true; driver = pkgs.libfprint-2-tod1-goodix; };
# };
security.pam.services.login.fprintAuth = true;
security.pam.services.xscreensaver.fprintAuth = true;
# Clamav
# services.clamav = {
# daemon.enable = true;
# updater.enable = true;
# };
# Power-profiles
services.power-profiles-daemon.enable = true;
# services.teamviewer.enable = true;
# Virtualisation
virtualisation = {
docker.enable = true;
kvmgt.enable = true;
libvirtd = {
enable = true;
qemu.swtpm.enable = true;
};
podman.enable = true;
# virtualbox.host.enable = true;
};
# Allow completion for system packages
environment.pathsToLink = [ "/share/zsh" ];
security.sudo.extraConfig = ''
Defaults pwfeedback
'';
security.pam.services.sddm.enableGnomeKeyring = true;
security.pam.services.autoUnlockKwallet.enableKwallet = true;
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
steam = pkgs.steam.override { extraPkgs = pkgs: [ pkgs.icu ]; };
};
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
}

View file

@ -0,0 +1,16 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
boot = {
initrd.kernelModules = [ "i915" ];
blacklistedKernelModules = [ "nouveau" "nvidia" ];
};
# This runs only Intel and nvidia does not drain power.
##### disable nvidia for a very nice battery life.
hardware.nvidiaOptimus.disable = true;
services.xserver.videoDrivers = [ "intel" ];
}

View file

@ -0,0 +1,30 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ pkgs, ... }: {
boot = { initrd.kernelModules = [ "i915" ]; };
hardware.nvidia = {
# modesetting.enable = true;
# package = pkgs.linuxPackages.nvidia_x11;
prime = {
offload.enable = false;
sync.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
programs.gamemode = {
enable = true;
settings = {
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
services.xserver.videoDrivers = [ "nvidia" ];
}

View file

@ -0,0 +1,109 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@root" "x-gvfs-hide" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@nix" "x-gvfs-hide" ];
};
fileSystems."/home/bertof" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@home" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Giochi/SSD" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@games" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Video" = {
device = "/dev/disk/by-uuid/c2635d50-7f08-4aca-bcdd-0ac685047a64";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@videos" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Giochi/SATA" = {
device = "/dev/disk/by-uuid/c2635d50-7f08-4aca-bcdd-0ac685047a64";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@games" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Musica" = {
device = "/dev/disk/by-uuid/c2635d50-7f08-4aca-bcdd-0ac685047a64";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@music" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Immagini" = {
device = "/dev/disk/by-uuid/c2635d50-7f08-4aca-bcdd-0ac685047a64";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@images" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Scaricati" = {
device = "/dev/disk/by-uuid/c2635d50-7f08-4aca-bcdd-0ac685047a64";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@downloads" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Documenti" = {
device = "/dev/disk/by-uuid/c2635d50-7f08-4aca-bcdd-0ac685047a64";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@documents" "x-gvfs-hide" ];
};
fileSystems."/home/bertof/Documenti/Git" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@git" "x-gvfs-hide" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/82DB-3444";
fsType = "vfat";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/5f3cf424-2bd8-4352-a778-1bb067cb5700"; }
{
device = "/swapfile";
size = 1024 * 32;
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
# networking.useDHCP = lib.mkDefault true;
# networking.interfaces.docker0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp10s0u1u2.useDHCP = lib.mkDefault true;
# networking.interfaces.enp60s0.useDHCP = lib.mkDefault true;
# networking.interfaces.virbr0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
# networking.interfaces.ztmjfdwjkp.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

122
instances/odin/hm.nix Normal file
View file

@ -0,0 +1,122 @@
{ pkgs, ... }: {
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it,us,us";
variant = ",,colemak";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" "grp:menu_toggle" ];
};
packages = builtins.attrValues {
inherit (pkgs)
# element-desktop # matrix client
# freecad
# lutris
# minecraft
# mycrypto
# pcmanfm
# pulseaudio
# signal-desktop
# slack
# wineFull
arandr authenticator authy cava discord dmenu droidcam easyeffects evince evolution gallery-dl google-chrome gucharmap handbrake httpie inkscape keyboard-switch krita openvpn p7zip pavucontrol pentablet-driver procps pulseaudio retroarchFull shotwell spotify tdesktop transmission-gtk virt-manager virt-viewer wireguard-tools xournalpp zoom-us;
inherit (pkgs.gnome)
# geary
# gnome-boxes
# gnome-calendar
# gnome-sound-recorder
# seahorse
eog file-roller gnome-font-viewer gnome-screenshot gnome-system-monitor totem;
inherit (pkgs.unstable_pkgs) postman skypeforlinux;
};
};
services = { gnome-keyring.enable = true; };
xsession = {
enable = true;
numlock.enable = true;
initExtra = ''
## Touchpad
${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Natural Scrolling Enabled' 1
${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Tapping Enabled' 1
${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Disable While Typing Enabled' 1
'';
};
imports = [
../../modules/hm/__basic.nix
../../modules/hm/development/cpp.nix
../../modules/hm/development/data.nix
../../modules/hm/development/database.nix
../../modules/hm/development/docker.nix
# ../../modules/hm/development/go.nix
../../modules/hm/development/javascript.nix
../../modules/hm/development/kubernetes.nix
../../modules/hm/development/latex.nix
../../modules/hm/development/markdown.nix
../../modules/hm/development/nix.nix
../../modules/hm/development/python.nix
../../modules/hm/development/rust.nix
../../modules/hm/alacritty.nix
../../modules/hm/autorandr.nix
../../modules/hm/biblio.nix
../../modules/hm/bitwarden.nix
../../modules/hm/blender.nix
../../modules/hm/bspwm.nix
../../modules/hm/cava.nix
../../modules/hm/dunst.nix
# ../../modules/hm/dwarf-fortress.nix
../../modules/hm/easyeffects.nix
../../modules/hm/firefox.nix
# ../../modules/hm/fonts.nix
# ../../modules/hm/gnome_shell.nix
# ../../modules/hm/grobi.nix
../../modules/hm/gtk_theme.nix
../../modules/hm/heif.nix
../../modules/hm/helix.nix
# ../../modules/hm/joystickwake.nix
../../modules/hm/kakoune.nix
../../modules/hm/kdeconnect.nix
# ../../modules/hm/keepassxc.nix
../../modules/hm/kicad.nix
# ../../modules/hm/kitty.nix
../../modules/hm/lf.nix
../../modules/hm/libinput-gestures.nix
../../modules/hm/mangohud.nix
../../modules/hm/megasync.nix
../../modules/hm/mpv.nix
# ../../modules/hm/nautilus.nix
../../modules/hm/ncspot.nix
../../modules/hm/nix-index.nix
../../modules/hm/noti.nix
../../modules/hm/nushell.nix
../../modules/hm/obs-studio.nix
../../modules/hm/office.nix
../../modules/hm/pass.nix
../../modules/hm/picom.nix
../../modules/hm/polybar.nix
../../modules/hm/pro_audio.nix
../../modules/hm/pycharm.nix
../../modules/hm/research.nix
../../modules/hm/rofi.nix
# ../../modules/hm/screen_locker.nix
# ../../modules/hm/security.nix
../../modules/hm/spotifyd.nix
../../modules/hm/sxhkd.nix
../../modules/hm/syncthing.nix
../../modules/hm/terminator.nix
# ../../modules/hm/thunar.nix
# ../../modules/hm/twmn.nix
../../modules/hm/update_background.nix
../../modules/hm/vim.nix
../../modules/hm/webapp.nix
../../modules/hm/xidlehook.nix
../../modules/hm/xresources.nix
../../modules/hm/zathura.nix
../../modules/hm/zellij.nix
];
home.stateVersion = "22.05";
}

View file

@ -0,0 +1,211 @@
{ lib, config, pkgs, ... }:
with lib; {
boot = {
binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
# kernelPackages = pkgs.linuxPackages_latest;
# kernelPackages = pkgs.linuxPackages_6_1;
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback hid-nintendo ];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
checkJournalingFS = true;
luks.devices = {
root = {
device = "/dev/nvme0n1p2";
preLVM = true;
allowDiscards = true;
bypassWorkqueues = true;
};
};
};
};
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
environment = {
pathsToLink = [ "/share/zsh" ];
systemPackages = builtins.attrValues { inherit (pkgs) kakoune tmux vim; };
};
hardware = {
opengl.enable = true;
bluetooth = {
enable = true;
package = pkgs.bluezFull;
};
enableRedistributableFirmware = true;
pulseaudio.enable = false;
# nvidia.modesetting.enable = true;
};
i18n.defaultLocale = "it_IT.UTF-8";
programs = {
dconf.enable = true;
flashrom.enable = true;
gamemode = {
enable = true;
settings = {
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
steam = {
enable = true;
package = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [ icu ];
extraProfile = ''
export GSETTINGS_SCHEMA_DIR="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas/"
'';
};
};
zsh = { enable = true; };
};
networking = {
hostName = "thor"; # Define your hostname.
networkmanager.enable = true;
};
time.timeZone = "Europe/Rome";
services = {
avahi = {
enable = true;
openFirewall = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
userServices = true;
workstation = true;
};
extraServiceFiles = {
ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
};
blueman.enable = true;
# clamav = {
# daemon.enable = true;
# updater.enable = true;
# };
dbus.packages = [ pkgs.dconf ];
gnome.gnome-keyring.enable = true;
gvfs = {
enable = true;
# package = pkgs.gnome3.gvfs;
};
# joycond.enable = true;
keybase.enable = true;
onedrive = { enable = true; package = pkgs.unstable_pkgs.onedrive; };
openssh = { enable = true; openFirewall = true; };
pipewire = {
enable = true;
alsa = { enable = true; support32Bit = true; };
jack.enable = true;
pulse.enable = true;
# media-session.enable = true;
};
power-profiles-daemon.enable = true;
smartd.enable = true;
snapper = {
configs =
let
common = {
ALLOW_USERS = [ "bertof" ];
TIMELINE_CLEANUP = true;
TIMELINE_CREATE = true;
};
in
{
bertof_home = recursiveUpdate common { SUBVOLUME = "/home/bertof"; };
};
};
thermald.enable = true;
xserver = {
enable = true;
desktopManager = {
# gnome.enable = true;
# cinnamon.enable = true;
# plasma5 = { enable = true; runUsingSystemd = true; useQtScaling = true; };
};
windowManager.bspwm = { enable = true; };
# displayManager.gdm = { enable = true; };
displayManager.sddm = {
enable = true;
theme =
"${pkgs.sddm-theme-clairvoyance}/usr/share/sddm/themes/clairvoyance";
};
videoDrivers = [ "nvidia" ];
layout = "us,it";
xkbOptions =
"eurosign:e,terminate:ctrl_alt_bksp,compose:rctrl,grp:menu_toggle";
xrandrHeads = [{
primary = true;
output = "DP-4";
}];
};
# gnome.gnome-remote-desktop.enable = true;
};
# services.teamviewer.enable = true;
security = {
tpm2.enable = true;
rtkit.enable = true;
pam.services = { autounlock_gnome_keyring.enableGnomeKeyring = true; };
sudo.extraConfig = ''
Defaults pwfeedback
'';
};
sound.enable = false;
users.users.bertof = {
isNormalUser = true;
extraGroups = [
"audio"
"input"
"docker"
"flashrom"
"libvirtd"
"network"
"networkmanager"
"usb"
"video"
"wheel"
];
shell = pkgs.zsh;
};
virtualisation = {
docker.enable = true;
kvmgt.enable = true;
libvirtd.enable = true;
podman.enable = true;
# virtualbox.host.enable = true;
};
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
steam = pkgs.steam.override { extraPkgs = pkgs: [ pkgs.icu ]; };
};
# cudaSupport = true;
};
system.stateVersion = "22.11"; # Did you read the comment?
}

View file

@ -0,0 +1,64 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/6c06428e-c296-4ef1-8429-62bafb860126";
fsType = "btrfs";
options = [
"subvol=@root"
"x-gvfs-hide"
"space_cache=v2"
"discard"
"compress-force=zstd:1"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B9D2-255C";
fsType = "vfat";
};
fileSystems."/home/bertof" = {
device = "/dev/disk/by-uuid/6c06428e-c296-4ef1-8429-62bafb860126";
fsType = "btrfs";
options = [
"subvol=@home_bertof"
"x-gvfs-hide"
"space_cache=v2"
"discard"
"compress-force=zstd:1"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/6c06428e-c296-4ef1-8429-62bafb860126";
fsType = "btrfs";
options = [
"subvol=@nix"
"x-gvfs-hide"
"space_cache=v2"
"discard"
"compress-force=zstd:1"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/dee188e4-4ff8-417c-9419-b7f00ecb9989"; }
{
device = "/swapfile";
size = 1024 * 32;
}
];
}

111
instances/thor/hm.nix Normal file
View file

@ -0,0 +1,111 @@
{ pkgs, ... }: {
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "us,it";
variant = ",colemak,";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" "grp:menu_toggle" ];
};
packages = builtins.attrValues {
inherit (pkgs)
# electrum
# element-desktop # matrix client
evolution
# freecad
# minecraft
# mycrypto
# pcmanfm
# pulseaudio
# signal-desktop
# slack
# wineFull
arandr authenticator authy discord dmenu docker-compose docker-machine droidcam easyeffects evince filelight gallery-dl google-chrome gucharmap handbrake httpie inkscape krita openvpn p7zip pavucontrol pcsx2 pentablet-driver procps pulseaudio retroarchFull shotwell spotify tdesktop transmission-gtk virt-manager virt-viewer wireguard-tools xournalpp zoom-us;
inherit (pkgs.gnome)
# geary
# gnome-boxes
# gnome-calendar
# gnome-sound-recorder
# seahorse
eog file-roller gnome-font-viewer gnome-screenshot gnome-system-monitor totem;
inherit (pkgs.unstable_pkgs) postman skypeforlinux;
};
};
services = { gnome-keyring.enable = true; };
imports = [
../../modules/hm/__basic.nix
../../modules/hm/development/cpp.nix
../../modules/hm/development/data.nix
../../modules/hm/development/database.nix
../../modules/hm/development/docker.nix
# ../../modules/hm/development/go.nix
../../modules/hm/development/javascript.nix
../../modules/hm/development/kubernetes.nix
../../modules/hm/development/latex.nix
../../modules/hm/development/markdown.nix
../../modules/hm/development/nix.nix
../../modules/hm/development/python.nix
../../modules/hm/development/rust.nix
../../modules/hm/alacritty.nix
../../modules/hm/autorandr.nix
../../modules/hm/biblio.nix
../../modules/hm/bitwarden.nix
../../modules/hm/blender_nvidia.nix
../../modules/hm/bspwm.nix
../../modules/hm/cava.nix
../../modules/hm/dunst.nix
# ../../modules/hm/dwarf-fortress.nix
../../modules/hm/easyeffects.nix
../../modules/hm/firefox.nix
../../modules/hm/fonts.nix
# ../../modules/hm/gnome_shell.nix
# ../../modules/hm/grobi.nix
../../modules/hm/gtk_theme.nix
../../modules/hm/heif.nix
../../modules/hm/helix.nix
../../modules/hm/joystickwake.nix
../../modules/hm/kakoune.nix
../../modules/hm/kdeconnect.nix
# ../../modules/hm/keepassxc.nix
# ../../modules/hm/kitty.nix
../../modules/hm/lf.nix
../../modules/hm/lutris.nix
../../modules/hm/mangohud.nix
../../modules/hm/megasync.nix
../../modules/hm/mpv.nix
# ../../modules/hm/nautilus.nix
../../modules/hm/ncspot.nix
../../modules/hm/nix-index.nix
../../modules/hm/noti.nix
../../modules/hm/nushell.nix
../../modules/hm/obs-studio.nix
../../modules/hm/office.nix
../../modules/hm/pass.nix
../../modules/hm/picom.nix
../../modules/hm/polybar.nix
../../modules/hm/pro_audio.nix
../../modules/hm/pycharm.nix
../../modules/hm/spotifyd.nix
../../modules/hm/research.nix
../../modules/hm/rofi.nix
# ../../modules/hm/screen_locker.nix
# ../../modules/hm/security.nix
../../modules/hm/sxhkd.nix
../../modules/hm/syncthing.nix
../../modules/hm/terminator.nix
# ../../modules/hm/thunar.nix
# ../../modules/hm/twmn.nix
../../modules/hm/update_background.nix
../../modules/hm/vim.nix
../../modules/hm/webapp.nix
../../modules/hm/xidlehook.nix
../../modules/hm/xresources.nix
../../modules/hm/zathura.nix
../../modules/hm/zellij.nix
];
home.stateVersion = "22.11";
}