diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..64d3d6a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/configs/common.nix b/configs/common.nix index 978dfb5..502b5c2 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -1,10 +1,13 @@ { config, pkgs, lib, ... }: { + boot.tmpOnTmpfs = true; environment.systemPackages = with pkgs; [ ack + atop dfc git + lsof glances home-manager htop @@ -23,4 +26,10 @@ tree lm_sensors ]; + + documentation.enable = false; + documentation.nixos.enable = false; + #documentation.man.enable = false; + documentation.info.enable = false; + documentation.doc.enable = false; } diff --git a/configs/gui.nix b/configs/gui.nix index dd772a9..a134634 100644 --- a/configs/gui.nix +++ b/configs/gui.nix @@ -3,11 +3,12 @@ { environment.systemPackages = with pkgs; [ kitty + signal-desktop chromium gparted keepassxc meld - twemoji-color-font + # twemoji-color-font mpv brave firefox @@ -25,4 +26,67 @@ gnome.eog virtmanager ]; + + fonts = { + enableDefaultFonts = true; + fontDir.enable = true; + + fonts = with pkgs; [ + fira-mono + libertine + open-sans + twemoji-color-font + liberation_ttf + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + ]; + + fontconfig = { + enable = true; + antialias = true; + defaultFonts = { + # monospace = [ "Fira Mono" ]; + serif = [ "Linux Libertine" ]; + sansSerif = [ "Open Sans" ]; + emoji = [ "Twitter Color Emoji" ]; + }; + }; + }; + + programs.dconf.enable = true; + + nixpkgs.config.chromium.commandLineArgs = "--enable-features=WebUIDarkMode,NativeNotifications,VaapiVideoDecoder --ignore-gpu-blocklist --use-gl=desktop --force-dark-mode --disk-cache-dir=/tmp/cache"; + programs.chromium = { + enable = true; + extensions = [ + "cbnipbdpgcncaghphljjicfgmkonflee" # Axel Springer Blocker + "cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin + "mnjggcdmjocbbbhaepdhchncahnbgone" # SponsorBlock for YouTube + "hjdoplcnndgiblooccencgcggcoihigg" # Terms of Service; Didn’t Read + "gcbommkclmclpchllfjekcdonpmejbdp" # HTTPS Everywhere + "oboonakemofpalcgghocfoadofidjkkk" # KeePassXC-Browser + "fploionmjgeclbkemipmkogoaohcdbig" # Page load time + "egnjhciaieeiiohknchakcodbpgjnchh" # Tab Wrangler + "fnaicdffflnofjppbagibeoednhnbjhg" # Floccus bookmarks + ]; + extraOpts = { + "BrowserSignin" = 0; + "SyncDisabled" = true; + "PasswordManagerEnabled" = false; + "AutofillAddressEnabled" = true; + "AutofillCreditCardEnabled" = false; + "BuiltInDnsClientEnabled" = false; + "MetricsReportingEnabled" = true; + "SearchSuggestEnabled" = false; + "AlternateErrorPagesEnabled" = false; + "UrlKeyedAnonymizedDataCollectionEnabled" = false; + "SpellcheckEnabled" = true; + "SpellcheckLanguage" = [ + "de" + "en-US" + ]; + "CloudPrintSubmitEnabled" = false; + }; + }; } diff --git a/configs/user.nix b/configs/user.nix new file mode 100644 index 0000000..3a55c95 --- /dev/null +++ b/configs/user.nix @@ -0,0 +1,128 @@ +{ config, pkgs, lib, ... }: +{ + imports = [ ]; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users = { + defaultUserShell = pkgs.zsh; + + users.alex = { + isNormalUser = true; + extraGroups = [ "wheel" "docker" "networkmanager" "libvirtd" ]; + }; + }; + + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + + home-manager.users.alex = { pkgs, ... }: { + home.packages = [ + pkgs.cryfs + pkgs.cinnamon.nemo + ]; + + dconf.enable = true; + dconf.settings = with lib.hm.gvariant; { + "org/gnome/desktop/wm/preferences".button-layout = "close:maximize"; + # visual-bell = false; + # titlebar-font = "Liberation Sans Bold 9"; + # }; + # "org/gnome/mutter" = { + # button-mode = "programming"; + # show-thousands = true; + # base = 10; + # word-size = 64; + # window-position = lib.hm.gvariant.mkTuple [100 100]; + # }; + }; + + programs = { + ssh = { + enable = true; + serverAliveInterval = 60; + }; + + git = { + enable = true; + userName = "Alexander Szczepanski"; + userEmail = "alexander@szczepan.ski"; + extraConfig = { + push = { default = "current"; }; + pull = { rebase = true; }; + }; + }; + + vscode = { + enable = true; + package = pkgs.vscode; + extensions = with pkgs.vscode-extensions; [ + bbenoist.Nix + justusadam.language-haskell + editorconfig.editorconfig + ms-azuretools.vscode-docker + #hsnazar.hyper-term-theme + #rafaelmaiolla.remote-vscode + eamodio.gitlens + ]; + # userSettings = { + # #"terminal.integrated.fontFamily" = "Hack"; + # "workbench.colorTheme" = "Hyper Term Black"; + # "window.titleBarStyle" = "custom"; + # }; + }; + + mpv = { + enable = true; + }; + + kitty = { + enable = true; + extraConfig = '' + enabled_layouts splits:split_axis=vertical + enable_audio_bell false + + map F5 launch --location=hsplit + map F6 launch --location=vsplit + map F7 layout_action rotate + + map shift+up move_window up + map shift+left move_window left + map shift+right move_window right + map shift+down move_window down + + map ctrl+left neighboring_window left + map ctrl+right neighboring_window right + map ctrl+up neighboring_window up + map ctrl+down neighboring_window down + + background #000000 + foreground #e9e9e9 + cursor #e9e9e9 + selection_background #424242 + color0 #000000 + color8 #000000 + color1 #d44d53 + color9 #d44d53 + color2 #b9c949 + color10 #b9c949 + color3 #e6c446 + color11 #e6c446 + color4 #79a6da + color12 #79a6da + color5 #c396d7 + color13 #c396d7 + color6 #70c0b1 + color14 #70c0b1 + color7 #fffefe + color15 #fffefe + selection_foreground #000000 + ''; + }; + }; + + # manuals not needed + manual.html.enable = false; + manual.json.enable = false; + manual.manpages.enable = false; + }; +} diff --git a/machine/desktop/configuration.nix b/machine/desktop/configuration.nix index b14089e..3a3a690 100644 --- a/machine/desktop/configuration.nix +++ b/machine/desktop/configuration.nix @@ -7,16 +7,16 @@ in imports = [ # Include the results of the hardware scan. /etc/nixos/hardware-configuration.nix -# ./vscode.nix ../../configs/gui.nix ../../configs/virtualisation.nix ../../configs/common.nix + ../../configs/user.nix ]; # Use the systemd-boot EFI boot loader. fileSystems."/".options = [ "noatime" "discard" ]; fileSystems."/boot".options = [ "noatime" "discard" ]; - fileSystems."/mnt/second" = { + fileSystems."/mnt/second" = { device = "/dev/disk/by-uuid/49c04c91-752d-4dff-b4d9-40a0b9a7bf7c"; fsType = "ext4"; options = [ "noatime" "discard" ]; @@ -32,7 +32,6 @@ in boot.plymouth.enable = true; boot.extraModulePackages = with pkgs.linuxPackages; [ it87 ]; boot.kernelModules = [ "it87" ]; - boot.tmpOnTmpfs = true; networking.hostName = "desktop"; # Define your hostname. @@ -50,39 +49,47 @@ in font = "latarcyrheb-sun32"; keyMap = "us"; }; - - hardware.fancontrol.enable = true; - hardware.fancontrol.config = '' - INTERVAL=10 - DEVPATH=hwmon2=devices/platform/it87.656 - DEVNAME=hwmon2=it8665 - FCTEMPS=hwmon2/pwm3=hwmon2/temp1_input hwmon2/pwm2=hwmon2/temp1_input hwmon2/pwm1=hwmon2/temp1_input - FCFANS=hwmon2/pwm3=hwmon2/fan2_input hwmon2/pwm2=hwmon2/fan1_input hwmon2/pwm1= - MINTEMP=hwmon2/pwm3=60 hwmon2/pwm2=60 hwmon2/pwm1=60 - MAXTEMP=hwmon2/pwm3=75 hwmon2/pwm2=75 hwmon2/pwm1=75 - MINSTART=hwmon2/pwm3=51 hwmon2/pwm2=51 hwmon2/pwm1=51 - MINSTOP=hwmon2/pwm3=51 hwmon2/pwm2=51 hwmon2/pwm1=51 - MINPWM=hwmon2/pwm1=51 hwmon2/pwm2=51 hwmon2/pwm3=51 - MAXPWM=hwmon2/pwm3=127 hwmon2/pwm2=204 - ''; + hardware = { + cpu.amd.updateMicrocode = true; - hardware.cpu.amd.updateMicrocode = true; - hardware.opengl.extraPackages = with pkgs; [ - rocm-opencl-icd - rocm-opencl-runtime - amdvlk - ]; + opengl = { + driSupport = true; + driSupport32Bit = true; + extraPackages = with pkgs; [ + rocm-opencl-icd + rocm-opencl-runtime + amdvlk + ]; + }; - hardware.opengl = { - driSupport = true; - driSupport32Bit = true; + fancontrol = { + enable = true; + config = '' + INTERVAL=10 + DEVPATH=hwmon2=devices/platform/it87.656 + DEVNAME=hwmon2=it8665 + FCTEMPS=hwmon2/pwm3=hwmon2/temp1_input hwmon2/pwm2=hwmon2/temp1_input hwmon2/pwm1=hwmon2/temp1_input + FCFANS=hwmon2/pwm3=hwmon2/fan2_input hwmon2/pwm2=hwmon2/fan1_input hwmon2/pwm1= + MINTEMP=hwmon2/pwm3=60 hwmon2/pwm2=60 hwmon2/pwm1=60 + MAXTEMP=hwmon2/pwm3=75 hwmon2/pwm2=75 hwmon2/pwm1=75 + MINSTART=hwmon2/pwm3=51 hwmon2/pwm2=51 hwmon2/pwm1=51 + MINSTOP=hwmon2/pwm3=51 hwmon2/pwm2=51 hwmon2/pwm1=51 + MINPWM=hwmon2/pwm1=51 hwmon2/pwm2=51 hwmon2/pwm3=51 + MAXPWM=hwmon2/pwm3=127 hwmon2/pwm2=204 + ''; + }; + + pulseaudio = { + enable = true; + support32Bit = true; + }; }; # Enable the X11 windowing system. services.xserver.enable = true; services.xserver.desktopManager.pantheon.enable = true; - services.xserver.desktopManager.pantheon.extraWingpanelIndicators = [ pkgs.pantheon.wingpanel-indicator-nightlight ]; + services.xserver.desktopManager.pantheon.extraWingpanelIndicators = [ pkgs.pantheon.wingpanel-indicator-nightlight ]; services.xserver.videoDrivers = [ "amdgpu" ]; fonts.fonts = with pkgs; [ @@ -104,52 +111,6 @@ in # Enable sound. sound.enable = true; - hardware.pulseaudio.enable = true; - hardware.pulseaudio.support32Bit = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users = { - defaultUserShell = pkgs.zsh; - - users.alex = { - isNormalUser = true; - extraGroups = [ "wheel" "docker" "networkmanager" "libvirtd" ]; - }; - }; - - nixpkgs.config.chromium.commandLineArgs = "--enable-features=WebUIDarkMode,NativeNotifications,VaapiVideoDecoder --ignore-gpu-blocklist --use-gl=desktop --force-dark-mode --disk-cache-dir=/tmp/cache"; - programs.chromium = { - enable = true; - extensions = [ - "cbnipbdpgcncaghphljjicfgmkonflee" # Axel Springer Blocker - "cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin - "mnjggcdmjocbbbhaepdhchncahnbgone" # SponsorBlock for YouTube - "hjdoplcnndgiblooccencgcggcoihigg" # Terms of Service; Didn’t Read - "gcbommkclmclpchllfjekcdonpmejbdp" # HTTPS Everywhere - "oboonakemofpalcgghocfoadofidjkkk" # KeePassXC-Browser - "fploionmjgeclbkemipmkogoaohcdbig" # Page load time - "egnjhciaieeiiohknchakcodbpgjnchh" # Tab Wrangler - "fnaicdffflnofjppbagibeoednhnbjhg" # Floccus bookmarks - ]; - extraOpts = { - "BrowserSignin" = 0; - "SyncDisabled" = true; - "PasswordManagerEnabled" = false; - "AutofillAddressEnabled" = true; - "AutofillCreditCardEnabled" = false; - "BuiltInDnsClientEnabled" = false; - "MetricsReportingEnabled" = true; - "SearchSuggestEnabled" = false; - "AlternateErrorPagesEnabled" = false; - "UrlKeyedAnonymizedDataCollectionEnabled" = false; - "SpellcheckEnabled" = true; - "SpellcheckLanguage" = [ - "de" - "en-US" - ]; - "CloudPrintSubmitEnabled" = false; - }; - }; programs.zsh = { enable = true; @@ -203,4 +164,3 @@ in system.stateVersion = "21.05"; # Did you read the comment? } - diff --git a/machine/thinkpad/configuration.nix b/machine/thinkpad/configuration.nix index 459d449..3cae836 100644 --- a/machine/thinkpad/configuration.nix +++ b/machine/thinkpad/configuration.nix @@ -20,6 +20,7 @@ in ../../configs/gui.nix ../../configs/virtualisation.nix ../../configs/common.nix + ../../configs/user.nix ]; # boot.initrd.luks.devices = { @@ -39,9 +40,8 @@ in boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub.gfxmodeEfi = "1024x768"; - boot.tmpOnTmpfs = true; #boot.plymouth.enable = true; - + environment.etc."issue.d/ip.issue".text = "\\4\n"; networking.hostName = "thinkpad"; # Define your hostname. @@ -56,10 +56,6 @@ in networking.interfaces.enp0s31f6.useDHCP = true; networking.interfaces.wlp0s20f3.useDHCP = true; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Select internationalisation properties. # i18n.defaultLocale = "en_US.UTF-8"; console = { @@ -142,7 +138,7 @@ in dina-font proggyfonts ]; - + # Enable CUPS to print documents. services.printing.enable = true; @@ -174,16 +170,6 @@ in ]; }; - # Define a user account. Don't forget to set a password with ‘passwd’. - users = { - defaultUserShell = pkgs.zsh; - - users.alex = { - isNormalUser = true; - extraGroups = [ "wheel" "docker" "networkmanager" ]; - }; - }; - # List packages installed in system profile. To search, run: # $ nix search wget nixpkgs.config.chromium.commandLineArgs = "--enable-features=WebUIDarkMode,NativeNotifications,VaapiVideoDecoder --ignore-gpu-blocklist --use-gl=desktop --force-dark-mode --disk-cache-dir=/tmp/cache"; @@ -279,4 +265,3 @@ in # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "21.05"; # Did you read the comment? } -