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' 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}' stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'

View File

@@ -6,6 +6,6 @@ spaces (){
} }
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 spaces
done done

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
{ {
description = "Development flake for this python project"; 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"; inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }: outputs = { self, nixpkgs, flake-utils }:
@@ -8,8 +8,8 @@
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python39; python = pkgs.python312;
pythonPackages = pkgs.python39Packages; pythonPackages = pkgs.python312Packages;
projectDependencies = with pythonPackages; [ projectDependencies = with pythonPackages; [
]; ];

82
flake.lock generated
View File

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

View File

@@ -4,10 +4,10 @@
inputs = { inputs = {
# - Nixpkgs ---------------------------------- # - Nixpkgs ----------------------------------
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
# - Home Manager ----------------------------- # - 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"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
# - Agenix ----------------------------------- # - Agenix -----------------------------------

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -10,9 +10,12 @@ in
enable = lib.mkEnableOption "rofi"; enable = lib.mkEnableOption "rofi";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs;
rofi if hyprCfg.enable then [
]; rofi-wayland
] else [
rofi
];
hm.xdg.configFile."rofi/menus".source = ../../config/rofi/menus; hm.xdg.configFile."rofi/menus".source = ../../config/rofi/menus;
hm.xdg.configFile."rofi/nix.png".source = nix-colors-lib.nixWallpaperFromScheme { hm.xdg.configFile."rofi/nix.png".source = nix-colors-lib.nixWallpaperFromScheme {

View File

@@ -20,9 +20,9 @@ in
devenv = "source $HOME/.local/share/devenv/devenv.sh"; 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 { 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 ----------------------------- # - Requirements -----------------------------

View File

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

View File

@@ -11,7 +11,7 @@ in
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
pinentryFlavor = "qt"; pinentryPackage = pkgs.pinentry-qt;
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pinentry 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
)
'';
};
};
};
};
}