From 68d67965f5f4a660cebbb1e21f5bd5be785d739a Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Sun, 18 Dec 2022 17:07:40 +0100 Subject: [PATCH] formatting --- flake.nix | 1 + hosts/thinkpad/configuration.nix | 355 ++++++++++++++++--------------- 2 files changed, 179 insertions(+), 177 deletions(-) diff --git a/flake.nix b/flake.nix index 57a3740..c13f504 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ system = "x86_64-linux"; modules = [ ./hosts/thinkpad/configuration.nix + home-manager.nixosModules.home-manager ]; }; }; diff --git a/hosts/thinkpad/configuration.nix b/hosts/thinkpad/configuration.nix index 30459af..18acfec 100755 --- a/hosts/thinkpad/configuration.nix +++ b/hosts/thinkpad/configuration.nix @@ -1,208 +1,209 @@ { config, pkgs, lib, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "thinkpad"; # Define your hostname. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - networking.firewall = { - allowedUDPPorts = [51820]; - checkReversePath = false; - }; + networking.hostName = "thinkpad"; # Define your hostname. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + networking.firewall = { + allowedUDPPorts = [ 51820 ]; + checkReversePath = false; + }; - # Set your time zone. - time.timeZone = "Europe/Berlin"; + # Set your time zone. + time.timeZone = "Europe/Berlin"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - useXkbConfig = true; # use xkbOptions in tty. - }; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + useXkbConfig = true; # use xkbOptions in tty. + }; - # Enable the X11 windowing system. - services.xserver = { - enable = true; + # Enable the X11 windowing system. + services.xserver = { + enable = true; - displayManager = { - lightdm.enable = true; - defaultSession = "none+awesome"; - }; - windowManager.awesome = { - enable = true; - luaModules = with pkgs.luaPackages; [ - luarocks - vicious - ]; - }; - libinput.enable = true; - }; + displayManager = { + lightdm.enable = true; + defaultSession = "none+awesome"; + }; + windowManager.awesome = { + enable = true; + luaModules = with pkgs.luaPackages; [ + luarocks + vicious + ]; + }; + libinput.enable = true; + }; - - # Configure keymap in X11 - services.xserver.layout = "us"; - services.xserver.xkbVariant = "dvorak-alt-intl"; - services.xserver.displayManager.sessionCommands = - "${pkgs.xorg.xmodmap}/bin/xmodmap ${pkgs.writeText "xkb-layout" '' - keycode 108 = Mode_switch - keycode 94 = Shift_L NoSymbol Shift_L - keysym a = a A adiaeresis Adiaeresis - keysym o = o O odiaeresis Odiaeresis - keysym u = u U udiaeresis Udiaeresis - keysym s = s S ssharp - ''}"; - # Enable sound. - sound.enable = true; - hardware.pulseaudio.enable = true; - hardware.bluetooth.enable = true; + # Configure keymap in X11 + services.xserver.layout = "us"; + services.xserver.xkbVariant = "dvorak-alt-intl"; + services.xserver.displayManager.sessionCommands = + "${pkgs.xorg.xmodmap}/bin/xmodmap ${pkgs.writeText "xkb-layout" '' + keycode 108 = Mode_switch + keycode 94 = Shift_L NoSymbol Shift_L + keysym a = a A adiaeresis Adiaeresis + keysym o = o O odiaeresis Odiaeresis + keysym u = u U udiaeresis Udiaeresis + keysym s = s S ssharp + ''}"; - environment.variables = { EDITOR = "vim"; }; + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + hardware.bluetooth.enable = true; - # enable polkit - security.polkit.enable = true; + environment.variables = { EDITOR = "vim"; }; - # Define a user account. - users.users.rouven = { - isNormalUser = true; - extraGroups = [ "wheel" "video" "network" "libvirtd"]; - }; + # enable polkit + security.polkit.enable = true; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - ((vim_configurable.override { }).customize{ - name = "vim"; - vimrcConfig.packages.myplugins = with pkgs.vimPlugins; { - start = [ vim-nix vim-lastplace ]; - opt = []; - }; - vimrcConfig.customRC = '' + # Define a user account. + users.users.rouven = { + isNormalUser = true; + extraGroups = [ "wheel" "video" "network" "libvirtd" ]; + }; - " basic commands bound to uppercase key - command Q q - command W w - command Wq wq - command WQ wq - - set number relativenumber - set tabstop=4 - set shiftwidth=4 - set smartcase - set colorcolumn=120 - set nowrap - syntax on - highlight ColorColumn ctermbg=darkgray - - nnoremap ; : - nnoremap : ; - vnoremap ; : - vnoremap : ; - - " set space as leader - nnoremap - let mapleader = " " - - - " beautify indents - :set list lcs=tab:\|\ - - "remove ex-mode shortcut - nmap Q - - " quickfixlist binds - nnoremap :cnext - nnoremap :cprev - - " locallist binds - nnoremap :lnext - nnoremap :lprev - - " split keybinds - nnoremap s :sp - nnoremap v :vs - - nnoremap h h - nnoremap j j - nnoremap k k - nnoremap l l - ''; - } - ) - # essentials - wget - git - gcc - htop - tmux - dig - traceroute - killall - xorg.xmodmap - # libs - libyubikey - libfido2 - # dev - jdk - maven - # virtualisation - virt-manager - ]; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + ((vim_configurable.override { }).customize { + name = "vim"; + vimrcConfig.packages.myplugins = with pkgs.vimPlugins; { + start = [ vim-nix vim-lastplace ]; + opt = [ ]; + }; + vimrcConfig.customRC = '' - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; + " basic commands bound to uppercase key + command Q q + command W w + command Wq wq + command WQ wq + + set number relativenumber + set tabstop=4 + set shiftwidth=4 + set smartcase + set colorcolumn=120 + set nowrap + syntax on + highlight ColorColumn ctermbg=darkgray + + nnoremap ; : + nnoremap : ; + vnoremap ; : + vnoremap : ; + + " set space as leader + nnoremap + let mapleader = " " + + + " beautify indents + :set list lcs=tab:\|\ + + "remove ex-mode shortcut + nmap Q + + " quickfixlist binds + nnoremap :cnext + nnoremap :cprev + + " locallist binds + nnoremap :lnext + nnoremap :lprev + + " split keybinds + nnoremap s :sp + nnoremap v :vs + + nnoremap h h + nnoremap j j + nnoremap k k + nnoremap l l + ''; + } + ) + # essentials + wget + git + gcc + htop + tmux + dig + traceroute + killall + xorg.xmodmap + # libs + libyubikey + libfido2 + # dev + jdk + maven + # virtualisation + virt-manager + ]; - programs.light.enable = true; # display brightness manager - programs.kdeconnect.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; - # List services that you want to enable: - services.blueman.enable = true; - services.devmon.enable = true; - services.pcscd.enable = true; # yubikey and smartcard stuff - services.printing.enable = true; - services.fprintd.enable = true; + programs.light.enable = true; # display brightness manager + programs.kdeconnect.enable = true; - # Automatically configure displays - services.autorandr.enable = true; + # List services that you want to enable: + services.blueman.enable = true; + services.devmon.enable = true; + services.pcscd.enable = true; # yubikey and smartcard stuff + services.printing.enable = true; + services.fprintd.enable = true; + + # Automatically configure displays + services.autorandr.enable = true; - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "steam" - "steam-original" - "steam-runtime" - "steam-run" - ]; - - programs.steam.enable = true; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "steam" + "steam-original" + "steam-runtime" + "steam-run" + ]; - services.udev.packages = [ pkgs.yubikey-personalization ]; + programs.steam.enable = true; - virtualisation.libvirtd.enable = true; + services.udev.packages = [ pkgs.yubikey-personalization ]; - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - system.copySystemConfiguration = true; + virtualisation.libvirtd.enable = true; - # 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 = "22.11"; # Did you read the comment? + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + system.copySystemConfiguration = true; + + # 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 = "22.11"; # Did you read the comment? }