From 62100c9265a4de389d1ea8060cbddddacde161a7 Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Thu, 12 Sep 2024 21:44:46 -0300 Subject: split users/leonardo.nix into modules with options in order to be able to deploy just a few of those to iori.nix --- hosts/hanekawa/configuration.nix | 108 ------------------------------ hosts/hanekawa/hardware-configuration.nix | 77 --------------------- hosts/iori.nix | 37 ++++++++++ hosts/iori/configuration.nix | 17 ----- hosts/kunagisa.nix | 52 ++++++++++++++ hosts/kunagisa/configuration.nix | 63 ----------------- hosts/kunagisa/hardware-configuration.nix | 44 ------------ hosts/larissa.nix | 69 +++++++++++++++++++ hosts/larissa/configuration.nix | 106 ----------------------------- hosts/larissa/hardware-configuration.nix | 51 -------------- 10 files changed, 158 insertions(+), 466 deletions(-) delete mode 100644 hosts/hanekawa/configuration.nix delete mode 100644 hosts/hanekawa/hardware-configuration.nix create mode 100644 hosts/iori.nix delete mode 100644 hosts/iori/configuration.nix create mode 100644 hosts/kunagisa.nix delete mode 100644 hosts/kunagisa/configuration.nix delete mode 100644 hosts/kunagisa/hardware-configuration.nix create mode 100644 hosts/larissa.nix delete mode 100644 hosts/larissa/configuration.nix delete mode 100644 hosts/larissa/hardware-configuration.nix (limited to 'hosts') diff --git a/hosts/hanekawa/configuration.nix b/hosts/hanekawa/configuration.nix deleted file mode 100644 index e646c98..0000000 --- a/hosts/hanekawa/configuration.nix +++ /dev/null @@ -1,108 +0,0 @@ -# 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’). - -{ config, pkgs, lib, inputs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "hanekawa"; # Define your hostname. - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/Sao_Paulo"; - - # Select internationalisation properties. - i18n.defaultLocale = "pt_BR.UTF-8"; - - # Enable the X11 windowing system. - services.touchegg.enable = true; - services.xserver = { - enable = true; - xkb.layout = "br"; - xkb.variant = ""; - libinput = { - enable = true; - touchpad = { - tapping = true; - scrollMethod = "twofinger"; - clickMethod = "clickfinger"; - tappingButtonMap = "lrm"; - }; - }; - videoDrivers = [ "nvidia" ]; - }; - - # Configure console keymap - console.keyMap = "br-abnt2"; - - # Enable CUPS to print documents. - services.printing.enable = true; - - services.thermald.enable = true; - - # Enable sound with pipewire. - sound.enable = true; - - security.rtkit.enable = true; - services.fstrim.enable = lib.mkDefault true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.leonardo = { - isNormalUser = true; - description = "leonardo"; - extraGroups = [ "networkmanager" "wheel" ]; - }; - - fonts = { - fontconfig.enable = true; - packages = [(pkgs.nerdfonts.override { fonts = [ "Iosevka" "FiraCode" ]; })]; - }; - - # Allow unfree packages - services.openssh.enable = true; - programs.ssh = { - forwardX11 = true; - startAgent = true; - }; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # 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. It‘s 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 = "23.05"; # Did you read the comment? - -} diff --git a/hosts/hanekawa/hardware-configuration.nix b/hosts/hanekawa/hardware-configuration.nix deleted file mode 100644 index 2b11bd6..0000000 --- a/hosts/hanekawa/hardware-configuration.nix +++ /dev/null @@ -1,77 +0,0 @@ -# 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, pkgs, modulesPath, ... }: - -{ - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - - ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - - boot.kernelModules = [ - "kvm-intel" - "i915" - ]; - boot.kernelParams = [ - "acpi_osi=Linux-Dell-Video" - ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/36536f52-8ca1-4a1e-b418-4016e529ea97"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6021-0AF8"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/51402149-30c4-475c-af19-c5d600b1ee8e"; } - ]; - - - - hardware = { - opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - pulseaudio.enable = false; - nvidia = { - modesetting.enable = true; - powerManagement = { enable = false; finegrained = false; }; - open = false; - nvidiaSettings = true; - prime = { - offload = { - enable = true; - enableOffloadCmd = true; - }; - sync.enable = false; - reverseSync.enable = false; - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; - opengl.extraPackages = [ pkgs.vaapiVdpau ]; - - }; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp4s0.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; -} diff --git a/hosts/iori.nix b/hosts/iori.nix new file mode 100644 index 0000000..896f836 --- /dev/null +++ b/hosts/iori.nix @@ -0,0 +1,37 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ lib, inputs, modulesPath, ... }: + +{ + imports = [ # Include the results of the hardware scan. + inputs.nixos-hardware.nixosModules.raspberry-pi-4 + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + santi-modules = { + default-user.enable = true; + basic.enable = true; + font-config.enable = false; + services.ddns.enable = true; + }; + + boot = { + loader.grub.enable = false; + loader.generic-extlinux-compatible.enable = true; + initrd.availableKernelModules = [ "xhci_pci" ]; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + networking = { + hostName = "iori"; # Define your hostname. + useDHCP = lib.mkDefault true; + }; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + system.stateVersion = "24.05"; # Did you read the comment? +} diff --git a/hosts/iori/configuration.nix b/hosts/iori/configuration.nix deleted file mode 100644 index db84c09..0000000 --- a/hosts/iori/configuration.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, inputs, ... }: -{ - imports = - [ inputs.nixos-hardware.nixosModules.raspberry-pi-4 ]; - # hardware = { - # raspberry-pi."4".apply-overlays-dtmerge.enable = true; - # }; - nixpkgs.overlays = [ - (final: super: { - makeModulesClosure = x: - super.makeModulesClosure (x // { allowMissing = true; }); - }) - ]; - - networking.hostName = "iori"; - system.stateVersion = "23.11"; -} diff --git a/hosts/kunagisa.nix b/hosts/kunagisa.nix new file mode 100644 index 0000000..60d7d65 --- /dev/null +++ b/hosts/kunagisa.nix @@ -0,0 +1,52 @@ +# 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’). + +{ config, pkgs, lib, modulesPath, inputs, ... }: { + imports = [ + inputs.mixrank.nixosModules.dev-machine + (modulesPath + "/installer/scan/not-detected.nix") + ]; + santi-modules.desktop-environment.enable = true; + # Bootloader. + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + initrd = { + availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; + kernelModules = [ "amdgpu" ]; + }; + binfmt.emulatedSystems = [ "aarch64-linux" ]; + kernelModules = [ "kvm-amd" ]; + kernelPackages = pkgs.linuxPackages_latest; + extraModulePackages = [ ]; + }; + + networking = { + hostName = "kunagisa"; # Define your hostname. + networkmanager.enable = true; + firewall.enable = false; + useDHCP = lib.mkDefault true; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/96c114a2-ffd7-476d-80fa-51e670c27e4b"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/AA22-4A81"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/1a204e5c-05cb-4e7f-b859-927fb024fb12"; } + ]; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + system.stateVersion = "23.05"; +} diff --git a/hosts/kunagisa/configuration.nix b/hosts/kunagisa/configuration.nix deleted file mode 100644 index 9965d92..0000000 --- a/hosts/kunagisa/configuration.nix +++ /dev/null @@ -1,63 +0,0 @@ -# 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’). - -{ config, pkgs, inputs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - - networking.hostName = "kunagisa"; # Define your hostname. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - networking.networkmanager.enable = true; - - time.timeZone = "America/Sao_Paulo"; - - i18n.defaultLocale = "pt_BR.UTF-8"; - - services.xserver = { - enable = true; - xkb = { - variant = ""; - layout = "br"; - }; - }; - - console.keyMap = "br-abnt2"; - - services.printing.enable = true; - - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - networking.firewall = { - enable = false; - # allowedTCPPorts = [ 12345 ]; - }; - - # 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. It‘s 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 = "23.05"; # Did you read the comment? -} diff --git a/hosts/kunagisa/hardware-configuration.nix b/hosts/kunagisa/hardware-configuration.nix deleted file mode 100644 index f98cb38..0000000 --- a/hosts/kunagisa/hardware-configuration.nix +++ /dev/null @@ -1,44 +0,0 @@ -# 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, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - # boot.kernelParams = [ - # "video=HDMI-1:1920x1080@60" - # "video=DP-2:2560x1080@75" - # ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/96c114a2-ffd7-476d-80fa-51e670c27e4b"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/AA22-4A81"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/1a204e5c-05cb-4e7f-b859-927fb024fb12"; } - ]; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/larissa.nix b/hosts/larissa.nix new file mode 100644 index 0000000..80f496b --- /dev/null +++ b/hosts/larissa.nix @@ -0,0 +1,69 @@ +# 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’). + +{ config, pkgs, lib, inputs, modulesPath, ... }: { + imports = [ + inputs.mixrank.nixosModules.dev-machine + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + santi-modules = { + desktop-environment.enable = true; + services.ddns.enable = true; + }; + # Bootloader. + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + initrd = { + luks.devices."luks-fc474bfb-2d0a-4a8a-99db-a55e15d8a836".device = "/dev/disk/by-uuid/fc474bfb-2d0a-4a8a-99db-a55e15d8a836"; + availableKernelModules = [ + "nvme" + "xhci_pci" + "thunderbolt" + "usb_storage" + "sd_mod" + ]; + }; + kernelPackages = pkgs.linuxPackages_latest; + kernelModules = [ "kvm-amd" ]; + kernelParams = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"] ; + }; + + networking = { + hostName = "larissa"; + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + }; + # Custom services for laptop + services = { + power-profiles-daemon.enable = lib.mkDefault true; + touchegg.enable = true; + fwupd.enable = true; + libinput = { + enable = true; + touchpad = { + tapping = true; + scrollMethod = "twofinger"; + clickMethod = "clickfinger"; + tappingButtonMap = "lrm"; + }; + }; + }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/bd4da861-db3f-4efd-82e1-ca925f8ef873"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/D40E-FE35"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + }; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + system.stateVersion = "23.11"; +} diff --git a/hosts/larissa/configuration.nix b/hosts/larissa/configuration.nix deleted file mode 100644 index 9057de4..0000000 --- a/hosts/larissa/configuration.nix +++ /dev/null @@ -1,106 +0,0 @@ -# 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’). - -{ config, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - services.fwupd.enable = true; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "larissa"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/Sao_Paulo"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "pt_BR.UTF-8"; - LC_IDENTIFICATION = "pt_BR.UTF-8"; - LC_MEASUREMENT = "pt_BR.UTF-8"; - LC_MONETARY = "pt_BR.UTF-8"; - LC_NAME = "pt_BR.UTF-8"; - LC_NUMERIC = "pt_BR.UTF-8"; - LC_PAPER = "pt_BR.UTF-8"; - LC_TELEPHONE = "pt_BR.UTF-8"; - LC_TIME = "pt_BR.UTF-8"; - }; - - services.touchegg.enable = true; - # Configure keymap in X11 - services.xserver = { - enable = true; - xkb = { - variant = "abnt2"; - layout = "br"; - }; - }; - services.libinput = { - enable = true; - touchpad = { - tapping = true; - scrollMethod = "twofinger"; - clickMethod = "clickfinger"; - tappingButtonMap = "lrm"; - }; - }; - - console.keyMap = "br-abnt2"; - # Enable CUPS to print documents. - services.printing.enable = true; - - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # 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. It‘s 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 = "23.11"; # Did you read the comment? - -} diff --git a/hosts/larissa/hardware-configuration.nix b/hosts/larissa/hardware-configuration.nix deleted file mode 100644 index 4a17244..0000000 --- a/hosts/larissa/hardware-configuration.nix +++ /dev/null @@ -1,51 +0,0 @@ -# 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, inputs, pkgs, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - inputs.nixos-hardware.nixosModules.framework-13-7040-amd - ]; - - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "thunderbolt" - "usb_storage" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelModules = [ "kvm-amd" ]; - boot.kernelParams = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"] ; - boot.extraModulePackages = [ ]; - - services.power-profiles-daemon.enable = lib.mkDefault true; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/bd4da861-db3f-4efd-82e1-ca925f8ef873"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-fc474bfb-2d0a-4a8a-99db-a55e15d8a836".device = "/dev/disk/by-uuid/fc474bfb-2d0a-4a8a-99db-a55e15d8a836"; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D40E-FE35"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} -- cgit v1.2.3