diff --git a/flake.lock b/flake.lock index 413f993..0b058ef 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712310679, - "narHash": "sha256-XgC/a/giEeNkhme/AV1ToipoZ/IVm1MV2ntiK4Tm+pw=", + "lastModified": 1712437997, + "narHash": "sha256-g0whLLwRvgO2FsyhY8fNk+TWenS3jg5UdlWL4uqgFeo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "72da83d9515b43550436891f538ff41d68eecc7f", + "rev": "e38d7cb66ea4f7a0eb6681920615dfcc30fc2920", "type": "github" }, "original": { @@ -38,11 +38,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1712163089, - "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3fcdef7..9aa970f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Zion Flake!"; + description = "Mike's Flake"; inputs = { nixpkgs.url = "nixpkgs/nixos-23.11"; @@ -14,11 +14,27 @@ system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; + systemSettings = { + profile = "thor"; # select 'thor' or 'zion' + }; in { nixosConfigurations = { zion = lib.nixosSystem { inherit system; - modules = [ ./configuration.nix ]; + modules = [ + (./. + ("/" + systemSettings.profile) + + "/configuration.nix") + ]; + specialArgs = { + inherit pkgs-unstable; + }; + }; + thor = lib.nixosSystem { + inherit system; + modules = [ + (./. + ("/" + systemSettings.profile) + + "/configuration.nix") + ]; specialArgs = { inherit pkgs-unstable; }; @@ -27,7 +43,10 @@ homeConfigurations = { mike = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = [ ./home.nix ]; + modules = [ + (./. + ("/" + systemSettings.profile) + + "/configuration.nix") + ]; extraSpecialArgs = { inherit pkgs-unstable; }; diff --git a/thor/configuration.nix b/thor/configuration.nix new file mode 100644 index 0000000..aaed2fa --- /dev/null +++ b/thor/configuration.nix @@ -0,0 +1,157 @@ +# 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, pkgs-unstable, ... }: + +{ + 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 = "thor"; # 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 = "en_US.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"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + + environment.shells = with pkgs; [ bash zsh ]; + users.defaultUserShell = pkgs.zsh; + programs.zsh.enable = true; + + # Configure keymap in X11 + services.xserver = { + layout = "pl"; + xkbVariant = ""; + }; + + # Configure console keymap + console.keyMap = "pl2"; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.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; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.mike = { + isNormalUser = true; + description = "Mike"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = [ + pkgs.discord + pkgs.spotify + ]; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + environment.systemPackages = + (with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + git + neofetch + zsh + pavucontrol + home-manager + firefox + htop + nerdfonts + ntfs3g + dosfstools + woeusb + ]) + + ++ + + (with pkgs-unstable; [ + neovim + ]); + + # 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 = "23.11"; # Did you read the comment? + + # Allow unfree packages + nixpkgs.config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + }; +} diff --git a/thor/hardware-configuration.nix b/thor/hardware-configuration.nix new file mode 100644 index 0000000..1ad4e74 --- /dev/null +++ b/thor/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + boot.kernelParams = [ "resume=/var/swapfile" "resume_offset=16230400" ]; + boot.resumeDevice = "/dev/disk/by-uuid/9bf8fe18-8b72-4e43-a472-546260574b1e"; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/9bf8fe18-8b72-4e43-a472-546260574b1e"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/09BA-3F6F"; + fsType = "vfat"; + }; + + swapDevices = [ { device = "/var/swapfile"; size = 32 * 1024; } ]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/configuration.nix b/zion/configuration.nix similarity index 100% rename from configuration.nix rename to zion/configuration.nix diff --git a/hardware-configuration.nix b/zion/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to zion/hardware-configuration.nix