diff options
-rw-r--r-- | flake.nix | 22 | ||||
-rw-r--r-- | machines/x220-gnome/configuration.nix | 79 | ||||
-rw-r--r-- | machines/x220-gnome/gnome.nix | 59 | ||||
-rw-r--r-- | machines/x220-gnome/hardware-configuration.nix | 51 |
4 files changed, 211 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4b907d4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "Nixos config flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + + # home-manager = { + # url = "github:nix-community/home-manager"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + ./machines/x220-gnome/configuration.nix + # inputs.home-manager.nixosModules.default + ]; + }; + }; +} diff --git a/machines/x220-gnome/configuration.nix b/machines/x220-gnome/configuration.nix new file mode 100644 index 0000000..898f71e --- /dev/null +++ b/machines/x220-gnome/configuration.nix @@ -0,0 +1,79 @@ +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./gnome.nix + ./hardware-configuration.nix + ]; + +# 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 = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; +# Define a user account. Don't forget to set a password with ‘passwd’. + users.users.pn = { + isNormalUser = true; + description = "Patryk Niedzwiedzinski"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + gnomeExtensions.gsconnect + ]; + }; + + programs.vim.defaultEditor = true; + programs.nano.enable = false; + programs.git.enable = true; + +# Allow unfree packages + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = [ "flakes" "nix-command" ]; + +# List packages installed in system profile. To search, run: +# $ nix search wget + 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 + ]; + +# 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; +# }; + + +# 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 = "24.05"; # Did you read the comment? + +} diff --git a/machines/x220-gnome/gnome.nix b/machines/x220-gnome/gnome.nix new file mode 100644 index 0000000..2ca8aed --- /dev/null +++ b/machines/x220-gnome/gnome.nix @@ -0,0 +1,59 @@ +{ pkgs, ... }: +{ +# Enable the X11 windowing system. + services.xserver.enable = true; + +# Enable the GNOME Desktop Environment. + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + services.xserver.desktopManager.xterm.enable = false; + services.xserver.excludePackages = [ pkgs.xterm ]; + + environment.gnome.excludePackages = with pkgs.gnome; [ + baobab totem yelp file-roller seahorse gnome-clocks pkgs.gnome-connections + pkgs.gnome-tour + ]; + + services.xserver.desktopManager.gnome.extraGSettingsOverrides = '' + [org.gnome.desktop.wm.keybindings] + close = ["<Super>q"] + + [org.gnome.settings-daemon.plugins.media-keys] + custom-keybindings = ["org/gnome/settings-daemon/plugins/media-keys/custom0/"] + + [org.gnome.settings-daemon.plugins.media-keys.custom0] + binding = ["<Super><Enter>"] + command = ["kgx"] + name = ["GNOME Console"] + ''; + +# 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. + 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; + }; + + documentation.nixos.enable = false; +} diff --git a/machines/x220-gnome/hardware-configuration.nix b/machines/x220-gnome/hardware-configuration.nix new file mode 100644 index 0000000..7db32ec --- /dev/null +++ b/machines/x220-gnome/hardware-configuration.nix @@ -0,0 +1,51 @@ +# 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.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.luks.devices."luks-9f3a316a-7177-4122-a4f5-03fbd375d6e1".device = "/dev/disk/by-uuid/9f3a316a-7177-4122-a4f5-03fbd375d6e1"; + networking.hostName = "nixos"; # Define your hostname. + + + boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/01db2679-e134-4870-b503-a0e616432175"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-8a50e0b7-d2a7-4b0c-b092-9194536cae41".device = "/dev/disk/by-uuid/8a50e0b7-d2a7-4b0c-b092-9194536cae41"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D259-64AC"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/a7366f52-418f-47a7-bb29-fbd394d559ee"; } + ]; + + # 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.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwp0s29u1u4i6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} |