Initial commit

This commit is contained in:
Charlotte Van Petegem 2020-02-06 19:53:43 +01:00
commit 4256a94080
22 changed files with 1179 additions and 0 deletions

4
.git-crypt/.gitattributes vendored Normal file
View file

@ -0,0 +1,4 @@
# Do not edit this file. To specify the files to encrypt, create your own
# .gitattributes file in the directory where your files are.
* !filter !diff
*.gpg binary

4
.gitattributes vendored Normal file
View file

@ -0,0 +1,4 @@
# To add a new file:
# /secret/file filter=git-crypt diff=git-crypt
**/*-secret.nix filter=git-crypt diff=git-crypt
**/secret.nix filter=git-crypt diff=git-crypt

9
configuration.nix Normal file
View file

@ -0,0 +1,9 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ ... }:
{
imports = [ ./machines/pentos/default.nix ];
}

View file

@ -0,0 +1,56 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports = [
<home-manager/nixos>
./hardware.nix
./secret.nix
../../profiles/common/default.nix
../../profiles/graphical/default.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "pentos"; # Define your hostname.
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp0s31f6.useDHCP = true;
networking.interfaces.wlp0s20f3.useDHCP = true;
# Set your time zone.
time.timeZone = "Europe/Brussels";
# 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. Its 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 = "20.03"; # Did you read the comment?
home-manager.users.charlotte = { pkgs, ... }: {
home = {
stateVersion = "20.03";
};
};
# Machine-specific application settings
custom = {
git.email = "charlotte@vanpetegem.me";
};
# System settings
system = {
autoUpgrade.enable = true;
};
}

View file

@ -0,0 +1,31 @@
# 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, ... }:
{
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/0eb8b94a-5fc2-4b24-962a-94b3675b6f5b";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/46AC-2E2E";
fsType = "vfat";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/b8f6154e-6b1f-42d7-8fe0-c03d7ad150f3"; }
];
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = true;
}

BIN
machines/pentos/secret.nix Normal file

Binary file not shown.

View file

@ -0,0 +1,38 @@
{ pkgs, ... }:
{
imports = [
./secret.nix
../../programs/git/default.nix
../../programs/ssh/default.nix
../../programs/tmux/default.nix
../../programs/zsh/default.nix
];
i18n = {
defaultLocale = "en_IE.UTF-8";
extraLocaleSettings = {
LC_TIME = "en_GB.UTF-8";
};
};
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
nix.trustedUsers = [ "@wheel" ];
users = {
mutableUsers = false;
defaultUserShell = pkgs.zsh;
users = {
charlotte = {
isNormalUser = true;
home = "/home/charlotte";
description = "Charlotte Van Petegem";
extraGroups = [ "wheel" ];
};
};
};
}

BIN
profiles/common/secret.nix Normal file

Binary file not shown.

View file

@ -0,0 +1,126 @@
{ pkgs, ... }:
{
imports = [
./secret.nix
../../programs/dropbox/default.nix
../../programs/kitty/default.nix
../../programs/neovim/default.nix
../../programs/syncthing/default.nix
../../programs/sway/default.nix
];
services.pcscd = {
enable = true;
plugins = [ pkgs.ccid ];
};
sound.enable = true;
hardware.pulseaudio.enable = true;
fonts = {
enableFontDir = true;
fontconfig = {
enable = true;
defaultFonts = {
emoji = [ "Noto Color Emoji" ];
monospace = [ "Fira Code" ];
sansSerif = [ "Noto Sans" ];
serif = [ "Noto Serif" ];
};
};
fonts = with pkgs; [
fira-code
fira-code-symbols
font-awesome
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
];
};
users.users.charlotte.extraGroups = [ "networkmanager" "video" "input" ];
home-manager.users.charlotte = { pkgs, ... }: {
nixpkgs = {
config = {
allowUnfree = true;
};
};
home = {
packages = with pkgs; [
chromium
eid-mw
firefox
hledger
libreoffice
moreutils
mpv
okular
rambox
ranger
sshfs
thunderbird
vanilla-dmz
wl-clipboard
];
file = {
".icons/default/index.theme".text = ''
[Icon Theme]
Name=Default
Comment=Default Cursor Theme
Inherits=Vanilla-DMZ
'';
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
gtk-theme = "Arc";
icon-theme = "Arc";
cursor-theme = "Vanilla-DMZ";
};
};
gtk = {
enable = true;
font = {
package = pkgs.noto-fonts;
name = "Noto Sans 10";
};
gtk2.extraConfig = ''
gtk-cursor-theme-name = "Vanilla-DMZ"
gtk-cursor-theme-size = 0
'';
gtk3.extraConfig = {
gtk-cursor-theme-name = "Vanilla-DMZ";
gtk-cursor-theme-size = 0;
};
iconTheme = {
package = pkgs.arc-icon-theme;
name = "Arc";
};
theme = {
package = pkgs.arc-theme;
name = "Arc";
};
};
qt = {
enable = true;
platformTheme = "gtk";
};
xdg = {
enable = true;
userDirs = {
enable = true;
desktop = "\$HOME/desktop";
documents = "\$HOME/documents";
download = "\$HOME/downloads";
music = "\$HOME/music";
pictures = "\$HOME/pictures";
publicShare = "\$HOME/desktop";
templates = "\$HOME/templates";
videos = "\$HOME/videos";
};
};
};
}

Binary file not shown.

View file

@ -0,0 +1,27 @@
{ ... }:
{
home-manager.users.charlotte = { pkgs, ... }: {
home.packages = [ pkgs.dropbox-cli ];
systemd.user.services = {
dropbox = {
Unit = {
Description = "Dropbox";
};
Service = {
Environment = "QT_PLUGIN_PATH=\"/run/current-system/sw/${pkgs.qt5.qtbase.qtPluginPrefix}\" QML2_IMPORT_PATH=\"/run/current-system/sw/${pkgs.qt5.qtbase.qtQmlPrefix}\"";
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
KillMode = "control-group";
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
Nice = 10;
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
};
};
}

29
programs/git/default.nix Normal file
View file

@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
{
options.custom.git.email = lib.mkOption {
type = lib.types.str;
default = "charlotte@vanpetegem.me";
example = "charlotte@vanpetegem.me";
description = ''
Default email set in git config
'';
};
config.home-manager.users.charlotte = { pkgs, ... }: {
home.packages = [ pkgs.git-crypt ];
programs.git = {
enable = true;
extraConfig = {
branch = {
setupautorebase = "always";
};
};
ignores = [
"**/*.patch"
];
userEmail = config.custom.git.email;
userName = "Charlotte Van Petegem";
};
};
}

View file

@ -0,0 +1,46 @@
{ pkgs, ... }:
{
home-manager.users.charlotte = { pkgs, ... }: {
home.packages = [ pkgs.kitty ];
xdg.configFile."kitty/kitty.conf".text = ''
font_family Fira Code
font_size 9.0
disable_ligatures cursor
background #fbffff
foreground #535c65
selection_background #6d7782
selection_foreground #fbffff
url_color #906c33
cursor #434951
# normal
color0 #fbffff
color1 #ae5865
color2 #4d7f43
color3 #906c33
color4 #2b7ab2
color5 #8f63a2
color6 #008483
color7 #535c65
# bright
color8 #6d7782
color9 #ae5865
color10 #4d7f43
color11 #906c33
color12 #2b7ab2
color13 #8f63a2
color14 #008483
color15 #434951
enable_audio_bell no
visual_bell_duration 0.25
remember_window_size no
initial_window_width 1280
initial_window_width 720
'';
};
}

160
programs/neovim/default.nix Normal file
View file

@ -0,0 +1,160 @@
with import <nixpkgs> {};
let
neovim = pkgs.neovim.override {
configure = {
customRC = ''
set autoread
"" Theming
set background=light
"" General settings
" Undo over sessions
set undofile
set undodir=~/.cache/nvimundo
" Automatically save sessions on exit and load them on start
function! MakeSession()
let b:sessiondir = $HOME . "/.config/nvim/sessions" . getcwd()
if (filewritable(b:sessiondir) != 2)
exe 'silent !mkdir -p ' b:sessiondir
redraw!
endif
let b:filename = b:sessiondir . '/session.vim'
exe "mksession! " . b:filename
endfunction
function! LoadSession()
let b:sessiondir = $HOME . "/.config/nvim/sessions" . getcwd()
let b:sessionfile = b:sessiondir . "/session.vim"
if (filereadable(b:sessionfile))
exe 'source ' b:sessionfile
else
echo "No session loaded."
endif
endfunction
if(argc() == 0)
au VimEnter * nested :call LoadSession()
endif
au VimLeave * :call MakeSession()
"" Filetype configuration
" Base settings for all files
syntax enable
set number
set showcmd
set scrolloff=8
set expandtab
set tabstop=4
set shiftwidth=4
set linebreak
set list
set listchars=tab:·\ ,trail:·
set inccommand=split
set clipboard=unnamedplus
filetype plugin indent on
" Filetype specific settings
autocmd FileType javascript call TwoSpaces()
autocmd FileType less call TwoSpaces()
autocmd FileType css call TwoSpaces()
autocmd FileType scss call TwoSpaces()
autocmd FileType html call TwoSpaces()
autocmd FileType ruby call TwoSpaces()
autocmd FileType yaml call TwoSpaces()
autocmd FileType eruby call TwoSpaces()
autocmd FileType haskell call TwoSpaces()
autocmd FileType json call TwoSpaces()
autocmd FileType typescript call TwoSpaces()
function TwoSpaces()
setlocal tabstop=2
setlocal shiftwidth=2
setlocal softtabstop=2
endfunction
"" Plugin configuration
function! s:completedFiles(winid, filename, ...) abort
bdelete!
call win_gotoid(a:winid)
if filereadable(a:filename)
let lines = readfile(a:filename)
if !empty(lines)
exe ':e ' . lines[0]
endif
call delete(a:filename)
endif
endfunction
function! FzyFiles()
let file = tempname()
let winid = win_getid()
let cmd = split(&shell) + split(&shellcmdflag) + ["${pkgs.ripgrep.out}/bin/rg --files --hidden -g '!/.git' --smart-case | ${pkgs.fzy.out}/bin/fzy > " . file]
let F = function('s:completedFiles', [winid, file])
botright 10 new
call termopen(cmd, {'on_exit': F})
startinsert
endfunction
function! s:completedGrep(winid, filename, ...) abort
bdelete!
call win_gotoid(a:winid)
if filereadable(a:filename)
let lines = readfile(a:filename)
if !empty(lines)
let list = split(lines[0], ':')
let file = list[0]
let line = list[1]
exe ':e ' . file
exe line
endif
call delete(a:filename)
endif
endfunction
function! FzyGrep()
let file = tempname()
let winid = win_getid()
let cmd = split(&shell) + split(&shellcmdflag) + ["${pkgs.ripgrep.out}/bin/rg --vimgrep --hidden -g '!/.git' '^' | ${pkgs.fzy.out}/bin/fzy > " . file]
let F = function('s:completedGrep', [winid, file])
botright 10 new
call termopen(cmd, {'on_exit': F})
startinsert
endfunction
nnoremap <C-f> :call FzyFiles()<CR>
nnoremap <C-g> :call FzyGrep()<CR>
'';
vam.knownPlugins = pkgs.vimPlugins;
vam.pluginDictionaries = [
{
names = [
"vim-ledger"
"vim-nix"
];
}
];
};
};
in
{
home-manager.users.charlotte = { pkgs, ... }: {
nixpkgs = {
config = {
packageOverrides = pkgs: {
neovim = neovim;
};
};
};
home.packages = [ pkgs.neovim ];
};
}

12
programs/ssh/default.nix Normal file
View file

@ -0,0 +1,12 @@
{ ... }:
{
home-manager.users.charlotte = { ... }: {
programs.ssh = {
enable = true;
compression = true;
hashKnownHosts = true;
serverAliveInterval = 300;
};
};
}

358
programs/sway/default.nix Normal file
View file

@ -0,0 +1,358 @@
with import <nixpkgs> {};
{ pkgs, ... }:
let
gemoji = pkgs.buildRubyGem {
pname = "gemoji";
gemName = "gemoji";
source.sha256 = "1xv38sxql1fmaxi5lzj6v98l2aqhi6bqkhi6kqd0k38vw40l3yqc";
type = "gem";
version = "4.0.0.rc2";
};
emoji_list = stdenv.mkDerivation {
name = "emoji_list";
buildInputs = [ pkgs.ruby gemoji ];
unpackPhase = "true";
buildPhase = ''
cat > extract_emoji.rb <<HERE
require 'emoji'
File.open('emoji_list.txt', 'w') do |f|
Emoji.all.each do |e|
f.puts("#{e.raw} #{e.description} #{e.name}#{(" " + e.tags.join(" ")) if e.tags.any?} (#{e.category})")
end
end
HERE
ruby extract_emoji.rb
'';
installPhase = ''
cp emoji_list.txt $out
'';
};
launcher = pkgs.writeScript "launcher" ''
#!${pkgs.zsh}/bin/zsh
emoji_options() {
cat ${emoji_list} | sed "s/^/emoji /"
}
emoji() {
char=$(echo -n "$1" | sed "s/^\([^ ]*\) .*/\1/")
${pkgs.sway}/bin/swaymsg exec -- "echo -n $char | ${pkgs.wl-clipboard}/bin/wl-copy --foreground"
}
run_options() {
print -rl -- ''${(ko)commands} | sed "s/^/run /"
}
run() {
${pkgs.sway}/bin/swaymsg exec $1
}
ssh_options() {
cat $HOME/.ssh/config | grep "^Host [a-zA-Z]\+" | sed "s/Host /ssh /"
}
ssh() {
${pkgs.sway}/bin/swaymsg exec "${pkgs.kitty}/bin/kitty -e ssh $1"
}
windows_options() {
${pkgs.sway}/bin/swaymsg -t get_tree | ${pkgs.jq}/bin/jq -r 'recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.layout=="none")|select(.app_id!="launcher")|select(.type=="con"),select(.type=="floating_con")|(if .app_id then .app_id else .window_properties.class end)+": "+.name+" ("+(.id|tostring)+")"' | sed "s/^/windows /"
}
windows() {
window=$(echo $@ | sed 's/.* (\([^)]*\))$/\1/')
${pkgs.sway}/bin/swaymsg \[con_id="$window"\] focus
}
CHOSEN=$(cat <(windows_options) <(ssh_options) <(run_options) <(emoji_options) | ${pkgs.fzy}/bin/fzy --lines 36 | tail -n1)
if [ -n "$CHOSEN" ]
then
PREFIX=$(echo $CHOSEN | sed "s/^\([^ ]*\) .*/\1/g")
WORD=$(echo $CHOSEN | sed "s/^[^ ]* \(.*\)/\1/g")
$PREFIX $WORD
fi
'';
in
{
imports = [
./kanshi.nix
./waybar.nix
];
programs = {
sway = {
enable = true;
extraPackages = with pkgs; [
wf-recorder
xwayland
];
extraSessionCommands = ''
export XDG_SESSION_TYPE=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCALE_FACTOR=1
export GDK_SCALE=1
export GDK_DPI_SCALE=1
export MOZ_ENABLE_WAYLAND=1
export _JAVA_AWT_WM_NONREPARENTING=1
'';
};
};
home-manager.users.charlotte = { pkgs, ... }: {
xdg.configFile."sway/config".text = ''
# Config for sway
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term ${pkgs.kitty}/bin/kitty
# Your preferred application launcher
# Note: it's recommended that you pass the final command to sway
set $menu $term --class launcher -e ${launcher}
### Output configuration
exec ${pkgs.kanshi}/bin/kanshi
workspace 1 output eDP-1
workspace 2 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 3 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 4 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 5 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 6 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 7 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 8 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 9 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
workspace 10 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
### Idle configuration
#
# This will lock your screen after 300 seconds of inactivity, turn off
# your displays after another 150 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
exec ${pkgs.swayidle}/bin/swayidle -w \
timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' \
timeout 150 '${pkgs.sway}/bin/swaymsg "output * dpms off"' \
resume '${pkgs.sway}/bin/swaymsg "output * dpms on"' \
before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000'
### Notification daemon
#
exec ${pkgs.mako}/bin/mako
# User services bound to the graphical session
exec "${pkgs.systemd}/bin/systemctl --user import-environment; ${pkgs.systemd}/bin/systemctl --user start graphical-session.target"
### Window rules
#
# Common programs
assign [app_id="firefox"] 1
assign [app_id="thunderbird"] 3
assign [class="rambox"] 4
# Launcher popup
for_window [app_id="launcher"] floating enable
### Startup programs
#
exec ${pkgs.firefox}/bin/firefox
exec ${pkgs.thunderbird}/bin/thunderbird
exec ${pkgs.rambox}/bin/rambox
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll 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.
input "1:1:AT_Translated_Set_2_keyboard" {
xkb_layout "us"
xkb_variant "altgr-intl"
xkb_numlock enabled
xkb_options "compose:caps"
}
input "1241:513:USB-HID_Keyboard" {
xkb_layout "us"
xkb_variant "altgr-intl"
xkb_numlock enabled
xkb_options "compose:caps"
}
input "2:7:SynPS/2_Synaptics_TouchPad" {
drag enabled
dwt enabled
scroll_method two_finger
tap enabled
}
### Key bindings
#
# Basics:
#
# start a terminal
bindsym $mod+Return exec $term
# kill focused window
bindsym $mod+Shift+c kill
# start your launcher
bindsym $mod+d exec $menu
# 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+r reload
# exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec ${pkgs.sway}/bin/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' '${pkgs.sway}/bin/swaymsg exit'
# lock screen
bindsym $mod+c exec ${pkgs.swaylock}/bin/swaylock -f -c 000000
# screenshot
bindsym Print exec ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" $(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/$(${pkgs.coreutils}/bin/date +'screenshot_%Y-%m-%d-%H%M%S.png')
# audio
bindsym XF86AudioRaiseVolume exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume $(${pkgs.pulseaudio}/bin/pacmd list-sinks |${pkgs.gawk}/bin/awk '/* index:/{print $3}') +5%
bindsym XF86AudioLowerVolume exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume $(${pkgs.pulseaudio}/bin/pacmd list-sinks |${pkgs.gawk}/bin/awk '/* index:/{print $3}') -5%
bindsym XF86AudioMute exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute $(${pkgs.pulseaudio}/bin/pacmd list-sinks |${pkgs.gawk}/bin/awk '/* index:/{print $3}') toggle
# brightness
bindsym XF86MonBrightnessDown exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-
bindsym XF86MonBrightnessUp exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%
#
# 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
# move workspace to output
bindsym $mod+Alt+Left move workspace to output left
bindsym $mod+Alt+Right move workspace to output right
# 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
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
swaybar_command ${pkgs.waybar}/bin/waybar
}
default_border pixel
include /etc/sway/config.d/*
'';
};
}

22
programs/sway/kanshi.nix Normal file
View file

@ -0,0 +1,22 @@
{ ... }:
{
home-manager.users.charlotte = { ... }: {
xdg.configFile."kanshi/config".text = ''
{
output "Unknown 0x2036 0x00000000" position 0,0 mode 2560x1440 scale 1.0
}
{
output "Unknown 0x2036 0x00000000" position 0,0 mode 2560x1440 scale 1.0
output "Dell Inc. DELL U2715H GH85D5B90R4S" position 2560,0 mode 2560x1440 scale 1.0
}
{
output "Chimei Innolux Corporation 0x14D3 0x00000000" position 0,0 mode 1920x1080 scale 1
}
{
output "Chimei Innolux Corporation 0x14D3 0x00000000" position 0,0 mode 1920x1080 scale 1
output "Dell Inc. DELL U2718Q FN84K83Q1KHL" position 1920,0 mode 3840x2160 scale 1.25
}
'';
};
}

188
programs/sway/waybar.nix Normal file
View file

@ -0,0 +1,188 @@
{ pkgs, ... }:
{
home-manager.users.charlotte = { pkgs, ... }: {
xdg.configFile = {
"waybar/config".text = ''
{
"layer": "bottom",
"position": "top",
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["sway/window"],
"modules-right": ["idle_inhibitor", "pulseaudio", "network", "backlight", "battery", "tray", "clock"],
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/window": {
"max-length": 50
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
"spacing": 10
},
"clock": {
"format": "{:%a %Y-%m-%d %H:%M}"
},
"cpu": {
"format": "{usage}% "
},
"memory": {
"format": "{}% "
},
"backlight": {
"format": "{percent}% {icon}",
"format-icons": ["", ""]
},
"battery": {
"bat": "BAT0",
"states": {
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-icons": ["", "", "", "", ""]
},
"network": {
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr} ",
"format-disconnected": "Disconnected "
},
"pulseaudio": {
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
}
}
'';
"waybar/style.css".text = ''
* {
border: none;
border-radius: 0;
font-family: Noto;
font-size: 13px;
min-height: 0;
}
window#waybar {
background: rgba(43, 48, 59, 0.5);
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
color: white;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button {
padding: 0 5px;
background: transparent;
color: white;
border-bottom: 3px solid transparent;
}
#workspaces button.focused {
background: #64727D;
border-bottom: 3px solid white;
}
#mode {
background: #64727D;
border-bottom: 3px solid white;
}
#clock, #battery, #cpu, #memory, #backlight, #network, #pulseaudio, #custom-spotify, #tray, #mode, #idle_inhibitor {
padding: 5px 10px;
margin: 0 5px;
}
#clock {
background-color: #64727D;
}
#battery {
background-color: #ffffff;
color: black;
}
#battery.charging {
color: white;
background-color: #26A65B;
}
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
#battery.critical:not(.charging) {
background: #f53c3c;
color: white;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#cpu {
background: #2ecc71;
color: #000000;
}
#memory {
background: #9b59b6;
}
#backlight {
background: #90b1b1;
}
#network {
background: #2980b9;
}
#network.disconnected {
background: #f53c3c;
}
#pulseaudio {
background: #f1c40f;
color: black;
}
#pulseaudio.muted {
background: #90b1b1;
color: #2a5c45;
}
#tray {
background-color: #2980b9;
}
#idle_inhibitor {
background-color: #2d3436;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}
'';
};
};
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
home-manager.users.charlotte = { pkgs, ... }: {
services.syncthing.enable = true;
};
}

17
programs/tmux/default.nix Normal file
View file

@ -0,0 +1,17 @@
{ ... }:
{
home-manager.users.charlotte = { ... }: {
programs.tmux = {
enable = true;
clock24 = true;
extraConfig = ''
bind q kill-session
bind v run-shell "tmux setw main-pane-width $(($(tmux display -p '#{window_width}') * 70 / 100)); tmux select-layout main-vertical"
bind h run-shell "tmux setw main-pane-height $(($(tmux display -p '#{window_height}') * 70 / 100)); tmux select-layout main-horizontal"
'';
keyMode = "vi";
tmuxinator.enable = true;
};
};
}

45
programs/zsh/default.nix Normal file
View file

@ -0,0 +1,45 @@
{ ... }:
{
programs.command-not-found.enable = true;
home-manager.users.charlotte = { pkgs, ... }: {
home.packages = [ pkgs.autojump ];
programs.zsh = {
enable = true;
enableAutosuggestions = true;
dotDir = ".config/zsh";
history.path = "\$HOME/.config/zsh/zsh_history";
oh-my-zsh = {
enable = true;
plugins = [
"autojump"
"command-not-found"
"common-aliases"
"extract"
"history-substring-search"
"git"
"sudo"
"systemd"
"tmux"
];
theme = "agnoster";
};
plugins = [
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.6.0";
sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4";
};
}
];
sessionVariables = {
DEFAULT_USER = "charlotte";
EDITOR = "nvim";
};
};
};
}