From f051c4de99d635c0ea82e9e9351ee99e720def23 Mon Sep 17 00:00:00 2001 From: Sasza Stanczew Date: Tue, 10 Feb 2026 15:37:43 +0100 Subject: [PATCH] =?UTF-8?q?NOT=20TESTED=20-=20posprz=C4=85tanie=20repox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.nix | 16 ++++ configuration.nix | 38 -------- flake.nix | 18 ++-- hosts/nix-latitude/configuration.nix | 89 +++++++++++++++++++ hosts/nix-latitude/hardware-configuration.nix | 33 +++++++ modules/network.nix | 2 +- modules/office.nix | 1 - modules/plasma.nix | 44 +++++++++ 8 files changed, 194 insertions(+), 47 deletions(-) create mode 100644 base.nix delete mode 100644 configuration.nix create mode 100644 hosts/nix-latitude/configuration.nix create mode 100644 hosts/nix-latitude/hardware-configuration.nix create mode 100644 modules/plasma.nix diff --git a/base.nix b/base.nix new file mode 100644 index 0000000..613b27d --- /dev/null +++ b/base.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + + # Włączamy Flakes + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # paczki systemowe + environment.systemPackages = with pkgs; [ + neovim + git + openssh + wget + tree + ]; + + nixpkgs.config.allowUnfree = true; +} diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index a973ae0..0000000 --- a/configuration.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - # ./modules/gaming.nix - ./modules/network.nix - ./modules/office.nix - ./modules/3dprint.nix - ]; - - # Włączamy Flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Bootloader (standard dla UEFI) - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Sieć - networking.hostName = "nix-latitude"; - networking.networkmanager.enable = true; - - # paczki systemowe - environment.systemPackages = with pkgs; [ - neovim - git - openssh - wget - ]; - - # Użytkownik - users.users.sasza = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - shell = pkgs.zsh; # Możesz zmienić na bash - }; - - nixpkgs.config.allowUnfree = true; - system.stateVersion = "24.11"; -} diff --git a/flake.nix b/flake.nix index f71cd50..bd6bc7f 100644 --- a/flake.nix +++ b/flake.nix @@ -15,8 +15,8 @@ inherit system; modules = [ { networking.hostName = hostname; } - /etc/nixos/configuration.nix - ./common.nix + # base configuration + ./base.nix # home manager home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; @@ -27,15 +27,19 @@ }; in { nixosConfigurations = { - nix-latitude = mkSystem "x86_64-linux" "nix-latitude" [ - ./modules/network.nix - ./modules/office.nix + nix-latitude = mk_system "x86_64-linux" "nix-latitude" [ + ./hosts/nix-latitude/configuration.nix + ./modules/plasma.nix + #./modules/network.nix + #./modules/office.nix ]; - nix-gaming = mkSystem "x86_64-linux" "nix-gaming" [ + nix-gaming = mk_system "x86_64-linux" "nix-gaming" [ + ./hosts/nix-gaming/configuration.nix + ./modules/plasma.nix ./modules/gaming.nix ./modules/network.nix - ./modules/office.nix + # ./modules/office.nix ./modules/3dprint.nix ]; }; diff --git a/hosts/nix-latitude/configuration.nix b/hosts/nix-latitude/configuration.nix new file mode 100644 index 0000000..c75460d --- /dev/null +++ b/hosts/nix-latitude/configuration.nix @@ -0,0 +1,89 @@ +# 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 + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Use latest kernel. + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.hostName = "nix-latitude"; # 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 = "Europe/Warsaw"; + + # Select internationalisation properties. + i18n.defaultLocale = "pl_PL.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "pl_PL.UTF-8"; + LC_IDENTIFICATION = "pl_PL.UTF-8"; + LC_MEASUREMENT = "pl_PL.UTF-8"; + LC_MONETARY = "pl_PL.UTF-8"; + LC_NAME = "pl_PL.UTF-8"; + LC_NUMERIC = "pl_PL.UTF-8"; + LC_PAPER = "pl_PL.UTF-8"; + LC_TELEPHONE = "pl_PL.UTF-8"; + LC_TIME = "pl_PL.UTF-8"; + }; + + # Configure console keymap + console.keyMap = "pl2"; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.sasza = { + isNormalUser = true; + description = "Sasza Stanczew"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + kdePackages.kate + # thunderbird + ]; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = 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 = "25.11"; # Did you read the comment? + +} diff --git a/hosts/nix-latitude/hardware-configuration.nix b/hosts/nix-latitude/hardware-configuration.nix new file mode 100644 index 0000000..2246201 --- /dev/null +++ b/hosts/nix-latitude/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/aaa59e12-919c-4d39-a894-5bd6faed1070"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1601-037B"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/1ee3d4d9-86aa-4e13-9027-39f7078d4c17"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/network.nix b/modules/network.nix index ae346df..ee2dff8 100644 --- a/modules/network.nix +++ b/modules/network.nix @@ -3,7 +3,7 @@ # paczki users.users.sasza.packages = with pkgs; [ eddie + wireguard-tools qbittorrent - ]; } diff --git a/modules/office.nix b/modules/office.nix index b68efd7..329fc8b 100644 --- a/modules/office.nix +++ b/modules/office.nix @@ -3,6 +3,5 @@ # paczki users.users.sasza.packages = with pkgs; [ libreoffice-fresh - ]; } diff --git a/modules/plasma.nix b/modules/plasma.nix new file mode 100644 index 0000000..b573602 --- /dev/null +++ b/modules/plasma.nix @@ -0,0 +1,44 @@ +{ pkgs, ... }: { + + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "pl"; + variant = ""; + }; + + # Enable sound with pipewire. + services.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; + }; + + # paczki graficzne + environment.systemPackages = with pkgs; [ + brave + ]; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Install firefox. + # programs.firefox.enable = true; + +}