From afc597e552facff6c0103657d315775902709841 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Wed, 11 Mar 2026 16:34:05 +0100 Subject: gerarchia modificata (sono pazzo) --- systems/odino/boot.nix | 19 +++++++++++++++ systems/odino/default.nix | 37 +++++++++++++++++++++++++++++ systems/odino/hardware.nix | 28 ++++++++++++++++++++++ systems/odino/home-manager/default.nix | 5 ---- systems/odino/home-manager/leo/home.nix | 13 ---------- systems/odino/home-manager/leo/programs.nix | 11 --------- systems/odino/locales.nix | 20 ++++++++++++++++ systems/odino/networking.nix | 31 ++++++++++++++++++++++++ systems/odino/nixos/boot.nix | 19 --------------- systems/odino/nixos/default.nix | 37 ----------------------------- systems/odino/nixos/hardware.nix | 28 ---------------------- systems/odino/nixos/locales.nix | 20 ---------------- systems/odino/nixos/networking.nix | 31 ------------------------ systems/odino/nixos/programs.nix | 26 -------------------- systems/odino/nixos/services.nix | 8 ------- systems/odino/programs.nix | 26 ++++++++++++++++++++ systems/odino/services.nix | 8 +++++++ 17 files changed, 169 insertions(+), 198 deletions(-) create mode 100644 systems/odino/boot.nix create mode 100644 systems/odino/default.nix create mode 100644 systems/odino/hardware.nix delete mode 100644 systems/odino/home-manager/default.nix delete mode 100644 systems/odino/home-manager/leo/home.nix delete mode 100644 systems/odino/home-manager/leo/programs.nix create mode 100644 systems/odino/locales.nix create mode 100644 systems/odino/networking.nix delete mode 100644 systems/odino/nixos/boot.nix delete mode 100644 systems/odino/nixos/default.nix delete mode 100644 systems/odino/nixos/hardware.nix delete mode 100644 systems/odino/nixos/locales.nix delete mode 100644 systems/odino/nixos/networking.nix delete mode 100644 systems/odino/nixos/programs.nix delete mode 100644 systems/odino/nixos/services.nix create mode 100644 systems/odino/programs.nix create mode 100644 systems/odino/services.nix (limited to 'systems/odino') diff --git a/systems/odino/boot.nix b/systems/odino/boot.nix new file mode 100644 index 0000000..52b2d3e --- /dev/null +++ b/systems/odino/boot.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + boot = { + kernelPackages = pkgs.linuxPackages_6_18; # NOTE: soltanto versioni LTS per il server + kernelModules = [ "kvm-intel" ]; + kernelParams = [ "boot.shell_on_fail" ]; + + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + }; + + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + extraModulePackages = [ ]; + }; +} diff --git a/systems/odino/default.nix b/systems/odino/default.nix new file mode 100644 index 0000000..fca67b9 --- /dev/null +++ b/systems/odino/default.nix @@ -0,0 +1,37 @@ +{pkgs, ...}: { + imports = [ + ./hardware.nix + ./boot.nix + ./networking.nix + ./locales.nix + + ./services.nix + ./programs.nix + ]; + + # Experimental features + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Users + users.users.leo = { + isNormalUser = true; + shell = pkgs.zsh; + + extraGroups = [ "wheel" "networkmanager" ]; + }; + + programs.zsh.enable = true; + + environment.shellAliases = { + ls = "eza"; + l = "ls -lh"; + ll = "ls -lah"; + + update-boot = "sudo nixos-rebuild boot --flake ~/nixos#odino"; + update-system = "sudo nixos-rebuild switch --flake ~/nixos#odino"; + update-home = "home-manager switch --flake ~/nixos#odino"; + }; + + # Version + system.stateVersion = "25.05"; +} diff --git a/systems/odino/hardware.nix b/systems/odino/hardware.nix new file mode 100644 index 0000000..4bb260c --- /dev/null +++ b/systems/odino/hardware.nix @@ -0,0 +1,28 @@ +{config, lib, modulesPath, ...}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/31eed536-5936-4814-bb60-73fcc4fabdc5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1DD7-85F5"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + fileSystems."/mnt/media" = { + device = "/dev/disk/by-uuid/d441ef68-e6c5-4407-8ab4-f85855c2848a"; + fsType = "ext4"; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/8478cb29-8a67-4842-b9ed-16a226506cb7"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/systems/odino/home-manager/default.nix b/systems/odino/home-manager/default.nix deleted file mode 100644 index bb6ef28..0000000 --- a/systems/odino/home-manager/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - imports = [ - ./leo/home.nix - ]; -} diff --git a/systems/odino/home-manager/leo/home.nix b/systems/odino/home-manager/leo/home.nix deleted file mode 100644 index e0c3d6f..0000000 --- a/systems/odino/home-manager/leo/home.nix +++ /dev/null @@ -1,13 +0,0 @@ -{...}: { - imports = [ - ./programs.nix - ]; - - home = { - username = "leo"; - homeDirectory = "/home/leo"; - }; - - # Version - home.stateVersion = "25.05"; -} diff --git a/systems/odino/home-manager/leo/programs.nix b/systems/odino/home-manager/leo/programs.nix deleted file mode 100644 index eac28b0..0000000 --- a/systems/odino/home-manager/leo/programs.nix +++ /dev/null @@ -1,11 +0,0 @@ -{...}: { - imports = [ - ../../../../components/programs/zsh.nix - ../../../../components/programs/tmux.nix - ../../../../components/programs/fastfetch.nix - ]; - - zsh.enable = true; - tmux.enable = true; - fastfetch.enable = true; -} diff --git a/systems/odino/locales.nix b/systems/odino/locales.nix new file mode 100644 index 0000000..2d2363d --- /dev/null +++ b/systems/odino/locales.nix @@ -0,0 +1,20 @@ +{...}: { + time.timeZone = "Europe/Rome"; + console.keyMap = "it"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "it_IT.UTF-8"; + LC_IDENTIFICATION = "it_IT.UTF-8"; + LC_MEASUREMENT = "it_IT.UTF-8"; + LC_MONETARY = "it_IT.UTF-8"; + LC_NAME = "it_IT.UTF-8"; + LC_NUMERIC = "it_IT.UTF-8"; + LC_PAPER = "it_IT.UTF-8"; + LC_TELEPHONE = "it_IT.UTF-8"; + LC_TIME = "it_IT.UTF-8"; + }; + }; +} diff --git a/systems/odino/networking.nix b/systems/odino/networking.nix new file mode 100644 index 0000000..3ab8e46 --- /dev/null +++ b/systems/odino/networking.nix @@ -0,0 +1,31 @@ +{lib, ...}: { + networking = { + hostName = "odino"; + useDHCP = lib.mkDefault true; + + nameservers = [ "208.67.222.222" "208.67.220.220" ]; + + firewall = { + enable = true; + + allowedTCPPorts = [ 22 ]; + allowedUDPPorts = [ 51820 ]; + }; + + networkmanager.enable = true; + + wg-quick.interfaces."tunnel" = { + privateKeyFile = "/home/leo/.wireguard/private.key"; + address = [ "10.69.0.2/24" ]; + + peers = [ + { + publicKey = "rwUMCdhjQbQt9uGjljfdABj4DSJFgL62bzT13sg8LmU="; + allowedIPs = [ "10.69.0.0/24" ]; + endpoint = "leoflo.me:51820"; + persistentKeepalive = 25; + } + ]; + }; + }; +} diff --git a/systems/odino/nixos/boot.nix b/systems/odino/nixos/boot.nix deleted file mode 100644 index 52b2d3e..0000000 --- a/systems/odino/nixos/boot.nix +++ /dev/null @@ -1,19 +0,0 @@ -{pkgs, ...}: { - boot = { - kernelPackages = pkgs.linuxPackages_6_18; # NOTE: soltanto versioni LTS per il server - kernelModules = [ "kvm-intel" ]; - kernelParams = [ "boot.shell_on_fail" ]; - - initrd = { - availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - kernelModules = [ ]; - }; - - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - - extraModulePackages = [ ]; - }; -} diff --git a/systems/odino/nixos/default.nix b/systems/odino/nixos/default.nix deleted file mode 100644 index fca67b9..0000000 --- a/systems/odino/nixos/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./hardware.nix - ./boot.nix - ./networking.nix - ./locales.nix - - ./services.nix - ./programs.nix - ]; - - # Experimental features - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Users - users.users.leo = { - isNormalUser = true; - shell = pkgs.zsh; - - extraGroups = [ "wheel" "networkmanager" ]; - }; - - programs.zsh.enable = true; - - environment.shellAliases = { - ls = "eza"; - l = "ls -lh"; - ll = "ls -lah"; - - update-boot = "sudo nixos-rebuild boot --flake ~/nixos#odino"; - update-system = "sudo nixos-rebuild switch --flake ~/nixos#odino"; - update-home = "home-manager switch --flake ~/nixos#odino"; - }; - - # Version - system.stateVersion = "25.05"; -} diff --git a/systems/odino/nixos/hardware.nix b/systems/odino/nixos/hardware.nix deleted file mode 100644 index 4bb260c..0000000 --- a/systems/odino/nixos/hardware.nix +++ /dev/null @@ -1,28 +0,0 @@ -{config, lib, modulesPath, ...}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/31eed536-5936-4814-bb60-73fcc4fabdc5"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/1DD7-85F5"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - fileSystems."/mnt/media" = { - device = "/dev/disk/by-uuid/d441ef68-e6c5-4407-8ab4-f85855c2848a"; - fsType = "ext4"; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/8478cb29-8a67-4842-b9ed-16a226506cb7"; } - ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/systems/odino/nixos/locales.nix b/systems/odino/nixos/locales.nix deleted file mode 100644 index 2d2363d..0000000 --- a/systems/odino/nixos/locales.nix +++ /dev/null @@ -1,20 +0,0 @@ -{...}: { - time.timeZone = "Europe/Rome"; - console.keyMap = "it"; - - i18n = { - defaultLocale = "en_US.UTF-8"; - - extraLocaleSettings = { - LC_ADDRESS = "it_IT.UTF-8"; - LC_IDENTIFICATION = "it_IT.UTF-8"; - LC_MEASUREMENT = "it_IT.UTF-8"; - LC_MONETARY = "it_IT.UTF-8"; - LC_NAME = "it_IT.UTF-8"; - LC_NUMERIC = "it_IT.UTF-8"; - LC_PAPER = "it_IT.UTF-8"; - LC_TELEPHONE = "it_IT.UTF-8"; - LC_TIME = "it_IT.UTF-8"; - }; - }; -} diff --git a/systems/odino/nixos/networking.nix b/systems/odino/nixos/networking.nix deleted file mode 100644 index 3ab8e46..0000000 --- a/systems/odino/nixos/networking.nix +++ /dev/null @@ -1,31 +0,0 @@ -{lib, ...}: { - networking = { - hostName = "odino"; - useDHCP = lib.mkDefault true; - - nameservers = [ "208.67.222.222" "208.67.220.220" ]; - - firewall = { - enable = true; - - allowedTCPPorts = [ 22 ]; - allowedUDPPorts = [ 51820 ]; - }; - - networkmanager.enable = true; - - wg-quick.interfaces."tunnel" = { - privateKeyFile = "/home/leo/.wireguard/private.key"; - address = [ "10.69.0.2/24" ]; - - peers = [ - { - publicKey = "rwUMCdhjQbQt9uGjljfdABj4DSJFgL62bzT13sg8LmU="; - allowedIPs = [ "10.69.0.0/24" ]; - endpoint = "leoflo.me:51820"; - persistentKeepalive = 25; - } - ]; - }; - }; -} diff --git a/systems/odino/nixos/programs.nix b/systems/odino/nixos/programs.nix deleted file mode 100644 index 965e31b..0000000 --- a/systems/odino/nixos/programs.nix +++ /dev/null @@ -1,26 +0,0 @@ -{inputs, pkgs, ...}: { - imports = [ - ../../../components/programs/git.nix - - inputs.home-manager.nixosModules.home-manager - ]; - - nixpkgs.config.allowUnfree = true; - - # Packages - environment.systemPackages = with pkgs; [ - ascii file fastfetch eza btop dysk - openssh rsync wireguard-tools dig - tmux vim - - # Home manager - inputs.home-manager.packages.${stdenv.hostPlatform.system}.home-manager - ]; - - # Docker - virtualisation.docker.enable = true; - users.extraGroups."docker".members = [ "leo" ]; - - # Custom modules - git.enable = true; -} diff --git a/systems/odino/nixos/services.nix b/systems/odino/nixos/services.nix deleted file mode 100644 index 534073a..0000000 --- a/systems/odino/nixos/services.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - imports = [ - ../../../components/services/openssh.nix - ]; - - # Custom modules - openssh.enable = true; -} diff --git a/systems/odino/programs.nix b/systems/odino/programs.nix new file mode 100644 index 0000000..34c0eaa --- /dev/null +++ b/systems/odino/programs.nix @@ -0,0 +1,26 @@ +{inputs, pkgs, ...}: { + imports = [ + ../../components/programs/git.nix + + inputs.home-manager.nixosModules.home-manager + ]; + + nixpkgs.config.allowUnfree = true; + + # Packages + environment.systemPackages = with pkgs; [ + ascii file fastfetch eza btop dysk + openssh rsync wireguard-tools dig + tmux vim + + # Home manager + inputs.home-manager.packages.${stdenv.hostPlatform.system}.home-manager + ]; + + # Docker + virtualisation.docker.enable = true; + users.extraGroups."docker".members = [ "leo" ]; + + # Custom modules + git.enable = true; +} diff --git a/systems/odino/services.nix b/systems/odino/services.nix new file mode 100644 index 0000000..6b25e0d --- /dev/null +++ b/systems/odino/services.nix @@ -0,0 +1,8 @@ +{...}: { + imports = [ + ../../components/services/openssh.nix + ]; + + # Custom modules + openssh.enable = true; +} -- cgit v1.3