diff --git a/configs/common.nix b/configs/common.nix index 023e150..f78c8d1 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -6,8 +6,6 @@ (fetchTarball "https://github.com/msteen/nixos-vscode-server/tarball/master") ]; - services.vscode-server.enable = true; - programs.zsh = { enable = true; @@ -37,18 +35,26 @@ }; }; - #nextdns - services.nextdns = { - enable = true; - arguments = [ - "-config" - "aaa56c" - "-cache-size" - "10MB" - "-listen" - "127.0.0.1:53" - "-report-client-info" - ]; + services = { + vscode-server.enable = true; + openssh = { + enable = true; + permitRootLogin = "no"; + passwordAuthentication = false; + openFirewall = true; + }; + nextdns = { + enable = true; + arguments = [ + "-config" + "aaa56c" + "-cache-size" + "10MB" + "-listen" + "127.0.0.1:53" + "-report-client-info" + ]; + }; }; networking = { @@ -94,10 +100,6 @@ ]; documentation.enable = false; - documentation.nixos.enable = false; - #documentation.man.enable = false; - documentation.info.enable = false; - documentation.doc.enable = false; nix.autoOptimiseStore = true; diff --git a/configs/desktop.nix b/configs/desktop.nix new file mode 100644 index 0000000..d818a58 --- /dev/null +++ b/configs/desktop.nix @@ -0,0 +1,194 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + elementary-xfce-icon-theme + gnomeExtensions.appindicator + sxhkd + bspwm + polybar + lightlocker + dunst + ]; + + environment.etc.bspwmrc = { + mode = "0645"; + text = '' + #!/usr/bin/env bash + # spread desktops + # desktops=5 + # count=$(xrandr -q | grep -c ' connected') + # i=1 + # for m in $(xrandr -q | grep ' connected' | awk '{print $1}'); do + # sequence=$(seq -s ' ' $(((1+(i-1)*desktops/count))) $((i*desktops/count))) + # bspc monitor "$m" -d $(echo ''${sequence//10/0}) + # i=$((i+1)) + # done + # if [ -e "/etc/X11/Xresources" ]; then + # xrdb /etc/X11/Xresources + # fi + # if [ -e "$HOME/.Xresources" ]; then + # xrdb -merge "$HOME/.Xresources" + # fi + # # polybar + # for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + # MONITOR=$m ${pkgs.polybar}/bin/polybar --reload default -c /etc/polybar.conf & + # done + + # pointer + xsetroot -cursor_name left_ptr + # turn off blanking + # xset -dpms + # xset s off + # xset s noblank + # sxhkd & + # node ~/.config/bspwm/window.js & + + bspc config border_width 4 + bspc config window_gap 5 + bspc config top_padding 0 + bspc config left_padding 0 + bspc config right_padding 0 + bspc config bottom_padding 0 + bspc config split_ratio 0.50 + bspc config borderless_monocle true + bspc config single_monocle true + bspc config gapless_monocle true + bspc config focus_follows_pointer true + bspc config pointer_follows_monitor true + bspc config pointer_follows_focus false + bspc config center_pseudo_tiled true + bspc config automatic_scheme alternate + bspc config remove_unplugged_monitors true + bspc config remove_disabled_monitors true + + bspc rule -a Gnome-calculator state=floating + + bspc config normal_border_color "#333333" + bspc config focused_border_color "#666666" + bspc config presel_feedback_color "#000000" + + bspc wm --adopt-orphans + ''; + }; + + environment.etc.sxhkdrc = { + text = '' + #show time + super + z + notify-send Time $(date '+%H:%M') + #show Battery + super + x + notify-send Battery $(cat /sys/class/power_supply/BAT0/capacity)% + alt + Tab + rofi -show window + #Mute + XF86AudioMute + pulseaudio-ctl mute + XF86AudioLowerVolume + pulseaudio-ctl down + XF86AudioRaiseVolume + pulseaudio-ctl up + #XF86MonBrightnessUp + # lux -a 20% + #XF86MonBrightnessDown + # lux -s 20% + super + Return + kitty + super + shift + Return + rofi -show drun + super + Escape + pkill -USR1 -x sxhkd + #cycle windows + super {_,shift + }Tab + bspc node -f {next,prev} + super + shift + c + bspc node -c + super + a + bspc node @/ --flip vertical + super + d + layer=normal; \ + bspc query -N -n "focused.$\{layer\}" && layer=below; \ + bspc node -l "$layer" + super + {s,f,k} + state={floating,fullscreen,pseudo_tiled}; \ + bspc query -N -n "focused.$\{state\}" && state=tiled; \ + bspc node -t "$state" + super + alt + {Left,Down,Up,Right} + bspc node -p {west,south,north,east} + super + ctrl + {Left,Right,Up,Down} + xdo move {-x -50,-x +50,-y -50,-y +50} + super + ctrl + alt + {Left,Right,Up,Down} + xdo resize {-w -50,-w +50,-h -50,-h +50} + super + {_,shift + }{Left,Down,Up,Right} + bspc node -{f,s} {west,south,north,east} + super + m + bspc node -s biggest + super + l + ~/.bin/lock + #super + y + # bspc node -n last.!automatic + super + ctrl + space + bspc node -p cancel + super + apostrophe + bspc node -s last + super + ctrl + comma + bspc node @/ --rotate 90 + super + shift + comma + bspc node @/ --circulate forward + #super + shift + x + # bspc wm -d > "$BSPWM_STATE" && bspc quit + super + {q,w,e,r,t,y,u,i,o,p} + bspc desktop -f '{I,II,III,IV,V,VI,VII,VIII,IX,X}' && notify-send `bspc query -D -d --names` + super + shift + {q,w,e,r,t,y,u,i,o,p} + bspc node -d '{I,II,III,IV,V,VI,VII,VIII,IX,X}' + ''; + }; + + + services = { + udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; + gnome.gnome-keyring.enable = true; + xserver = { + enable = true; + displayManager = { + # autoLogin = { + # enable = true; + # user = "starlight"; + # }; + lightdm = { + enable = true; + # autoLogin = { + # relogin = false; + # }; + }; + # setupCommands = '' + # xset -dpms + # xset s off + # ''; + defaultSession = "bspwm"; + session = [{ + manage = "desktop"; + name = "bspwm"; + start = '' + ${pkgs.sxhkd}/bin/sxhkd -c /etc/sxhkdrc & + ${pkgs.bspwm}/bin/bspwm -c /etc/bspwmrc & + ${pkgs.xfce.xfce4-session}/bin/xfce4-session + ''; + }]; + }; + + desktopManager = { + xfce = { + enable = true; + noDesktop = true; + enableXfwm = true; + }; + }; + layout = "us"; + # Enable touchpad support. + libinput.enable = true; + updateDbusEnvironment = true; + }; + }; +}; diff --git a/configs/user.nix b/configs/user.nix index 27bb66d..b8662f5 100644 --- a/configs/user.nix +++ b/configs/user.nix @@ -20,34 +20,6 @@ pkgs.cryfs ]; - # dconf.enable = true; - # dconf.settings = { - # "org/gnome/desktop/wm/preferences".titlebar-font = "Liberation Sans Bold 9"; - # "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { - # binding = "Return"; - # command = "kitty"; - # name = "kitty"; - # }; - - # "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { - # binding = "Return"; - # command = "rofi -show drun"; - # name = "rofi -show drun"; - # }; - - # "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = { - # binding = "Tab"; - # command = "rofi -show window"; - # name = "rofi -show window"; - # }; - - # "org/gnome/settings-daemon/plugins/media-keys".custom-keybindings = [ - # "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" - # "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" - # "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/" - # ]; - # }; - programs = { ssh = { enable = true; diff --git a/configs/virtualisation.nix b/configs/virtualisation.nix index 5caeabf..dfaee33 100644 --- a/configs/virtualisation.nix +++ b/configs/virtualisation.nix @@ -1,12 +1,11 @@ { config, pkgs, lib, ... }: { - # container virtualization - virtualisation.docker.enable = true; - - # hypervisor virtualization - virtualisation.libvirtd = { - enable = true; - qemuPackage = pkgs.qemu_kvm; + virtualisation = { + docker.enable = true; + libvirtd = { + enable = true; + qemuPackage = pkgs.qemu_kvm; + }; }; } diff --git a/machine/desktop.nix b/machine/desktop.nix index e0432a9..2a66774 100644 --- a/machine/desktop.nix +++ b/machine/desktop.nix @@ -126,11 +126,6 @@ in # 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 = [ ... ]; diff --git a/machine/homeserver.nix b/machine/homeserver.nix index 947d9fd..9928f00 100644 --- a/machine/homeserver.nix +++ b/machine/homeserver.nix @@ -117,8 +117,6 @@ # enableSSHSupport = true; # }; - # List services that you want to enable: - services.openssh.enable = true; services.netdata.enable = true; diff --git a/machine/nixos-vm.nix b/machine/nixos-vm.nix index b4d0e76..543f99f 100644 --- a/machine/nixos-vm.nix +++ b/machine/nixos-vm.nix @@ -8,22 +8,17 @@ in [ # Include the results of the hardware scan. /etc/nixos/hardware-configuration.nix ../configs/gui.nix - # ../configs/virtualisation.nix ../configs/common.nix ../configs/user.nix + ../configs/desktop.nix ]; # Use the GRUB 2 boot loader. boot.loader.grub.enable = true; boot.loader.grub.version = 2; - # boot.loader.grub.efiSupport = true; - # boot.loader.grub.efiInstallAsRemovable = true; - # boot.loader.efi.efiSysMountPoint = "/boot/efi"; # Define on which hard drive you want to install Grub. boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only - networking.hostName = "nixos-vm"; # Define your hostname. - # Set your time zone. time.timeZone = "Europe/Berlin"; @@ -33,10 +28,6 @@ in networking.useDHCP = false; networking.interfaces.enp1s0.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 = { @@ -44,52 +35,10 @@ in # keyMap = "us"; # }; - # Enable the X11 windowing system. - # services.xserver.enable = true; - - - - - # Configure keymap in X11 - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # sound.enable = true; - # hardware.pulseaudio.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.alex = { - # isNormalUser = true; - # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # environment.variables = { + # XDG_CURRENT_DESKTOP = "MATE"; # }; - # List packages installed in system profile. To search, run: - # $ nix search wget - # environment.systemPackages = with pkgs; [ - # # wget - # git - # ]; - - # 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 = [ ... ]; diff --git a/machine/thinkpad.nix b/machine/thinkpad.nix index b271222..d071143 100644 --- a/machine/thinkpad.nix +++ b/machine/thinkpad.nix @@ -170,11 +170,6 @@ in # 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 = [ 52698 ]; #networking.firewall.allowedUDPPorts = [ 52698 ]; diff --git a/machine/vps.nix b/machine/vps.nix index c118a7f..c45432b 100644 --- a/machine/vps.nix +++ b/machine/vps.nix @@ -47,16 +47,6 @@ # enableSSHSupport = true; # }; - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - permitRootLogin = "no"; - passwordAuthentication = false; - openFirewall = true; - }; - security.acme.email = "webmaster@szczepan.ski"; security.acme.acceptTerms = true; services.nginx = {