Compare commits

...

5 Commits

Author SHA1 Message Date
marc
7cbf3cb37b Added kanata 2024-11-10 20:12:15 +01:00
marc
6ba393d433 Fix rofi, eww and gpg 2024-11-10 20:12:15 +01:00
marc
e4bf731436 Use python 3.12 in devenv 2024-11-10 20:12:15 +01:00
marc
eef75973d4 Upgrade flake 2024-11-10 20:12:12 +01:00
marc
25a24fe206 Add mouse shortuct to resize window in hyprland 2024-11-10 20:10:05 +01:00
22 changed files with 141 additions and 119 deletions

View File

@@ -0,0 +1,11 @@
import = ["~/.config/alacritty/theme.toml"]
[font]
size = 12
[font.normal]
family = "Iosevka Nerd Font"
style = "Regular"
[window]
opacity = 0.85

View File

@@ -1,9 +0,0 @@
window:
opacity: 0.85
font:
size: 12
normal:
family: Iosevka Nerd Font
style: Regular
import:
- ~/.config/alacritty/theme.yml

View File

@@ -2,5 +2,5 @@
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'

View File

@@ -6,6 +6,6 @@ spaces (){
}
spaces
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
spaces
done

View File

@@ -4,7 +4,7 @@
*
**/
@import "../../theme.rasi"
@import "~/.config/rofi/theme.rasi"
/*****----- Configuration -----*****/
configuration {

View File

@@ -4,7 +4,7 @@
*
**/
@import "../../theme.rasi"
@import "~/.config/rofi/theme.rasi"
/*****----- Configuration -----*****/
configuration {

View File

@@ -4,7 +4,7 @@
*
**/
@import "../../theme.rasi"
@import "~/.config/rofi/theme.rasi"
/*****----- Configuration -----*****/
configuration {

View File

@@ -4,7 +4,7 @@
*
**/
@import "../../theme.rasi"
@import "~/.config/rofi/theme.rasi"
/*****----- Configuration -----*****/
configuration {

View File

@@ -4,7 +4,7 @@
*
**/
@import "../../theme.rasi"
@import "~/.config/rofi/theme.rasi"
/*****----- Configuration -----*****/
configuration {

View File

@@ -1,6 +1,6 @@
{
description = "Development flake for this python project";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
@@ -8,8 +8,8 @@
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python39;
pythonPackages = pkgs.python39Packages;
python = pkgs.python312;
pythonPackages = pkgs.python312Packages;
projectDependencies = with pythonPackages; [
];

82
flake.lock generated
View File

@@ -10,11 +10,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1716561646,
"narHash": "sha256-UIGtLO89RxKt7RF2iEgPikSdU53r6v/6WYB0RW3k89I=",
"lastModified": 1723293904,
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
"owner": "ryantm",
"repo": "agenix",
"rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9",
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
"type": "github"
},
"original": {
@@ -41,16 +41,15 @@
},
"emacs-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1716829580,
"narHash": "sha256-AjurIGzI/3Y5uuKvdr3mIZTjrW2ZRb+GmP+R8fX4Obw=",
"lastModified": 1731257787,
"narHash": "sha256-QmijaEOYVhmj8V1bUtCQUQyanEHZ2n9HMCcMXveJMuI=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "2f61d16c26d7f54753eeb93d3c39fe7040ef99c9",
"rev": "10001900f78be46ab8642edde7455aa5f0d54a6a",
"type": "github"
},
"original": {
@@ -59,24 +58,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -105,16 +86,16 @@
]
},
"locked": {
"lastModified": 1716729592,
"narHash": "sha256-Y3bOjoh2cFBqZN0Jw1zUdyr7tjygyxl2bD/QY73GZP0=",
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2c78a57c544dd19b07442350727ced097e1aa6e6",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
@@ -140,11 +121,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1716509168,
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
@@ -171,43 +152,43 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1716633019,
"narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=",
"lastModified": 1730963269,
"narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e",
"rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1716633019,
"narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=",
"lastModified": 1730963269,
"narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e",
"rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.11",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1716845897,
"narHash": "sha256-Y05w+fP9r8MaK82U7GKIXcmxu2Js8aPoMxh0ZRKMH9w=",
"lastModified": 1731264423,
"narHash": "sha256-DTWprnE/7Oud9JpJL1LOGVJP9CFod7YeArsb0U3yXWo=",
"owner": "nix-community",
"repo": "NUR",
"rev": "eaa4ccca982df3c8bc4161aa77dad8f89b695ae9",
"rev": "00516a12c8792c11daa0982b8285b54c9a4e3c5e",
"type": "github"
},
"original": {
@@ -240,21 +221,6 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@@ -4,10 +4,10 @@
inputs = {
# - Nixpkgs ----------------------------------
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
# - Home Manager -----------------------------
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# - Agenix -----------------------------------

View File

@@ -62,6 +62,7 @@ in
system.gpg.enable = true;
system.pass.enable = true;
system.sshfs.enable = true;
system.kanata.enable = true;
server.vatnajokull.enable = true;

View File

@@ -21,36 +21,40 @@ in
(nerdfonts.override { fonts = [ "Iosevka" ]; })
];
hm.xdg.configFile."alacritty/alacritty.yml".source = ../../config/alacritty/alacritty.yml;
hm.xdg.configFile."alacritty/alacritty.toml".source = ../../config/alacritty/alacritty.toml;
# - Themeing ---------------------------------
hm.xdg.configFile."alacritty/theme.yml".text = ''
colors:
primary:
background: '0x${config.colorScheme.palette.base00}'
foreground: '0x${config.colorScheme.palette.base05}'
cursor:
text: '0x${config.colorScheme.palette.base00}'
cursor: '0x${config.colorScheme.palette.base05}'
normal:
black: '0x${config.colorScheme.palette.base00}'
red: '0x${config.colorScheme.palette.base08}'
green: '0x${config.colorScheme.palette.base0B}'
yellow: '0x${config.colorScheme.palette.base0A}'
blue: '0x${config.colorScheme.palette.base0D}'
magenta: '0x${config.colorScheme.palette.base0E}'
cyan: '0x${config.colorScheme.palette.base0C}'
white: '0x${config.colorScheme.palette.base05}'
bright:
black: '0x${config.colorScheme.palette.base03}'
red: '0x${config.colorScheme.palette.base09}'
green: '0x${config.colorScheme.palette.base01}'
yellow: '0x${config.colorScheme.palette.base02}'
blue: '0x${config.colorScheme.palette.base04}'
magenta: '0x${config.colorScheme.palette.base06}'
cyan: '0x${config.colorScheme.palette.base0F}'
white: '0x${config.colorScheme.palette.base07}'
draw_bold_text_with_bright_colors: false
hm.xdg.configFile."alacritty/theme.toml".text = ''
[colors]
draw_bold_text_with_bright_colors = false
[colors.primary]
background = "0x${config.colorScheme.palette.base00}"
foreground = "0x${config.colorScheme.palette.base05}"
[colors.cursor]
text = "0x${config.colorScheme.palette.base00}"
cursor = "0x${config.colorScheme.palette.base05}"
[colors.normal]
black = "0x${config.colorScheme.palette.base00}"
red = "0x${config.colorScheme.palette.base08}"
green = "0x${config.colorScheme.palette.base0B}"
yellow = "0x${config.colorScheme.palette.base0A}"
blue = "0x${config.colorScheme.palette.base0D}"
magenta = "0x${config.colorScheme.palette.base0E}"
cyan = "0x${config.colorScheme.palette.base0C}"
white = "0x${config.colorScheme.palette.base05}"
[colors.bright]
black = "0x${config.colorScheme.palette.base03}"
red = "0x${config.colorScheme.palette.base09}"
green = "0x${config.colorScheme.palette.base01}"
yellow = "0x${config.colorScheme.palette.base02}"
blue = "0x${config.colorScheme.palette.base04}"
magenta = "0x${config.colorScheme.palette.base06}"
cyan = "0x${config.colorScheme.palette.base0F}"
white = "0x${config.colorScheme.palette.base07}"
'';
samfelag.modules.desktop.i3.extraKeybindings = lib.mkIf i3Cfg.enable {

View File

@@ -29,9 +29,9 @@
time.timeZone = "Europe/Madrid";
i18n.defaultLocale = "ca_ES.utf8";
console.keyMap = "es";
services.xserver = {
services.xserver.xkb = {
layout = "es";
xkbVariant = "cat";
variant = "cat";
};
# - Packages -----------------------------------

View File

@@ -17,7 +17,7 @@ in {
# - Configuration ----------------------------
environment.systemPackages = with pkgs; [
eww-wayland
eww
# Scripts' dependencies
jq
socat

View File

@@ -72,13 +72,11 @@ in {
programs.hyprland = {
enable = true;
xwayland.enable = true;
enableNvidiaPatches = true;
};
hm.wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
enableNvidiaPatches = true;
package = pkgs.hyprland;
# Optional
@@ -175,6 +173,7 @@ in {
bindm = [
"${cfg.mod}, mouse:272, movewindow"
"${cfg.mod} SHIFT, mouse:272, resizewindow 1"
];
};
};

View File

@@ -10,7 +10,10 @@ in
enable = lib.mkEnableOption "rofi";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs;
if hyprCfg.enable then [
rofi-wayland
] else [
rofi
];

View File

@@ -20,9 +20,9 @@ in
devenv = "source $HOME/.local/share/devenv/devenv.sh";
};
# TODO: This assumes we have alacritty and a python39 devenv set up (may want to fix this at some point)
# TODO: This assumes we have alacritty and a python311 devenv set up (may want to fix this at some point)
samfelag.modules.desktop.i3.extraKeybindings = lib.mkIf i3Cfg.enable {
"${i3Cfg.mod}+Shift+P" = "exec ${pkgs.alacritty}/bin/alacritty -t floating-term -e zsh -c \"direnv exec ~/sandbox/python39 ipython\"";
"${i3Cfg.mod}+Shift+P" = "exec ${pkgs.alacritty}/bin/alacritty -t floating-term -e zsh -c \"direnv exec ~/sandbox/python311 ipython\"";
};
# - Requirements -----------------------------

View File

@@ -24,7 +24,7 @@ in
enable = true;
dotDir = ".config/zsh";
enableAutosuggestions = true;
autosuggestion.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;

View File

@@ -11,7 +11,7 @@ in
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "qt";
pinentryPackage = pkgs.pinentry-qt;
};
environment.systemPackages = with pkgs; [
pinentry

47
modules/system/kanata.nix Normal file
View File

@@ -0,0 +1,47 @@
{ config, pkgs, lib, ... }:
let
cfg = config.samfelag.modules.system.kanata;
in
{
options.samfelag.modules.system.kanata = {
enable = lib.mkEnableOption "kanata";
};
config = lib.mkIf cfg.enable {
users.users.${config.user.name}.extraGroups = [
"input"
"uinput"
];
services.kanata = {
enable = true;
keyboards = {
internalKeyboard = {
extraDefCfg = "process-unmapped-keys yes";
config = ''
(defsrc
a s d f h j k l
)
(defvar
tap-time 150
hold-time 200
)
(defalias
a (tap-hold $tap-time $hold-time a lalt)
s (tap-hold $tap-time $hold-time s lsft)
d (tap-hold $tap-time $hold-time d lmet)
f (tap-hold $tap-time $hold-time f lctl)
h (tap-hold $tap-time $hold-time h rctl)
j (tap-hold $tap-time $hold-time j rmet)
k (tap-hold $tap-time $hold-time k rsft)
l (tap-hold $tap-time $hold-time l ralt)
)
(deflayer base
@a @s @d @f @h @j @k @l
)
'';
};
};
};
};
}