Browse Source

idk

master
parent
commit
126657e0be
Signed by: govanify GPG Key ID: DE62E1E2A6145556
13 changed files with 395 additions and 36 deletions
  1. +2
    -1
      common/default.nix
  2. +10
    -0
      common/desktop.nix
  3. +10
    -3
      common/graphical.nix
  4. +3
    -0
      common/headfull.nix
  5. +3
    -3
      common/users.nix
  6. +218
    -0
      dotfiles/graphical/sway-laptop/config
  7. +8
    -0
      dotfiles/graphical/sway-laptop/locale.sh
  8. +13
    -0
      dotfiles/graphical/sway-laptop/status-desktop.sh
  9. +21
    -0
      dotfiles/graphical/sway-laptop/status.sh
  10. +53
    -23
      dotfiles/graphical/sway/config
  11. +14
    -6
      machines/alastor/hardware.nix
  12. BIN
      machines/alastor/wallpaper.png
  13. +40
    -0
      pkgs/wlrobs.nix

+ 2
- 1
common/default.nix View File

@ -6,7 +6,8 @@
./locale.nix
./xdg.nix
./sandboxing.nix
(import "${builtins.fetchTarball https://github.com/rycee/home-manager/archive/release-20.03.tar.gz}/nixos")
(import "${builtins.fetchTarball
https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos")
./../secrets/deployment.nix
./../pkgs/vim.nix
./../pkgs/zsh.nix

+ 10
- 0
common/desktop.nix View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
imports = [
../../common/headfull.nix
../../common/graphical.nix
];
}

+ 10
- 3
common/graphical.nix View File

@ -1,8 +1,11 @@
{ config, pkgs, lib, ... }: {
{ config, lib, pkgs, ... }: {
imports = [ ./../pkgs/termite.nix ];
services.mingetty.autologinUser = "govanify";
# firefox no segfaulty
xdg.portal.enable = false;
programs.sway = {
enable = true;
extraPackages = with pkgs; [
@ -17,7 +20,8 @@
# multimedia
mpv imv
# reading
calibre okular kcc
#calibre
okular kcc
# web browsers
# standard firefox is used for basically everything and is "impossible" to
# fingerprint with my configuration, but i do login on websites sometimes.
@ -30,7 +34,10 @@
blender krita kdenlive ardour
# stem
freecad kicad wireshark
# recording/streaming
obs-studio obs-wlrobs
jdk11
android-studio
(
pkgs.writeTextFile {

+ 3
- 0
common/headfull.nix View File

@ -35,6 +35,9 @@
# firmwares + steam et al
nixpkgs.config.allowUnfree = true;
# adb
programs.adb.enable = true;
# we do not use gpg agent as all gpg keys used are available _without_ a
# password, if someone is able to snoop into my user files they will sooner
# or later get the password anyways

+ 3
- 3
common/users.nix View File

@ -6,15 +6,15 @@
users.users.govanify = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "audio" "wireshark"];
extraGroups = [ "wheel" "networkmanager" "audio" "wireshark" "adbusers"];
};
home-manager.users.govanify = {
home.file.".config/ssh/authorized_keys".source = ./../secrets/authorized_keys;
programs.git = {
enable = true;
userName = "gauvain@govanify.com";
userEmail = "Gauvain Roussel-Tarbouriech";
userEmail = "gauvain@govanify.com";
userName = "Gauvain 'GovanifY' Roussel-Tarbouriech";
};
};

+ 218
- 0
dotfiles/graphical/sway-laptop/config View File

@ -0,0 +1,218 @@
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $lock "swaylock --indicator-radius 100 --indicator-thickness 7 --ring-color bb00cc --key-hl-color 880033 --line-color 00000000 --inside-color 00000088 --separator-color 00000000 -i ~/Pictures/wallpaper.png"
# auto lock
exec swayidle -w \
timeout 300 "swaylock --indicator-radius 100 --indicator-thickness 7 --ring-color bb00cc --key-hl-color 880033 --line-color 00000000 --inside-color 00000088 --separator-color 00000000 -i ~/Pictures/wallpaper.png" \
timeout 600 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep "swaylock --indicator-radius 100 --indicator-thickness 7 --ring-color bb00cc --key-hl-color 880033 --line-color 00000000 --inside-color 00000088 --separator-color 00000000 -i ~/Pictures/wallpaper.png"
# screen
output * bg ~/Pictures/wallpaper.png fill
output eDP-1 scale 2.0
# all you need to have a good day
exec swaymsg "workspace 1; exec ibus-daemon -dr"
exec swaymsg "workspace 1; exec firefox"
exec swaymsg "workspace 3; exec riot-x11"
exec swaymsg "workspace 2; exec termite -e tmux"
# ui chrome
default_border pixel 1
seat seat0 xcursor_theme breeze_cursors 48
# IME
bindsym $mod+i exec /etc/sway/locale.sh
# inputs
input "2:14:ETPS/2_Elantech_Touchpad" {
dwt enabled
tap enabled
middle_emulation enabled
}
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
#
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym XF86MonBrightnessUp exec brightnessctl set +5%
bindsym XF86AudioPlay exec playerctl play-pause
bindsym $mod+down exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec "termite"
# run commands
bindsym $mod+x exec "wofi --show drun"
bindsym $mod+z exec "wofi --show run"
bindsym $mod+c exec "grim /tmp/screenshot.png"
bindsym $mod+d exec "grim -g "$(slurp)" /tmp/screenshot.png"
bindsym $mod+Ctrl+l exec $lock
# old habits die hard
bindsym Ctrl+Alt+l exec $lock
# Kill focused window
bindsym $mod+Shift+q kill
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
#bindsym $mod+Left focus left
#bindsym $mod+Down focus down
#bindsym $mod+Up focus up
#bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while ~/.config/sway/status.sh; do sleep 1; done
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
include /etc/sway/config.d/*

+ 8
- 0
dotfiles/graphical/sway-laptop/locale.sh View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
engine=$(ibus engine)
if [ "${engine}" == "mozc-jp" ] || [ "${engine}" == "xkb:jp::jpn" ]
then
ibus engine xkb:us::eng
else
ibus engine mozc-jp
fi

+ 13
- 0
dotfiles/graphical/sway-laptop/status-desktop.sh View File

@ -0,0 +1,13 @@
#!/bin/sh
# The Sway configuration file in ~/.config/sway/config calls this script.
# You should see changes to the status bar after saving this script.
# If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.
# The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
# like 2018-10-06 and the time (e.g., 14:01)
date_formatted=$(date "+%a %F %H:%M")
mail=$(cat ~/.local/share/mail/unread-govanify)
# Emojis and characters for the status bar
# ⚡ \|
echo "mail: $mail | $date_formatted"

+ 21
- 0
dotfiles/graphical/sway-laptop/status.sh View File

@ -0,0 +1,21 @@
#!/bin/sh
# The Sway configuration file in ~/.config/sway/config calls this script.
# You should see changes to the status bar after saving this script.
# If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.
# The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
# like 2018-10-06 and the time (e.g., 14:01)
date_formatted=$(date "+%a %F %H:%M")
# Returns the battery status: "Full", "Discharging", or "Charging".
battery_status=$(cat /sys/class/power_supply/BAT/status)
mail=$(cat ~/.local/share/mail/unread-govanify)
battery_info=$(upower --show-info $(upower --enumerate |\
grep 'BAT') |\
egrep "state|percentage" | grep -oP '[0-9]*%')
# Emojis and characters for the status bar
# ⚡ \|
echo "mail: $mail | bat: $battery_info | $date_formatted"

+ 53
- 23
dotfiles/graphical/sway/config View File

@ -15,6 +15,9 @@ exec swayidle -w \
# screen
output * bg ~/Pictures/wallpaper.png fill
output eDP-1 scale 2.0
output DP-2 scale 2.0
output DP-2 pos 1920 0 res 3840x2160
output HDMI-A-2 pos 0 0 res 1920x1080
# all you need to have a good day
exec swaymsg "workspace 1; exec ibus-daemon -dr"
@ -35,6 +38,11 @@ input "2:14:ETPS/2_Elantech_Touchpad" {
tap enabled
middle_emulation enabled
}
input "5426:515:Razer_Razer_BlackWidow_Chroma" {
xkb_layout "fr"
}
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
@ -112,27 +120,49 @@ bindsym XF86AudioPrev exec playerctl previous
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
#bindsym $mod+1 workspace 1
#bindsym $mod+2 workspace 2
#bindsym $mod+3 workspace 3
#bindsym $mod+4 workspace 4
#bindsym $mod+5 workspace 5
#bindsym $mod+6 workspace 6
#bindsym $mod+7 workspace 7
#bindsym $mod+8 workspace 8
#bindsym $mod+9 workspace 9
#bindsym $mod+0 workspace 10
## Move focused container to workspace
#bindsym $mod+Shift+1 move container to workspace 1
#bindsym $mod+Shift+2 move container to workspace 2
#bindsym $mod+Shift+3 move container to workspace 3
#bindsym $mod+Shift+4 move container to workspace 4
#bindsym $mod+Shift+5 move container to workspace 5
#bindsym $mod+Shift+6 move container to workspace 6
#bindsym $mod+Shift+7 move container to workspace 7
#bindsym $mod+Shift+8 move container to workspace 8
#bindsym $mod+Shift+9 move container to workspace 9
#bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+ampersand workspace 1
bindsym $mod+eacute workspace 2
bindsym $mod+quotedbl workspace 3
bindsym $mod+apostrophe workspace 4
bindsym $mod+parenleft workspace 5
bindsym $mod+egrave workspace 6
bindsym $mod+minus workspace 7
bindsym $mod+underscore workspace 8
bindsym $mod+ccedilla workspace 9
bindsym $mod+agrave workspace 10
bindsym $mod+Shift+ampersand move container to workspace 1
bindsym $mod+Shift+eacute move container to workspace 2
bindsym $mod+Shift+quotedbl move container to workspace 3
bindsym $mod+Shift+apostrophe move container to workspace 4
bindsym $mod+Shift+parenleft move container to workspace 5
bindsym $mod+Shift+egrave move container to workspace 6
bindsym $mod+Shift+minus move container to workspace 7
bindsym $mod+Shift+underscore move container to workspace 8
bindsym $mod+Shift+ccedilla move container to workspace 9
bindsym $mod+Shift+agrave move container to workspace 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
@ -167,11 +197,11 @@ bindsym XF86AudioPrev exec playerctl previous
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+Shift+7 move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
bindsym $mod+7 scratchpad show
#
# Resizing containers:
#

+ 14
- 6
machines/alastor/hardware.nix View File

@ -4,6 +4,7 @@
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
@ -15,12 +16,14 @@
efiSupport = true;
enableCryptodisk = true;
extraInitrd = /boot/initrd.keys.gz;
extraConfig = "
terminal_input at_keyboard
keymap fr
";
};
# broken
#boot.initrd.secrets = {
# "keyfile_lain.bin" = "/etc/secrets/initrd/keyfile_lain.bin";
# "keyfile_matrix.bin" = "/etc/secrets/initrd/keyfile_matrix.bin";
#};
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
@ -78,7 +81,12 @@
console.keyMap = "fr";
nix.maxJobs = lib.mkDefault 4;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware.pulseaudio.extraConfig = ''
load-module module-remap-source master=alsa_input.usb-Focusrite_Scarlett_2i2_USB-00.analog-stereo source_name=Mic-Mono master_channel_map=left channel_map=mono
set-default-source Mic-Mono
'';
}

BIN
machines/alastor/wallpaper.png View File

Before After
Width: 2400  |  Height: 1350  |  Size: 2.4 MiB

+ 40
- 0
pkgs/wlrobs.nix View File

@ -0,0 +1,40 @@
# We don't have a wrapper which can supply obs-studio plugins so you have to
# somewhat manually install this:
# nix-env -f . -iA wlrobs
# mkdir -p ~/.config/obs-studio/plugins
# ln -s ~/.nix-profile/share/obs/obs-plugins/wlrobs ~/.config/obs-studio/plugins/
{ stdenv, fetchhg
, meson, ninja, pkg-config
, obs-studio, wlroots, wayland
, libX11, libGL, libdrm
}:
let
metadata = import ./metadata.nix;
in
stdenv.mkDerivation rec {
name = "wlrobs-${version}";
version = metadata.rev;
src = fetchhg {
url = "https://hg.sr.ht/~scoopta/wlrobs";
rev = metadata.rev;
sha256 = metadata.sha256;
};
nativeBuildInputs = [ meson ninja pkg-config ];
buildInputs = [ obs-studio wayland wlroots libX11 libGL libdrm ];
installPhase = ''
mkdir -p $out/share/obs/obs-plugins/wlrobs/bin/64bit
cp libwlrobs.so $out/share/obs/obs-plugins/wlrobs/bin/64bit
'';
meta = with stdenv.lib; {
description = "wlrobs is an obs-studio plugin that allows you to screen capture on wlroots based wayland compositors";
homepage = "https://sr.ht/~scoopta/wlrobs";
maintainers = with maintainers; [ colemickens ];
platforms = with platforms; linux;
};
}

Loading…
Cancel
Save